{
 "library": "bootstrap",
 "version": "0.11.0",
 "root": "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5",
 "license": null,
 "slug": "SocraticLoop",
 "ref": "SocraticLoop#ffaa",
 "hash": "sema:SocraticLoop#mh:SHA-256:ffaac4d5ca573af32ba28028ed642e7aec6b54a3a2e197e50e336cee6c2aaa3c",
 "stub": "ffaa",
 "layer": "Mind",
 "type": "Reasoning",
 "summary": "Clarification before generation",
 "mechanism": "Ambiguity detection loop. If Confidence(Prompt#1b04) < Threshold, Agent#e127 pauses execution to query the user. Loop#37f9 continues until intent is disambiguated or max_questions reached. It engages the user in a Dialectic#6961 exchange to progressively narrow the ambiguity space.",
 "invariants": [
  "Each question names the specific ambiguity it is asked to resolve.",
  "The Loop#37f9 halts when confidence exceeds `ambiguity_threshold` or questions reach `max_questions`, and which one ended it is recorded."
 ],
 "parameters": [
  {
   "name": "ambiguity_threshold",
   "type": "Float",
   "range": "[0.0, 1.0]",
   "description": "Confidence below which the agent asks a clarifying question instead of acting"
  },
  {
   "name": "max_questions",
   "type": "Integer",
   "range": "[1, 3]",
   "description": "Maximum clarification questions before the agent must proceed"
  }
 ],
 "signature": [],
 "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."
 ],
 "domain": "",
 "caution": "",
 "sources": [],
 "name": "SocraticLoop",
 "builds_on": [
  {
   "alias": "prompt",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Prompt",
   "ref": "Prompt#1b04",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Prompt"
  },
  {
   "alias": "loop",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Loop",
   "ref": "Loop#37f9",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Loop"
  },
  {
   "alias": "dialectic",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Dialectic",
   "ref": "Dialectic#6961",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Dialectic"
  },
  {
   "alias": "agent",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Agent",
   "ref": "Agent#e127",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Agent"
  }
 ],
 "related": [],
 "used_by": [
  {
   "slug": "PolymorphicSolver",
   "relation": "composes_with",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/PolymorphicSolver"
  },
  {
   "slug": "RigorousSolver",
   "relation": "references",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/RigorousSolver"
  }
 ],
 "url": "https://semahash.org/vocabularies/bootstrap/patterns/SocraticLoop",
 "md_url": "https://semahash.org/vocabularies/bootstrap/patterns/SocraticLoop.md",
 "library_url": "https://semahash.org/vocabularies/bootstrap"
}
