---
title: Design an agentic RAG system for enterprise questions that span several corpora (HR policy, contracts, ticket history)…
url: https://gurkanozkan.ai/learn/questions/recent-b-rag-02/
markdown: https://gurkanozkan.ai/learn/questions/recent-b-rag-02.md
kind: question
role: Applied LLM
stage: System design
difficulty: Hard
json: https://gurkanozkan.ai/api/learn/questions/recent-b-rag-02.json
robots: noindex
---

# Design an agentic RAG system for enterprise questions that span several corpora (HR policy, contracts, ticket history). How does the agent decide it has retrieved enough, how do you bound cost and latency, and how do you evaluate it against a single-pass RAG baseline?

Applied LLM · System design · Hard

## Answer

*Model answer, written in a candidate's voice*

### In short

- Router/planner selects corpora, rewrites and decomposes the question, fans out retrieval, then synthesises with citations.
- Sufficiency judge compares question, snippets and draft, names missing facts, and triggers a new query, synthesis or abstention.
- Loop is bounded by max rounds, token and latency budgets, early exit for simple queries, and retrieval caching.
- Permissions are enforced per corpus at retrieval time, before snippets enter the model context.
- Evaluate on labelled multi-hop and unanswerable questions versus single-pass RAG, reporting accuracy, citation accuracy, abstention quality, calls per answer and p95 latency.

### In full

I would treat it as a controlled loop, not a bigger prompt: a router/planner picks HR policy, contracts and ticket history, rewrites and decomposes the question, fans out retrieval, then synthesises an answer with citations. The sufficiency check is explicit: a judge compares the question, snippets and draft, names missing facts, and either suggests a new query, allows synthesis, or triggers abstention. The loop is bounded by a configured maximum number of rounds, token and latency budgets, early exit for simple queries, and caching of retrieved results so repeated subqueries do not re-hit the corpora. Permissions are enforced at retrieval time per corpus, so unauthorised snippets never reach the model. I would evaluate against a single-pass RAG baseline on labelled multi-hop and unanswerable questions, reporting accuracy, citation accuracy, abstention quality, calls per answer and p95 latency, and I would not claim improvement until those numbers show it.

*Corrected by an independent AI reviewer.*

## What a strong answer covers

- Splits roles: planner or router choosing corpora, query rewriting and decomposition, search fan-out, a sufficiency check, and answer synthesis with citations.
- Makes sufficiency explicit: a judge that compares the question, snippets and a draft, names missing facts and either suggests a new query or allows synthesis or abstention.
- Bounds the loop with a maximum number of rounds, token and latency budgets, early exit for simple queries, and caching of retrieved results.
- Enforces permissions per corpus at retrieval time, not after generation.
- Evaluates on labelled multi-hop and unanswerable questions against single-pass RAG, reporting accuracy, citation accuracy, abstention quality, calls per answer and p95 latency.

## Common mistakes

- Letting the agent loop without a stopping rule or budget, or trusting the sufficiency judge without validating it against human labels.

## Follow-ups

- Google reported up to 34% higher accuracy than standard RAG for a design like this; what would make you believe or doubt such a number on your data?
- When would you train the search policy with RL instead of prompting it?

## Topic guides

- [Agents and tool use](https://gurkanozkan.ai/learn/topics/agents.md)
- [Evaluation: metrics, evals for LLM systems and statistical rigour](https://gurkanozkan.ai/learn/topics/evaluation.md)
- [Retrieval-augmented generation](https://gurkanozkan.ai/learn/topics/rag.md)
---

*Study material compiled with AI: drafted by a local model (Inkling 2 Mini) from public sources, then checked against those sources by independent AI reviewers (Claude) in November 2026. Not reviewed line by line by a person.*
