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

# Basic

> Run a basic Agno agent as a Discord bot with conversation history.

## Code

```python basic.py theme={null}
from agno.agent import Agent
from agno.integrations.discord import DiscordClient
from agno.models.openai import OpenAIChat

basic_agent = Agent(
    name="Basic Agent",
    model=OpenAIChat(id="gpt-4o"),
    add_history_to_context=True,
    num_history_runs=3,
    add_datetime_to_context=True,
)

discord_agent = DiscordClient(basic_agent)
if __name__ == "__main__":
    discord_agent.serve()
```

## Usage

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

**1. Set your API keys**

```bash theme={null}
export OPENAI_API_KEY=xxx
export DISCORD_BOT_TOKEN=xxx
```

**2. Install dependencies**

```bash theme={null}
uv pip install -U agno openai discord.py
```

**3. Run Agent**

Save the code above as `basic.py`, then run:

```bash theme={null}
python basic.py
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.