
Teaching a RAG agent to ask instead of guessing
Read the full post on AWS BlogAsk a RAG system a vague question and you tend to get one of two bad answers: "I don't know", or a confident invention. Neither is really a retrieval failure. The question didn't carry enough detail, and the system went ahead and answered anyway. A person would have asked what you meant, and this post gives the system that option.
The setup is a LangChain agent running on an Amazon Bedrock model, retrieving from an Amazon Kendra index built over the AWS documentation for Kendra, Lex and SageMaker, with a Streamlit front end. A conventional agent here has one tool: fetch documents, put them in the prompt, answer. We add a second tool that asks the user a clarifying question, and let the agent choose between them. So when a query is too vague to retrieve against, the agent asks for the missing detail, folds the answer back into the query, and retrieves again with something specific enough to match.
The hard part is the choice rather than the dialogue. The agent has to notice that a question is ambiguous before it has an answer to judge, and that recognition lives in the prompt and in how you describe the two tools to it. Get those descriptions wrong and it either interrogates people who asked perfectly clear questions, or carries on guessing as before. Code is on GitHub.

