Skip to content

Commit d896245

Browse files
committed
docs: embed full system-architecture schematic in the README
Add an inline Mermaid architecture diagram (plane-level: clients, API, runtime core, cross-cutting providers/governance/async/observability/telemetry, storage, benchmark) in the style of the How-it-works diagram, with default-off components dashed; add an Architecture nav link. The exhaustive per-module diagram + flag table stays in docs/architecture-diagram.md.
1 parent 3da347c commit d896245

1 file changed

Lines changed: 64 additions & 1 deletion

File tree

README.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Most "agent memory" is a vector store with extra steps. MemTrace treats memory a
1919
<a href="#-quickstart-5-minute-no-network-demo"><b>Quickstart</b></a> ·
2020
<a href="#-why-not-plain-vector-memory"><b>Why</b></a> ·
2121
<a href="#-how-it-works"><b>How it works</b></a> ·
22+
<a href="#-system-architecture"><b>Architecture</b></a> ·
2223
<a href="#-benchmark-snapshot"><b>Benchmark</b></a> ·
2324
<a href="#-user-docs"><b>Docs</b></a> ·
2425
<a href="docs/design/ROADMAP.md"><b>Roadmap</b></a>
@@ -73,7 +74,69 @@ flowchart LR
7374
5. **Pack & compact.** The packer assembles bounded context, retaining protected constraints under budget pressure.
7475
6. **Replay everything.** Every retrieval is reconstructable from access/gate logs and a policy snapshot that distinguishes data drift from policy drift.
7576

76-
> 📐 The diagram above is the hot path. For the **complete system architecture** — every component across all planes (runtime, providers, governance, async, observability/telemetry, storage, benchmark, integrations), including the default-off ones and the flag that enables each — see [docs/architecture-diagram.md](docs/architecture-diagram.md).
77+
## 🏗️ System architecture
78+
79+
The whole system at a glance — solid = default-on, **dashed = default-off / opt-in**, blue = data stores. Everything dashed is degrade-safe: turn it off (or leave the service/extra absent) and candidate scoring is byte-identical, benchmark stays 16/16. For the exhaustive per-module diagram + the `MEMTRACE_*` flag that enables each optional piece, see [docs/architecture-diagram.md](docs/architecture-diagram.md).
80+
81+
```mermaid
82+
flowchart TB
83+
classDef core fill:#e6f4ea,stroke:#3fb950,color:#0b1f10;
84+
classDef opt fill:#fff4e5,stroke:#e0a458,stroke-dasharray:5 4,color:#3a2a06;
85+
classDef store fill:#e7efff,stroke:#4c8dff,color:#0a1a33;
86+
87+
subgraph CL["Clients & integrations"]
88+
direction LR
89+
C1["Python SDK · TS SDK · MCP server · CLI · demos"]:::core
90+
C2["React dashboard · VS Code ext · Go/Rust collectors"]:::opt
91+
end
92+
subgraph AP["API — FastAPI /v1"]
93+
direction LR
94+
A1["routes · deps (DI + auth/quota) · static dashboard UI"]:::core
95+
A2["admin API"]:::opt
96+
end
97+
subgraph CORE["Runtime core — MemoryRuntime facade"]
98+
direction LR
99+
R1["Trace + state tree<br/>root → step → recovery"]:::core
100+
R2["Write / extract<br/>rule writer · resolver/conflict · buffer · summarizer · lifecycle"]:::core
101+
R3["Retrieval controller<br/>lexical + vector · gate (hard/risk/soft) · packer + compaction · profiler"]:::core
102+
R4["subgoal inference · MAGE planner"]:::opt
103+
R5["LLM extraction · rolling summary · Redis buffer"]:::opt
104+
R6["query planner · multi-hop · BM25 · graph · RRF · ranking profiles"]:::opt
105+
end
106+
subgraph SIDE["Cross-cutting planes"]
107+
direction LR
108+
P1["Providers<br/>embedding / extract / summarize / judge"]:::core
109+
P4["Observability<br/>metrics · replay · reports"]:::core
110+
P2["Governance<br/>auth/JWT · membership · admin · quota · redaction · encrypted store"]:::opt
111+
P3["Async<br/>Celery · idempotency · lease · beat · worker"]:::opt
112+
P5["Telemetry<br/>OTel/OpenInference exporters"]:::opt
113+
end
114+
subgraph ST["Storage"]
115+
direction LR
116+
S1["Repository → InMemory / SQL (Alembic)"]:::core
117+
S2[("PostgreSQL + pgvector<br/>source of truth")]:::store
118+
S3[("Redis")]:::store
119+
S4[("Elasticsearch")]:::store
120+
S5[("Neo4j")]:::store
121+
end
122+
subgraph BE["Benchmark & eval (offline)"]
123+
direction LR
124+
B1["runner · dataset_bench · trace_bench · plots"]:::core
125+
B2["real-LLM: qa / locomo / llm bench"]:::opt
126+
end
127+
128+
CL --> AP --> CORE --> ST
129+
S1 --> S2
130+
S1 -. opt .-> S3
131+
R6 -. opt .-> S4
132+
R6 -. opt .-> S5
133+
CORE -. uses .-> P1
134+
AP -. gated by .-> P2
135+
CORE -. offload .-> P3
136+
CORE --> P4
137+
CORE -. fail-open .-> P5
138+
B1 -. drives .-> CORE
139+
```
77140

78141
## ✨ What's implemented today
79142

0 commit comments

Comments
 (0)