Knowledge Graph
Definition
A structured representation of entities and their relationships, stored as a graph of nodes (entities) and edges (relationships). In agent systems, knowledge graphs complement vector databases by providing structured, queryable relationships that pure semantic search cannot capture. While a vector DB answers 'what documents are similar to this query?', a knowledge graph answers 'what entities are connected to this entity, and how?' Knowledge graphs are especially valuable for agent systems that need to reason about complex domains with many interrelated entities.
Builder Context
Knowledge graphs are high-effort, high-reward. Only invest in one if your agent needs to answer relationship queries ('which tools in category X integrate with service Y?') or navigate complex entity hierarchies. For most agent use cases, a well-chunked vector store with metadata filtering is sufficient. If you do build a knowledge graph: use it alongside your vector store, not instead of it — use the vector store for semantic retrieval and the graph for relationship traversal. Tools like Neo4j and AWS Neptune are the established options; for simpler needs, a PostgreSQL recursive CTE often suffices.