
What is a Knowledge Graph?
A knowledge graph is a structured representation of real-world entities and the relationships between them, stored as a network of nodes (entities) and edges (relationships). It organizes information in a way that machines can reason over — connecting people, places, concepts, products, and events into a queryable web of knowledge.
Why It Matters
Knowledge graphs power Google's Knowledge Panel (those info boxes in search results), Amazon's product recommendations, and enterprise search systems. In AI, they provide structured context that complements LLMs — enabling more accurate, factual, and explainable responses. Combining knowledge graphs with LLMs (GraphRAG) is an active research frontier for reducing hallucinations.
How It Works
Structure:
- Nodes (entities) — people, organizations, concepts, products, locations
- Edges (relationships) — "works_at", "located_in", "is_a", "related_to"
- Properties — attributes attached to nodes and edges (dates, descriptions, scores)
- Stored as triples: (subject, predicate, object) → (Albert Einstein, born_in, Ulm)
Building a knowledge graph:
- Entity extraction — identify entities in text (NER — named entity recognition)
- Relation extraction — identify relationships between entities
- Entity resolution — merge duplicate entities ("NYC" = "New York City")
- Schema design — define entity types and valid relationships
- Population — fill the graph from structured data, text, or APIs
Knowledge graphs + LLMs:
- GraphRAG — use graph structure to retrieve more relevant context for LLM responses
- Grounding — validate LLM outputs against graph facts
- LLM-powered graph construction — use LLMs to extract entities and relations from text
- Structured reasoning — traverse graph relationships for multi-hop questions
Technologies:
- Neo4j — popular graph database
- RDF / SPARQL — W3C standards for linked data
- Wikidata — open collaborative knowledge graph
- Google Knowledge Graph — powers Google Search features
Example
Google's Knowledge Graph connects billions of entities. When you search "Leonardo da Vinci," the Knowledge Panel shows his birth date, artworks, profession, and related people — all structured relationships in the graph. The graph knows that the Mona Lisa "was_painted_by" Leonardo da Vinci, "is_displayed_at" the Louvre, and "was_created_in" the early 16th century.