> ## Documentation Index
> Fetch the complete documentation index at: https://phidatainc-agui.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Basic AG-UI Agent

> Connect an Agno agent to a web frontend over the AG-UI protocol.

## Code

```python cookbook/05_agent_os/interfaces/agui/basic.py theme={null}
from agno.agent.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.os import AgentOS
from agno.os.interfaces.agui import AGUI

chat_agent = Agent(
    name="Assistant",
    model=OpenAIResponses(id="gpt-5.4"),
    instructions="You are a helpful AI assistant.",
    add_datetime_to_context=True,
    markdown=True,
)

agent_os = AgentOS(
    agents=[chat_agent],
    interfaces=[AGUI(agent=chat_agent)],
)
app = agent_os.get_app()

if __name__ == "__main__":
    agent_os.serve(app="basic:app", reload=True, port=9001)
```

## Usage

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Set Environment Variables">
    ```bash theme={null}
    export OPENAI_API_KEY=your_openai_api_key
    ```
  </Step>

  <Step title="Install Dependencies">
    ```bash theme={null}
    uv pip install 'agno[agui]'
    ```
  </Step>

  <Step title="Run Example">
    ```bash theme={null}
    python cookbook/05_agent_os/interfaces/agui/basic.py
    ```
  </Step>
</Steps>

## Key Features

* **Web Interface**: Browser-based chat through an AG-UI frontend like Dojo or CopilotKit
* **Real-Time Streaming**: Responses stream token-by-token
* **Markdown Support**: Rich text formatting in responses
* **DateTime Context**: Time-aware responses via `add_datetime_to_context`
* **Open Protocol**: Works with any AG-UI-compatible frontend

## Setup Frontend

1. Clone the AG-UI repository: `git clone https://github.com/ag-ui-protocol/ag-ui.git`
2. Install the TypeScript SDK: `cd ag-ui/typescript-sdk && pnpm install`
3. Build the Agno integration: `cd integrations/agno && pnpm run build`
4. Start Dojo: `cd ../../apps/dojo && pnpm run dev`
5. Open `http://localhost:3000` and select the Agno integration
