What Is a Knowledge Graph?
A knowledge graph is a structured representation of information in which real-world entities — people, places, organizations, concepts, products — are modeled as nodes, and the relationships between them are modeled as edges. This graph structure allows systems to traverse connections and reason across multiple hops, something a flat document store cannot do natively.
The term was popularized by Google in 2012 when it launched its Knowledge Graph to power richer search results. Since then, knowledge graphs have become a foundational component in enterprise AI, search engines, recommendation systems, and increasingly in LLM-based agent architectures.
Core Components
- Nodes (Entities): Discrete things in the world — a company, a person, a product, a concept.
- Edges (Relationships): Named connections between entities — "works at", "is a subsidiary of", "located in".
- Properties: Attributes attached to nodes or edges — a person's birth year, a company's founding date.
- Ontology: The schema defining what types of entities and relationships are valid in the graph.
How Knowledge Graphs Enable Reasoning
A flat vector store can answer "what documents are similar to this query?" A knowledge graph can answer questions like:
- Which companies are competitors of Company X that also sell in Europe?
- What products were launched by engineers who previously worked at Company Y?
- Which regulatory changes affect suppliers in Tier 2 of this supply chain?
These multi-hop queries require traversing multiple edges, which is the native operation of a graph database.
Knowledge Graphs in AI Systems
In modern AI pipelines, knowledge graphs are used in several ways:
- GraphRAG: Retrieving context for LLMs by walking the graph rather than doing a flat vector similarity search.
- Fact verification: Checking whether a generated claim conflicts with known edges in the graph.
- Agent memory: Storing long-term structured knowledge about users, domains, or the world that agents can query.
- Entity linking: Resolving mentions in text to canonical nodes in the graph.
Practical Example
A customer support AI might maintain a knowledge graph where:
- Product nodes connect to known issue nodes via "has reported bug" edges.
- Issue nodes connect to resolution nodes via "resolved by" edges.
- Customer nodes connect to product nodes via "purchased" edges.
When a customer asks about a problem, the agent traverses the graph to find whether the issue is known, what the fix is, and whether that customer's specific product version is affected — all in a single structured query.
Knowledge Graphs vs. Vector Databases
| Feature | Knowledge Graph | Vector Database |
|---|---|---|
| Structure | Explicit relationships | Implicit similarity |
| Query type | Graph traversal | Nearest neighbor |
| Reasoning | Multi-hop | Single-hop |
| Setup cost | High | Low |
Both are often combined: a vector search narrows candidates, and the graph provides relational context.