Evolution from Vector Search to Graph-Based RAG for Enterprise Knowledge Systems
writer · Tech · 2024 · source Agentic: no · promotional bias: med · source-backed · extracted with prompt 0.5.6 (schema v2)
Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.
Problem
Domain: enterprise knowledge retrieval and graph RAG
Writer needed enterprise RAG that could retrieve accurate evidence from dense, specialized, massive corporate knowledge bases where simple keyword search and vector chunking confused similar facts and produced hallucinations.
Constraints:
- Enterprise data was dense, specialized, massive, and often used similar terminology across documents.
- Naive chunking and nearest-neighbor retrieval could confuse facts in adjacent chunks.
- Graph database conversion and scaling became costly and exceeded the team's operational expertise.
- Cypher and complex graph structures struggled with the similarity matching and text-style queries the team needed.
- Accuracy and low hallucination rates were especially important for regulated industries such as healthcare and finance.
Architecture
Writer evolved from keyword search to vector search and then to a graph-based RAG architecture. The team trained specialized models to map enterprise text into graph nodes and edges, stored graph structures as JSON in a Lucene-based search engine, applied context-aware splitting, and combined knowledge graphs with fusion-in-decoder ranking to improve evidence aggregation, response time, and hallucination rates.
Diagram confidence: reconstructed (reconstructed from prose).
flowchart LR enterprise-document-corpus["Enterprise document corpus"] --> context-aware-splitting["Context-aware splitting"] context-aware-splitting --> text-to-graph-model["Text-to-graph model"] text-to-graph-model --> lucene-json-graph-store["Lucene JSON graph store"] lucene-json-graph-store --> fusion-decoder-retriever["Fusion decoder retriever"] fusion-decoder-retriever --> answer-generator["Answer generator"] answer-generator --> benchmark-suite["Benchmark suite"]
Components
| Component | Role | Interacts with |
|---|---|---|
Enterprise document corpus |
Dense specialized enterprise knowledge that must be queried by end users. | Context-aware splitting |
Context-aware splitting |
Preserves context and semantic relationships before graph conversion. | Text-to-graph model |
Text-to-graph model |
Maps text into nodes and edges using a specialized fine-tuned model. | Lucene JSON graph store |
Lucene JSON graph store |
Stores graph structures as JSON in a search engine to avoid graph database scaling limits. | Fusion decoder retriever |
Fusion decoder retriever |
Uses knowledge graph relationships and two-stage passage ranking for evidence aggregation. | Answer generator |
Answer generator |
Generates answers from retrieved and ranked evidence. | Benchmark suite |
Benchmark suite |
Compares Writer's retrieval system against vector search baselines. | — |
Data flow
Enterprise documents are split with context awareness, converted into graph structures by a specialized model, stored as JSON in a Lucene-based search engine, retrieved with graph-aware search, passed through fusion-in-decoder style ranking and generation, and benchmarked against vector search systems for accuracy and response time.
Why this architecture
Writer chose graph-based retrieval because vector chunks lost relationships in concentrated enterprise data. When graph databases created scale and cost problems, storing graph JSON in a Lucene search engine matched the team's expertise while preserving relationships for downstream fusion-in-decoder evidence aggregation.
Models used: Writer-built text-to-graph model · Vector embeddings · Knowledge graph retrieval · Fusion-in-decoder · Lucene-based search engine · Robust QA benchmark
Scale
- Writer targeted enterprise corpora measured in terabytes.“enterprise data is really dense, specialized and massive. So we're often dealing with terabytes of data”transcript, stated
- The system was aimed at industries such as healthcare and finance where hallucination reduction mattered.“healthcare and finance where accuracy and low hallucinations are super important.”transcript, stated
- Writer benchmarked against seven vector search systems.“compared our retrieval system with knowledge graph and fusion decoder and everything uh with our with seven different vector search uh systems”transcript, stated
Alternatives considered (roads not taken)
Keyword search over a knowledge base.
Rejected because: It was adequate for basic keyword search but insufficient for advanced similarity search.
Vector embeddings with chunking and nearest-neighbor search.
Rejected because: Naive chunks could include conflicting facts and confuse retrieval in concentrated enterprise documents.
Operate a graph database directly.
Rejected because: Graph conversion, cost, scaling, Cypher matching, and team expertise became bottlenecks.
Patterns
rag-retrieval (graph RAG)
Writer used graph relationships rather than plain vector chunks to retrieve more accurate enterprise evidence.
retrieval-ranking (fusion decoder)
Writer combined knowledge graphs with fusion-in-decoder and two-stage ranking to aggregate evidence more effectively.
fine-tuning-adaptation (graph conversion)
The team fine-tuned a specialized model to convert text into graph nodes and edges.
Tradeoffs
Use a search engine to store graph data.
Chose Graph structures as JSON in Lucene over Scaling a graph database directly.
Rationale: The search-engine route preserved graph relationships while avoiding graph database performance, cost, and expertise bottlenecks.
Build a specialized text-to-graph model.
Chose A team-owned fine-tuned conversion model over Waiting for general small models or manually engineering graph conversion.
Rationale: At the time, the team did not have suitable off-the-shelf fast small models and had model-building expertise.
Follow customer problems rather than hype.
Chose Problem-led graph RAG design over Implementing fashionable retrieval techniques without customer fit.
Rationale: The team attributes progress to solving customer retrieval failures rather than chasing a specific solution label.
Gotchas (what bit them)
Chunking can corrupt fact retrieval.
Root cause: Nearest-neighbor search may retrieve a chunk containing multiple nearby facts and select the wrong one.
Resolution: Preserve relationships with graph structures instead of relying only on naive chunks.
Graph databases introduced operational friction.
Root cause: Graph conversion, cost, database scaling, Cypher matching, and expertise limits collided with production needs.
Resolution: Store graph JSON in a Lucene-based search engine and keep the implementation aligned with team expertise.
Enterprise corpora are too semantically concentrated for simple similarity.
Root cause: Documents in the same enterprise domain often share vocabulary and entities, making nearest matches ambiguous.
Resolution: Use graph relationships and full-text/similarity combinations to add structure around the retrieved evidence.
Evaluation
Writer benchmarked the graph-plus-fusion-decoder retrieval system against seven vector-search systems using Amazon's robust QA dataset, checking accuracy, response time, and hallucination rate.
Metrics: Accuracy · Fastest response time · Hallucination rate · Performance at scale · Evidence aggregation quality
Outcomes
- Graph-based retrieval preserved relationships and improved accuracy.
- Lucene JSON storage handled large graph data without speed degradation at scale.
- Knowledge graph plus fusion-in-decoder lowered hallucination rates.
- Benchmarks showed best accuracy and fastest response time against seven vector systems.
The system targets terabytes of dense enterprise data, benchmarked against seven vector search systems, with explicit attention to regulated enterprise domains.