---
title: "Retrieval · Agent Wranglers"
url: https://agentwranglers.se/playbook/ai-features/retrieval
updated: 2026-10-20
licence: "All rights reserved"
---

# Retrieval

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

> Answer from your own documents. Split them by structure, search by meaning and by words, cite every source, keep the index fresh and respect who may read what.

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers ai features playbook: https://agentwranglers.se/playbook/ai-features/retrieval`.

## Required

- [Record the embedding model with every vector](https://agentwranglers.se/playbook/ai-features/retrieval/embedding-model-version): Store the embedding model name and version with every vector. Never compare vectors from two different embedding models.
- [Measure retrieval on its own](https://agentwranglers.se/playbook/ai-features/retrieval/retrieval-evals): Test the search step apart from the answer step, with labelled questions and the documents that should be found. Fail the build when recall falls under a stored target.
- [Cite a source for every answer](https://agentwranglers.se/playbook/ai-features/retrieval/cite-sources): Make the model return the IDs of the chunks it used, and check each ID was in the retrieved set. Show the sources as links next to the answer.
- [Keep the index as fresh as its sources](https://agentwranglers.se/playbook/ai-features/retrieval/index-freshness): Update or remove a document's chunks within a set time after the source changes, such as 15 minutes. Show the source date with every answer.
- [Copy access rights into the index and check them again](https://agentwranglers.se/playbook/ai-features/retrieval/retrieval-permissions): Store each document's access rights with its chunks, filter every search by them, and re-check the source's rights before a chunk reaches the model.

## Recommended

- [Split documents along their structure](https://agentwranglers.se/playbook/ai-features/retrieval/structured-chunks): Split documents into chunks along headings and paragraphs, of 200 to 800 tokens each. Store each chunk with its document ID, title, heading path and address.
- [Search by meaning and by words](https://agentwranglers.se/playbook/ai-features/retrieval/hybrid-search): Combine a keyword search and a vector search, and merge the two result lists, for example with reciprocal rank fusion.
- [Say so when nothing relevant was found](https://agentwranglers.se/playbook/ai-features/retrieval/no-match-answer): When search finds nothing above a set relevance threshold, reply that the documents do not cover the question. Do not let the model answer from its general knowledge.

- Previous: [Structured output and tools](https://agentwranglers.se/playbook/ai-features/structured-output-and-tools)
- Next: [Evals and quality](https://agentwranglers.se/playbook/ai-features/evals-and-quality)
- [All chapters](https://agentwranglers.se/playbook/ai-features)
