Migrating from
AGUIApp? See the v2 migration guide.Setup
Follow the AG-UI setup guide to run the backend and connect a frontend.Install the AG-UI dependencies:
uv pip install 'agno[agui]'OPENAI_API_KEY, or a key for whichever model provider you use.- A frontend pointed at the
{prefix}/aguiendpoint. Use Dojo for local development.
Example Usage
- Agent
- Team
basic.py
See more examples including agents with tools, reasoning, and teams.
9001, which Dojo expects. See the setup guide to run a frontend.
Sessions & State
AG-UI frontends send athread_id, optional state, and the full message history with every request. The interface maps these to Agno and uses only the latest user message, letting the agent manage history through its session database.
| AG-UI field | Maps to | Purpose |
|---|---|---|
thread_id | session_id | Each thread is a separate conversation. |
state | session_state | Shared state available to the agent during the run. |
forwarded_props.user_id | user_id | Per-user memory and history. |
Reasoning
Reasoning streams to the frontend as AG-UI reasoning events. Native reasoning models and theReasoningTools toolkit are both supported.
See the reasoning agent example.
Structured Output
Setoutput_schema to a Pydantic model to return typed output. The structured result streams to the frontend as content.
See the structured output example.
Frontend Tools
Tools markedexternal_execution=True run on the frontend instead of the backend. The interface streams the tool call to the client, the client executes it, and the result returns on the next request.
external_execution_silent=True to suppress the assistant’s “I have tools to execute” message for cleaner UX.
See the agent with tools example.
Custom Events
Tools can yield custom events, which the interface delivers to the frontend in the AG-UI custom event format.Multiple Instances
Run multiple agents or teams on one server by giving eachAGUI interface a different prefix:
{prefix}/agui and {prefix}/status endpoints.
Security
The AG-UI endpoint is open by default and sets permissive CORS headers (Access-Control-Allow-Origin: *). It performs no signature verification or authentication.
Troubleshooting
ImportError: ag_ui not installed
ImportError: ag_ui not installed
Cause: The AG-UI protocol package is missing.Fix: Install it with
uv pip install 'agno[agui]'.Frontend cannot reach the backend
Frontend cannot reach the backend
Cause: Port mismatch. Dojo runs on
http://localhost:3000 and expects the backend on port 9001.Fix: Serve the backend with agent_os.serve(app=..., port=9001) and confirm the frontend points at http://localhost:9001.No streaming output in the frontend
No streaming output in the frontend
Cause: The frontend is not reading the event stream, or a proxy is buffering it.Fix: Confirm the request hits
POST {prefix}/agui and that any proxy passes text/event-stream through without buffering.CORS errors in the browser console
CORS errors in the browser console
Cause: A proxy or gateway is stripping the interface’s CORS headers.Fix: The interface sets
Access-Control-Allow-Origin: * by default. Confirm your deployment layer preserves these headers.Developer Resources
Setup Guide
Run the backend and connect a Dojo frontend step by step.
Interface Reference
Parameters, endpoints, and the Agno to AG-UI event map.
Deploy Guide
Serve the protocol endpoint for frontend integration.
Usage Examples
Tools, reasoning, structured output, teams, and multiple instances.