query-loop-implementation
Installation
SKILL.md
Query Loop Implementation
Core Idea
Build the loop as product infrastructure, not prompt glue:
ConversationManager -> QueryLoop -> ToolRuntime
ConversationManagerowns durable state: session id, messages, user settings, budget, persistence.QueryLoopowns one task turn: call model, detect tool calls, execute tools, append tool results, repeat.ToolRuntimeowns registered tools: schemas, permission checks, execution, error formatting.
Use ReAct as the mental model:
Thought -> Action -> Observation -> Thought -> Answer