GraphRAG can help when an answer requires following relationships between information spread across multiple sources. That does not mean every company search system needs a graph database. First compare the same set of questions with a simpler solution, and include the work needed to extract, verify and maintain relationships.
We will illustrate the decision using a local test that was actually run on seven synthetic Czech passages. It compares simple text search, relationship expansion and a non-graph control using record joins. It does not measure production Microsoft GraphRAG, Neo4j, embeddings or answer generation. Its value lies in a transparent mechanism and visible failures, not a transferable accuracy percentage.
Distinguish passage retrieval from questions spanning relationships
“When is the service’s maintenance window?” may be answered by a single paragraph. “Which storage system does a project depend on through the service it uses?” may require two documents: the project uses a service, and that service depends on a storage system. If the first document does not name the storage system, similar wording alone may not ensure complete evidence.
A graph explicitly stores this relationship as an edge between nodes. A node may represent a project, service or document; an edge represents a particular connection, such as “uses.” Traversing edges can then locate another source. But it still matters whether entities are correctly distinguished, the relationship is genuinely supported and it applies at the time of the question. A wrong edge merely makes a wrong connection available faster.
The GraphRAG name also covers multiple approaches. Microsoft’s documentation distinguishes, among other things, local search combining a graph with text passages from global search over generated community reports. The documentation describes the global variant as computationally intensive. It is not the same as every two-hop relationship traversal.
The Neo4j GraphRAG library also offers different retrievers and separates retrieval from the model generating the answer. Neo4j’s presence in the architecture does not prove that a query uses relationship expansion. The documentation for this article was checked on November 18, 2026; we did not deploy these products here.
Prepare a simple non-graph baseline
A baseline is a starting point for comparison, not a deliberately broken opponent. For a custom system, text search with filters, or hybrid search, may be a reasonable foundation. Azure AI Search describes a hybrid query as simultaneous full-text and vector search combined using RRF. You do not automatically need graph expansion for that.
In our small fixture, the baseline uses an even simpler rule: the number of words shared by the question and passage after lowercasing and removing a specified set of common words. Matches are ranked in descending order, with document ID breaking ties. At most two passages are returned. This is not BM25, lemmatization or semantic embeddings. The weakness of this baseline limits the conclusion: the test does not show a graph beating a well-tuned hybrid solution.
Both main approaches received the same four questions, the same seven passages and the same budget of two returned items. The graph branch additionally received manually prepared relationships and the question’s seed entity. This advantage is not free: the test does not automatically handle entity extraction or edge accuracy. Keeping the passage count equal is useful, but does not mean equal preparation costs.
On a narrow screen, scroll the table horizontally; with a keyboard, focus the region and use the arrow keys.
| ID | Passage |
|---|---|
| G1 | Project Javor uses the Lumen service. |
| G2 | Lumen depends on the Kamen storage system. |
| G3 | Project Bor uses the Delta service. |
| G4 | Delta depends on the Oblak storage system. |
| G5 | Lumen has a maintenance window on Tuesday. |
| G6 | Project Javor uses the Delta service through October. |
| G7 | The Kamen storage system supports CSV export. |
The graph approach takes at most two directed hops from the specified entity. It first takes source passages from effective edges, fills remaining slots using text search and limits the result to two items. This is not a learned router. Expansion runs even for simple questions, allowing us to see unnecessary material being added too.
Retain the source and time validity of every edge
The edge “Javor uses Lumen” must contain more than two names. For this test, we record the relationship ID, source passage and locator, relationship type, start and optional end of validity, permitted roles and annotation provenance. E1 points to G1 and is effective from November 1, 2026. The older E5 points to G6 and expires precisely at the start of that day. E2 connects Lumen to Kamen, E3 connects Bor to Delta and E4 connects Delta to Oblak; these three edges are effective in the fixture from January 1, with no recorded end.
As of November 18, the path is therefore Javor → Lumen → Kamen, while the Javor → Delta branch is no longer effective. The filter must apply to every edge traversed, not just the last document. The same applies to access: permission to read the first passage does not unlock the next node. In this fixture, all edges are accessible to both illustrative roles; different graph ACLs are therefore not tested.

