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

# Your First Agent

> Build and run your first agent in 20 lines of code.

Let's build an agent that can answer questions about Agno, remembers previous conversations, and runs as a production API — all in about 20 lines.

Save the following code as `agno_assist.py`:

```python agno_assist.py lines theme={null}
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.anthropic import Claude
from agno.os import AgentOS
from agno.tools.mcp import MCPTools

agno_assist = Agent(
    name="Agno Assist",
    model=Claude(id="claude-sonnet-4-5"),
    db=SqliteDb(db_file="agno.db"),                     # session storage
    tools=[MCPTools(url="https://docs.agno.com/mcp")],  # Agno docs via MCP
    add_datetime_to_context=True,
    add_history_to_context=True,                         # include past runs
    num_history_runs=3,                                  # last 3 conversations
    markdown=True,
)

# Serve via AgentOS → streaming, auth, session isolation, API endpoints
agent_os = AgentOS(agents=[agno_assist])
app = agent_os.get_app()
```

<Check>
  That's it. This gives you streaming responses, per-user session isolation, and a full API — no extra configuration.
</Check>

## Run your AgentOS

<Steps>
  <Step title="Set up your virtual environment">
    <CodeGroup>
      ```bash Mac theme={null}
      uv venv --python 3.12
      source .venv/bin/activate
      ```

      ```bash Windows theme={null}
      uv venv --python 3.12
      .venv\Scripts\activate
      ```
    </CodeGroup>
  </Step>

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U 'agno[os]' anthropic mcp
    ```
  </Step>

  <Step title="Export your Anthropic API key">
    <CodeGroup>
      ```bash Mac theme={null}
      export ANTHROPIC_API_KEY=sk-***
      ```

      ```bash Windows theme={null}
      setx ANTHROPIC_API_KEY sk-***
      ```
    </CodeGroup>
  </Step>

  <Step title="Run your AgentOS">
    ```bash theme={null}
    fastapi dev agno_assist.py
    ```

    This starts your AgentOS at `http://localhost:8000`. View the auto-generated API docs at `http://localhost:8000/docs`. You can add your own routes, middleware, or any FastAPI feature on top.
  </Step>
</Steps>

## Connect to the AgentOS UI

The [AgentOS UI](https://os.agno.com) connects directly to your runtime, letting you monitor, manage, and test your agents.

1. Open [os.agno.com](https://os.agno.com) and sign in.
2. Click **"Add new OS"** in the top navigation.
3. Select **"Local"** to connect to a local AgentOS.
4. Enter your endpoint URL (default: `http://localhost:8000`).
5. Name it something like "Development OS".
6. Click **"Connect"**.

<Frame>
  <video autoPlay muted loop controls playsInline style={{ borderRadius: "0.5rem", width: "100%", height: "auto" }}>
    <source src="https://mintcdn.com/agno-v2-includ-tool-results-in-member-responses/qy-j_trNWS-WIHEv/videos/agent-os-connect-1.mp4?fit=max&auto=format&n=qy-j_trNWS-WIHEv&q=85&s=c3573d0669bb84367885485240bdce95" type="video/mp4" data-path="videos/agent-os-connect-1.mp4" />
  </video>
</Frame>

Once connected, you'll see your OS with a live status indicator.

## Chat with your Agent

Go to **Chat** in the sidebar, select your Agent, and ask "What is Agno?" — the agent will pull from the Agno docs MCP server to answer.

<Frame>
  <video autoPlay muted loop controls playsInline style={{ borderRadius: "0.5rem", width: "100%", height: "auto" }}>
    <source src="https://mintcdn.com/agno-v2-includ-tool-results-in-member-responses/qy-j_trNWS-WIHEv/videos/agno-agent-chat.mp4?fit=max&auto=format&n=qy-j_trNWS-WIHEv&q=85&s=97e88105a6cc39965b1a4abf54eaa7c6" type="video/mp4" data-path="videos/agno-agent-chat.mp4" />
  </video>
</Frame>

<Tip>
  Click **Sessions** in the sidebar to view your Agent's conversations. Data is stored in your local database — no third-party tracing required.
</Tip>

## Next

* [Explore the SDK →](/agents/overview)
* [Deploy AgentOS to your cloud →](/deploy/introduction)
* [Browse 2000+ code examples →](/examples/introduction)
