Hippocampus: An Efficient and Scalable Memory Module for Agentic AI

Yi Ju Li, Lianjie Cao, Faraz Ahmed, Puneet Sharma, Bingzhe Li · DOI

Abstract

Agentic AI require persistent memory to store user-specific histories beyond the limited context window of LLMs. Existing memory systems use dense vector databases or knowledge-graph traversal (or hybrid), incurring high retrieval latency and poor storage scalability. We introduce Hippocampus, an agentic memory management system that uses compact binary signatures for semantic search and lossless token-ID streams for exact content reconstruction. Its core is a Dynamic Wavelet Matrix (DWM) that compresses and co-indexes both streams to support ultra-fast search in the compressed domain, thus avoiding costly dense-vector or graph computations. This design scales linearly with memory size, making it suitable for long-horizon agentic deployments. Empirically, our evaluation shows that Hippocampus reduces end-to-end retrieval latency by up to 31$\times$ and cuts per-query token footprint by up to 14$\times$, while maintaining accuracy on both LoCoMo and LongMemEval benchmarks.

Introduction

Large Language Models (LLMs) are constrained by finite context windows. Autonomous "Agentic AI" systems, which operate over extended durations through iterative perception, planning, and action, require a mechanism to retain past interactions, tool outputs, and user preferences. Current solutions typically employ Retrieval-Augmented Generation (RAG) with dense vector databases or Knowledge Graphs (KGs). However, these methods suffer from significant inefficiencies: writing to memory necessitates expensive embedding generation or LLM summarization, while reading requires computationally intensive floating-point operations or complex graph traversals. Research indicates that the search phase alone can account for up to 85% of retrieval latency, creating a bottleneck for long-horizon tasks.

Methodology: The Hippocampus Architecture

Hippocampus addresses these inefficiencies by replacing dense vector embeddings with a dual-representation strategy built on a specialized data structure.

Dynamic Wavelet Matrix (DWM)

The core of Hippocampus is the Dynamic Wavelet Matrix, a succinct data structure designed to compress sequences of symbols while allowing for search operations directly in the compressed domain. Unlike standard Wavelet Matrices, the DWM is append-friendly, enabling the continuous streaming of new memories.

Dual-Stream Representation

Hippocampus maintains two parallel DWMs to separate semantic indexing from content storage:

  1. Content DWM: Stores the exact, lossless sequence of LLM token-IDs.
  2. Signature DWM: Stores compact, context-aware binary signatures for those tokens.
Memory Construction Process using Dynamic Wavelet Matrices (DWM) for dual-stream storage.

Semantic Hashing and Retrieval

Instead of floating-point embeddings, Hippocampus utilizes a lightweight streaming algorithm to convert token contexts into short binary codes. Retrieval follows an "approximate-then-exact" approach. Queries are converted into binary signatures and matched against the Signature DWM using bitwise operations (XOR and POPCOUNT), which are significantly faster than GPU-bound matrix multiplications. Once matches are identified, the Content DWM reconstructs the high-fidelity text for the LLM.

Experimental Evaluation

The system was evaluated on two rigorous benchmarks:

  • LoCoMo: Focused on long-term conversational memory with multi-session dialogues averaging 16K tokens.
  • LongMemEval: Tailored for interactive assistants, testing information extraction and temporal reasoning across multiple sessions.

Key Results

Empirical results demonstrate that Hippocampus occupies the Pareto frontier of speed, cost, and accuracy.

Performance comparison of Hippocampus (red star) against baselines across F1 score, token consumption, and latency.
  • Blazing Fast Retrieval: Hippocampus achieves an average response time of 1.08 seconds, representing a 31$\times$ speedup over dense-vector approaches like ReadAgent (~33.6s).
  • Drastically Lower Cost: It consumes approximately 1.3K tokens per query, a 14$\times$ reduction compared to systems like MemGPT (~16.9K) and MemoryOS (~8.1K).
  • Zero-Token Ingestion: Memory construction requires zero LLM tokens and is 5.3$\times$ faster in wall-clock time than the fastest baseline.
  • Maintained Accuracy: Hippocampus maintains or exceeds state-of-the-art performance on F1, BLEU-1, and LLM-as-a-Judge metrics across both benchmarks.

Conclusion and Future Work

Hippocampus demonstrates that mapping semantic meaning to binary signatures allows for hardware-optimized bitwise search, drastically reducing the computational overhead of agentic memory. While the current architecture is optimized for text, future work will explore scaling these binary search spaces to accommodate massive multi-modal streams, such as continuous video and audio tokenization, without compromising latency.

Summary updated

BibTeX
@misc{li2026hippocampus,
  author = {Yi Ju Li and Lianjie Cao and Faraz Ahmed and Puneet Sharma and Bingzhe Li},
  title = {{Hippocampus: An Efficient and Scalable Memory Module for Agentic AI}},
  year = {2026},
  eprint = {2602.13594},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.13594},
}
Figure