Building a private knowledge base using Obsidian, local Retrieval-Augmented Generation (RAG) plugins (like Smart Connections or Copilot), and open-weight models (via Ollama or LM Studio) provides unmatched data privacy and sovereignty. However, local AI setups introduce a critical operational challenge: silent hallucinations and source attribution drift.
When querying local Markdown notes or technical PDFs, an unoptimized local LLM may confidently cite non-existent source passages, hallucinate facts by blending adjacent notes, or omit critical contextual constraints.
To maintain a reliable knowledge management system, you must implement a systematic audit framework to evaluate retrieval precision, chunking quality, and output groundedness.
The Anatomy of a Local RAG Failure
[ Local Vault (.md / .pdf) ] ──► [ Vector Database / Indexer ] ──► [ Local LLM Inference ]
│ │ │
▼ ▼ ▼
Chunking Misconfigurations Vector Drift & Context Window Overcrowding
(Broken Headers / Overlap) Embedding Mismatch (Confabulation & Hallucination)
1. Primary Causes of Local AI Hallucinations
-
Sub-Optimal Chunk Size and Chunk Overlap: If text chunks are too small (e.g., 128 tokens), the embedding model loses cross-paragraph context. If chunks are too large (e.g., 2048 tokens), the vector retriever injects unnecessary noise into the LLM context window.
-
Embedding Model Misalignment: Using low-dimensional embedding models (such as legacy
all-MiniLM-L6-v2) causes semantic overlap, where distinct technical concepts map to identical coordinates in the vector space. -
Context Overcrowding & Lost in the Middle: Local open-weight models (like 8B parameter variants) often suffer from attention degradation when processing long context windows, ignoring retrieved chunks positioned in the middle of the prompt.
-
Unconstrained Decoding Hyperparameters: Setting high
temperature(e.g., > 0.7) ortop_pvalues forces the model to select low-probability tokens, triggering creative confabulation rather than strict factual extraction.
2. Step-by-Step Local Vault Audit Framework
3. RAG Audit Metric Reference Matrix
Use this matrix to identify symptoms, diagnostic causes, and technical fixes during your audit:
| Audit Metric | Failure Symptom | Underlying Root Cause | Technical Remediation |
| Faithfulness / Groundedness | The LLM adds facts not found in your notes. | High inference temperature or unconstrained system prompt. | Set temperature = 0.0–0.2 and enforce strict negative constraints (“Do not assume”). |
| Context Recall | The LLM states “Information not found,” but the note exists in your vault. | Poor tokenization, low Top-K value, or inadequate chunk overlap. | Switch to nomic-embed-text, increase Top-K from 3 to 5, and adjust semantic chunking. |
| Context Precision | The retrieved context contains irrelevant notes that confuse the LLM. | Chunk size is too large or query embedding fails to capture intent. | Reduce chunk size (e.g., 512 tokens) and implement Hybrid Search (BM25 + Dense Vectors). |
| Citation Drift | The LLM provides correct info but points to the wrong .md file. |
Overcrowded context window blending adjacent document vectors. | Enable metadata filtering and inject explicit document title tags into chunk headers. |
4. Advanced Optimization: Hybrid Search and Re-Ranking
-
Dense Retrieval (Vector Embeddings): Captures conceptual meaning and semantic intent.
-
Sparse Retrieval (BM25 / Keyword Search): Captures exact match technical terms, product codes, proper nouns, and unique IDs.
-
Cross-Encoder Re-Ranking: A secondary lightweight local model (such as
bge-reranker-large) evaluates the retrieved candidates from both searches, re-scoring and filtering the top 3 most relevant chunks before passing them to the main LLM.



