Build your first Agent
Let’s build an Agent that connects to an MCP server, persists conversation state, and is served via FastAPI. Save the following code asagno_agent.py:
agno_agent.py
In ~20 lines: an Agent with memory, state, and MCP tools, served via FastAPI with pre-built endpoints.
Run your AgentOS
Connect to the AgentOS UI
The AgentOS UI connects directly to your runtime, letting you monitor, manage, and test your system.- Open os.agno.com and sign in.
- Click “Add new OS” in the top navigation.
- Select “Local” to connect to a local AgentOS.
- Enter your endpoint URL (default:
http://localhost:8000). - Name it something like “Development OS”.
- Click “Connect”.
Chat with your Agent
Go to Chat in the sidebar and select your Agent.- Ask “What is Agno?” and the Agent will answer using the Agno MCP server.
- Each Agent maintains its own history, tools, and instructions. Switching users won’t mix context.
Pre-built API endpoints
The FastAPI app includes SSE-compatible endpoints you can build on. Add your own routes, middleware, or any FastAPI feature. View the API docs athttp://localhost:8000/docs.