SocraticLoop
Clarification before generation
Mechanism
Ambiguity detection loop. If Confidence(Prompt) < Threshold, Agent pauses execution to query the user. Loop continues until intent is disambiguated or max_questions reached. It engages the user in a Dialectic exchange to progressively narrow the ambiguity space.
Invariants
- Each question names the specific ambiguity it is asked to resolve.
- The Loop halts when confidence exceeds `ambiguity_threshold` or questions reach `max_questions`, and which one ended it is recorded.
Parameters
- ambiguity_threshold: type=Float, range=[0.0, 1.0], description=Confidence below which the agent asks a clarifying question instead of acting
- max_questions: type=Integer, range=[1, 3], description=Maximum clarification questions before the agent must proceed
Preconditions
- Ambiguity detected
- User prompt received
Postconditions
- Either intent is disambiguated, or the bound was reached and the remaining ambiguities are stated with the best-guess fallback
Failure modes
- Premature stop: a vague answer is accepted and the ambiguity treated as resolved.
- Budget spent without resolution: `max_questions` reached having clarified nothing.
- Clarification the user cannot give: the question is well-aimed and unanswerable.
Where this came from
—
Builds on
Used by
- PolymorphicSolver composes_with
- RigorousSolver references
Identity
- Ref:
SocraticLoop#ffaa - Hash: sema:SocraticLoop#mh:SHA-256:ffaac4d5ca573af32ba28028ed642e7aec6b54a3a2e197e50e336cee6c2aaa3c
- Library: bootstrap 0.11.0, root a6a3d1ff0f98
- License: Not stated; check the repository