Build the context: instructions, conversation history, retrieved memory and the list of available tools.
Call the model, which returns either a final answer or one or more tool calls.
Check permissions and policy on each requested call: allow, deny, or ask a human.
Execute the tools (with validation, timeouts and retries) and append the results to the context with the matching call IDs.
Repeat until the model answers, a stop condition fires, or a limit is reached.
Loading…