Guide · Agentic RAG

Knowledge graph vs vector database: explicit relationships against measured similarity.

A knowledge graph stores facts as named links between things. A vector database stores text as points in space and finds the nearest ones.

Both are pitched as the memory behind enterprise AI, and they answer very different questions. This guide shows how each one stores information, how a query runs in each, which questions favour which, what Microsoft’s GraphRAG changed, what each costs to build and keep current — and how teams combine them.

Updated · 7 sources

entities and relationships

Knowledge graph

Things are nodes; facts are typed edges between them — Acme supplies Northwind, Northwind is based in Rotterdam.

  • Explicit, named relationships
  • Answers by following links
  • Exact and explainable paths
  • Needs a schema and extraction
embeddings and distance

Vector database

Each passage becomes a list of numbers from an embedding model; a question finds the passages whose numbers sit closest.

  • Implicit similarity of meaning
  • Answers by nearest-neighbour search
  • Fuzzy and tolerant of wording
  • Loads raw text with little modelling
Triples or a property graphStoresVectors with the passage and its metadata
Pattern match and traversalQueryApproximate nearest-neighbour search
Multi-hop, counting, “how is X related to Y”Good atFinding text that means the same as the question
Free-text nuance it never extractedWeak atRelationships, aggregates and exact identifiers
The path of edges it followedExplains its answerA similarity score

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

A knowledge graph stores entities and the named relationships between them, and answers by following those links — good for multi-hop questions and explainable paths. A vector database stores embeddings of text and answers by finding the nearest ones — good for finding passages that mean what the question means. In knowledge graph vs vector database, the graph holds structure and the vectors hold meaning, and many RAG systems now use both.

Data model

How a knowledge graph and a vector database store the same fact.

Take one sentence from a supplier contract and store it both ways. The graph keeps who did what to whom; the vector keeps what the sentence is about.

As a knowledge graph (RDF-style triples)
# “Northwind Logistics supplies Arden Packaging
#  under contract C-114, governed by Dutch law.”

:NorthwindLogistics  :supplies     :ArdenPackaging .
:C114                :party        :NorthwindLogistics .
:C114                :party        :ArdenPackaging .
:C114                :governingLaw :Netherlands .
:NorthwindLogistics  :type         :Supplier .
As a vector database record
{
  "id": "C-114#p3",
  "text": "Northwind Logistics supplies Arden
           Packaging under contract C-114,
           governed by Dutch law.",
  "vector": [0.021, -0.113, 0.087, …],
  "metadata": { "doc": "C-114", "page": 3 }
}
  • TripleThe W3C’s RDF standard defines a statement as subject, predicate and object; a graph is a set of such triples, with each thing named by an IRI.
  • Property graphThe other common model: nodes and edges that both carry key-value properties, queried with languages such as Cypher or GQL — the graph query language ISO published as a standard in April 2024 (ISO/IEC 39075).
  • EmbeddingA vector from an embedding model; texts with similar meaning land near each other.
  • ANN indexAn approximate nearest-neighbour index such as HNSW, which searches layered proximity graphs and scales logarithmically with the number of vectors.
Question types

Knowledge graph vs vector database: which questions each answers best.

Sort your real questions on two axes — how precise the relationship is, and whether the answer sits in one place or across the whole corpus — and the right store usually becomes obvious.

Precise relationships
Multi-hop lookups“Which of our suppliers share a parent company with a supplier we terminated?” Follow edges.Knowledge graph
Network questions“How many contracts are governed by Dutch law, by supplier region?” Traverse and count.Graph query
Fuzzy wording
Find the passage“What does the travel policy say about upgrading flights?” Nearest passages by meaning.Vector database
Themes and summaries“What are the main complaints across ten thousand support tickets?” Neither alone; this is what GraphRAG targets.GraphRAG
Answer in a few placesAnswer across the whole corpus
Graphs built by a model

GraphRAG: building a knowledge graph from documents with an LLM.

A hand-built knowledge graph needs an ontology and people to keep it true. Microsoft Research’s GraphRAG (2024) has a language model extract the graph from the documents instead, then pre-writes summaries of each cluster so that questions about the whole corpus become answerable.

  1. Split

    Source documents are cut into text chunks.

    index
  2. Extract

    An LLM reads each chunk and lists entities and the relationships between them.

    index
  3. Build the graph

    Entities become nodes, relationships edges, merged across chunks.

    index
  4. Find communities

    Closely linked groups of entities are detected.

    index
  5. Summarise communities

    The LLM writes a summary for every group, ahead of any question.

    index
  6. Answer globally

    Each summary gives a partial answer; the partial answers are summarised into the final one.

    query

