Expose your Agno Agent as a AG-UI compatible app
Install the backend dependencies
Run the backend
AGUIApp
exposing an Agno Agent. You can use the previous code!Run the frontend
git clone https://github.com/ag-ui-protocol/ag-ui.git
/ag-ui/typescript-sdk
with pnpm install
, and to build the Agno package in /integrations/agno
with pnpm run build
.Chat with your Agno Agent
AGUIApp
: Wraps Agno agents/teams for in a FastAPI app.serve
: Serves the FastAPI AG-UI app using Uvicorn.AGUIApp
uses helper functions for routing.
AGUIApp
ClassParameter | Type | Default | Description |
---|---|---|---|
agent | Optional[Agent] | None | Agno Agent instance. |
team | Optional[Team] | None | Agno Team instance. |
settings | Optional[APIAppSettings] | None | API configuration. Defaults if None . |
api_app | Optional[FastAPI] | None | Existing FastAPI app. New one created if None . |
router | Optional[APIRouter] | None | Existing APIRouter. New one created if None . |
app_id | Optional[str] | None | App identifier (autogenerated if not set). |
name | Optional[str] | None | Name for the App. |
description | Optional[str] | None | Description for the App. |
agent
or team
, not both.
Method | Parameters | Return Type | Description |
---|---|---|---|
get_app | use_async: bool = True | FastAPI | Returns configured FastAPI app (async by default). Sets prefix, error handlers, CORS, docs. |
prefix
(default /v1
).
POST /agui
RunAgentInput
object (from the ag-ui-protocol
package) as defined by the protocol. You can read more about it in their docs.
serve
)Parameter | Type | Default | Description |
---|---|---|---|
app | Union[str, FastAPI] | N/A | FastAPI app instance or import string (Required). |
host | str | "localhost" | Host to bind. |
port | int | 7777 | Port to bind. |
reload | bool | False | Enable auto-reload for development. |