Skip to main content

Execute Agent

Execute a research agent. The request blocks until the agent finishes execution (synchronous).
Client timeout caveat. This endpoint holds the HTTP connection until executeAgentRun completes all of LLM inference, tool invocations (browsing/search), RAG, and graph extraction. Typical runs take 10 seconds to several minutes depending on the task.If the client times out (default 30–120s in most HTTP libraries), the connection is dropped — but the server keeps running and the result is persisted to chat history, not returned to the caller. You can recover it later via GET /turn/list.Recommendation: use Execute Agent (Streaming) for anything beyond trivial Q&A. SSE returns the runId immediately in the first event and can be resumed with /agent/run/stream/{runId} if the connection drops. If you must use this non-streaming endpoint, set your client timeout to at least 300 seconds.

Request

Headers

Request Body

Parameters

workspaceId is not required. It is automatically resolved from the API key.

Response

Response Fields

Examples

Retrieving detailed run data after completion

GET /agent/run/{runId}/status is lightweight — it returns only status and pending*Draft flags. To recover full run details (browse steps, tool calls, plan and report and matrix drafts, graph extraction events, referenced sources), use GET /turn/list. Each turn entry includes:
  • agentRun.process — the persisted timeline of every SSE event emitted during the run (config, delta, step, browse-*, plan-*, report-structure-*, matrix-*, source-summary-*, graph-*)
  • agentRun.publicSourceAgentRuns / privateSourceAgentRuns — URL sources the agent referenced, including bodyLinks metadata
  • agentRun.agent — agent metadata
There is no direct GET /agent/run/{runId} endpoint. To find a specific runId, paginate /turn/list (newest first) and match turns[].agentRun.id.

Agent-to-Agent delegation

Including type: "agent" entries in mentions lets the target Agent delegate to mentioned peers mid-run.

Single target

What happens:
  1. The initial Agent (e.g. agent-alpha) starts its run
  2. Its LLM selects the mentionAgent tool and writes a final message like [@agent-beta](agent://b-id) favorite color in one word
  3. After alpha completes, the server automatically starts a new AgentRun for agent-beta, using alpha’s final message as input
  4. beta runs independently and its reply is persisted to chat history
The response runId is for the parent run (alpha) only. To retrieve child runs, use /turn/list or /agent/run/{childRunId}/status.

Multiple targets

When two or more agents are mentioned, a server-side LLM classifier decides parallel vs chain from the message intent.
  • parallel (independent opinions): all mentioned agents run concurrently. Example: “Ask A and B for their independent opinions”
  • chain (sequential): the primary agent runs first and chains to the others via mentionAgent. Example: “A drafts a plan, then B reviews it”

Guards

  • Self-loop prevention: targets that match the caller’s own agentId are skipped
  • Depth limit: maxChainSteps (1-50, default 10) caps recursive mentionAgent fan-outs
  • Error isolation: one child’s failure does not block other siblings from spawning

Error Responses