Skip to main content

What we’re building

In this quickstart, you’ll create a simple Agent that can understand and respond to questions. You’ll see it work in seconds, then learn how to make it production-ready. Agents are programs where a language model controls the flow of execution.

Step 1: Install and configure

1

Install Agno

Install Agno and your model provider SDK:
pip install agno openai
You can use any model provider. For Claude, install anthropic instead of openai. See all supported models.
2

Set your API key

Get your API key from your model provider and set it as an environment variable:
export OPENAI_API_KEY=sk-***
For Claude, use ANTHROPIC_API_KEY instead. On Windows, you may need to restart your terminal after setting the environment variable.

Step 2: Create your first Agent

Create a file called agent.py:
agent.py
from agno.agent import Agent
from agno.models.openai import OpenAIChat

# Create your Agent
agent = Agent(
    model=OpenAIChat(id="gpt-4o-mini"),
    instructions="You are a helpful AI assistant.",
    markdown=True,
)

# Run
agent.print_response("What is artificial intelligence?", stream=True)

Step 3: Run your Agent

python agent.py
Your agent will process the input and stream its response directly to your terminal.
You’ve successfully created and run your first Agent. In just a few lines of code, you have a working agent that can understand questions and generate responses.

What’s next?

Now that you have a working agent, here are some ways to extend it:

Add tools

Give your agent access to external tools via MCP (Model Context Protocol). MCP enables your agent to interact with external systems through a standardized interface. In this example, we’ll use the Agno MCP server:
agent.py
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.mcp import MCPTools

agent = Agent(
    model=OpenAIChat(id="gpt-4o-mini"),
     # Add the Agno MCP server to the Agent
    tools=[MCPTools(transport="streamable-http", url="https://docs.agno.com/mcp")],
    instructions="You are a helpful AI assistant.",
    markdown=True,
)
Learn more about MCP tools and all available tools.

Add short-term memory

Store conversation history in a database:
agent.py
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.db.sqlite import SqliteDb

agent = Agent(
    model=OpenAIChat(id="gpt-4o-mini"),
    db=SqliteDb(db_file="agent.db"),  # Store conversations
    add_history_to_context=True,  # Remember previous messages
    instructions="You are a helpful AI assistant.",
    markdown=True,
)
Learn more about sessions and memory.

Deploy as an API

Turn your agent into a production-ready API using AgentOS. Update your agent.py:
agent.py
from agno.os import AgentOS
from agno.agent import Agent

agent = Agent(...)

agent_os = AgentOS(agents=[agent])
app = agent_os.get_app()

if __name__ == "__main__":
    agent_os.serve(app="agent:app", reload=True)
Then run it:
python agent.py
This creates a FastAPI server with REST endpoints, streaming support, and a web interface. Read more about AgentOS.

Connect to AgentOS Control Plane

Agno provides a web interface called the AgentOS Control Plane that connects to your AgentOS. Use it to monitor, manage and test your agentic system.
  1. Open os.agno.com and sign in to your account
  2. Click “Add new OS” in the top navigation bar
  3. Select “Local” to connect to a local AgentOS running on your machine
  4. Enter the endpoint URL (default is http://localhost:8000)
  5. Give your AgentOS a descriptive name and click “Connect”

Chat with your Agent

Once connected, go to the Chat section in the sidebar and select your Agent. You can now interact with your agent through the web interface!
Learn more about creating your first AgentOS.

Next steps

Happy building!