What a knowledge graph is
A knowledge graph stores data as entities and the relations between them: “a part belongs to an assembly”, “an employee is responsible for a process”, “a topic builds on another topic”. The meaning is recorded in the relations themselves. That is why a graph can handle questions that take several steps. For example: what happens to production if this particular machine goes down.
What vector search is
A vector database stores text fragments as numbers that reflect their meaning. A query is turned into the same kind of set of numbers, and the database returns the closest fragments. This kind of search copes with rephrasing: “how to book a holiday” will find the policy clause on “provision of annual paid leave”, even though not a single word matches.
What the difference is
- Vector search answers the question “what is similar to this”. A graph answers the question “what is connected to this, and through what”.
- A vector knows nothing about structure. Two fragments with the same words are close to it even if they come from different contracts.
- A graph does not forgive gaps: if an entity has not been extracted and a relation has not been laid down, the question stays unanswered.
- A vector index is cheap to fill: chunking the documents is enough. A graph needs an ontology, a decision made in advance on which types of entities and relations exist.
Which questions each approach answers
Vector search is stronger when
- knowledge lives in text: policies, instructions, correspondence, a support knowledge base;
- users ask in their own words, without the system’s terms;
- the corpus is large and mixed, and there is nobody to label it;
- you need a fast start and documents updated on the fly.
A knowledge graph is stronger when
- the answer requires a path: cause → effect, part → assembly → product, topic → prerequisite topic;
- complete traversal matters: list everything that depends on an object and miss nothing;
- you need constraints and rules: what is incompatible with what, which order is mandatory;
- the same entities appear in different documents and have to be merged into one.
How they are combined
In working systems you usually do not have to choose between them. The duties are split roughly like this:
- The vector index takes the user’s question in free form and finds an entry point: fragments and the entities they mention.
- From that point the graph builds out the context: related objects, dependencies, constraints, the current version.
- The model receives both the text fragments and the structured context and answers with references to the sources.
This pairing holds up noticeably better than pure semantic search where completeness matters. And it is noticeably cheaper to fill than an attempt to push absolutely everything into the graph.
Where a graph breaks
An ontology “for every occasion”
The wish to describe the whole domain leads to a schema that cannot be filled and that nobody understands. What works is a minimal ontology for specific questions, extended when new questions appear.
Extracting entities from text
A graph built automatically by a language model comes out as a draft: one entity arrives in three spellings, relations are duplicated, some of them are made up. You need normalisation, deduplication and spot checks by a person. This is real work, and it cannot be skipped.
Keeping it current
A graph that is not updated along with its sources is wrong more convincingly than search, because it looks structured and authoritative. The update rule is designed together with the graph.
How to choose in four questions
- Is the answer to a typical question a fragment of text, or does it come from following relations? The first calls for vector search, the second for a graph.
- Does an incomplete answer cost much? If missing one item from a list costs money, you need a graph.
- Who will maintain the structure? If nobody, the graph will not work. Start with vector search.
- How often do the documents change? The more often, the more cheap updates matter, which means vector search or a hybrid.
Our experience
A graph database sits at the core of StudyNinja, the learning platform our methods run on. Its knowledge graph holds topics, skills, solution methods and typical mistakes, and the relations between them say what builds on what. The platform’s tasks (finding a gap in knowledge and choosing the next step) are solved by traversing these relations. There is no vector layer in this system today.