AGUI
Run Agent
Mount the interface
Install ag-ui-protocol alongside the example server dependencies, then import AGUI and replace that server's AgentOS construction with:
from agno.os.interfaces.agui import AGUI
agent_os = AgentOS(agents=[agent], interfaces=[AGUI(agent=agent)])This fragment uses the existing agent, database and server startup from that example. A Team can also be mounted through AGUI(team=...).
Send an AG-UI request
curl --fail-with-body -N http://127.0.0.1:7777/agui \
-H "Authorization: Bearer $OS_SECURITY_KEY" \
-H 'Content-Type: application/json' \
-d '{"threadId":"agui-session","runId":"agui-run-1","messages":[{"id":"message-1","role":"user","content":"Hello"}],"tools":[],"context":[],"forwardedProps":{},"state":{}}'The response is text/event-stream, despite the generic JSON response below. Consume SSE data: records as AG-UI events, including run completion and errors. AgentOS middleware can require authentication even when the generated operation does not list a security requirement.
The adapter extracts the last user message and its media; it does not import the full client transcript as server history. Configure the agent's database and history as in the example to retain conversation context. Trailing tool messages can continue a local Agent or Team's paused run only when they match its stored requirements. The protocol's resume and parentRunId fields do not independently dispatch a resume operation.
forwardedProps.user_id supplies anonymous attribution only. Authenticated server identity takes precedence, and reserved identities are rejected.
/aguiRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Input for running an agent.
Response Body
application/json
application/json
curl --request POST 'https://example.com/agui' \ --header 'Content-Type: application/json' \ --data-raw '{"threadId":"string","runId":"string","messages":[{"id":"string","content":"string"}],"tools":[{"name":"string","description":"string"}],"context":[{"description":"string","value":"string"}],"forwardedProps":null}'null{ "detail": [ { "loc": [ "string" ], "msg": "string", "type": "string", "input": null, "ctx": {} } ]}