Standard RAG often fails when dealing with long, technical documents. Information gets lost in "generic" chunks. RAG-DiReCT solves this by maintaining hierarchical relationships between data points.
The Challenge: "Information Dilution"#
When you chunk a 50-page manual into 500-token pieces, you lose the overarching context. The engine needs to know that a specific technical spec belongs to a specific product model mentioned 10 pages earlier.
Hierarchical Architecture#
Our approach uses a multi-layered retrieval strategy: Parent chunks for context, Child chunks for precise detail.
The Technical Stack#
Vector Storage
Supabase with pgvector for high-concurrency similarity search.
Embedding Models
Custom fine-tuned BGE embeddings for domain-specific terminology.
Re-ranking
Cohere Rerank layer to filter top 100 results down to top 5.
Orchestration
LangChain optimized for low-latency asynchronous retrieval.
Measured Impact#
In head-to-head evals against naive RAG, RAG-DiReCT demonstrated a 40% improvement in "Faithfulness" and a 30% reduction in "Hallucination" rates on complex technical queries.
Explore the source code
Dive into the implementation details of hierarchical chunking and semantic routing.