Search Tutorials
--Ads--RAG Decision Cheat Sheet
Which technique to use for which problem, on one page.
This page condenses the whole tutorial into quick decisions: a recommended default stack, which technique to try for which symptom, and what to use for different kinds of data. Use it as a starting point, then confirm each choice with your evaluation set.
A strong default stack
| Stage | Default | Lesson |
|---|---|---|
| Parsing | Layout-aware parser for PDFs; keep tables as Markdown; page numbers in metadata | Parsers |
| Chunking | Structure-aware where possible, else recursive; 200–500 tokens; 10–20% overlap; heading path in each chunk | Chunking |
| Embeddings | A strong retrieval model chosen with a test on your data; normalised vectors | Embeddings |
| Storage | The database you already run if it supports vectors; otherwise a dedicated vector database | Vector DBs |
| Retrieval | Hybrid (BM25 + dense) with RRF, 20–50 candidates, metadata and permission filters | Hybrid search |
| Post-retrieval | Cross-encoder reranker to 3–8 chunks; deduplicate | Reranking |
| Generation | Grounded prompt with sources first, question last, citations, explicit "not found"; prompt caching; streaming | Prompts |
| Evaluation | Golden set with evidence; hit rate, MRR, judged correctness and faithfulness; regression tests in CI | Evaluation |
| Operations | Incremental sync, tracing, feedback loop, cost and latency dashboards | Production |
Symptom → what to try
| Symptom | Try first | Then |
|---|---|---|
| Exact terms (codes, names) not found | Hybrid search | Identifier-aware tokenisation, glossary expansion |
| Casual or vague questions fail | Query rewriting | Multi-query, HyDE |
| Follow-up questions fail | Query condensing | Conversational RAG with history management |
| Right document, wrong chunk | Reranking | Contextual retrieval, smaller chunks |
| Answers cut off or missing context | Parent-child chunking | Larger chunks, sentence windows |
| Chunks from the wrong product, year or team | Contextual headers + metadata filters | Self-query retrieval |
| Repetitive top results | Deduplication at indexing | MMR |
| Multi-part or comparison questions | Query decomposition | Agentic RAG |
| Facts linked across documents | Iterative multi-hop retrieval | GraphRAG |
| "Summarise everything about X" questions | Long context with retrieved documents | RAPTOR, GraphRAG global search |
| Numbers and totals wrong | Text-to-SQL or code for calculations | Table-aware RAG |
| Hallucinated or unsupported claims | Stronger grounding prompt + citations | Groundedness checks, self-correction |
| Outdated answers | Incremental sync, archive old versions | Recency ranking, conflict rules |
| Too slow | Streaming, lower effort, fewer chunks | Parallel steps, caching, routing |
| Too expensive | Prompt caching, fewer chunks, answer caches | Batch API offline, routing |
Data type → approach
| Data | Approach |
|---|---|
| Policies, manuals, documentation | Structure-aware chunks with heading paths, hybrid search, reranking |
| FAQs and knowledge-base articles | One Q&A or article section per chunk; consider indexing the questions |
| Scanned or visually rich PDFs | Vision LLM transcription or ColPali-style page retrieval |
| Tables and spreadsheets | Tables as Markdown with summaries; SQL or pandas for calculations |
| Databases | Text-to-SQL with read-only access |
| Source code | Function-level chunks, identifier-aware hybrid search, agentic file reading |
| Meetings, calls, videos | Timestamped transcripts, time-window chunks, timestamp citations |
| Emails and tickets | One message or thread per chunk, PII redaction, injection scanning |
| Relationship-heavy records | GraphRAG or a graph database alongside vector search |
Scale → infrastructure
| Scale | Suggestion |
|---|---|
| A few hundred pages, same for all users | Consider long context with prompt caching before building retrieval |
| Up to ~100k chunks | Exact search (NumPy or FAISS flat) or any embedded database |
| 100k to tens of millions of chunks | HNSW in pgvector, Qdrant, Weaviate, Milvus, Elasticsearch or a managed service |
| Hundreds of millions or more | Quantization, disk-based indexes, sharding, dedicated vector infrastructure |
Questions to ask before adding a technique
- Which failures in my evaluation set does it target?
- How much latency and cost does it add per question?
- Can I route only the questions that need it?
- Did the evaluation confirm the gain, beyond noise?
The one rule
Measure, then change one thing, then measure again. Every technique in this tutorial is a tool for a specific failure, not an upgrade to apply everywhere.