Agent Memory and Knowledge Graphs
Agent memory and knowledge graphs are two interlocking foundations of persistent AI agents. Agent memory is the capability that lets an agent retain, organise, and reuse information across interactions, distinguishing a long-running agent from a stateless language model; it is the component that determines how knowledge is accumulated, how experience is processed, and how information is retrieved to support action. Knowledge graphs supply the structure that turns accumulated records into knowledge an agent can traverse and reason over, representing entities and their relations as a network rather than a flat collection of text. Together they address the central limitation of large language models: a fixed context window and no durable experience of their own.
Memory is studied through a well-established taxonomy. Working and short-term memory hold the agent's current circumstances and are bounded by the context window; long-term memory persists across sessions and divides into episodic memory of specific experiences, semantic memory of stable facts, and procedural memory of skills and routines. Architectures such as MemGPT treat the context window as a scarce resource paged against external storage, while other systems store natural-language memory streams, hierarchical summaries, or evolving note networks. Retrieval-augmented generation supplies the read path, matching queries to stored content; when organised as graphs, retrieval can follow relations and span a corpus rather than returning isolated chunks.
Knowledge graphs are built by extracting entities and relations from text, linking them to canonical identifiers, and organising them under an ontology that supplies the vocabulary of concepts and relationships. Stored in graph databases and queried with languages such as SPARQL and Cypher, they support reasoning that derives facts never stated explicitly. In agent systems the graph has become the "beyond-RAG" layer of choice, producing more comprehensive answers on corpus-wide questions. GraphRAG, HippoRAG, and temporal knowledge graphs such as Zep's Graphiti extend this by adding community summarisation, associative retrieval, and time-stamped facts that are invalidated rather than overwritten.
The field is also defined by its methods and its unresolved problems. Consolidation compresses short-term traces into durable facts, forgetting prunes low-value records, and embedding models let both text and graph structure be searched by similarity. Persistent memory introduces real risks: injected or poisoned records can manipulate an agent's future behaviour, stale facts can contradict current ones, and stored experience accumulates sensitive data. Evaluation through long-term benchmarks such as LongMemEval and LoCoMo, and open questions in retention, continual learning, graph coverage, governance, and interoperability, set the agenda for continuing work.