You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/design/03-concepts.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,7 +93,7 @@ oplog (
93
93
94
94
---
95
95
96
-
## 4. System Architecture
96
+
## 3.4 System Architecture
97
97
98
98
Mnemon's architecture is divided into five layers:
99
99
@@ -178,7 +178,7 @@ mnemon/
178
178
└── Makefile # Build, install, test
179
179
```
180
180
181
-
## 4.1 Data Directory Layout
181
+
## 3.5 Data Directory Layout
182
182
183
183
```
184
184
~/.mnemon/
@@ -197,7 +197,7 @@ mnemon/
197
197
198
198
**Isolation boundary**: Each store contains an independent `mnemon.db` — insights, edges, and oplog are fully isolated. Prompt files (`guide.md`, `skill.md`) are shared — behavioral rules are universal, memory data is private.
199
199
200
-
## 4.2 Store Isolation
200
+
## 3.6 Store Isolation
201
201
202
202
Mnemon supports named stores for lightweight data isolation between different agents, projects, or scenarios.
**Purpose**: Link insights that mention the same entities.
36
36
@@ -50,7 +50,7 @@ Insight A ←── entity ──→ Insight B ←── entity ──→ Insigh
50
50
51
51
**Metadata**: `{"entity": "Qdrant"}`
52
52
53
-
## 5.3 Causal Graph
53
+
## 4.3 Causal Graph
54
54
55
55
**Purpose**: Capture the reasons behind decisions and cause-effect relationships.
56
56
@@ -73,7 +73,7 @@ Insight A ──── causal ────→ Insight B
73
73
74
74
This is a quintessential example of the LLM-Supervised philosophy: Binary handles low-cost candidate discovery (regex + token overlap), while the LLM handles high-value causal judgment.
75
75
76
-
## 5.4 Semantic Graph
76
+
## 4.4 Semantic Graph
77
77
78
78
**Purpose**: Connect semantically similar insights based on meaning.
79
79
@@ -94,7 +94,7 @@ Insight C ←── semantic (LLM review) ──→ Insight D
94
94
cos=0.65, manually linked after LLM judged "related"
Different query intents activate different graph traversal weights:
100
100
@@ -109,11 +109,11 @@ When asking "why was SQLite chosen," the causal edge weight is highest, so the s
109
109
110
110
---
111
111
112
-
# Graph-LLM Theoretical Foundations
112
+
## 4.6 Graph-LLM Theoretical Foundations
113
113
114
114
The following sections establish the theoretical basis for why graph databases are the native storage model for LLMs, and why `remember / link / recall` constitutes a universal protocol for agent memory systems.
115
115
116
-
## Structural Isomorphism
116
+
###Structural Isomorphism
117
117
118
118
LLM attention, graph data models, and natural language all describe the same thing: weighted associations between entities.
Relational databases force network relationships into tables. Vector databases retain only one relationship type (similarity). Only graphs preserve full relational semantics.
127
127
128
-
## The Three-Step Paradigm: Extract → Candidate → Associate
@@ -194,7 +194,7 @@ This is the RAG paradigm applied to any data store. The variation lies in the tr
194
194
195
195
A vector database can answer "what is **similar** to what" but cannot answer "what **caused** what" or "what **belongs to** what". Graphs can.
196
196
197
-
## remember / link / recall as Universal Algebra
197
+
###remember / link / recall as Universal Algebra
198
198
199
199
The three-step paradigm (Extract → Candidate → Associate) maps directly to three primitive operations: **remember**, **link**, **recall**. This is not an implementation detail of mnemon — it is the minimal complete interface for any agent memory system.
200
200
@@ -238,7 +238,7 @@ Native RAG link absent entirely
238
238
239
239
The more degenerate the `link` operation, the more burden falls on the LLM at recall time to infer associations that were never stored.
240
240
241
-
## The Protocol Gap: LLM ↔ Database
241
+
###The Protocol Gap: LLM ↔ Database
242
242
243
243
### The Missing Layer
244
244
@@ -349,7 +349,7 @@ MemGPT──┘ │── SQLite adapter (mnemon current
349
349
-**Not competing with Mem0** on product features (it is a product bound to its implementation)
350
350
-**Analogous to MCP** — MCP connected LLMs to the tool ecosystem; this protocol connects LLMs to the database ecosystem
351
351
352
-
## Academic Landscape and Positioning
352
+
###Academic Landscape and Positioning
353
353
354
354
### Prior Art Assessment
355
355
@@ -401,7 +401,7 @@ Original contributions (no prior formulation found)
401
401
- Transformers are Graph Neural Networks (arXiv 2506.22084, Jun 2025)
402
402
- A Generalization of Transformer Networks to Graphs (arXiv 2012.09699, 2020)
Five edge types preserve five distinct relational semantics. Degenerating to pure vector retrieval would retain only `semantic` — losing ~80% of relational information. MAGMA ablation studies confirm: removing causal edges drops accuracy 3-5%, removing temporal edges drops it further.
415
415
416
-
## Summary
416
+
###Summary
417
417
418
418
-**Extract → Candidate → Associate** is the universal paradigm for graph construction engines
419
419
- This three-step model achieves its **most complete expression** on graphs and degenerates toward KV
Copy file name to clipboardExpand all lines: docs/design/05-pipelines.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,13 @@
4
4
5
5
---
6
6
7
-
## 6. Write Pipeline: Remember
7
+
## 5.1 Write Pipeline: Remember
8
8
9
9
`mnemon remember` is the core command for writing memories. It includes a built-in diff step that automatically detects duplicates and conflicts before storage. The write transaction executes atomically within a single SQLite transaction.
mnemon remember "Chose Qdrant as the vector database" \
@@ -84,13 +84,13 @@ After receiving this output, the LLM can evaluate candidates and establish edges
84
84
85
85
---
86
86
87
-
## 7. Read Pipeline: Smart Recall (Default)
87
+
## 5.2 Read Pipeline: Smart Recall
88
88
89
89
`mnemon recall` is Mnemon's core retrieval algorithm. Smart recall is the default mode for all queries. It combines intent detection, multi-signal anchor selection, Beam Search graph traversal, and multi-factor re-ranking to achieve intent-aware graph-enhanced retrieval. Use `--basic` for legacy SQL LIKE fallback.
If the intent is WHY, an additional topological sort using Kahn's algorithm is performed: results are arranged along causal edges so that **causes come first, effects follow**.
181
181
182
-
### 7.6 Signal Transparency
182
+
### Signal Transparency
183
183
184
184
Each retrieval result includes a detailed signal breakdown:
185
185
@@ -202,7 +202,7 @@ This is a unique innovation in Mnemon: **exposing the retrieval pipeline's inter
EI combines base importance, access frequency, time decay, and graph connectivity:
14
14
@@ -27,13 +27,13 @@ Interpretation:
27
27
-**Long period without access** -> exponential decay (halves every 30 days)
28
28
-**Rich graph connections** -> indicates relevance to other knowledge, bonus applied
29
29
30
-
## 9.2 Immunity Rules
30
+
## 6.2 Immunity Rules
31
31
32
32
The following insights are exempt from automatic cleanup:
33
33
-`importance >= 4` (high-value memories)
34
34
-`access_count >= 3` (frequently retrieved)
35
35
36
-
## 9.3 Auto-Pruning
36
+
## 6.3 Auto-Pruning
37
37
38
38
Triggered when the total number of active insights exceeds **1000**:
39
39
@@ -43,7 +43,7 @@ Triggered when the total number of active insights exceeds **1000**:
43
43
4. Soft-delete (set `deleted_at`)
44
44
5. Cascade-delete related edges
45
45
46
-
## 9.4 GC Command
46
+
## 6.4 GC Command
47
47
48
48
Manual lifecycle management tool:
49
49
@@ -57,11 +57,11 @@ mnemon gc --keep <id>
57
57
58
58
---
59
59
60
-
## 10. Embedding Support
60
+
## 6.5 Embedding Support
61
61
62
62
Embedding vectors are an optional enhancement. Without embeddings, Mnemon operates entirely on keywords and graph structure; with embeddings, semantic retrieval capabilities are significantly enhanced.
63
63
64
-
### 10.1 Ollama Integration
64
+
### Ollama Integration
65
65
66
66
Via the local Ollama service (no external API required):
Copy file name to clipboardExpand all lines: docs/design/07-integration.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@
8
8
9
9
Mnemon integrates with LLM CLIs through lifecycle hooks, a skill file, and a behavioral guide. Claude Code's [hook system](https://docs.anthropic.com/en/docs/claude-code/hooks) is the reference implementation — all components are deployed automatically via `mnemon setup`.
10
10
11
-
## 11.1 Integration Architecture
11
+
## 7.1 Integration Architecture
12
12
13
13
Four hooks drive the memory lifecycle:
14
14
@@ -46,7 +46,7 @@ Three layers work together:
46
46
|**Skill**|`SKILL.md` — command reference in Claude Code skill format |`.claude/skills/mnemon/`| Teaches the LLM *how* to use mnemon commands |
47
47
|**Guide**|`guide.md` — detailed execution manual for recall, remember, and delegation |`~/.mnemon/prompt/`| Teaches the LLM *when* to recall, *what* to remember, and *how* to delegate |
48
48
49
-
## 11.2 Hook Details
49
+
## 7.2 Hook Details
50
50
51
51
Claude Code fires hooks at specific lifecycle events. Mnemon registers up to four, each with a distinct role in the memory lifecycle:
52
52
@@ -97,7 +97,7 @@ Fires before context window compression. Instructs the agent to extract the most
97
97
echo"[mnemon] Context compaction starting. Review this session and remember the most valuable insights (up to 5) before context is compressed. Delegate to Task sub-agents now."
98
98
```
99
99
100
-
## 11.3 Automated Setup
100
+
## 7.3 Automated Setup
101
101
102
102
`mnemon setup` handles all deployment automatically:
103
103
@@ -142,7 +142,7 @@ Key setup options:
142
142
143
143
The Prime hook is always installed. Remind, Nudge, and Compact hooks are optional (Remind and Nudge enabled by default).
144
144
145
-
## 11.4 Sub-Agent Delegation
145
+
## 7.4 Sub-Agent Delegation
146
146
147
147
Memory writes don't happen in the main conversation. Instead, the host LLM delegates to a lightweight sub-agent:
148
148
@@ -174,7 +174,7 @@ This separation means:
174
174
-**Context isolation**: Memory processing doesn't pollute the main conversation context
175
175
-**Model efficiency**: Sonnet handles routine execution while Opus focuses on high-level decisions
176
176
177
-
## 11.5 Adapting to Other LLM CLIs
177
+
## 7.5 Adapting to Other LLM CLIs
178
178
179
179
For CLIs with hook support, replicate the Claude Code pattern: register lifecycle hooks that call mnemon commands, deploy the skill file, and provide the behavioral guide.
The [two-layer architecture](02-philosophy.md#23-memory-gateway-protocol-not-database) has achieved agent-side pluggability — any LLM CLI can interact with Mnemon through the protocol surface today. The remaining work is on the other side.
0 commit comments