Loading the retrieval index…
Chapter 4 of 7
The layers of a RAG system
The simple pipeline works, so the team cut costs. Then a sales lead asks about refunds again, and the answer goes wrong.
This chapter: What happens between “a pile of documents” and “the passages the model reads”, and where can it break?
About this chapter
You will learn
- How a chunker splits documents, and how a bad cut hides a rule
- How embeddings turn text into numbers that capture meaning
- How the index and the context assembler deliver the final prompt
Words you’ll meet
- Chunk
- A small piece of a document. RAG searches and hands over chunks, not whole files.
- Overlap
- Repeating the end of one chunk at the start of the next, so a sentence near a cut survives whole.
- Embedding
- A list of numbers that captures what a piece of text means. Similar meanings get similar numbers.
- Embedder
- The block that turns each chunk, and the question, into an embedding.
- Vector index
- Storage for every chunk’s embedding, built so all of them can be compared with the question at once.
Step 1 of 8
The team now cuts documents into 16-word and sends only the best.
Ask about refunds again.