|
11 | 11 | </h3> |
12 | 12 |
|
13 | 13 | <p align="center"> |
14 | | - A user-owned memory store that any agent can plug into to become instantly personalized.<br> |
15 | | - Agents read via scoped retrieval. Writes land in staging until you approve. |
| 14 | + Hit a rate limit in Claude Code? Open Codex — it already knows what you were doing.<br> |
| 15 | + One memory kernel. Shared across every agent. Bio-inspired forgetting. Staged writes. Episodic recall. |
| 16 | +</p> |
| 17 | + |
| 18 | +<p align="center"> |
| 19 | + <b>⚠ Early-stage software — not recommended for production use. APIs may change. Use at your own risk.</b> |
16 | 20 | </p> |
17 | 21 |
|
18 | 22 | <p align="center"> |
|
36 | 40 |
|
37 | 41 | ## Why Engram |
38 | 42 |
|
39 | | -Every AI agent you use starts with amnesia. Your coding assistant forgets your preferences between sessions. Your planning agent has no idea what your research agent discovered yesterday. You end up re-explaining context that should already be known. |
| 43 | +Every AI agent you use starts with amnesia. But the real pain isn't just forgetting — it's what happens when you **switch agents**. |
40 | 44 |
|
41 | | -**Engram fixes this.** It's a Personal Memory Kernel (PMK) — a single memory store that sits between you and all your agents. Any agent can plug in via MCP or REST to become instantly personalized, without you having to repeat yourself. |
| 45 | +You're 40 minutes into a refactor with Claude Code. You've touched six files, picked a migration strategy, mapped out the remaining TODOs. Then you hit a rate limit. Or your terminal crashes. Or you just need Codex for the next part. So you switch — and the new agent has **zero context**. You re-paste file paths, re-explain decisions, re-describe the plan. Half the time the new agent contradicts something you'd already decided. |
42 | 46 |
|
43 | | -But unlike "store everything forever" approaches, Engram treats agents as **untrusted writers**. Writes land in staging. You control what sticks. And memories that stop being useful fade away naturally — just like biological memory. |
| 47 | +**Engram fixes this.** It's a Personal Memory Kernel (PMK) — one memory store shared across all your agents. When Claude Code pauses, it saves a session digest. When Codex picks up, it loads that digest and continues where you left off. No re-explanation. No cold starts. |
44 | 48 |
|
45 | | -| Capability | Other Memory Layers | **Engram** | |
46 | | -|:-----------|:--------------------|:-----------| |
47 | | -| Bio-inspired forgetting | No | **Ebbinghaus decay curve** | |
48 | | -| Untrusted agent writes | Store directly | **Staging + verification + conflict stash** | |
49 | | -| Episodic narrative memory | No | **CAST scenes (time/place/topic)** | |
50 | | -| Multi-modal encoding | Rare | **5 retrieval paths (EchoMem)** | |
51 | | -| Cross-agent memory sharing | Per-agent silos | **Scoped retrieval with masking** | |
52 | | -| Knowledge graph | Sometimes | **Entity extraction + linking** | |
| 49 | +But Engram isn't just a handoff bus. It solves four fundamental problems with how AI memory works today: |
| 50 | + |
| 51 | +| Problem | Other Memory Layers | **Engram** | |
| 52 | +|:--------|:--------------------|:-----------| |
| 53 | +| **Switching agents = cold start** | Manual copy/paste context | **Handoff bus — session digests, auto-resume** | |
| 54 | +| **Nobody forgets** | Store everything forever | **Ebbinghaus decay curve, ~45% less storage** | |
| 55 | +| **Agents write with no oversight** | Store directly | **Staging + verification + trust scoring** | |
| 56 | +| **No episodic memory** | Vector search only | **CAST scenes (time/place/topic)** | |
| 57 | +| Multi-modal encoding | Single embedding | **5 retrieval paths (EchoMem)** | |
| 58 | +| Cross-agent memory sharing | Per-agent silos | **Scoped retrieval with all-but-mask privacy** | |
53 | 59 | | Reference-aware decay | No | **If other agents use it, don't delete it** | |
54 | | -| Hybrid search | Vector only | **Semantic + keyword + episodic** | |
55 | | -| Storage efficiency | Store everything | **~45% less** | |
| 60 | +| Knowledge graph | Sometimes | **Entity extraction + linking** | |
56 | 61 | | MCP + REST | One or the other | **Both, plug-and-play** | |
57 | 62 | | Local-first | Cloud-required | **127.0.0.1:8100 by default** | |
58 | 63 |
|
@@ -127,9 +132,10 @@ docker compose up -d # API at http://localhost:8100 |
127 | 132 |
|
128 | 133 | Engram is a **Personal Memory Kernel** — not just a vector store with an API. It has opinions about how memory should work: |
129 | 134 |
|
130 | | -1. **Agents are untrusted writers.** Every write is a proposal that lands in staging. Trusted agents can auto-merge; untrusted ones wait for approval. |
| 135 | +1. **Switching agents shouldn't mean starting over.** When an agent pauses — rate limit, crash, tool switch — it saves a session digest. The next agent loads it and continues. Zero re-explanation. |
131 | 136 | 2. **Memory has a lifecycle.** New memories start in short-term (SML), get promoted to long-term (LML) through repeated access, and fade away through Ebbinghaus decay if unused. |
132 | | -3. **Scoping is mandatory.** Every memory is scoped by user. Agents see only what they're allowed to — everything else gets the "all but mask" treatment (structure visible, details redacted). |
| 137 | +3. **Agents are untrusted writers.** Every write is a proposal that lands in staging. Trusted agents can auto-merge; untrusted ones wait for approval. |
| 138 | +4. **Scoping is mandatory.** Every memory is scoped by user. Agents see only what they're allowed to — everything else gets the "all but mask" treatment (structure visible, details redacted). |
133 | 139 |
|
134 | 140 | ``` |
135 | 141 | ┌─────────────────────────────────────────────────────────────────┐ |
@@ -192,7 +198,7 @@ Engram is a **Personal Memory Kernel** — not just a vector store with an API. |
192 | 198 |
|
193 | 199 | ### The Memory Stack |
194 | 200 |
|
195 | | -Engram combines four bio-inspired memory systems, each handling a different aspect of how humans actually remember: |
| 201 | +Engram combines five systems, each handling a different aspect of how memory should work: |
196 | 202 |
|
197 | 203 | #### FadeMem — Decay & Consolidation |
198 | 204 |
|
@@ -243,6 +249,21 @@ Scene: "Engram v2 architecture session" |
243 | 249 | Memories: [mem_1, mem_2] ← semantic facts extracted |
244 | 250 | ``` |
245 | 251 |
|
| 252 | +#### Handoff Bus — Cross-Agent Continuity |
| 253 | + |
| 254 | +When an agent pauses work — rate limit, crash, you switch tools — it saves a session digest: task summary, decisions made, files touched, remaining TODOs, blockers. The next agent calls `get_last_session` and gets the full context. No re-explanation needed. |
| 255 | + |
| 256 | +``` |
| 257 | +Claude Code (rate limited) |
| 258 | + → save_session_digest(task, decisions, files, todos, blockers) |
| 259 | + → Session stored in handoff bus |
| 260 | +
|
| 261 | +Codex (picks up) |
| 262 | + → get_last_session(repo="/my-project") |
| 263 | + → Gets full context: task, decisions, files, todos |
| 264 | + → Continues where Claude Code stopped |
| 265 | +``` |
| 266 | + |
246 | 267 | --- |
247 | 268 |
|
248 | 269 | ### Key Flows |
@@ -300,6 +321,16 @@ Engram is plug-and-play. Run `engram install` and it auto-configures everything: |
300 | 321 | engram install # Writes MCP config to ~/.claude.json |
301 | 322 | ``` |
302 | 323 |
|
| 324 | +`engram install` also bootstraps workspace continuity rules (in your current |
| 325 | +project directory) so agents call handoff tools automatically: |
| 326 | + |
| 327 | +- `AGENTS.md` |
| 328 | +- `CLAUDE.md` |
| 329 | +- `CURSOR.md` |
| 330 | +- `.cursor/rules/engram-continuity.mdc` |
| 331 | + |
| 332 | +Set `ENGRAM_INSTALL_SKIP_WORKSPACE_RULES=1` to disable this behavior. |
| 333 | + |
303 | 334 | **MCP tools** give Claude reactive memory — it stores and retrieves when you ask. |
304 | 335 |
|
305 | 336 | The optional **Claude Code plugin** makes memory **proactive** — relevant context is injected automatically before Claude sees your message: |
@@ -340,10 +371,12 @@ Claude: Based on your preferences, I'd recommend TypeScript... |
340 | 371 | ### Cursor |
341 | 372 |
|
342 | 373 | `engram install` writes MCP config to `~/.cursor/mcp.json`. Restart Cursor to load. |
| 374 | +It also sets `ENGRAM_MCP_AGENT_ID=cursor` for deterministic handoff identity. |
343 | 375 |
|
344 | 376 | ### OpenAI Codex |
345 | 377 |
|
346 | 378 | `engram install` writes MCP config to `~/.codex/config.toml`. Restart Codex to load. |
| 379 | +It also sets `ENGRAM_MCP_AGENT_ID=codex` for deterministic handoff identity. |
347 | 380 |
|
348 | 381 | ### OpenClaw |
349 | 382 |
|
@@ -379,6 +412,9 @@ Once configured, your agent has access to these tools: |
379 | 412 | | `list_pending_commits` | Inspect staged write queue | |
380 | 413 | | `resolve_conflict` | Resolve invariant conflicts (accept proposed or keep existing) | |
381 | 414 | | `search_scenes` / `get_scene` | Episodic CAST scene retrieval with masking policy | |
| 415 | +| `save_session_digest` | Save handoff context when pausing or switching agents | |
| 416 | +| `get_last_session` | Load session context from the last active agent | |
| 417 | +| `list_sessions` | Browse handoff history across agents | |
382 | 418 |
|
383 | 419 | --- |
384 | 420 |
|
@@ -432,6 +468,19 @@ curl "http://localhost:8100/v1/trust?user_id=u123&agent_id=planner" |
432 | 468 | # 7. Sleep-cycle maintenance |
433 | 469 | curl -X POST http://localhost:8100/v1/sleep/run \ |
434 | 470 | -d '{"user_id": "u123", "apply_decay": true, "cleanup_stale_refs": true}' |
| 471 | + |
| 472 | +# 8. Zero-intervention handoff (session bus) |
| 473 | +curl -X POST http://localhost:8100/v1/handoff/resume \ |
| 474 | + -H "Authorization: Bearer <TOKEN>" \ |
| 475 | + -H "Content-Type: application/json" \ |
| 476 | + -d '{"user_id":"u123","agent_id":"frontend","repo_path":"/repo","objective":"continue latest task"}' |
| 477 | + |
| 478 | +curl -X POST http://localhost:8100/v1/handoff/checkpoint \ |
| 479 | + -H "Authorization: Bearer <TOKEN>" \ |
| 480 | + -H "Content-Type: application/json" \ |
| 481 | + -d '{"user_id":"u123","agent_id":"frontend","repo_path":"/repo","task_summary":"implemented card layout"}' |
| 482 | + |
| 483 | +curl "http://localhost:8100/v1/handoff/lanes?user_id=u123" |
435 | 484 | ``` |
436 | 485 |
|
437 | 486 | ### Python SDK |
@@ -796,7 +845,7 @@ MIT License — see [LICENSE](LICENSE) for details. |
796 | 845 | --- |
797 | 846 |
|
798 | 847 | <p align="center"> |
799 | | - <b>Your agents forget everything between sessions. Engram fixes that.</b> |
| 848 | + <b>Switch agents without losing context. Stop re-explaining yourself.</b> |
800 | 849 | <br><br> |
801 | 850 | <a href="https://github.com/Ashish-dwi99/Engram">GitHub</a> · |
802 | 851 | <a href="https://github.com/Ashish-dwi99/Engram/issues">Issues</a> · |
|
0 commit comments