For real extraction, retain the model or parser, its version and the edge’s review status. Distinguish “the source explicitly states” from “the system inferred.” Do not merge two companies with the same name based only on a text label. To remove a relationship, you need to trace its origin and dependent derived outputs. Without that connection, a cheap initial import comes at the cost of expensive repairs.
Our graph is an author-created synthetic structure, not the output of an LLM extractor or a human-approved company record. We therefore have no measured extraction accuracy. The comparison below deliberately separates the effect of ready-made relationships from the work required to obtain them.
Compare errors, latency and operations
Before the run, a required evidence set was recorded for each question. Success means that all required sources appear among the at most two returned passages. We do not evaluate the final verbal answer. Relationship questions require two sources; a simple factual question requires one.
On a narrow screen, scroll the table horizontally; with a keyboard, focus the region and use the arrow keys.
| Question | Required sources | Text baseline | Relationship expansion | Non-graph join |
|---|---|---|---|---|
| R1: Which storage system does Javor depend on through its service? | G1, G2 | G1, G2 ✓ | G1, G2 ✓ | G1, G2 ✓ |
| R2: Which storage system does Bor depend on through its service? | G3, G4 | G2, G3 — incomplete | G3, G4 ✓ | G3, G4 ✓ |
| N1: When is Lumen’s maintenance window? | G5 | G5, G1 ✓ | G2, G5 ✓ | G5, G1 ✓ |
| N2: Which export does Kamen support? | G7 | G7, G2 ✓ | G7, G2 ✓ | G7, G2 ✓ |
For relationship questions, the complete set was found in one of two cases by the text baseline and in two of two by expansion. For non-relationship questions, both methods found the single required source in both cases. In R1, the baseline succeeded partly because of the tie-breaking rule. Renaming the documents could change their order. This small example is not a statistical estimate of quality.
The non-graph control uses the same relationship table, but performs two successive record joins instead of a general traversal. It also obtained every required set in the test. This approach can be expressed in a relational database too. The test therefore supports the usefulness of explicitly managed relationships for a particular question, not the necessity of a graph database. The advantage may change with more complex paths, larger volumes or different operational requirements; that is not measured here.
We separately tested graph faults on R1. After removing E2, the result remained complete because text search supplied the missing source. When E2 incorrectly pointed to G4, expansion filled the budget with G1 and G4, leaving incomplete evidence. Without the time filter, G1 and the old G6 occupied the first two slots; the required G2 was lost. A graph can therefore displace correct context that is otherwise available.
In the recorded run, we repeated each of the four questions 200 times for each approach, giving 800 measurements per approach. The median local retrieval time alone was 35.53 microseconds for text search, 39.65 microseconds for expansion and 15.37 microseconds for record joins. These times exclude index preparation, networking and generation. They are not assistant-response latency and do not justify a server purchase. The measured repetitions share the same small process and are not an independent sample of users.
In the operating budget, record document conversion, entity and edge extraction, human review of disputed relationships, updates, storage, queries and the answering model separately. Add the time required to correct a mistaken identity and delete expired relationships. We give no monetary price here: no paid GraphRAG system was run for the benchmark, and team costs are unknown.
Runnable synthetic Python example
Copy the entire code into a file named ukazka.py and run python3 ukazka.py. Python 3.10 or later is sufficient; the code does not read company data or make network calls. The values are illustrative. The output retains deliberately introduced defects too; timings depend on the machine.
Long code lines can be scrolled horizontally. Use Tab to focus the region and the arrow keys to scroll; copy the entire code without changing its indentation.
"""Syntetická ukázka; Python 3.10+, bez balíčků a sítě. Nejde o LLM benchmark."""
import json,copy,re,time,statistics
DATA = {'graph_documents': [{'id': 'G1',
'text': 'Projekt Javor používá službu Lumen.',
'entities': ['Javor', 'Lumen']},
{'id': 'G2',
'text': 'Lumen závisí na úložišti Kamen.',
'entities': ['Lumen', 'Kamen']},
{'id': 'G3',
'text': 'Projekt Bor používá službu Delta.',
'entities': ['Bor', 'Delta']},
{'id': 'G4',
'text': 'Delta závisí na úložišti Oblak.',
'entities': ['Delta', 'Oblak']},
{'id': 'G5',
'text': 'Lumen má servisní okno v úterý.',
'entities': ['Lumen']},
{'id': 'G6',
'text': 'Projekt Javor používá službu Delta do října.',
'entities': ['Javor', 'Delta']},
{'id': 'G7',
'text': 'Úložiště Kamen podporuje export CSV.',
'entities': ['Kamen']}],
'edges': [{'id': 'E1',
'from': 'Javor',
'to': 'Lumen',
'relation': 'používá',
'source': 'G1',
'locator': 'věta1',
'from_date': '2026-11-01',
'to_date': None,
'roles': ['podpora', 'vedouci'],
'extracted_by': 'explicitní autorská syntetická hrana; ne výstup extrakčního modelu',
'review': 'autorská modelová anotace; nikoli člověk'},
{'id': 'E2',
'from': 'Lumen',
'to': 'Kamen',
'relation': 'závisí',
'source': 'G2',
'locator': 'věta1',
'from_date': '2026-01-01',
'to_date': None,
'roles': ['podpora', 'vedouci'],
'extracted_by': 'explicitní autorská syntetická hrana; ne výstup extrakčního modelu',
'review': 'autorská modelová anotace; nikoli člověk'},
{'id': 'E3',
'from': 'Bor',
'to': 'Delta',
'relation': 'používá',
'source': 'G3',
'locator': 'věta1',
'from_date': '2026-01-01',
'to_date': None,
'roles': ['podpora', 'vedouci'],
'extracted_by': 'explicitní autorská syntetická hrana; ne výstup extrakčního modelu',
'review': 'autorská modelová anotace; nikoli člověk'},
{'id': 'E4',
'from': 'Delta',
'to': 'Oblak',
'relation': 'závisí',
'source': 'G4',
'locator': 'věta1',
'from_date': '2026-01-01',
'to_date': None,
'roles': ['podpora', 'vedouci'],
'extracted_by': 'explicitní autorská syntetická hrana; ne výstup extrakčního modelu',
'review': 'autorská modelová anotace; nikoli člověk'},
{'id': 'E5',
'from': 'Javor',
'to': 'Delta',
'relation': 'používá',
'source': 'G6',
'locator': 'věta1',
'from_date': '2026-01-01',
'to_date': '2026-11-01',
'roles': ['podpora', 'vedouci'],
'extracted_by': 'explicitní autorská syntetická hrana; ne výstup extrakčního modelu',
'review': 'autorská modelová anotace; nikoli člověk'}],
'graph_questions': [{'id': 'R1',
'kind': 'relation',
'question': 'Na kterém úložišti závisí Javor přes svou službu?',
'seed': 'Javor',
'date': '2026-11-18',
'required': ['G1', 'G2']},
{'id': 'R2',
'kind': 'relation',
'question': 'Na kterém úložišti závisí Bor přes svou službu?',
'seed': 'Bor',
'date': '2026-11-18',
'required': ['G3', 'G4']},
{'id': 'N1',
'kind': 'passage',
'question': 'Kdy má Lumen servisní okno?',
'seed': 'Lumen',
'date': '2026-11-18',
'required': ['G5']},
{'id': 'N2',
'kind': 'passage',
'question': 'Jaký export podporuje Kamen?',
'seed': 'Kamen',
'date': '2026-11-18',
'required': ['G7']}]}
def load(): return copy.deepcopy(DATA)
STOP = {'jaký', 'přes', 'má', 'kdy', 'kterém', 'na', 'svou'}
def tokens(s):return set(re.findall(r'\w+',s.lower()))-STOP
def active(e,q):return e['from_date']<=q['date'] and (not e['to_date'] or q['date']<e['to_date']) and 'podpora' in e['roles']
def lexical(q,docs):
scores=[(len(tokens(q['question'])&tokens(d['text'])),d['id']) for d in docs]
return [i for score,i in sorted(scores,key=lambda x:(-x[0],x[1])) if score>0][:2]
def expansion(q,docs,edges):
frontier={q['seed']};seen=set(frontier);ids=[];visited=[]
for _ in range(2):
nxt=set()
for e in edges:
if active(e,q) and e['from'] in frontier:
visited.append(e['id'])
if e['source'] not in ids:ids.append(e['source'])
if e['to'] not in seen:nxt.add(e['to']);seen.add(e['to'])
frontier=nxt
return (ids+ [i for i in lexical(q,docs) if i not in ids])[:2],visited
def join_control(q,docs,edges):
# Relational adjacency joins need no graph database. Same authored relationships.
if q['kind']!='relation':return lexical(q,docs)
for e in edges:
if active(e,q) and e['from']==q['seed']:
for f in edges:
if active(f,q) and e['to']==f['from']:return [e['source'],f['source']]
return []
def graph_eval():
f=load();docs=f['graph_documents'];edges=f['edges'];rows=[];times={x:[] for x in ['lexical','expansion','join']}
for q in f['graph_questions']:
selected={};visited=[]
for mode,fn in [('lexical',lambda:lexical(q,docs)),('expansion',lambda:expansion(q,docs,edges)[0]),('join',lambda:join_control(q,docs,edges))]:
for _ in range(200):
start=time.perf_counter_ns();ids=fn();times[mode].append(time.perf_counter_ns()-start)
selected[mode]={'ids':ids,'complete_evidence':set(q['required'])<=set(ids),'recall':len(set(q['required'])&set(ids))/len(q['required']),'precision':len(set(q['required'])&set(ids))/len(ids) if ids else 0}
_,visited=expansion(q,docs,edges)
rows.append({'id':q['id'],'kind':q['kind'],'question':q['question'],'required':q['required'],'selected':selected,'edges_visited':visited})
ablations=[]
for name,es in [('missing_E2',[e for e in edges if e['id']!='E2']),('wrong_source_E2',[dict(e,source='G4') if e['id']=='E2' else e for e in edges]),('stale_without_time_filter',[dict(e,to_date=None) for e in edges])]:
q=f['graph_questions'][0];ids,visited=expansion(q,docs,es);ablations.append({'variant':name,'ids':ids,'complete_evidence':set(q['required'])<=set(ids),'edges':visited})
return {'rows':rows,'timing_ns':{k:{'n':len(v),'median':statistics.median(v),'p95':sorted(v)[int(len(v)*.95)-1]} for k,v in times.items()},'ablations':ablations,'budget':2,'hops':2,'llm_calls':0,'embedding_calls':0,'graph_database':False,'edge_count':len(edges)}
print(json.dumps(graph_eval(),ensure_ascii=False,indent=2))
Decide by task, not database brand
If most questions ask for a clear passage and a simpler solution handles them on your sample, a graph is not automatically the next level of maturity. First fix missing metadata, Czech abbreviations, filters and context selection. Vectors in SEO explains representation basics; RRF separately discusses merging rankings. Neither method by itself verifies source validity.
Pilot a graph branch when you have documented recurring relationship questions for which the baseline loses important evidence. Define permitted edge types, maximum depth, context budget and an owner for updates. Check whether a controlled SQL query or tabular join would work just as well. Graph and relational models may offer different operational advantages; a picture of nodes alone cannot decide between them.
For further comparison, you need real questions, independently verified references, extraction review, repeated runs and the full time from query to usable answer. Retain failures too. Human domain annotation, learned embeddings, answer generation, concurrent load and production-scale data are missing here. Applying the conclusions beyond seven synthetic passages therefore remains an open question, not a proven result.
Breaking a question into subqueries, or query fan-out, may be another non-graph option, but it also needs its own test. Adding a graph, a new model and query decomposition at the same time, then attributing the entire difference to the graph, would not be a fair comparison.
Want to check whether relationships can improve your search?
I can help you select pilot questions, define a baseline and agree on the evidence needed to decide on further investment. Tell me which connections people currently have to piece together manually from multiple sources. We will choose technology to suit the task and operations, not a promised GraphRAG advantage.









