Your first Agent
What are Agents?
Agents are autonomous programs that use language models to achieve tasks. They solve problems by running tools, accessing knowledge and memory to improve responses.
Instead of a rigid binary definition, let’s think of Agents in terms of agency and autonomy.
- Level 0: Agents with no tools (basic inference tasks).
- Level 1: Agents with tools for autonomous task execution.
- Level 2: Agents with knowledge, combining memory and reasoning.
- Level 3: Teams of agents collaborating on complex workflows.
Basic Agent
To run the agent, install dependencies and export your OPENAI_API_KEY
.
Setup your virtual environment
Install dependencies
Export your OpenAI key
Run the agent
Agent with tools
This basic agent will obviously make up a story, lets give it a tool to search the web.
Install dependencies and run the Agent
Install dependencies
Run the agent
Now you should see a much more relevant result.
Agent with knowledge
Agents can store knowledge in a vector database and use it for RAG or dynamic few-shot learning.
Agno agents use Agentic RAG by default, which means they will search their knowledge base for the specific information they need to achieve their task.
Install dependencies and run the Agent
Install dependencies
Run the agent
Multi Agent Teams
Agents work best when they have a singular purpose, a narrow scope and a small number of tools. When the number of tools grows beyond what the language model can handle or the tools belong to different categories, use a team of agents to spread the load.
Install dependencies and run the Agent team
Install dependencies
Run the agent
Debugging
Want to see the system prompt, user messages and tool calls?
Agno includes a built-in debugger that will print debug logs in the terminal. Set debug_mode=True
on any agent or set AGNO_DEBUG=true
in your environment.
Run the agent to view debug logs in the terminal: