Let’s create an agent that organizes a messy folder. It walks through the folder, categorizes the files and proposes a clean layout.Documentation Index
Fetch the complete documentation index at: https://agno-v2-ab-home-page-updates-5-16.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Create your Agent
Save the following code assorting_hat.py:
sorting_hat.py
Run your Agent
Export your OpenAI API key
Don’t have one? Get a key from platform.openai.com.
Run your Agent as a Service
The code above is a one-run python script. If we need our agent to do anything useful, we need to run it as a service. We should also:- Add session storage, so we can have a conversation with our agent. Agno automatically manages session read, write and context injection for you.
- Add memory, so our agent learns from our usage patterns. Agno automatically handles memory management and exposes an
update_user_memorytool to the agent.
workbench.py:
workbench.py
Confirm server is running
Your AgentOS is now running at
http://localhost:8000.Open http://localhost:8000/docs to view the API docs.- A stateful agent served as a production API
- Session storage and conversation history
- Tracing on every run
- Per-session isolation, with JWT-based RBAC available for multi-user isolation
Give your Agent a UI
The code above runs our agent as a service using AgentOS. AgentOS is a FastAPI-based runtime that serves agents and related operations as REST APIs. AgentOS also comes with a UI, available at: os.agno.com. It connects directly from your browser to the running API. Use it to test, monitor, and manage your agents in real time.- Open os.agno.com and sign in.
- Click “Connect OS”
- Select “Local”, enter your endpoint URL (default:
http://localhost:8000), name it “Local AgentOS”, and click “Connect”.