Architecture
Dimple is a local-first memory system: everything is a memory unit (text, code, facts — one uniform artifact), organized by a topic tree (where to search), connected by an artifact graph (what is near, what explains, what contradicts or supersedes), annotated by concepts (emergent subject tags), and maintained by a durable job runtime (all structural work, idempotent and resume-safe).
┌────────────────────────────────┐ │ dimple │ │ write ──▶ embed ──▶ tree │ │ query ──▶ descend ──▶ hybrid │ └───────┬─────────────┬──────────┘ │ │ ┌────────▼─────┐ ┌────▼─────────┐ │ dimple.db │ │ jobs.db │ │ memories │ │ durable queue│ │ topic tree │ │ splits/merge │ │ graph + audit│ │ dreams/repair│ └──────────────┘ └──────────────┘Reading map (dependency order)
Section titled “Reading map (dependency order)”| Page | Answers |
|---|---|
| Memory units & lifecycle | What is stored, what states it can be in, what “superseded” means |
| Topic tree | How memories are organized so search cost grows with depth, not count — routing, splits, merges, rebalance |
| Retrieval | How queries turn into ranked, scoped, audited results — hybrid fusion, beam descent, budgets |
| Artifact graph | How memories relate — supports / supersedes / contradicts / code_calls, the pending→confirm lifecycle |
| Concepts & consolidation | How the corpus organizes itself — deterministic clustering + annotations + query sovereignty |
| Dream (consolidation) | The LLM pass — edge classification, concept clustering, provenance, gates |
| Durability & determinism | What keeps everything consistent across restarts — the job runtime and the reproducibility contract |
Every page opens with “In one sentence” and closes with “Key facts” (stable invariants + hard limits) so both people and agents can extract the contract quickly. Algorithms are explained where they are used, not in an appendix.
Storage at a glance
Section titled “Storage at a glance”Two SQLite files (or one Turso remote database — the same engine over the wire):
| Database | Holds |
|---|---|
dimple.db (storeUrl) |
memories, topic tree, graph edges, concepts, retrieval audit |
jobs.db (jobs.dbUrl) |
the durable job queue + workflow state |
Algorithms at a glance
Section titled “Algorithms at a glance”| Mechanism | Where | See |
|---|---|---|
| Greedy centroid descent (stable tie-breaks) | insert routing | Topic tree → Insert routing |
| CF-triplet sufficient statistics | centroids/radii (splits, rebalance, clustering) | Topic tree → Splits |
| Farthest-pair seeds → Lloyd refinement | leaf/internal splits | Topic tree → Splits |
| Donor-min borrow, nearest-sibling merge | underflow | Topic tree → Merge & borrow |
| RRF fusion (k = 60) | hybrid retrieval | Retrieval → Hybrid fusion |
| Beam descent | tree-scoped queries | Retrieval → Tree descent |
| FNV-1a query hashing | audit identity | Retrieval → Audit |
| Deterministic k-means (corpus pass) | concept clustering | Concepts → Clustering |
| LLM edge classification + provenance rule | consolidation | Dream → What it does |