TheDocumentation Index
Fetch the complete documentation index at: https://docs.idun-group.com/llms.txt
Use this file to discover all available pages before exploring further.
/agent/run endpoint streams AG-UI events over Server-Sent Events. The bundled chat UI uses it. Your scripts and integrations call the same endpoint.
Request shape
The body is an AG-UIRunAgentInput:
| Field | Type | Common value |
|---|---|---|
threadId | string | a unique conversation ID |
runId | string | a unique-per-call ID |
state | object | {} for chat-mode agents |
messages | array | [{id, role, content}] |
tools | array | [] if your agent has none |
context | array | [] for the default case |
forwardedProps | object | {} for the default case |
parentRunId is optional, used when resuming a run.
All seven required fields must be present (even when empty), or the endpoint returns 422 Unprocessable Entity.
Curl example
Content-Type: text/event-stream) of AG-UI events: RunStarted, TextMessageStart / Content / End, ToolCallStart / Args / End, ThinkingStart / End, RunFinished.
Structured-mode agents
If your LangGraph agent declares an explicitinput_schema on the StateGraph that contains fields beyond messages, the engine auto-detects input.mode = "structured" and requires messages[-1].content to be valid JSON matching the input schema. The chat surface returns a RUN_ERROR SSE event with code: VALIDATION_ERROR if you send plain text.
Example explicit-schema agent:
/agent/run directly, build the JSON yourself.
Implicit-state agents (the common case)
When your agent declares oneOverallState TypedDict with messages plus internal carry-fields and does not supply input_schema=, the engine resolves to input.mode = "chat". Plain-text content works as expected. The internal scalars (intent, draft, etc.) get populated by your nodes during the run.
Reading the SSE stream
Every event line isdata: <json>\n\n. Decode and dispatch on type. A minimal Python reader: