V · MemoryEmerging

Knowledge Graph Memory

also known as Triple Store Memory, Symbolic Memory

Persist agent memory as entities and relations in a structured graph so symbolic queries (path, neighbour, type) become possible.

This pattern helps complete certain larger patterns —

  • used-bySemantic MemoryMaintain a dedicated store of what the agent holds to be true about the user and the world, separate from event records (episodic) and learned how-to (procedural).
  • used-byHybrid Symbolic-Neural RoutingPer query, route between a symbolic path (rule engine, knowledge graph) and a neural path (LLM), using the LLM for interpretation and the symbolic layer for exact constraints.

Context

An agent's tasks involve questions about structured relationships rather than semantic similarity: 'who reports to whom in this organisation chart', 'what code depends on this function', 'what are the ancestors of this entity in the family tree', 'which products are compatible with this one'. The answers are not 'documents that look similar' but 'nodes connected by specific edge types in a graph'.

Problem

Vector memory excels at semantic similarity but cannot answer relational queries: there is no embedding-space operator for 'find every node whose reports_to edge transitively reaches Alice'. When the team stores only vector representations of facts, the symbolic structure between facts — who knows whom, what depends on what — is lost. Without a graph representation, structured queries either become brittle keyword hacks or have to be answered by the model from raw text, where the relational structure has been flattened into prose and is no longer reliably queryable.

Forces

  • Entity and relation extraction is itself a model task with errors.
  • Schema design for the graph is a separate engineering effort.
  • Updates and deletions need referential integrity.

Example

An ops agent for a 400-person company is asked 'who would approve a $5k purchase in the design org?' Vector memory returns three semantically similar past tickets but cannot answer the structural question. The team adds knowledge-graph-memory: people, roles, reporting lines, and approval thresholds are extracted from the HRIS and intranet into a Neo4j graph. The agent now answers via a Cypher traversal — 'design-org → manager → director with approval ≥ $5k' — and combines that with vector recall of past similar approvals.

Diagram

Solution

Therefore:

Extract entities and relations from observations into a graph store (Neo4j, RDF, simple JSON). Queries traverse the graph (Cypher/SPARQL or programmatic). Combine with vector memory for hybrid retrieval (vector finds entry points; graph traverses).

What this pattern forbids. Memory queries that require traversal must use graph operations; ad-hoc text matching over the graph is not the supported access path.

The smaller patterns that complete this one —

  • generalisesWorld-Model Graph MemoryMemory store structured as a typed entity-relation graph used as the agent's authoritative world model for planning — not only for retrieval.

And the patterns that stand alongside it, or against it —

  • alternative-toVector Memory★★Store memories as embeddings in a vector index and retrieve the most semantically similar items at query time.
  • composes-withGraphRAGBuild an LLM-extracted entity-and-relation knowledge graph plus hierarchical community summaries, then answer global queries via map-reduce over those summaries.
  • alternative-toSynthetic Filesystem Overlay·Project heterogeneous enterprise data sources into a single Unix-like tree exposed through filesystem primitives so the agent reuses path semantics it already knows instead of learning a bespoke API per source.
  • complementsProcedural MemoryMaintain a third agent memory type alongside episodic (past events) and semantic (facts): procedural memory captures *learned how-to* — reusable skills, workflows, and self-rewritten system instructions that map situations directly to actions.
  • complementsHippoRAGBuild an LLM-extracted schemaless knowledge graph from the corpus and run Personalized PageRank seeded on the query's key concepts so multi-hop retrieval completes in a single pass.

Neighbourhood

Click any neighbour to follow the language. Scroll to zoom, drag to pan.