Concept guide · RAG foundations
Walk through a basic RAG pipeline.
A slower explanation for when the short interview answer is not enough. Start with the intuition, then connect it to the technical idea and the way an interviewer expects you to reason about it.
ML area
Generative AI → Basic RAG pipeline
Interview format
Core · Scenario
Question
GENAI-049
Start with the idea
In simple terms
A basic RAG pipeline prepares documents for search, retrieves the most useful passages for a question, places them into a controlled prompt, and asks the model to answer from that evidence.
Make it concrete
For a help centre assistant: parse articles, split them by headings, embed and index them, retrieve relevant sections, add article titles and links to the prompt, then generate a cited answer.
Build the answer
How to approach it
- 1Draw the offline indexing path and online query path separately.
- 2Keep source IDs and metadata attached from ingestion through the answer.
- 3Evaluate retrieval and generation as components before relying on end-to-end quality.
Go one level deeper
The technical explanation
The ingestion path should preserve source identity, version, timestamps, structure, and permissions. The query path may rewrite the question, run hybrid retrieval, rerank candidates, filter or compress context, and select a response policy. A good architecture makes each step observable so you can tell whether a wrong answer came from missing evidence, bad assembly, or unsupported synthesis.
Say this in the interview
Load and parse documents, preserve useful metadata, split them into retrievable units, embed and index them, retrieve candidates at query time, optionally rerank or filter them, assemble a bounded context, generate a grounded answer, and expose citations or refusal behaviour when evidence is insufficient.
Keep preparing