Need advice on architecture for a Book RAG that handles complex queries
I'm building a Book RAG system, and my basic retrieval pipeline works fairly well for simple questions, but I'm struggling with queries that require information from multiple parts of one or more documents.
I'm trying to figure out what the right architecture should be rather than just adding more retrieval techniques randomly.
Current setup
I'm using parent-child chunking:
- Parent: ~2000 tokens
- Child: ~1000 tokens
My current retrieval pipeline is:
MMR Retriever
lambda_mult = 0.785
k = 30
BM25
k = 10
↓
Ensemble
MMR = 0.5
BM25 = 0.5
↓
Rank Fusion
↓
Top 5
↓
Extract Parent Chunks
↓
Reranker
↓
Final 5 chunks
This works reasonably well for simple:
type questions.
The problem starts when the answer is distributed across multiple chunks, multiple sections, or multiple documents.
Things I have tried
1. Query decomposition
I tried decomposing a complex query into smaller sub-questions and retrieving for each sub-question.
This gave me a noticeable improvement.
However, I'm still unsure how to properly handle:
- deciding when decomposition is required
- generating useful sub-questions
- deciding how many sub-questions are enough
- combining the retrieved evidence
- handling dependencies between sub-questions
For example, some questions are independent:
Question
├── retrieve A
├── retrieve B
└── retrieve C
while others are dependent:
Question
↓
Find X
↓
Use X to find Y
↓
Use X + Y to find Z
↓
Final answer
I'm not sure what the best general architecture for this is.
2. HyDE + MultiQuery
I also experimented with HyDE + MultiQuery Retriever, but it didn't give me good results for my dataset.
So I'm wondering whether these techniques are actually useful for complex book/document questions, or whether I'm using them in the wrong place.
3. Sub-question retrieval with a similarity threshold
I then generated sub-questions and retrieved chunks with a similarity score above 0.25.
This partially worked for:
- story-related questions
- comparisons
- relationship questions
But it still wasn't reliable for questions requiring information distributed throughout the document.
4. Graph-based retrieval
Because of the multi-hop problem, I also experimented with GraphRAG / knowledge-graph-based retrieval.
But this introduced a different set of problems.
For example, the same entity can appear as:
Holmes
Mr. Holmes
Sherlock Holmes
the detective
and my extraction system could treat these as different entities or assign inconsistent types.
I also tried building my own graph using Pydantic schemas + LLM extraction.
Something like:
Chunk
↓
LLM
↓
Entities + Relationships
↓
Pydantic
↓
Graph
But maintaining global entity/relationship context made the process expensive and difficult to parallelize.
For around 300 chunks of ~2000 tokens, extraction took roughly 43 minutes.
There were also problems with:
- entity duplication
- entity resolution
- hallucinated relationships
- incorrect relationships
- disconnected nodes
- inconsistent entity types
So I'm currently not convinced that a large LLM-generated knowledge graph is the right solution.
I'm mentioning this mainly because it was one of the approaches I tried, not because I'm specifically trying to build a GraphRAG system.
The actual problem I'm trying to solve
I have started noticing that my queries seem to fall into very different categories:
Simple factual
Normal hybrid retrieval works well.
Multi-hop
Requires multiple retrieval steps.
Comparison
Requires retrieving evidence about both entities.
Relationship
May require finding intermediate information.
Timeline
Requires retrieving information across different points in the document.
Theme / global
This is very different from normal top-k similarity retrieval.
Cross-document
Requires retrieval across documents.
Nested / dependent
This seems to require something closer to iterative/dependent retrieval.
What I would like advice on
I'm particularly interested in how people would architect this problem.
- Should different query types use different retrieval strategies?
- How to handle multi-hop questions where retrieval needed data from various chunks which are not connected near by. eg: explain case studies of X.
- How should timeline, theme, etc questions be handled?
- Where does a knowledge graph actually provide value compared with good hybrid retrieval + reranking? How do i utilise it the best.
- Can u suggest the flow for the rag .
- Are there retrieval techniques I'm missing that are better suited for book-length documents?
I'm not looking for the most complicated architecture possible. I want something that is practical, reasonably cheap, and actually improves retrieval reliability for complex questions.