Memory

Knowledge Graph Memory

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

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.

Solution

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).

When to use

  • The agent must answer relational queries (path, neighbour, type) over remembered entities.
  • Observations cleanly yield entities and relations worth persisting symbolically.
  • Hybrid retrieval (vector entry + graph traversal) is feasible and useful.

Open the full interactive page

Diagram, neighbourhood map, code examples, related patterns and full provenance.

Related