Agent instance powered by GPT-4o that holds the full registry of specialized agents as handoffs, decides which of them to invoke, and synthesizes their outputs into a final response.
Agent definition
Orchestrator class in connectors/orchestrator.py wraps this definition and is instantiated per WebSocket connection, allowing future dynamic agent registration (e.g. injecting user-specific integrations via build_dynamic_agents).
The O.D.A.R. loop
Every request the orchestrator processes follows a four-phase loop:Observe
Parse the incoming user message together with any prior conversation context and tool results already in the thread.
Decide
Determine whether the request can be answered from existing context or requires delegating to one or more agents. Apply the H.A.N.D.O.F.F. criteria (see below) to select the best agent(s).
Act
Execute the chosen tool calls. Where multiple agents are needed and their calls are independent, they are parallelized.
The H.A.N.D.O.F.F. decision framework
When choosing which agent to invoke, the orchestrator evaluates seven criteria:H — Has capability
H — Has capability
Does the agent explicitly solve this task? Only agents whose declared capabilities match the user’s intent are considered.
A — Access
A — Access
Does the agent have the required data or API permissions for this user? For example, the Gmail agent is only invoked when the user has connected their Google account.
N — Novelty / Need
N — Novelty / Need
Is a tool call actually necessary, or can the orchestrator answer from known context or cached information? Unnecessary calls are avoided.
D — Delay / Cost
D — Delay / Cost
Prefer fewer or cheaper API calls when they produce equivalent quality. The orchestrator minimizes the number of agent invocations per request.
O — Output quality
O — Output quality
Will the agent return the format and information the request requires? Agents are assessed for fit before being selected.
F — Failure fallback
F — Failure fallback
If the first-choice agent is likely to fail (e.g. due to missing credentials), an alternate agent is chosen proactively.
F — Fusion
F — Fusion
When a task spans multiple domains, the orchestrator coordinates several agents in parallel and merges their outputs into a single coherent response.
Tool call progress messages
Every tool function exposed by a specialized agent is registered in theTOOL_CALLS dictionary. When the orchestrator invokes a tool, this dict is consulted to surface a user-friendly progress string over the WebSocket connection in real time.
None value are internal bookkeeping calls (e.g. store_location) that do not produce a visible progress message.
Parallel agent execution
When the O.D.A.R. loop reaches the Act phase and determines that multiple independent tool calls are required, the orchestrator issues them concurrently rather than sequentially. The response synthesis step waits for all results before generating the final reply.Tool calls that depend on each other’s output — for example, fetching a flight status and then looking up the arrival airport weather — are still issued sequentially, with each result fed into the next call’s context.