Add graphrag-neo4j module: structured-output entity and relation extraction into a typed Neo4j graph with a vector index, multi-hop retrieval by span linking and variable-length Cypher paths, compared with plain vector RAG over the same 35 chunks and 9 questions (complete evidence 7/9 vs 5/9 at k=8); Testcontainers on neo4j:2026.10.1 and 5.26. The extraction step is a rule-based stand-in, not a language model.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CifR2BE7PBvRy5hT8TS9oz
This commit is contained in:
2026-10-26 02:03:40 +00:00
co-authored by Claude Sonnet 5.5
parent 279be7eb9f
commit 108fc44542
66 changed files with 1997 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
# How the graph retriever's own settings move the result (complete evidence out of 9)
--- hops walked x paths kept (link threshold 0.80) ---
max hops | 6 paths 10 paths 20 paths 40 paths
1 | 3/9 ( 3.0 ch) 3/9 ( 3.4 ch) 3/9 ( 3.4 ch) 3/9 ( 3.4 ch)
2 | 4/9 ( 3.9 ch) 4/9 ( 5.1 ch) 7/9 ( 7.8 ch) 7/9 ( 8.4 ch)
3 | 7/9 ( 4.9 ch) 8/9 ( 6.8 ch) 9/9 (10.3 ch) 9/9 (13.6 ch)
--- entity-link threshold (3 hops, 6 paths) ---
threshold | complete seeds per question (avg)
0.70 | 7/9 3.9
0.80 | 7/9 1.9
0.85 | 8/9 1.2
0.90 | 8/9 1.0
0.95 | 8/9 1.0
--- the seeds found for three questions at 0.80 (span -> entity, cosine) ---
Q2 Who leads the team that owns the Payments Gateway?
'Payments Gateway' -> Payments Gateway (1.00)
'Payments' -> Payments Team (0.88)
'team' -> Fulfilment Team (0.83)
Q5 Where is the company that hosts the database behind the Ledger Service located?
'Ledger Service' -> Ledger Service (1.00)
'database' -> Orders Database (0.82)
Q7 Which services stop working if the Orders Database goes down?
'Orders Database' -> Orders Database (1.00)
--- candidate paths from one seed as the hop limit grows ---
Payments Gateway 1 hop : 5 2 hops: 14 3 hops: 32 4 hops: 54
Orders Database 1 hop : 4 2 hops: 12 3 hops: 24 4 hops: 46
Checkout Service 1 hop : 3 2 hops: 12 3 hops: 27 4 hops: 49