Quick Start with the Agno Multi-Agent Framework
This document aims to help beginners quickly grasp the core concepts and basic usage of the agno
library through a simpler, more understandable example, and to explain its internal working principles.
Quick Start Guide for agno
agno
is a powerful Python library for building, managing, and orchestrating autonomous AI agents. Whether you want to create a standalone agent or a team of collaborating agents to solve complex problems, agno
provides modular and extensible tools to realize your ideas.
This guide will walk you through the core components of agno
using a simple "Researcher and Writer Team" example.
Core Concepts
Before we start, let's understand a few core concepts of agno
:
- Model: The "brain" of the agent, responsible for reasoning, inference, and content generation.
agno
supports multiple models, such asOllama
(for running open-source models like Llama 3 locally). - Tools: The toolbox that gives agents concrete abilities to interact with the outside world, such as web search, database queries, or fetching financial data.
- Agent: An agent is a combination of model, tools, and instructions. It is assigned a specific role and goal, and uses its tools to complete tasks.
- Team: When a single agent is not enough to solve a complex problem, you can create a team. A team consists of multiple agents, coordinated by a leader (also a model), to collaboratively achieve a larger goal.
- Memory: The memory system allows agents and teams to remember previous interactions, enabling stateful, continuous dialogue and task processing.
Practical Example: Creating a "Researcher and Writer" Team
Our goal is to create a team that can receive a research topic and then:
- Researcher Agent: Uses web search tools to find relevant information.
- Writer Agent: Organizes the information found by the researcher into a clear summary.
Step 1: Environment Setup and Model Initialization
First, make sure you have installed the agno
library. Then, import the necessary modules and initialize the LLM you will use.
# Import core modules
from agno.agent import Agent
from agno.models.ollama import Ollama
from agno.tools.duckduckgo import DuckDuckGoTools
from agno.tools.reasoning import ReasoningTools
from agno.team import Team
# Initialize an Ollama model as the "brain" of our agents
# Make sure your Ollama service is running and the required model is downloaded
# Replace the host address with your own Ollama service address
ollama_model = Ollama(id="llama3", # Use a smaller model for faster response
timeout=60,
host="http://127.0.0.1:11434") # Example address, replace as needed
Step 2: Create Agents
Next, we define two agents with different roles.
- Researcher Agent: Responsible for searching the web, so we equip it with the
DuckDuckGoTools
tool. - Writer Agent: Responsible for analyzing and summarizing information, so we equip it with
ReasoningTools
to help it think and organize content.
# Create a "Researcher" agent dedicated to web search
researcher_agent = Agent(
name="Researcher",
role="Responsible for searching, finding, and collecting relevant information on the internet based on the specified topic.",
model=ollama_model,
tools=[DuckDuckGoTools()], # Give it the DuckDuckGo search tool
instructions="Focus on finding accurate and authoritative sources.",
add_datetime_to_instructions=True,
)
# Create a "Writer" agent dedicated to writing and summarizing
writer_agent = Agent(
name="Writer",
role="Responsible for analyzing, refining, and summarizing the collected information, ultimately producing a clear and well-structured article.",
model=ollama_model,
tools=[ReasoningTools(add_instructions=True)], # Give it reasoning and thinking tools
instructions="Ensure your output is well-structured, fluent, and highlights key points.",
add_datetime_to_instructions=True,
)
Step 3: Build the Team
Now, we combine these two agents into a team. The team's coordinator (model
) is responsible for understanding the overall task and assigning subtasks to the most suitable members.
# Create a "Research and Writing Team"
research_team = Team(
name="Research and Writing Team",
mode="coordinate", # Use coordination mode, letting the team leader assign tasks
model=ollama_model, # The team itself also needs a "brain" to coordinate work
members=[researcher_agent, writer_agent], # Add our agents to the team
instructions=[
"Collaborate efficiently: first conduct information retrieval, then summarize the results into a report.",
"Only output the final report integrated by the Writer agent.",
"Ensure the report is comprehensive and accurate.",
],
markdown=True,
show_members_responses=True, # Useful for debugging to see each member's output
enable_agentic_context=True,
add_datetime_to_instructions=True,
)
Step 4: Run the Team and Ask a Question
The team is ready! Now, let's assign it a task and see how the agents collaborate.
if __name__ == "__main__":
# Assign a research topic to the team
question = "Introduce the main advantages and common application areas of the Python language."
# Run the team and stream the results
research_team.print_response(
question,
stream=True,
show_full_reasoning=True, # Show detailed reasoning process
stream_intermediate_steps=True,
)
Internal Working Principle Analysis
When you run the above code, what happens inside agno
?
- Task Assignment:
- The user's question "Introduce the main advantages and common application areas of Python" is sent to
research_team
. - The team's coordinator (
team.model
) analyzes the question and the roles of the team members (members
). It determines that to answer this question, information must first be gathered.
- The user's question "Introduce the main advantages and common application areas of Python" is sent to
- Researcher Executes Task:
- The coordinator assigns a subtask: "Search for the advantages and application areas of Python" to the most suitable member—
Researcher
agent. - The
Researcher
agent receives the task and uses its only tool,DuckDuckGoTools
, to search the web.
- The coordinator assigns a subtask: "Search for the advantages and application areas of Python" to the most suitable member—
- Information Transfer:
- After the
Researcher
completes the search, it returns the original sources (e.g., web links, summaries) to the team coordinator.
- After the
- Writer Executes Task:
- The coordinator now has the original sources. It determines the next step is "summarize and write."
- It sends these sources along with a new instruction (e.g., "Based on the following information, write a report on Python's advantages and applications") to the
Writer
agent.
- Generate Final Report:
- The
Writer
agent receives the information and instruction. Using its model andReasoningTools
, it analyzes, refines, organizes, and polishes the content, ultimately producing a structured report.
- The
- Output Result:
- Since the team's instructions require "only output the final report," the coordinator presents the report generated by the
Writer
agent as the team's final result to the user.
- Since the team's instructions require "only output the final report," the coordinator presents the report generated by the

Through this approach, agno
automatically decomposes a complex task and leverages the strengths of different agents to collaborate efficiently, ultimately achieving the goal. We hope this simple example helps you start your journey with agno
!