6. Architecture Patterns
Five patterns crystallize from this survey. They don't compose well together, and most tools implement exactly one.
6.1 Hook-Driven Lifecycle Compression
Tools: claude-mem, claude-memory-compiler, agentmemory
The agent session is treated as an event stream. Hooks fire at SessionStart/PostToolUse/Stop; an extractor pulls signal from noise; a compressed representation is injected at the next session. This is event-sourcing with LLM-based projection.
The winning pattern in 2026 because it requires zero agent cooperation: the agent doesn't need to decide to remember. Automatic extraction at zero token cost beats voluntary MCP store calls for any high-frequency scenario. For the write path, this should be the default.
6.2 MCP as Blackboard
Tools: shared-memory-mcp, Agent-MCP, agentmemory, Mem0 cloud
Multiple agents read and write a shared semantic store via MCP tool calls. Classical AI blackboard pattern resurrected. The architectural limit: MCP was designed for user-to-agent context access, not agent-to-agent coordination. Works in practice; the design is a workaround.
6.3 Hierarchical Episodic + Permanent Graph
Tools: ICM (Memories + Memoirs), Neo4j Agent Memory (3-layer: short-term / long-term / reasoning)
Two-tier or three-tier separation: ephemeral data decays on importance and recency, structural knowledge persists permanently. ICM's Memoirs with typed relations (depends_on, contradicts, superseded_by) are the cleanest minimal implementation. The Neo4j three-layer model with dedicated reasoning memory is the most complete, but also the most operationally expensive.
6.4 Temporal Knowledge Graph
Tools: Zep / Graphiti (only)
Every edge carries a validity window. A query like "what did we believe before the April pivot?" is answerable. Every other tool in this survey treats memory as a flat snapshot; they cannot answer historical questions about superseded decisions.
The bitemporal model from data warehousing (Snodgrass, 1999) applied to agent memory. Required when organizations pivot and need a point-in-time view of past decisions. Overkill for straightforward session continuity.
6.5 Hybrid Retrieval Fusion (RRF)
Tools: agentmemory (BM25 + Vector + Graph)
Three indexes fused via Reciprocal Rank Fusion: score = sum(1 / (k + rank_i)) across each retriever, sorted by fused score. The lift from BM25 + Vector + Graph over BM25-only: 9 percentage points R@5 (95.2% vs 86.2%) on reproducible benchmarks. That translates to a 65% reduction in retrieval misses.
RRF is ~20 lines of code. The cost is maintaining three indexes in sync. Most tools optimized for install simplicity skip this. Pure vector search loses to hybrid in practice: the embedding smears exact-match signal (function names, error strings) across the vector space.
6.6 What's Missing Architecturally
No tool implements write-ahead conflict resolution for multi-writer scenarios. No tool implements memory provenance (which agent wrote this, based on what evidence, linked to which session). No tool implements causal consistency across distributed agents. The field is at "shared key-value with timestamps" sophistication.
The tools winning in 2026 (claude-mem, agentmemory) won because they solved lifecycle integration via hooks, not because they solved coordination. The next generation will solve coordination.
6.7 Storage Backend Right-Sizing
| Scenario | Correct backend | Avoid |
|---|---|---|
| Solo, single machine | SQLite-vec | ChromaDB (fragile write locking) |
| Solo, multi-device | Cloudflare D1 + Vectorize | SQLite over network filesystem |
| Small team 2-10, self-hosted | Postgres + pgvector | SQLite with multiple writers |
| Team needing temporal queries | Neo4j (via Zep) | Flat vector stores |
| Enterprise, compliance | Postgres + pgvector + RLS | Cloud-only vendors without export |
| Prototype / dev only | ChromaDB or plain SQLite | - |
The missing option across the ecosystem: Postgres + pgvector. No major memory MCP tool defaults to it. For any team beyond 5-10 developers, Postgres with MVCC handles concurrent writers cleanly, HNSW is available via pgvector 0.5+, row-level security maps naturally to user and team scopes, and backup tooling is mature. The absence of Postgres in the ecosystem is the clearest indicator of its team-readiness gap.
SQLite best practices when using it for memory workloads:
PRAGMA journal_mode=WAL; -- allow concurrent readers with one writer
PRAGMA synchronous=NORMAL; -- 30% throughput gain, recoverable on power-cut
PRAGMA mmap_size=268435456; -- 256MB, let OS page cache work
PRAGMA cache_size=20000; -- keep hot pages in memory
PRAGMA wal_autocheckpoint=10000; -- checkpoint on idle, not every commitSingle dedicated writer connection, N read connections pooled. busy_timeout=30000 as a safety net, not a primary mechanism.