A knowledge graph is a structured representation of knowledge in the form of a network of entities and the relationships between them. The basic unit is the subject-predicate-object triple, for example “Marie Curie – was awarded – the Nobel Prize in Physics”; from many such triples arises a graph whose nodes are entities and whose edges are named relations. The meaning of the edges and the permitted entity types are delimited by an ontology, thanks to which inference can be performed over the graph – transitivity or inheritance yield facts that were never explicitly written in the data. Technologically this covers the RDF and OWL standards, the SPARQL query language and graph databases. In search, this technology gave rise to the shift from strings to things introduced by the Google Knowledge Graph, and in content it appears as structured data following schema.org. In combination with language models it plays a dual role: the graph supplies verifiable, current and auditable facts, which curbs hallucinations, while models in turn can build the graph efficiently by extracting triples from text. Combining a graph query with semantic search is known as GraphRAG and excels at questions requiring information joined from several documents.
A vector database is like a hazy recollection of everything you have ever read. A knowledge graph, by contrast, is a family tree pinned to the wall: clear boxes with names and clear lines between them labelled “is the mother of”, “owns”, “is based in”. You do not have to guess. You can run your finger along a line and get the answer to a question nobody ever wrote down in a single sentence – “who is that child’s great-aunt” – because you derive it from the lines. And that is exactly where language models, good mainly at speaking fluently, fall short on their own.