RedLectern topic

Knowledge graphs for AI

Represent entities and relationships · graph retrieval · GraphRAG · provenance.

For: Builders · researchers

After this page you can: Judge whether graph structure improves a retrieval problem.

Page reviewed

Part of: Artificial Intelligence › Retrieval-augmented generation

About Knowledge graphs for AI

A knowledge graph represents entities and their relationships as connected structure. In RDF, a graph is a set of subject-predicate-object triples: the subject and object identify resources, and the predicate names their relationship. This makes links explicit enough to query and inspect.

In retrieval-augmented generation, graph structure can be built from source text and used alongside text passages or summaries. GraphRAG documentation describes local search for questions about specific entities, global search for questions about a corpus as a whole, and basic vector search as a comparison option. Those distinctions suggest a practical test: choose questions whose answers depend on connected evidence, compare graph retrieval with a suitable text-search baseline, and inspect the retrieved sources. Extraction can add cost and noise, so the graph’s usefulness depends on the retrieval problem. Preserve links from extracted entities and claims back to source passages: lineage helps people review where information came from, but does not by itself establish that the information is true.

Start here

route

Start with GraphRAG’s overview

See how indexing builds graph structure and how local, global, and basic search handle different query types.

Start with: Welcome to GraphRAG

Learn the foundations

1.Represent entities and relationshipsA graph makes entities and their connections explicit.

A graph makes entities and their connections explicit. In RDF, each statement is a subject, predicate, and object; a set of those triples forms a graph. The predicate expresses the relationship between the subject and object, while the object can be another resource or a value such as a literal. This is one formal graph model, not a requirement that every AI knowledge graph use RDF.

When modeling a retrieval problem, decide what counts as an entity, which relationships matter to the questions, and how each extracted statement points back to its source. GraphRAG’s dataflow documentation describes text units as chunks used for graph extraction and says extracted knowledge items reference them for provenance. A graph with unclear entity identity or unsupported relationships can make retrieval harder to inspect rather than easier.

Knowledge graph

A structured representation of entities and their relationships.

GraphRAG

A family of RAG approaches using graphs to organize or retrieve information.

Try it

Write one triple for a source you know: name a subject, a relationship, and an object. Then name the source passage that supports the relationship.

Example: “The RDF 1.1 document — defines — RDF graphs.” The subject is the document, the predicate is “defines,” and the object is RDF graphs; the W3C document is the source to check.

2.Match retrieval to the questionGraph retrieval is worth evaluating when a question depends on connections among entities or evidence spread across a collection.

Graph retrieval is worth evaluating when a question depends on connections among entities or evidence spread across a collection. GraphRAG documentation describes local search as combining graph data with raw-document text chunks for questions about specific entities. It describes global search as searching community reports for questions about the dataset as a whole, and includes basic vector RAG as a comparison option. The Microsoft Research paper presents GraphRAG as an approach to global sensemaking questions over a text corpus.

Use a question set that reflects the actual task, then compare graph retrieval with the baseline using the same questions and answer conditions. Check whether the retrieved passages support the answer, especially for multi-hop questions. A graph index adds extraction and organization steps; Microsoft’s documentation notes a cost and noisiness tradeoff between its indexing methods. Treat results as evidence for this corpus and task, not as a universal ranking.

Try it

For a question asking for a specific fact about one entity and a question asking for the main themes across a document collection, choose local graph search, global graph search, or basic vector search as a first comparison. Explain each choice.

For the entity-specific question, start by comparing local graph search with basic vector search. For themes across the collection, compare global search with basic vector search. These are starting comparisons: assess retrieved evidence and answer support on the actual questions.

3.Keep the evidence trailProvenance records information about how data or another result was produced.

Provenance records information about how data or another result was produced. The W3C PROV model organizes provenance around entities, activities, and agents, with relations for use, generation, derivation, and attribution. Those links can describe which source material an extraction activity used, what statement it generated, and who or what was responsible for the activity.

For retrieval, retain the source document and passage associated with an extracted entity, relationship, or claim. That allows a reviewer to inspect the evidence and the transformation path. A provenance record documents lineage; it does not certify that a source or extracted claim is true. Check the original passage and its context before relying on a retrieved statement.

  • PROV Model Primer

    Introduces provenance concepts and how provenance assertions can be represented.

Try it

An extracted relationship says that one report cites another. Name three provenance links you would record so a reviewer can trace and inspect that statement.

Record the source passage as an entity, the extraction step as an activity that used that source, and the extracted relationship as an entity generated by that activity. Attribute the activity to the responsible agent or system.

Latest

No recent updates are available.

See the sources list

Books

Glossary

2 terms on this page.

Browse the AI glossary

Questions and comments