
Every AI agent has amnesia.
Claude forgets your last conversation. GPT doesn't know what you decided last week. Your copilot can't recall the architecture discussions from three months ago. Every session starts from zero.
The current fixes don't work. Vector databases lose all structure -- you get "similar text," never "why did I decide this?". Markdown files are slow and break at scale. Key-value stores are flat -- no relationships, no reasoning chains. Provider memory is locked to one vendor.
AgenticMemory stores your agent's knowledge as a navigable graph in a single binary file. Not "search your old conversations." Your agent has a brain -- facts, decisions, reasoning chains, corrections, and skills -- all connected, all queryable in microseconds.
Problems Solved (Read This First)
- Problem: every chat starts over and previous decisions disappear.
Solved: persistent .amem memory survives restarts, model switches, and long gaps between sessions.
- Problem: vector search returns "similar text" but not true reasoning trails.
Solved: graph traversal, causal paths, and decision lineage are first-class queries.
- Problem: corrections overwrite truth and erase history.
Solved: supersession chains preserve old and new beliefs with auditable change history.
- Problem: memory quality degrades silently over time.
Solved: quality, drift, gap, and revision tooling keep memory reliable at runtime.
- Problem: long-term memory becomes too heavy to keep portable.
Solved: compact single-file storage with practical multi-year lifespan and backup portability.
from agentic_memory import Brain
brain = Brain("my_agent.amem")
# Your agent learns
brain.add_fact("User is a senior Rust developer", session=1, confidence=0.95)
brain.add_decision("Recommended tokio for async -- team has no Go experience", session=1)
# Session 47 -- months later, different LLM, same brain:
results = brain.search("async runtime") # Hybrid BM25 + vector search
chain = brain.traverse(decision_id) # Why did I decide this?
current = brain.resolve(old_fact_id) # What's the latest version?
report = brain.revise("Team now knows Go") # If this is true, what breaks?
gaps = brain.gaps() # Where am I guessing?
timeline = brain.drift("programming languages") # How has this belief changed?
Operational reliability commands (CLI):
amem quality my_agent.amem
amem runtime-sync my_agent.amem --workspace . --write-episode
Six lines. Sixteen query types. One file holds everything. Works with Claude, GPT, Ollama, or any LLM you switch to next.
V3: Immortal Architecture
New in v0.4.1 -- Memory that never dies.
V3 adds a complete append-only, content-addressed storage layer with BLAKE3 integrity chains. Your agent's memory is now cryptographically tamper-proof, multi-client, and designed to last 20 years.
Core Capabilities
- Immortal Log -- Append-only storage with BLAKE3 integrity chains. Never deletes. Never modifies.
- Five Indexes -- Temporal, semantic, causal, entity, and procedural. Find anything instantly.
- Tiered Storage -- Hot -> Warm -> Cold -> Frozen. 20 years of memory in ~500MB.
- Ghost Writer -- Auto-syncs to Claude, Cursor, Windsurf, and Cody. Zero configuration.
- Smart Retrieval -- Multi-index fusion with token budgeting. Perfect context assembly.
- Crash Recovery -- WAL with CRC32 checksums. Survives anything.
- MCP Hardening -- Content-Length framing with 8 MiB limit, JSON-RPC 2.0 validation, no silent fallbacks.
Multi-Client Support
| Client | Auto-Sync Location | Status |
|---|
| Claude Code | ~/.claude/memory/V3_CONTEXT.md | Full support |
| Cursor | ~/.cursor/memory/agentic-memory.md | Full support |
| Windsurf | ~/.windsurf/memory/agentic-memory.md | Full support |
| Cody | ~/.sourcegraph/cody/memory/agentic-memory.md | Full support |
V3 Architecture
+-------------------------------------------------------------+
| YOUR AI AGENT |
| (Claude, Cursor, Windsurf, Cody) |
+----------------------------+--------------------------------+
|
+----------v----------+
| MCP LAYER |
| Tools + Resources |
+----------+----------+
|
+----------------------------v--------------------------------+
| V3 ENGINE |
+--------------+--------------+--------------+----------------+
| Immortal Log | 5 Indexes |Tiered Storage| Ghost Writer |
| (append-only)| (T/S/C/E/P) | (H/W/C/F) | (multi-client) |
+--------------+--------------+--------------+----------------+
|
+----------v----------+
| .amem FILE |
| (your memory) |
+---------------------+
The Five Indexes
| Index | Purpose | Query Type |
|---|
| Temporal | Find by time | "What happened yesterday?" |
| Semantic | Find by meaning | "Everything about contracts" |
| Causal | Find decision chains | "Why did we choose Rust?" |
| Entity | Find by file/person | "All changes to main.rs" |
| Procedural | Find workflows | "Steps to deploy" |
Tiered Storage
| Tier | Age | Access Time | Storage |
|---|
| Hot | < 24 hours | < 1ms | Memory |
| Warm | < 30 days | < 10ms | Disk |
| Cold | < 1 year | < 100ms | Compressed |
| Frozen | Forever | < 1s | Archive |
V3 MCP Tools
AgenticMemory V3 exposes 13 MCP tools for AI agents:
Capture Tools
| Tool | Description |
|---|
memory_capture_message | Capture user/assistant messages |
memory_capture_tool | Capture tool calls with input/output |
memory_capture_file | Capture file operations |
memory_capture_decision | Capture decisions with reasoning |
memory_capture_boundary | Capture session boundaries (compaction, etc.) |
Retrieval Tools
| Tool | Description |
|---|
memory_retrieve | Smart context assembly with token budgeting |
memory_resurrect | Restore full state at any timestamp |
memory_v3_session_resume | Load context for session continuation |
Search Tools
| Tool | Description |
|---|
memory_search_temporal | Search by time range |
memory_search_semantic | Search by meaning/text |
memory_search_entity | Search by file/person/entity |
Stats Tools
| Tool | Description |
|---|
memory_v3_stats | Storage and index statistics |
memory_verify_integrity | Cryptographic integrity verification |
MCP Resources
memory://v3/session/context -- Full session context
memory://v3/session/decisions -- Recent decisions
memory://v3/session/files -- Files modified
memory://v3/session/errors -- Errors resolved
memory://v3/session/activity -- Recent activity
memory://v3/stats -- Storage statistics
Benchmarks
Rust core. Memory-mapped I/O. Zero-copy access. Real numbers from Criterion statistical benchmarks:
| Operation | Time | Scale |
|---|
| Add node | 276 ns | 10K graph |
| Add edge | 1.2 ms | 10K graph |
| Traverse depth-5 | 3.4 ms | 100K nodes |
| Similarity search (top 10) | 9.0 ms | 100K nodes |
| BM25 text search (fast path) | 1.58 ms | 100K nodes |
| BM25 text search (slow path) | 122 ms | 100K nodes |
| Hybrid search (BM25 + vector) | 10.83 ms | 100K nodes |
| PageRank convergence | 34.3 ms | 100K nodes |
| Bidirectional BFS shortest path | 104 us | 100K nodes |
| Belief revision (cascade) | 53.4 ms | 100K nodes |
| Drift detection | 68.4 ms | 100K nodes |
| Read 10K nodes from file | 3.7 ms | -- |
| mmap node access | 370 ns | 100K nodes |
All v0.2 query benchmarks measured with Criterion (100 samples) on Apple M4 Pro, 64 GB, Rust 1.90.0 --release. Computationally intensive queries (gap detection 297s, analogical 229s, consolidation 43.6s at 100K) are designed for periodic/offline execution and complete in <3s at 10K nodes.
Capacity: A year of daily use produces a ~24 MB file. A decade fits in ~240 MB. A lifetime of memory fits in under 1 GB.