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
Add RLM + MAGMA theoretical foundations to DESIGN docs
Position Mnemon at the intersection of two research directions:
- RLM paradigm (LLM as orchestrator of external environments)
- MAGMA methodology (four-graph memory architecture)
- Mnemon's own engineering bridge (CLI protocol, hook lifecycle,
zero-dependency distribution)
Changes across README (EN/ZH) and DESIGN (EN/ZH):
- DESIGN intro: lead with LLM-Supervised philosophy, not paper names
- DESIGN §2.4: new Theoretical Foundations section with 5-layer table
- DESIGN §5: connect MAGMA to RLM paradigm context
- DESIGN §12: reference RLM for two-stage validation pattern
- README: add References section (bottom, before License)
- Flatten ToC to top-level entries only
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
-[Architecture Diagrams](docs/diagrams/) — system architecture, pipelines, lifecycle management
209
209
-[中文文档](docs/zh/) — Chinese documentation
210
210
211
+
## References
212
+
213
+
Mnemon combines the paradigm of one paper with the methodology of another. See [Theoretical Foundations](docs/DESIGN.md#24-theoretical-foundations) for details.
214
+
215
+
-**RLM** — Zhang, Kraska & Khattab. [Recursive Language Models](https://arxiv.org/abs/2512.24601). 2025. Establishes the paradigm: LLMs are more effective as orchestrators of external environments than as direct data processors.
216
+
-**MAGMA** — Zou et al. [A Multi-Graph based Agentic Memory Architecture](https://arxiv.org/abs/2601.03236). 2025. Provides the methodology: four-graph model (temporal, entity, causal, semantic) with intent-adaptive retrieval.
Copy file name to clipboardExpand all lines: docs/DESIGN.md
+37-5Lines changed: 37 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
>
5
5
> The word shares its root with Mnemosyne (Μνημοσύνη), the goddess of memory — from her union with Zeus the nine Muses were born, symbolizing memory as the wellspring of all knowledge and creativity.
6
6
7
-
Mnemon is a persistent memory system designed for LLM agents. It implements the four-graph architecture from the [MAGMA](https://arxiv.org/abs/2601.03236) (Multi-Graph Agentic Memory Architecture) paper as a single Go binary + SQLite, with no external API dependencies.
7
+
Mnemon is a persistent memory system designed for LLM agents. It adopts the **LLM-Supervised** pattern: the host LLM acts as external orchestrator of a standalone memory binary through symbolic CLI interfaces, while the binary handles deterministic storage, graph indexing, and lifecycle management. Memory is organized as a four-graph knowledge structure with temporal, entity, causal, and semantic edges. Implemented as a single Go binary + SQLite, with no external API dependencies.
8
8
9
9
This document describes Mnemon's design philosophy, core concepts, system architecture, and key algorithms in detail.
10
10
@@ -16,8 +16,6 @@ This document describes Mnemon's design philosophy, core concepts, system archit
16
16
-[2. Design Philosophy](#2-design-philosophy)
17
17
-[3. Core Concepts](#3-core-concepts)
18
18
-[4. System Architecture](#4-system-architecture)
19
-
-[4.1 Data Directory Layout](#41-data-directory-layout)
20
-
-[4.2 Store Isolation](#42-store-isolation)
21
19
-[5. MAGMA Four-Graph Model](#5-magma-four-graph-model)
@@ -126,6 +124,40 @@ Binary encapsulates all logic that does not require an LLM; Skill only teaches t
126
124
-**The memory layer is the only part worth deep investment** — memory has a compound interest effect; it is the dividing line between an agent as a "tool" versus an "assistant"
127
125
-**The LLM itself is the best orchestrator** — no need for Python DAG orchestration of call chains; the LLM reads the Skill and knows what to do
128
126
127
+
### 2.4 Theoretical Foundations
128
+
129
+
Mnemon's design draws on the **paradigm** of one paper and the **methodology** of another, while making its own engineering choices for the bridge between them.
130
+
131
+
**RLM Paradigm: LLM as Orchestrator**
132
+
133
+
The [Recursive Language Models](https://arxiv.org/abs/2512.24601) paper (Zhang, Kraska & Khattab, MIT 2025) establishes the paradigm that LLMs are more effective as orchestrators of external structured environments than as direct data processors. The paper's key findings at the paradigm level:
134
+
135
+
- An 8B model handles inputs **100x beyond its context window** by treating data as external environment variables
- Passing **constant-size metadata** — not raw data — to the model is more effective
138
+
139
+
The RLM paper's own implementation uses **code generation + Python REPL** as the interaction mechanism: the LLM writes Python code, a sandbox executes it, and results feed back. Mnemon shares the paradigm but takes a different path at the protocol level (see below).
The [MAGMA](https://arxiv.org/abs/2601.03236) paper provides the concrete methodology for **what the external environment should contain**. Its key contribution: a single edge type (e.g., vector similarity) is insufficient for memory — different query intents require different relational perspectives. MAGMA's four-graph architecture (temporal, entity, causal, semantic) with intent-adaptive retrieval and multi-signal fusion gives Mnemon its data model and retrieval algorithms.
144
+
145
+
**Mnemon's Own Contribution: The Engineering Bridge**
146
+
147
+
Neither paper addresses how to connect an LLM orchestrator to a graph-structured memory in production. Mnemon fills this gap:
148
+
149
+
| Layer | Source | Choice |
150
+
|---|---|---|
151
+
|**Paradigm** — who orchestrates? | RLM | The host LLM, not an embedded model |
152
+
|**Methodology** — what's in the environment? | MAGMA | Four-graph with intent-adaptive retrieval |
153
+
|**Protocol** — how do they talk? | Mnemon | CLI commands + structured JSON (not code generation) |
154
+
|**Lifecycle** — how does memory evolve? | Mnemon | Hook-driven remember → diff → link → gc |
155
+
|**Distribution** — how to ship it? | Mnemon | Single Go binary, zero dependencies |
156
+
157
+
Where the RLM implementation relies on code generation in a sandboxed REPL (flexible but requires a runtime and raises safety concerns), Mnemon uses deterministic CLI commands as the symbolic interface — constrained, but auditable, portable, and zero-sandbox. Where MAGMA's reference implementation is a Python library with in-memory NetworkX graphs, Mnemon persists everything in SQLite with a complete write-back lifecycle.
158
+
159
+
The result is: **RLM's paradigm + MAGMA's methodology + a CLI-native engineering path** that runs on any LLM CLI without Python, without sandboxes, without API keys.
@@ -359,7 +391,7 @@ This layered design serves different scenarios:
359
391
360
392
## 5. MAGMA Four-Graph Model
361
393
362
-
The core idea of the MAGMA paper is: **a single edge type (such as pure vector similarity) is insufficient to capture the multidimensional relationships between memories.** Different query intents require different relational perspectives — asking "why" requires causal chains, asking "when" requires timelines, asking "about X" requires entity associations.
394
+
Within the [RLM paradigm](#24-theoretical-foundations), MAGMA provides the specific data structure for the external environment that the LLM orchestrates. The core idea of the MAGMA paper is: **a single edge type (such as pure vector similarity) is insufficient to capture the multidimensional relationships between memories.** Different query intents require different relational perspectives — asking "why" requires causal chains, asking "when" requires timelines, asking "about X" requires entity associations.
363
395
364
396
Mnemon implements four graphs, each capturing one dimension of relationships:
365
397
@@ -1022,4 +1054,4 @@ For CLIs without hook support, merge the recall/remember guidance into the corre
| Deployment | Python library | Single Go binary |
1024
1056
1025
-
Mnemon retains MAGMA's **architectural skeleton** (four-graph separation, intent-adaptive retrieval, multi-signal fusion) while replacing academic implementation details with production-ready simplifications. The core trade-off is: **use regex/heuristics to handle 80% of automation scenarios, and delegate the 20% requiring deep understanding to the host LLM.**
1057
+
Mnemon retains MAGMA's **architectural skeleton** (four-graph separation, intent-adaptive retrieval, multi-signal fusion) while replacing academic implementation details with production-ready simplifications. This two-tier approach — deterministic automation for the majority of cases, LLM judgment for the complex minority — is precisely the pattern validated by the [RLM paper](#24-theoretical-foundations): regex-based filtering plus LLM-driven semantic verification consistently outperforms either approach alone. The core trade-off is: **use regex/heuristics to handle 80% of automation scenarios, and delegate the 20% requiring deep understanding to the host LLM.**
-**MAGMA** — Zou et al. [A Multi-Graph based Agentic Memory Architecture](https://arxiv.org/abs/2601.03236). 2025. 提供方法论:四图模型(temporal、entity、causal、semantic)+ intent-adaptive retrieval。
0 commit comments