Knowledge Graph: Definition and Examples
A Knowledge Graph is a data structure that organizes information as a network of relationships between entities, allowing AI systems to understand and reason about the links between different concepts.
Full definition
A Knowledge Graph is a structured representation of information that models relationships between real-world entities. Unlike a classic database organized in tables, a Knowledge Graph uses triplets (subject → relation → object) to capture the richness of connections between concepts. For example, "Paris → is the capital of → France" or "GPT-4 → is developed by → OpenAI."
This technology is at the heart of modern search engines like Google, which has used its own Knowledge Graph since 2012 to enrich search results with contextual information. When you see an information box to the right of a Google search (birth date of a celebrity, population of a city), it is the Knowledge Graph providing that structured data.
In artificial intelligence, Knowledge Graphs play a crucial role in anchoring language models to verifiable facts. They help reduce hallucinations by offering a structured source of truth that the AI can consult. This hybrid approach — combining the generative power of LLMs with the factual precision of knowledge graphs — is one of the most promising avenues for improving the reliability of AI systems.
In the context of prompt engineering, understanding Knowledge Graphs allows you to better structure your queries by making relationships between concepts explicit. An informed user can ask an LLM to reason in graph terms, identify implicit connections between ideas, or build a structured representation of a knowledge domain from raw text.
Etymology
The term "Knowledge Graph" was popularized by Google in May 2012 with the launch of its eponymous system, under the slogan "Things, not strings." However, the underlying concept existed since the 1970s in artificial intelligence research under the names "semantic networks" and "ontologies." The word "graph" refers to graph theory in mathematics, where information is represented as nodes (entities) connected by edges (relationships).
Concrete examples
Structured knowledge extraction from a text
From the following text, build a Knowledge Graph in triplet form (entity → relation → entity). Identify all named entities and their explicit and implicit relationships: [PASTE_TEXT]
Enriching a search through relational reasoning
Reasoning as a Knowledge Graph, what are the indirect links between artificial intelligence and personalized medicine? Identify the intermediate entities and the relationships that connect them.
Factual verification and hallucination reduction
Verify the following claims by breaking each one into subject-relation-object triplets, then assess whether each triplet is factual, plausible, or incorrect: [LIST_OF_CLAIMS]
Practical usage
In prompt engineering, Knowledge Graphs are useful for asking an LLM to structure complex information into explicit relationships between entities. You can use them to create knowledge bases from unstructured documents, or to guide the model's reasoning by asking it to trace connections between concepts. This approach is particularly effective for tasks of summarization, comparative analysis, and factual verification.
Related concepts
FAQ
What is the difference between a Knowledge Graph and a relational database?
How do Knowledge Graphs help reduce LLM hallucinations?
Can an LLM be asked to create a Knowledge Graph from a text?
See also
How to use this prompt
- Copy the prompt with the button above.
- Paste it into ChatGPT, Claude or your favorite AI assistant.
- Replace the bracketed variables with your details, then refine the result.
About Prompt Guide
Prompt Guide is a free library of 2500+ ready-to-use prompts for ChatGPT, Claude and other AIs, with guides to learn prompting and tools to build and optimize your own prompts.
More definitions
LangChain: Definition and Examples
LangChain is an open source framework designed to facilitate the development of applications powered by language models (LLMs), by allowing chains of
Large Language Model: Definition and Examples
A Large Language Model (LLM) is an artificial intelligence model trained on massive volumes of text, capable of understanding and generating language
Latent Space: Definition and Examples
Latent space is a compressed mathematical representation where an AI model encodes the essential features of data as numerical vectors, capturing semantic relationships between concepts.
Layer Normalization: Definition and Examples
Layer Normalization is a normalization technique that standardizes the activations of a neural network by computing the mean and variance over the
Leaderboard: Definition and Examples
A leaderboard is a comparative ranking that evaluates and orders AI models according to their performance on standardized benchmarks, allowing users to
Least To Most Prompting: Definition and Examples
Prompt engineering technique that consists of breaking down a complex problem into progressively more difficult sub-problems, solving each one in
Get new prompts every week
Join our newsletter.