Definition
A knowledge graph is a directed graph database where nodes represent entities (people, organizations, products, concepts) and edges represent typed relationships between them (e.g., "WORKS_AT", "REGULATED_BY", "DEPENDS_ON"). Unlike flat document stores or vector databases, knowledge graphs make relationships explicit and queryable, enabling agents to answer multi-hop questions by traversing relationship chains rather than retrieving isolated text fragments.
Engineering Context
Knowledge graphs complement vector databases: where vector search excels at fuzzy semantic matching, knowledge graphs excel at precise relational queries ("What regulations apply to this contract type in this jurisdiction?"). Tools like Neo4j, Amazon Neptune, or RDFlib manage knowledge graphs. GraphRAG combines knowledge graph traversal with vector search for comprehensive retrieval. In production, knowledge graphs require an ingestion pipeline that extracts entities and relationships from source documents using NER models or LLM-based extraction, then maintains the graph as source documents are updated. Cypher (Neo4j) and SPARQL (RDF) are the primary query languages.
Related Terms
Building production AI agents?
We design and implement deterministic AI agent systems for enterprise teams.
Start Assessment