AI Memory Structure

From P2P Foundation Wiki
Jump to navigation Jump to search

Typology

Robin Dey and Panyanon Viradech:

"The AI Memory Problem

The context window limitation of transformer-based LLMs creates a fundamental tension between breadth and recency. The literature has converged on several approaches:

Extraction-based systems use an LLM to read conversations and extract structured facts. Mem0 (Mem0 AI, 2024) pioneered this approach, using GPT-series models to maintain a fact store consulted at the start of each session. The advantage is compact representation; the disadvantage is information loss—the LLM must decide at write time what will be relevant at read time, a fundamentally impossible task for open-ended conversations.

Knowledge graph systems build structured entity-relationship graphs from conversations. Zep’s Graphiti (Zep AI, 2024) uses Neo4j to maintain temporal knowledge graphs with entity resolution and multi-hop traversal.

Tiered memory systems maintain multiple levels of memory with different retention policies. Letta (Packer et al., 2023) implements a three-tier system (core, archival, recall memory) where the AI itself manages what gets promoted or demoted.

Retrieval-augmented generation (RAG) (Lewis et al., 2020) is the most general approach: store information in a vector database, retrieve relevant passages at query time, and inject them into the LLM’s context. MemPalace falls squarely in this category, with the addition of a hierarchical metadata layer.


The Method of Loci

The method of loci (MoL), also known as the memory palace technique, is the oldest systematically documented mnemonic strategy in Western civilization. Its origin is traditionally attributed to the Greek poet Simonides of Ceos (c. 556–468 BC), as recorded by Cicero in De Oratore (55 BC). The technique works by associating items to be remembered with specific locations (loci) along a mentally visualized route through a familiar building. Retrieval proceeds by mentally “walking” the route and “seeing” the items at each location. The technique exploits the brain’s spatial navigation system—phylogenetically ancient and highly robust—to scaffold memory for non-spatial content (O’Keefe and Nadel, 1978)."

(https://arxiv.org/html/2604.21284v1)


Example

MemPalace’s hierarchical structure

(Wings → Rooms → Drawers)

" ... invokes a well-established principle in cognitive science: hierarchical organization improves memory encoding and retrieval.

Collins and Quillian (1969) proposed that concepts are stored in a taxonomy where properties are inherited downward. Collins and Loftus (1975) extended this with spreading activation theory. Bartlett (1932) proposed schema theory, showing that hierarchical schemas improve both encoding efficiency and retrieval accuracy. Schapiro et al. (2017) showed that complementary learning systems in the hippocampus reconcile episodic memory with statistical learning, supporting the view that hierarchical organization is fundamental to memory. Collin et al. (2020) showed the hippocampus encodes hierarchical organizations of related memories.

Application to MemPalace: The cognitive science evidence strongly supports hierarchical organization as beneficial for memory systems. However, MemPalace’s hierarchy operates on metadata labels, not neural-like associative networks. In human memory, hierarchical structure enables inheritance and spreading activation. In MemPalace, the hierarchy enables metadata filtering. These are related concepts but different mechanisms."

(https://arxiv.org/html/2604.21284v1)