Ima retired Techy getting bored and I want to experiment with questioning the user to understand hat hes looking for as a way to attempt working around RAG driven inacuracies. Can anyone suggest libraries r tools I might experiment with?
This has an actual name in the literature, “query clarification” or “ambiguity-aware RAG,” so worth knowing the terms even if you’re experimenting freeform. Concretely to try:
DSPy is the best fit for hands-on experimenting since it lets you define a “clarify or answer” module and optimize the decision boundary with real examples rather than hand-tuning prompts. For frameworks with clarification built in already, LangGraph lets you build an explicit branch (ambiguous → ask, confident → retrieve+answer) as a graph rather than a single prompt, which makes the logic easier to inspect and tweak than a monolithic RAG chain.
Two research patterns worth reading before you build, since they map directly to what you’re describing: Tree of Clarification (ToC), which generates clarifying questions recursively for fuzzy queries and resolves them against the retriever rather than just asking the user everything upfront, and the simpler “Clarify Once, Learn the Default” pattern, which asks one focused question the first time a certain ambiguity shows up, then remembers the user’s typical answer so it stops asking the same thing repeatedly. That second one is probably the most practical starting point for a solo experiment, it’s a small, well-scoped loop (detect missing field → ask → store default → reuse) rather than a full research pipeline.
Thats incredibly helpful. Thank you.