# RAG retrieval cheat sheet: chunking, search, re ranking and tests

URL: https://aixl.academy/blog/rag-retrieval-cheat-sheet/
Published: 2026-11-23
Updated: 2026-11-23
Author: AIXL Academy
Topics: rag, retrieval, ai engineering, search

Most wrong answers from RAG systems start with retrieval, not the model. RAG retrieval decides which text reaches the model. If the right text never arrives, no prompt will fix it. This cheat sheet covers the retrieval half.

## 1. Decide if you need RAG at all

RAG suits large collections of text where the answer is written somewhere. It is the wrong tool when:

- The data is a table. Query it with a tool.
- The answer lives in one system. Call its API.
- The content is small and stable. Put it in the prompt.
- The question needs calculation. Use code.

## 2. Chunk by structure

- Split on headings first. A section is usually one idea.
- Keep tables whole. If a table must be split, repeat the header row.
- Keep a list with the sentence that introduces it.
- Fall back to size based splitting only inside very long sections.

## 3. Put metadata on every chunk

- Document title and section path, so a chunk knows where it came from.
- Document version and date, so old versions can be removed.
- Owner, so someone is responsible for keeping it current.
- Access list, so retrieval can filter by permissions.

## 4. Search two ways

- Vector search is good at meaning.
- Keyword search is good at exact terms: codes, ids, names, numbers.
- Run both and merge the results, for example with reciprocal rank fusion.
- Test on your own data. The gain is usually largest for queries with exact terms.

## 5. Re rank, then send few

- Re rank the merged top results with a re ranking model.
- Send only the best handful of chunks to the generating model.
- More context is not better. Irrelevant chunks make answers worse and calls slower.

## 6. Filter by permissions at search time

- The user's identity travels with each request.
- Filter on the access list before ranking.
- Never rely on the prompt to hide restricted content.
- Test with a user who has very low access.

## 7. Keep the index current

- Remove superseded document versions the day the new one is published.
- Sync permission changes, with removals faster than additions.
- Track the age of documents. Old content causes confident wrong answers.

## 8. Test retrieval on its own

A retrieval eval checks whether the chunk containing the answer is in the top results for a known question. It needs no model call.

- Build a list of real questions with the document and section that answers each.
- Measure how often the right chunk is in the top results.
- Run it on every change to chunking, metadata, search or the index.
- It runs in seconds, so run it often.

## 9. Debug in order

When an answer is wrong, check:

1. Was the right document retrieved?
2. Did the chunk contain the answer?
3. Did the model use it?
4. Is the source itself correct and current?

The model is usually the last place to look.

## Common mistakes

- Fixed size chunks that split tables.
- Vector search alone for queries full of codes.
- Sending the top fifty chunks "to be safe".
- Indexing everything with one service account.
- Testing only the final answer, never retrieval.

## Practise with feedback

If you want to build and debug retrieval on messy, realistic documents, the AIXL Academy Forward-Deployed AI Engineering cohort works through these steps on real scenarios.

Details and enrolment: [AIXL Academy Forward-Deployed AI Engineering cohort](https://aixl.academy/workshops/forward-deployed-ai-engineering/?utm_source=aixl.academy&utm_medium=blog&utm_campaign=fde-cohort&utm_content=aixl-2026-11-23-blog-cta)

Forward Deployed AI Engineering is a 60-hour live cohort for working engineers. The fee is USD 1,799 per participant. [Enquire about the next intake](https://aixl.academy/workshops/forward-deployed-ai-engineering/?utm_source=aixl.academy&utm_medium=blog&utm_campaign=fde-cohort&utm_content=rag-retrieval-cheat-sheet-cta-usd).

Related reading: [RAG and evals interview questions](/blog/rag-evals-interview-questions/), [LLM evals cheat sheet](/blog/llm-evals-cheat-sheet/) and [FDE learning path](/blog/fde-learning-path/).

## Frequently asked questions

**1. Is this a full RAG course?**
No. It is a practical checklist for the retrieval half of RAG. For the evaluation half, read the RAG and evals interview questions.

**2. Where should I start with retrieval?**
Start with chunking and metadata, then add permission filters before you tune ranking.

**3. Do I need a vector database?**
Not always. Choose the search method your data supports, and measure it on your own questions.

## Sources

- None: AIXL Academy curriculum practice, no external facts or figures.
