Knowledge graph

A knowledge graph is a network of facts that represents real-world entities, such as people, places and products, as nodes and the relationships between them as labelled links, often with rules that let software reason over them.

A knowledge graph stores facts as connections. Marie Curie is a node; Warsaw is a node; a link labelled "born in" joins them. Add millions of such facts and the result is a structure a computer can query and follow: which scientists were born in Warsaw, which of them won Nobel prizes, who their collaborators were. Many knowledge graphs also include an ontology, a schema that defines the types of entities and relationships, which lets software infer facts that were never stated directly.

The term is older than its fame. E. W. Schneider, a research scientist at the Human Resources Research Organization, used it in a paper on computer-based teaching presented in 1972, and researchers at the universities of Groningen and Twente worked on related ideas in the late 1980s. Large open graphs followed, with DBpedia and Freebase both founded in 2007. The phrase became widely known on May 16, 2012, when Google introduced its Knowledge Graph under the slogan "things, not strings". Google said it held more than 500 million objects and more than 3.5 billion facts about them, drawn from sources including Freebase, Wikipedia and the CIA World Factbook. Its example was Taj Mahal, which might mean the monument, a musician, a casino or a local restaurant; the graph lets search tell them apart.

Well-known examples today include Wikidata, YAGO and DBpedia, as well as the graphs that companies build for search, products and internal data. Researchers survey them under headings such as data models, query languages, quality assessment, refinement and enrichment, which reflects how much ongoing work they need.

Knowledge graphs and large language models complement each other. A language model holds knowledge implicitly in its parameters and can state things that are false; a knowledge graph holds explicit facts that can be checked and corrected one by one. Language models in turn make it easier to build graphs from ordinary text. In April 2024 Microsoft researchers led by Darren Edge described GraphRAG, which uses a language model to extract an entity graph from documents and then uses summaries of related entities to answer broad questions about the collection.

A knowledge graph is only as reliable as the facts put into it, and keeping one accurate and current takes sustained effort. Its strength is that every fact is visible and can be traced, which makes errors easier to find than in a model's parameters.

Common questions

What is a knowledge graph in simple terms?

It is a database of facts stored as connections between things. Each entity, such as a person, place or company, is a node, and each relationship, such as works for or located in, is a labelled link. Software can follow the links to answer questions.

What is Google's Knowledge Graph?

It is the database of entities and facts that Google introduced on May 16, 2012 to help search understand real-world things rather than just match keywords. At launch Google said it covered more than 500 million objects and 3.5 billion facts, drawn from sources including Freebase and Wikipedia.

What is the difference between a knowledge graph and a graph database?

A knowledge graph is the content: facts about entities and their relationships, often with an ontology defining what they mean. A graph database is software for storing and querying graph-shaped data. Knowledge graphs are often stored in graph databases.

How are knowledge graphs used with large language models?

They can supply checked facts for a model to draw on, as in retrieval-augmented generation, and language models can help build them by extracting entities and relationships from text. GraphRAG, described by Microsoft researchers in 2024, combines both directions.

Finding more

Search for "knowledge graph", "Wikidata", "ontology" or "GraphRAG". The 2020 survey <em>Knowledge Graphs</em> by Aidan Hogan and colleagues is a thorough introduction, and project sites such as Wikidata's show how large open graphs are built and maintained. Be wary of product claims that a knowledge graph removes hallucinations: it can supply better facts, but the language model still has to use them correctly.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.