Topic overview: practice interview questions.
A retrieval agent does not need to be impressive. It needs to know when it has done enough.
That is harder than it sounds. Give a model a search tool and a broad request, and it can keep reformulating queries, collecting near-duplicate passages and treating activity as progress. A final answer may even look reasonable. Meanwhile, cost grows, latency stretches and the system has no honest explanation for why it made one more call.
This exercise gives you a test case for that behavior. It is useful for an interview portfolio because it shows a design decision many agent demos leave blank: the condition that ends a run.
Write a task contract
Choose a modest knowledge task with a clear source set. For example: “Answer whether a customer is eligible for a plan change using the current policy documents, and cite the relevant section.” Do not begin with web-wide research or a task that requires perfect judgment. You need a test that can be reviewed.
Write the contract in six lines:
- User request: the exact question the agent receives.
- Allowed sources: the documents, dates and access rules it may use.
- Required answer: the fields, citation or action expected.
- Success evidence: what facts must be present and correct.
- Uncertainty rule: when it must ask, abstain or hand off.
- Budget: maximum retrieval calls, tool calls, time and spend.
The budget changes the design. A limit of two retrieval attempts forces the agent to make each query count. It also makes a result auditable. You can later say whether the system stopped because it found sufficient evidence, ran out of allowed attempts or encountered a condition that required a person.
For a first test, keep the budget almost uncomfortable: two searches, one document fetch per search, 20 seconds total. A system that only behaves with unlimited retries has not earned a production role.
Plant a retrieval failure on purpose
Now create a small document set that includes a trap. Put an older policy document near the top of the search results, while the current document has the answer in a less obvious section. Add metadata such as effective date and document owner. The agent should need to notice that relevance is not the same as authority.
Write a user question that looks easy: “Can a customer move from Plan A to Plan B after 30 days?” The old document might say yes. The newer document might say yes only when a particular account condition is met.
Your test should record:
- The initial query and returned document identifiers.
- The passages chosen for the context.
- Whether the agent noticed the date or authority conflict.
- The reason for any second retrieval.
- The final answer, citations and confidence statement.
The good behavior is not necessarily a second search. If the current document already answers the question, the correct move is to stop. If the first documents conflict, a revised query that filters to current policy may be justified. If the conflict remains after the budget is used, the correct answer may be, “I cannot determine this from the allowed sources.” That outcome is better than a confident guess.
Score the stop budget
Create a rubric with four scores from zero to two.
Evidence sufficiency: Did the agent answer only after finding an allowed source that supports the required facts?
Retrieval discipline: Did it make another search only when the available evidence left a named gap or conflict?
Budget compliance: Did it remain within the call, time and spending limits?
Escalation quality: When the evidence was missing or inconsistent, did it state what was unresolved and route the case correctly?
A score of two should require a record, not a nice-looking answer. For retrieval discipline, the trace must connect the second query to the issue in the first result. “Try a more specific search” is not a reason. “The top result predates the current policy, so filter by effective date” is one.
Add a hard failure rule for high-risk actions. If the agent acts, recommends a decision or sends a message without adequate source support, the whole case fails even if other scores are good. Averages can hide the behavior you most need to prevent.
Run the interview walkthrough
Once the test is working, explain it aloud as if an interviewer had asked, “How would you know your RAG agent stops at the right time?”
Start with the task contract. Say what the agent is allowed to consult, the required answer and the budget. Then explain the planted failure: an older but relevant document competes with a newer policy. Describe the trace you record and the rubric you use to distinguish a justified second retrieval from aimless looping.
Finish with the escalation rule. A strong answer is not “the agent always finds the answer.” It is “the agent can show why the evidence is enough, and it knows when the remaining uncertainty belongs with a person.”
Expect a follow-up about cost. Explain that a stop budget lets you estimate the upper bound for a request and find repeated behavior in logs. Expect a question about better prompts. Say prompts may improve query formation, but they do not replace explicit rules for source authority, tool limits and escalation. Expect a question about evaluation. Point to separate scores for retrieval behavior and answer support, because a correct answer reached by unreliable behavior is still a fragile system.
This test case is small by design. That is why it is useful. It turns an abstract promise that an agent will be careful into an inspectable contract, a failure simulation and a recorded decision to stop.
Explain the test case aloud in an Openskill curated interview. Pick a technical interview track, start in Openskill, and practise answering the first follow-up about cost, evaluation or failure handling.
Test the answer in a live mock interview at Openskill.