A Knowledge Graph (KG) is a structured system used to represent knowledge as a network of interconnected entities (objects, people, concepts) and relationships between them. Mathematically, a KG is a graph where nodes represent the entities and edges represent the relationships (or predicates) linking them.
KGs store factual information in the form of triplets: (Subject, Predicate, Object), making the data highly explicit, structured, and machine-readable. They serve as a critical foundation for search engines and intelligent systems that require accurate, verifiable, and logical Knowledge Representation (KR).
Context: Relation to Search, LLMs, and Generative Engine Optimization (GEO)
KGs are the technology that evolved search from simple keyword matching to understanding factual relationships, and they are essential for the accuracy of modern generative AI.
1. Search and GEO
KGs are a core component of how search engines like Google provide accurate and instant factual answers:
- Factual Answers: When a user searches for “capital of France,” the KG allows the search engine to look up the triplet (France, has_capital, Paris) and display “Paris” directly, bypassing the need to read and summarize entire documents.
- Structured Data and Schema Markup: For Generative Engine Optimization (GEO), a key tactic involves using structured data (Schema Markup) on a website. This structured data is essentially a small, machine-readable Knowledge Graph snippet about the webpage’s content, allowing search engines to ingest the information directly into their own internal Knowledge Graphs, improving visibility and rich result potential.
- Disambiguation: KGs help resolve ambiguity. If a user types “Mercury,” the KG knows there are entities for (1) the planet, (2) the element, and (3) the Roman god, and can use context to present the correct result.
2. Augmenting Large Language Models (LLMs)
While Large Language Models (LLMs) store knowledge implicitly in their Vector Embeddings, this implicit knowledge is prone to hallucinations (making up facts).
- Retrieval-Augmented Generation (RAG): KGs are often used in RAG systems. When an LLM receives a complex, factual query, the system first retrieves structured facts from a Knowledge Graph and then feeds those facts to the LLM, prompting it to generate an answer that is grounded in verifiable data. This dramatically improves the factual accuracy and traceability of the generated output.
The Structure of a Knowledge Graph
A Knowledge Graph is a collection of facts structured by triplets:
| Component | Role | Example |
| Subject (Entity 1) | The object being described. | Eiffel Tower |
| Predicate (Relationship) | The link or relationship type. | located_in |
| Object (Entity 2) | The object related to the subject. | Paris |
This structure allows for inference and reasoning. For example, if a system knows (Eiffel Tower, located_in, Paris) and (Paris, located_in, France), it can infer that the Eiffel Tower is also located in France.
Related Terms
- Knowledge Representation (KR): The broader field of formalizing knowledge for computer systems.
- Entity: A key term for the nodes (subjects and objects) within a Knowledge Graph.
- Retrieval-Augmented Generation (RAG): The modern technique that uses KGs and other factual data to ground LLM outputs.