KatInterview

Build a RAG-Powered Voice Assistant with Grounding Guarantees

Machine LearningModel answer
HardModel answerMachine LearningRAGLLMsystem-design

Last updated

Design a retrieval-augmented voice assistant that answers from a trusted knowledge base under a 500ms latency budget while minimizing hallucinations.

The Problem

Your team is building a voice assistant for a product support platform. Instead of letting the underlying language model answer from its training weights, every response must be grounded in a curated internal knowledge base — think product documentation, support articles, and how-to guides. Your job is to design the end-to-end system.

Functional requirements

  • Users can have multi-turn conversations. References like "the one you just mentioned" or "does it also apply to the older model?" must resolve correctly.
  • The system retrieves supporting passages before generating any answer.
  • A verification step confirms that what the assistant says is actually supported by the retrieved content.
  • When the knowledge base cannot support an answer, the assistant must say so explicitly rather than guess.

Non-functional requirements

  • Latency: the user must hear the first word within 500ms of finishing their utterance.
  • Hallucination budget: fewer than 2% of generated claims should be unsupported by retrieved sources.
  • Freshness: source documents update daily; the index must reflect changes within minutes to a few hours.

Scale

  • Knowledge base: 1 million documents.
  • Traffic: 10,000 queries per second (QPS) average, ~2.5× at peak.

What to cover

  1. Retrieval pipeline — embedding strategy, index design, hybrid retrieval, and reranking.
  2. Multi-turn handling — how context from prior turns feeds into retrieval.
  3. LLM integration — how you structure the prompt and enforce grounding rather than hoping the model behaves.
  4. Verification layer — how you check grounding without blowing the latency budget.
  5. Evaluation — how you measure groundedness, abstention quality, and retrieval accuracy in production.
  6. Trade-offs — where you sacrifice retrieval depth or answer completeness to meet the latency constraint.

No need to write production code. A clear architecture with concrete component choices, a latency breakdown that sums to under 500ms, and honest discussion of where things can fail is what a strong answer looks like.

Hints

Hint 1

Start by decomposing the 500ms budget across every stage — ASR, retrieval, reranking, generation, verification, and TTS. Showing that the numbers add up is half the answer.

Hint 2

Multi-turn retrieval quality lives or dies on query rewriting. A bare embedding of 'does it work with the older one?' retrieves almost nothing useful. Think about what must happen before the first vector search call.

Hint 3

Verification and latency are in direct tension. The insight that unlocks both is that you don't have to verify the whole answer before speaking — think about what the unit of verification can be.