Migration from Apps: If you’re migrating from
AGUIApp
, see the v2 migration guide for complete steps.Example usage
1
Install backend dependencies
2
Run the backend
Expose an Agno Agent through the AG-UI interface using
AgentOS
and AGUI
.basic.py
3
Run the frontend
Use Dojo (
ag-ui
’s frontend) as an advanced, customizable interface for AG-UI agents.- Clone:
git clone https://github.com/ag-ui-protocol/ag-ui.git
- Install dependencies in
/ag-ui/typescript-sdk
:pnpm install
- Build the Agno package in
/ag-ui/integrations/agno
:pnpm run build
- Start Dojo following the instructions in the repository.
4
Chat with your Agno Agent
With Dojo running, open
http://localhost:3000
and select your Agno agent.Custom Events
Custom events you create in your tools are automatically delivered to AG-UI in the AG-UI custom event format. Creating custom events:Core Components
AGUI
(interface): Wraps an AgnoAgent
orTeam
into an AG-UI compatible FastAPI router.AgentOS.serve
: Serves your FastAPI app (including the AGUI router) with Uvicorn.
AGUI
mounts protocol-compliant routes on your app.
AGUI
interface
Main entry point for AG-UI exposure.
Initialization Parameters
Parameter | Type | Default | Description |
---|---|---|---|
agent | Optional[Agent] | None | Agno Agent instance. |
team | Optional[Team] | None | Agno Team instance. |
agent
or team
.
Key Method
Method | Parameters | Return Type | Description |
---|---|---|---|
get_router | use_async: bool = True | APIRouter | Returns the AG-UI FastAPI router and attaches endpoints. |
Endpoints
Mounted at the interface’s route prefix (root by default):POST /agui
: Main entrypoint. AcceptsRunAgentInput
fromag-ui-protocol
. Streams AG-UI events.GET /status
: Health/status endpoint for the interface.
ag-ui-protocol
docs for payload details.
Serving your AgentOS
UseAgentOS.serve
to run your app with Uvicorn.
Parameters
Parameter | Type | Default | Description |
---|---|---|---|
app | Union[str, FastAPI] | required | FastAPI app instance or import string. |
host | str | "localhost" | Host to bind. |
port | int | 7777 | Port to bind. |
reload | bool | False | Enable auto-reload for development. |