RAG Reference Pipeline
RAG Reference Pipeline
Key jargon
| Term | Plain-language meaning |
|---|---|
| Retrieval-augmented generation (RAG) | Generating an answer with evidence retrieved from an external knowledge collection. |
| Retriever | The component that selects candidate passages for a query. |
| Reranker | A second-stage model or rule that reorders retrieved candidates by relevance. |
| Grounding | Constraining an answer to supplied evidence and making support inspectable. |
Key concepts
- RAG is a pipeline whose retrieval and generation stages can fail independently.
- Evaluate source ingestion, retrieval, evidence support, and final answers separately.
Concept map
flowchart LR
A["Ingest and index sources"] --> B["Retrieve candidates"]
B --> C["Rerank and assemble evidence"]
C --> D["Generate grounded answer"]Retrieval-augmented generation supplies selected external evidence to a generator. It can improve freshness and grounding, but it does not guarantee either.
flowchart LR
D[Sources] --> I[Parse and normalize]
I --> C[Chunk and enrich metadata]
C --> X[Index]
Q[Question] --> R[Retrieve]
X --> R
R --> K[Rerank and filter]
K --> P[Construct grounded prompt]
P --> M[Model]
M --> V[Validate answer and citations]Two evaluation planes
- Retrieval: did the system find the evidence needed?
- Generation: did the answer faithfully use that evidence?
Exercise
Create five short documents and ten questions with known supporting passages. Record retrieved passages separately from generated answers so failure location is visible.