Standard chunk-based RAG retrieves locally, which works for isolated fact lookups but breaks down across long books, contracts, and multi-chapter technical manuals where individual chunks lose document-wide context.
In my MiA-RAG implementation (github.com/ahadkhan9/MiA-RAG), I reproduced the architecture from Mindscape-Aware Retrieval-Augmented Generation (arXiv:2512.17220) entirely on local hardware—achieving a +25% retrieval accuracy gain over standard RAG on NarrativeQA at zero API cost.
Architecture Overview
Loading diagram...
Key Engineering Decisions
1. Hierarchical Mindscape Construction
Instead of indexing flat chunks in isolation, the ingestion stage generates per-chunk summaries and recursively aggregates them into a global semantic scaffold (mindscape). That scaffold conditions both query embeddings and final answer synthesis so cross-chapter entities and themes stay anchored.
2. Local Execution with INT4 LoRA & Ollama ($0 API Cost)
To make long-context evaluation reproducible without cloud inference bills:
- Embeddings: Served INT4-quantized, LoRA-adapted
MiA-Emb-8B for mindscape-conditioned representation.
- Generation: Served
Qwen2.5-14B-Instruct locally via Ollama, keeping prompt + retrieval experiments deterministic and free.
3. Three-Channel Hybrid Retrieval (ChromaDB + BM25 + RRF)
Relying solely on dense mindscape vectors still misses rare proper nouns and exact lexical cues. Combining:
- Dense chunk similarity (
ChromaDB)
- Mindscape-conditioned retrieval
- Lexical
BM25
via Reciprocal Rank Fusion (RRF) followed by an LLM reranking pass lifted NarrativeQA retrieval accuracy by +25% over the vanilla RAG baseline.
4. Interactive Evaluation Harness
The repository ships a Streamlit workbench with document ingestion, intermediate mindscape inspection, and an LLM-as-a-judge evaluation view to compare baseline RAG against MiA-RAG side by side on the same queries.
See the full project breakdown on the MiA-RAG case study page.