productinterview.tools
MenuClose

RAG and Retrieval: Grounding LLM Answers in Your Data

Grounding answers in your own data.

Core3 lessons5 questions

What this module covers

  • The problem RAG solves: private, recent or large knowledge the model doesn't have
  • The retrieval pipeline: chunking, embeddings, search, reranking
  • When to use RAG, long context, or fine-tuning instead
RAG and retrieval

Why it matters, by role

  • Applied AI PMProduct Manager. Decides what a product should do, for whom, and why. Read the full explanation: most AI features over company data are RAG; design and quality questions follow.
  • AI Platform PM: retrieval and vector search are core platform features developers ask for.
  • Forward Deployed EngineerForward Deployed Engineer. An engineer embedded with customers who scopes, builds and ships AI solutions into production. Read the full explanation: customer pilots usually start with "answer questions over our documents".
  • AI Product Engineer: you'll build and tune the pipeline.

Lessons

  1. Why RAG exists
  2. How retrieval works
  3. RAG vs long context vs fine-tuning

Why RAG exists

A model only knows its training data, up to a cutoff date. It doesn't know your company's policies, your product docs or yesterday's tickets. Retrieval-augmented generation (RAG) fixes this: at question time, find the relevant documents and put them in the model's context, then ask it to answer from them.

RAG gives you:

  • Fresh and private knowledge without retraining
  • Citations: the answer can point to its sources
  • Control: change the documents and the answers change, immediately

Its cost: answer quality now depends on retrieval. If the right document isn't found, the model can't use it.

How retrieval works

  1. Chunking: split documents into passages, often a few hundred tokens each, ideally along natural boundaries (sections, paragraphs). Chunks too small lose context; too large dilute relevance.
  2. Embeddings: turn each chunk into a vector, a list of numbers that captures its meaning, so similar meanings sit close together.
  3. Search: embed the question the same way and find the nearest chunks (semantic search). Most production systems also run keyword search (such as BM25) and combine the two, because embeddings can miss exact terms like product codes or names. This is hybrid search.
  4. Reranking: a second, more careful model re-scores the top results and keeps the best few.
  5. Generation: the top chunks go into the prompt with an instruction to answer only from them and cite them.

Each step can fail, which is why RAG evals check retrieval and generation separately.

RAG vs long context vs fine-tuning

Approach What it is Best when Watch out for
RAG Retrieve relevant chunks per question Large or changing knowledge; citations needed Retrieval misses
Long context Put all the material in the prompt The material fits and is used together (one contract, one codebase area) Cost and latency per request; models can miss details buried in very long contexts
Fine-tuning Train the model further on examples Teaching a style, format or skill Poor way to add facts; facts go stale; costly to update

A common interview trap: "Should we fine-tune the model on our docs?" Usually no. Fine-tuning teaches how to respond; RAG supplies what to know.

Questions

Core

QuestionTypeRolesAsked atSource
Design an assistant that answers employees' questions from 50,000 internal documents: policies, wikis and project docs.designForward Deployed Engineer, AI Product Engineer, AI Platform PM–Representative
You're building RAG over long technical manuals with tables, numbered steps and diagrams. How would you split them into chunks?designAI Product Engineer, Forward Deployed Engineer–Representative
Your team changed the embedding model in your RAG system. How would you know whether retrieval got better or worse?metricsAI Product Engineer, Model PM–Representative
Your RAG assistant over the company handbook gives wrong answers about 15% of the time. How do you find out why?diagnoseForward Deployed Engineer, AI Product Engineer, Applied AI PM–Representative
A legal team wants to ask questions about one 80-page contract at a time. Would you use RAG or put the whole contract in the context?trade-offApplied AI PM, Forward Deployed Engineer, AI Product Engineer–Representative

Rubric

Dimension Weak Passable Strong
Purpose "RAG makes the model smarter" Adds missing knowledge Fresh, private knowledge with citations and control
Pipeline "Search the docs" Embeddings and vector search Chunking, hybrid search, reranking, grounded generation, with failure points
Trade-offs Picks one approach for everything Compares two RAG vs long context vs fine-tuning by knowledge size, freshness, cost
Quality Assumes retrieval works Mentions retrieval quality Plans separate retrieval and answer evals

Next modules