This is basically a full ML systems design question crammed into one prompt.
Start by clarifying requirements and constraints (data volume, query types, latency SLAs, privacy needs) to scope the design. Then walk through the end-to-end pipeline: ingestion, retrieval, generation, and evaluation, making explicit trade-offs at each stage. Emphasize grounding, citations, and monitoring as first-class concerns, not afterthoughts.
Pro tip: Anchor your design in measurable business outcomes (e.g., answer accuracy, latency, cost per query) and proactively discuss failure modes and mitigations—this shows production maturity beyond just architecture.
Ask about data scale, query types, latency/throughput targets, privacy regulations, and existing infrastructure. This ensures your design is tailored and avoids over-engineering.
Outline document parsing, chunking, embedding, and indexing. Discuss trade-offs in chunk size, embedding models, and metadata enrichment for citations and freshness.
Choose hybrid retrieval (dense + sparse) with re-ranking. Explain how to handle freshness (e.g., time-decay scoring) and ensure diversity and relevance.
Describe prompt construction with retrieved context, citation injection, and hallucination reduction techniques (e.g., constrained decoding, self-check). Address privacy controls like PII redaction.
Propose offline and online evaluation metrics (faithfulness, answer relevance), A/B testing, and production monitoring for latency, throughput, and drift. Discuss scaling strategies (caching, sharding).
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.