How we built a persistent agent memory layer on Elasticsearch with 0.89 recall and zero tenant leaks
elastic.co
A team built a persistent memory system for AI agents using Elasticsearch with three separate indices for episodic (timestamped events), semantic (stable facts), and procedural (step-by-step playbooks) memories, combined with hybrid retrieval using BM25 and dense vectors plus a cross-encoder reranker. The system achieved 0.89 recall@10 on a 168-question evaluation with zero cross-tenant data leaks, using per-user document-level security to isolate each user's memories. The architecture consolidates short-lived episode logs into durable facts and playbooks every turn, handles contradictions through supersession rather than deletion, and applies time-decay so recent information ranks above older facts.
Why it matters
A persistent agent memory layer built on Elasticsearch uses a multi-index system to improve long-term memory capabilities for agents, leading to high recall accuracy and tenant isolation. With separate indices for episodic, semantic, and procedural memory, the architecture efficiently manages various memory types while addressing challenges like memory decay and data contradiction.