Knowledge Graph
/ˈnɒlɪdʒ ɡrɑːf/
Also known as: graph database, GraphRAG, context graph, code graph
What is a Knowledge Graph?
A knowledge graph stores information as nodes (entities such as a program, a customer, a regulation or a job) and edges (the relationships between them, such as "calls", "includes", "owns" or "is governed by"). Instead of asking which text chunks look similar to a question, you can ask which things are connected to which, across several hops, and get an exact answer with the provenance of each step.
For AI agents, the graph is a source of context. Neo4j's Stephen Chin argues in an AI Engineer talk that vector search gives similarity, relational databases give single-hop facts, and only a graph gives the multi-hop, accurate context a model needs when the advertised million-token window delivers 200K or less of usable context.
Key Characteristics
- Relationships are first-class - The connection between two facts is stored and queryable, not inferred at read time.
- Multi-hop answers - "Which batch jobs are affected if this copybook's record precision changes?" is one query, not a chain of searches.
- Evidence on every edge - In Blitzy's code graph, each relationship records the repository, revision, symbols touched and source span it was extracted from.
- Kept current - The graph is updated on every merge, and stale facts are invalidated rather than left to confuse the model.
- GraphRAG - Retrieval-augmented generation that queries a graph, alone or alongside vector search, to assemble context.
Why Knowledge Graphs Matter for AI Agents
The failure mode they prevent is an agent that writes correct code in the wrong place. Blitzy's Neeraj Deshmukh describes asking an AI to convert a COBOL interest formula to Java: it converts the formula and misses the record precision, account updates, transaction output and batch contract that depend on it. With the estate as a graph, each agent receives a task context packet with its slice of the system, constraints and evidence, which is what let Blitzy migrate a bank's trade posting engine with full parity in 18 days and map a 35-million-line mainframe in four. The same layer then supports compliance checks, business rule tracking and new features, because the knowledge outlives the migration.
Related Terms
- Context Engineering - Deciding what context an agent gets; graphs are one source
- Grounding - Anchoring outputs in retrievable facts
- Cloud Agents - The agents that consume graph-derived context at scale