-
Notifications
You must be signed in to change notification settings - Fork 2
research(memory): fact-based memory vs long-context — empirical crossover formula, cost model (arXiv:2603.04814) #2288
Description
Finding
Paper: "Beyond the Context Window: A Cost-Performance Analysis of Fact-Based Memory vs. Long-Context LLMs for Persistent Agents"
arXiv: https://arxiv.org/abs/2603.04814 (March 2026)
Core Idea
Empirically compares structured fact-extraction memory (Mem0-style SQLite/vector store) against full-history long-context inference on three persistence benchmarks (LongMemEval, LoCoMo, PersonaMemv2):
- Long-context wins on recall accuracy at short histories
- Fact-based memory wins dramatically on cost at scale
- Provides a crossover formula: at what message count does each approach dominate
Applicability to Zeph (5/5)
Zeph already implements exactly this tradeoff (SQLite episodic + Qdrant semantic vs. full context). The paper's crossover formula directly justifies Zeph's memory-first design and could inform:
- A configurable field in — uses the crossover formula to pick at runtime
- Cost tracking already in Zeph can be extended with a running cost-per-turn estimate to trigger memory-first mode when cost threshold is hit
- Validates the compaction + semantic retrieval pipeline as cost-optimal for long sessions
Implementation Sketch
In : add a strategy selector that queries current turn count + cost metrics, switches from full-history to memory-retrieval-first assembly when the crossover threshold is exceeded.