Skip to main content
ahad.works

MiA-RAG: Mindscape-Aware Retrieval-Augmented Generation

Local reproduction of Mindscape-Aware RAG (arXiv:2512.17220) improving retrieval accuracy by +25% over standard RAG on NarrativeQA using INT4-quantized LoRA-adapted MiA-Emb-8B, Qwen2.5-14B-Instruct via Ollama, 3-channel ChromaDB + BM25 + RRF search, and a Streamlit LLM-as-a-judge evaluation UI.

PythonOllamaLoRA/PEFTINT4 QuantizationChromaDBBM25Streamlit

Overview

MiA-RAG is a local reproduction of Mindscape-Aware Retrieval-Augmented Generation (arXiv:2512.17220) engineered to overcome flat chunk retrieval failures on long-context narrative and technical corpora. Instead of embedding chunks in isolation, the pipeline builds a hierarchical global summary (mindscape) and conditions both query embeddings and generation on that global scaffold.

Architecture & Implementation

  1. Hierarchical Mindscape Construction: Documents are segmented into chunks, summarized at the chunk level, and recursively aggregated into a document-wide semantic scaffold.
  2. INT4 LoRA Embeddings + Local Inference: Runs INT4-quantized, LoRA-adapted MiA-Emb-8B alongside Qwen2.5-14B-Instruct locally via Ollama, enabling reproducible long-context evaluation at zero external API cost.
  3. 3-Channel Hybrid Retrieval + Reranking: Fuses dense chunk similarity (ChromaDB), mindscape-conditioned embeddings, and lexical BM25 scores via Reciprocal Rank Fusion (RRF), followed by an LLM reranking pass.
  4. LLM-as-a-Judge Evaluation UI: Includes a Streamlit interface for interactive document ingestion, retrieval inspection, and side-by-side LLM-as-a-judge benchmarking against baseline RAG.

Evaluation Results

Metric / SetupOutcome
Benchmark DatasetNarrativeQA
Retrieval Accuracy vs. Standard RAG+25% improvement
Embedding BackboneMiA-Emb-8B (INT4-quantized, LoRA/PEFT)
Generator ModelQwen2.5-14B-Instruct via Ollama
Inference Cost$0 (100% local execution)