Design a Confidential RAG Assistant Over Engagement Documents
Last updated: November 29, 2026
Quick Overview
Design a generative AI assistant that lets consultants and auditors ask questions over their own engagement's documents and the firm's methodology library, with answers that cite sources and never leak content across clients.
PwC
November 29, 20260
0
0 solved
Design a generative AI assistant that lets consultants and auditors ask questions over their own engagement's documents and the firm's methodology library, with answers that cite sources and never leak content across clients.
PwC has rolled out internal GenAI assistants to a very large workforce, and the hard part is not the model but confidentiality between clients, citation quality and responsible AI review. The interviewer checks that access control is enforced at retrieval time, that evaluation is concrete, and that failure modes such as hallucinated audit guidance are taken seriously.
What the Interviewer Expects
- Enforce permission filtering inside retrieval, not after generation
- Chunk and index with metadata for client, engagement, document type and date
- Use hybrid retrieval and reranking, and require citations
- Define an offline evaluation set and online feedback signals
- Address prompt injection from client documents
- Keep logs for responsible AI review without breaching confidentiality
Key Topics to Cover
How to Approach This
- Start by mapping the business objective to a concrete ML objective and metric.
- Cover the full pipeline: data collection, feature engineering, model selection, training, serving.
- Discuss online vs offline evaluation. Plan an A/B test to validate real-world impact.
- Address the serving latency budget and whether batch or real-time inference is needed.
- Think about the data flywheel: how user feedback improves the model over time.
Possible Follow-up Questions
- How would you stop a malicious instruction hidden inside a client PDF from taking over the assistant?
- How do you evaluate faithfulness at scale without reviewers reading every answer?
- How would you handle a user whose engagement access is revoked mid-conversation?
- When would you fine-tune instead of relying on retrieval?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice ML System Design ProblemsSample Answer
Requirements
Users ask natural language questions; answers draw on (a) documents in engagements they are staffed on and (b) firm methodology. Every claim cites a source chunk. Hard constraints: no cross-client lea...
High-Level Design
Ingestion: documents are parsed, chunked by structure (headings, tables kept whole), embedded, and stored in a vector index with metadata client_id, engagement_id, acl_groups, doc_type, `effec...