---
title: "Testing retrieval quality before blaming the model: one problem at a time"
url: https://memory.wiki/G2P2KutM
updated: 2026-12-04T21:54:25.157Z
source: "memory.wiki"
---
# Testing retrieval quality before blaming the model: one problem at a time

## Why "Testing retrieval quality before blaming the model" matters for local RAG

Check whether the right passage was retrieved first; many bad answers start with bad retrieval.  Retrieval-augmented generation is usually the first serious project a team builds on a local model, because it keeps documents in-house and avoids fine-tuning. It is also where small design choices decide whether people trust the answers.

## Ingestion comes first

Bad input produces confident wrong answers. Before thinking about embeddings:

- Extract structure: headings, tables and lists should survive conversion from PDF or Office files.
- Attach metadata to every chunk: source file, section, version and document date.
- Reject documents that have no owner or no date; stale policies are a liability.
- Keep the original files so you can re-ingest when your splitter improves.

## Chunking and retrieval

Start with moderate chunk sizes and some overlap, then evaluate on your own questions instead of copying settings from a blog. Chinese text needs a splitter that respects sentences rather than English whitespace rules. Pure vector search misses exact identifiers such as part numbers, contract IDs or SKUs, so keep a keyword index alongside the vector store and merge the results. When policies change over time, bias retrieval toward the newest valid version.

## Evaluation you can repeat

Build a set of real questions with known answers and the documents that should support them. After each change to chunking, embedding model or prompt, run the set and look at both the answer and the retrieved passages. If the right passage was not retrieved, no prompt will fix it.

## Operations

- Back up the vector store and test a restore.
- Separate collections per department or client so access rules are easy to enforce.
- Log which sources were cited for each answer.
- Decide what the assistant must refuse to answer, and publish that list.

## A worked example

A small manufacturer wanted engineers to ask questions about internal specifications. The first version used only vector search and often returned the wrong revision of a document. The team added document dates and revision numbers as metadata, filtered out superseded revisions before ranking, and kept a keyword index for part numbers. They also rewrote their chunking so that tables were stored as separate records. After these changes, they re-ran the same evaluation questions and checked whether the correct source appeared in the retrieved passages. Only when retrieval was reliable did they spend time adjusting the answer prompt.

For related guides, see [MicroAI One software](https://microaione.com/microai-one/); you may also find [local AI tutorials](https://microaione.com/tutorials/) useful.

## Bottom line

Local AI rewards patience and record keeping more than raw spending. Decide what the system must do, measure it on your own hardware and documents, write down every change with a date and an owner, and review the setup after each significant upgrade. Small, documented steps are easier to debug, easier to hand over and easier to defend when someone asks why a particular choice was made. When in doubt, test on a smaller scale first and expand only when the evidence supports it.

## Quick reminders

- Use one models directory shared by every runtime.
- Test a restore, not just a backup.
- Measure on your own prompts before quoting any speed.
- Keep a printed fallback for offline demos.

*Published by [MicroAI One (本地AI 1号网)](https://microaione.com/), a Shenzhen team working on local LLM hardware, software and deployment.*

---

## Summary
To ensure accurate responses in local retrieval augmented generation, teams must prioritize the quality of data ingestion and retrieval before attempting to optimize the model. Reliable performance depends on systematic evaluation of retrieved passages using a set of known questions and answers.

## Themes
- Local RAG optimization
- Retrieval evaluation strategies
- Data ingestion best practices
- Systematic debugging workflows

## Key takeaways
- Always verify retrieval accuracy before attempting to optimize the generative model prompt.
- Ingestion pipelines must preserve document structure like tables and lists to prevent poor retrieval.
- Metadata such as source, section, and date are essential for filtering out stale or unauthorized information.
- Evaluation requires a repeatable set of questions with known ground truth answers to measure the impact of system changes.
- Access control and security are best managed by separating documents into distinct collections per department or client.

## Insights
- Retrieval quality is the primary failure point in RAG systems, often misattributed to the LLM prompt.
- Hybrid search combining vector and keyword indexing is necessary to handle specific identifiers like part numbers or SKUs.
- Metadata management is as critical as embedding quality for ensuring the system retrieves the most recent version of a document.

## Open questions / gaps
- What specific metrics or thresholds define reliable retrieval before moving to prompt engineering?
- How should the system handle conflicting information when multiple versions of a document exist despite metadata filtering?

