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

# Basic

> Expose an OpenAI agent through the AG-UI protocol.

## Code

```python 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 -U "agno[os,agui]" openai
    ```
  </Step>

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

## Key Features

* **AG-UI endpoint**: Connect the agent to an AG-UI-compatible frontend
* **Streaming events**: Stream agent responses to the frontend
* **Markdown support**: Return Markdown-formatted responses
* **Datetime context**: Include the current date and time in the agent context
* **Open protocol**: Use AG-UI events and message formats

## Setup Frontend

Create an AG-UI application:

```bash theme={null}
npx create-ag-ui-app@latest
```

* [AG-UI application quickstart](https://docs.ag-ui.com/quickstart/applications)
* [AG-UI Dojo](https://dojo.ag-ui.com/)
