AI Hints
Home›RAG Tutorial›Cheat Sheets and Mistakes
RAG · Lesson 115 of 120

Cheat Sheet: The Pipeline

Load to answer.

⏱ 2 min read▶ Video at 1:51:59🎓 Free
Watch this lesson in the RAG courseWatch on YouTube ↗Full RAG course

Here's the whole RAG pipeline on one page. Keep it as a reference whenever you build a new system.

Cheat Sheet: The Pipeline
From the video: Cheat Sheet: The Pipeline
  • One page
  • The whole pipeline
  • Keep it handy

Indexing, ahead of time

Load your documents, with metadata. Clean them. Split them into chunks of a few hundred characters, with some overlap. Embed every chunk. And store the vectors, with the text and metadata.

  1. Load
  2. Clean
  3. Chunk
  4. Embed
  5. Store
Indexing, ahead of time
From the video: Indexing, ahead of time

Answering, per question

Take the question, and condense it if it's a follow up. Retrieve candidates with hybrid search. Rerank, and keep the best few. Build a grounded prompt. And generate the answer, with sources.

  1. Condense
  2. Retrieve
  3. Rerank
  4. Prompt
  5. Answer

Default settings

Good starting points are chunks of three hundred to eight hundred characters, with ten to twenty percent overlap. Fetch ten to twenty candidates, and keep three to five. And always use temperature zero for answers.

keyvalue
Chunk size300 to 800 chars
Overlap10 to 20%
Fetch10 to 20
Keep3 to 5

Summary

Index ahead of time, then condense, retrieve, rerank, prompt, and answer. Next, the better retrieval cheat sheet.

Key takeaways
  • Load to store
  • Question to answer
  • Sensible defaults
Next up: Cheat Sheet: Better Retrieval — the tricks