AG-UI, or Agent-User Interaction Protocol, is a protocol standarizing how AI agents connect to front-end applications.

Example usage

1

Install the backend dependencies

pip install agno ag-ui-protocol
2

Run the backend

Now let’s run a AGUIApp exposing an Agno Agent. You can use the previous code!

3

Run the frontend

You can use Dojo, an advanced and customizable option to use as frontend for AG-UI agents.

  1. Clone the project: git clone https://github.com/ag-ui-protocol/ag-ui.git
  2. Follow the instructions here to learn how to install the needed dependencies and run the project.
  3. Remember to install the dependencies in /ag-ui/typescript-sdk with pnpm install, and to build the Agno package in /integrations/agno with pnpm run build.
  4. You can now run your Dojo! It will show our Agno agent as one of the available options.
4

Chat with your Agno Agent

Done! If you are running Dojo as your front-end, you can now go to http://localhost:3000 in your browser and chat with your Agno Agent.

You can see more examples in our AG-UI integration examples section.

Core Components

  • 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 Class

Main entry point for Agno AG-UI apps.

Initialization Parameters

ParameterTypeDefaultDescription
agentOptional[Agent]NoneAgno Agent instance.
teamOptional[Team]NoneAgno Team instance.
settingsOptional[APIAppSettings]NoneAPI configuration. Defaults if None.
api_appOptional[FastAPI]NoneExisting FastAPI app. New one created if None.
routerOptional[APIRouter]NoneExisting APIRouter. New one created if None.
app_idOptional[str]NoneApp identifier (autogenerated if not set).
nameOptional[str]NoneName for the App.
descriptionOptional[str]NoneDescription for the App.

Provide agent or team, not both.

Key Method

MethodParametersReturn TypeDescription
get_appuse_async: bool = TrueFastAPIReturns configured FastAPI app (async by default). Sets prefix, error handlers, CORS, docs.

Endpoints

Endpoints are available at the specified prefix (default /v1).

1. POST /agui

This is the main entrypoint to interact with your Agno Agent or Team.

It expects a RunAgentInput object (from the ag-ui-protocol package) as defined by the protocol. You can read more about it in their docs.

Serving the Application (serve)

Serves the FastAPI app using Uvicorn.

Parameters

ParameterTypeDefaultDescription
appUnion[str, FastAPI]N/AFastAPI app instance or import string (Required).
hoststr"localhost"Host to bind.
portint7777Port to bind.
reloadboolFalseEnable auto-reload for development.

You can check some usage examples in our AG-UI integration examples section.