Graph-based memory is a memory layer that represents facts as nodes in a graph and relations as typed edges. Entities become nodes. Relationships become edges. Queries become graph traversals.
A simple example: a workspace has entities (people, projects, companies) and relations (works-on, owns, depends-on). A graph-based memory layer stores both. A question like "what projects does person X work on?" is a one-hop traversal from the person node to the project nodes.
How it differs from other memory layers
| | Semantic memory | Graph-based memory | |---|---|---| | Indexes | Vectors over text chunks | Nodes and typed edges | | Best query | "What is similar to this?" | "What is connected to this?" | | Strength | Fuzzy retrieval | Precise traversal | | Weakness | No relations | No fuzzy matching | | When to use | Find relevant chunks | Find related entities |
The two layers are complements, not competitors. A useful memory stack has both: semantic memory for finding chunks, graph memory for traversing relations.
Why graph memory is useful
The work an agent does is mostly relational. "What entities own this property?" "Which sessions referenced this concept?" "What decisions depend on this fact?" Each question is a traversal through a graph.
Without a graph layer, the agent answers these questions by running semantic retrieval and hoping the relevant chunks contain the relations. That works for shallow questions. It fails for questions that require following three or four hops.
Failure modes
- Stale edges. The graph contains edges that no longer reflect the workspace's reality. The agent follows the edge and gets a wrong answer. The fix is at the curation layer — review the graph periodically, mark stale edges.
- Schema drift. The graph's edge types evolve over time without a migration plan. Old edges have types that no longer exist. The fix is at the schema layer — version the schema, migrate edges when the schema changes.
- Premature graphing. Reaching for a graph layer to answer questions that semantic retrieval would handle. The graph adds cost without buying clarity.
See also
- Agent Memory — the basic memory entry.
- Memory: Short-Term, Long-Term, and Semantic — the three-layer memory model.
- Wiki Memory — the fourth layer that keeps memory coherent past year one.
- From Loops to Graphs: Agent Engineering — the graph-driven workflow pattern.