AI EngineeringInterview preparation
Advanced·Concept·2 min read

Design 1: RAG chatbot

Practice this question

Overview

A conversational interface over an eligible knowledge corpus. It combines a document pipeline with a request-time answer pipeline.

Why this matters

Users need understandable answers grounded in private sources.

An everyday example

A librarian talks through an applicable handbook.

A technical example

API returns {answer, sourceIds, answerable}.

How it works

  1. Ingest/version
  2. Authorize
  3. Retrieve/rerank
  4. Construct context
  5. Generate
  6. Validate.

Architecture and flow

UI → auth API → retriever/index → LLM → cited response.

The insurance assistant example

Explain active policy reporting instructions.

When to use it

Private/changing documents with clear source ownership.

When to avoid it

Exact live claim lookup needs a service tool.

Interview answer

“I design ingestion and answer-time retrieval separately, with ACLs, freshness, abstention, and independent evals.”

Benefits, trade-offs, and production considerations

  • Use documents/chunks/jobs/messages records, queue ingestion, trace evidence IDs, and degrade to authorized search results if generation fails.
  • Scale search and provider capacity independently.
Adapted from 13_AI.MD · “Design 1: RAG chatbot”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.