What it fixed, and what it costs. On datasets in the million-token range, the paper reports more comprehensive and more diverse answers than conventional RAG to “global” questions such as the main themes in a dataset. The price is indexing: every chunk passes through an LLM, and a changed document means re-extracting its entities.

Effort

What each approach costs to build and keep current.

The most expensive part of a knowledge graph is not the database — it is deciding what the entities and relationships are, and keeping them true as documents change.

Load text and goModel the domain first
12345
  1. Vector indexChunk, embed, index. Hours to a first answer.
  2. Hybrid search with labelsExact-word and meaning search over the same passages, filtered by region, product or document type.
  3. Structured recordsFields extracted into typed tables for counting and joins.
  4. LLM-built graphGraphRAG-style extraction; costly indexing, little hand modelling.
  5. Curated knowledge graphAn ontology, entity resolution and stewards keeping it true.
Combined

Knowledge graph vs vector database in one system: hybrid retrieval.

A 2024 study on financial earnings-call transcripts found that combining graph retrieval with vector retrieval beat either one alone. The usual shape: vectors find the way in, the graph supplies the connections.

A hybrid graph-and-vector retrieval path
01
Question“What risks did suppliers linked to the Rotterdam port strike flag?”
user
02
Vector searchFinds passages about the strike and the entities they mention.
entry points
03
Graph expansionFollows supplier and location edges out from those entities, one or two hops.
traversal
04
Second retrievalFetches risk passages from the documents of the suppliers it reached.
filtered search
05
AnswerFacts from the graph and wording from the passages, each cited.
grounded
Choose by the questions you must answer
  • Mostly “what does it say about…”A vector index, with exact-word search beside it.
  • Many “how is X connected to Y”A knowledge graph, or graph expansion on top of vectors.
  • Counts, sums and filtersStructured records in a database — neither a graph nor vectors estimate totals well.
  • Themes across a large corpusPre-computed summaries, GraphRAG-style.
  • Auditors need the pathA graph shows the edges followed; vectors only show a score.
  • Content changes dailyFavour stores that update one document at a time.
On Botminds

How Botminds agents combine meaning, labels and records.

A Botminds agent does not have to pick one store. It carries many ways to search and chooses per step: by meaning over passages, by exact words, narrowed by labels, or counted in typed records.

Search by meaning and by exact words

Under the same filters, chosen per search — or both for one question. A question is always embedded with the model its library was indexed with.

Labels on every passage

Stamp a service, a region or a product on every passage, so a search can be narrowed to any mix of them.

Counts in the database

Agents count and sum in records with typed filters instead of estimating totals from passages.

Find the documents

List which documents carry a term or a reference, then read their pages or summaries.

Read agentic RAG for every way an agent searches, and AI data modeling for how records and their fields are designed.

Questions people ask

Knowledge graph vs vector database: common questions.

The technology behind itAgentic RAGEvery way to search, at any scale
Knowledge graph vs vector database: which is better for RAG?

In knowledge graph vs vector database for RAG, a vector database is the faster start and the better fit for “what does it say about…” questions. A knowledge graph wins on multi-hop and relationship questions and explains its path. Research on hybrid retrieval finds combining them beats either alone.

What is GraphRAG?

GraphRAG is Microsoft Research’s 2024 method in which a language model extracts an entity graph from documents and pre-writes summaries of closely linked groups of entities. Questions about the whole corpus are answered from those summaries, which plain vector RAG handles poorly.

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

A graph database is the storage engine. A knowledge graph is the content: entities, relationships and usually a schema or ontology describing them. A knowledge graph can live in a graph database, a triple store or even relational tables.

Can a vector database store relationships?

Only loosely. Metadata on each vector — a document id, a supplier name — lets you filter, but there are no typed edges to traverse. Multi-hop questions need a graph, joins in a database, or an agent that runs several searches in turn.

Do knowledge graphs reduce hallucinations?

They can narrow them: facts come from explicit edges, and the path can be shown. But an LLM-extracted graph can contain extraction errors, and the model can still misread what it is given. Citations and evaluations are still needed.

What is HNSW in a vector database?

Hierarchical Navigable Small World, an approximate nearest-neighbour index. It builds layered proximity graphs over the vectors and searches from the top layer down, which scales logarithmically with the collection — the reason vector search stays fast on large corpora.

When should I use a knowledge graph instead of a vector database?

When your questions are about connections — ownership chains, dependencies, who reports to whom — when answers must show their path, or when entities need to be resolved across many sources. For finding relevant text, start with vectors.

Does Botminds use a knowledge graph or a vector database?

Botminds agents search knowledge by meaning and by exact words, narrow by labels stamped on every passage, and count in typed records — choosing the method per step. See agentic RAG.

See it on
your own work.

Bring one process and its documents. We’ll show you the agents, the controls and the record, running on your data.