🤖AI Agents Guide
TutorialsComparisonsReviewsExamplesIntegrationsUse CasesTemplatesGlossary
Get Started
🤖AI Agents Guide

Your comprehensive resource for understanding, building, and implementing AI Agents.

Learn

  • Tutorials
  • Glossary
  • Use Cases
  • Examples

Compare

  • Tool Comparisons
  • Reviews
  • Integrations
  • Templates

Company

  • About
  • Contact
  • Privacy Policy

© 2026 AI Agents Guide. All rights reserved.

Home/Tutorials/Build an AI Agent with Agno Framework
intermediate28 min read

Build an AI Agent with Agno Framework

Learn how to build fast, multimodal AI agents using the Agno framework for Python, including memory management, persistent storage, team coordination, and support for images, audio, and video alongside text.

Vibrant colorful light streaks representing multimodal data flowing through an AI system
Photo by JJ Ying on Unsplash
By AI Agents Guide Team•February 28, 2026

Table of Contents

  1. What You'll Learn
  2. Prerequisites
  3. Step 1: Project Setup
  4. Step 2: Build a Single Agent with Memory
  5. Step 3: Add Tools to the Agent
  6. Step 4: Build a Multi-Agent Team
  7. Step 5: Multimodal Agent (Vision)
  8. What's Next
  9. Frequently Asked Questions
Man presenting at a whiteboard in a meeting.
Photo by Hoi An and Da Nang Photographer on Unsplash

Build an AI Agent with Agno Framework

Agno (formerly Phidata) is a high-performance Python framework for building multimodal AI agents. Its standout characteristics are speed — Agno agents instantiate roughly 10,000 times faster than comparable LangChain agents according to framework benchmarks — and first-class support for non-text modalities like images, audio, and video out of the box.

Agno takes an opinionated stance: agents should be simple classes, memory and storage should be pluggable, and teams of agents should be composable without complex ceremony. In this tutorial you will build a financial analysis team that combines a data-fetching agent, a quantitative analyst agent, and a report writer — all coordinated through Agno's Team abstraction with persistent SQLite memory.

What You'll Learn#

  • How to install Agno and configure it with multiple model providers
  • How to build agents with tools, memory, and persistent storage
  • How to create a Team of agents for parallel and sequential task execution
  • How to work with multimodal inputs (images) using vision-capable models
  • How to use Agno's built-in playground for interactive testing

Prerequisites#

  • Python 3.10 or higher installed
  • An OpenAI API key (Agno supports many providers; we use OpenAI here)
  • Basic understanding of AI agents and multi-agent systems
  • Familiarity with Python dataclasses and type hints

Step 1: Project Setup#

mkdir agno-agent-demo && cd agno-agent-demo
python -m venv .venv && source .venv/bin/activate

# Install Agno core + OpenAI provider + SQLite storage
pip install agno openai sqlalchemy python-dotenv

# For the web playground
pip install 'agno[playground]'

Create .env:

OPENAI_API_KEY=sk-...your-key...

Step 2: Build a Single Agent with Memory#

Agno's Agent class is the fundamental building block. Unlike heavier frameworks, it is a plain Python class you can instantiate and call directly.

# basic_agent.py
import os
from dotenv import load_dotenv
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.memory.v2.db.sqlite import SqliteMemoryDb
from agno.memory.v2.memory import Memory
from agno.storage.sqlite import SqliteStorage

load_dotenv()

# Configure persistent memory using SQLite
memory_db = SqliteMemoryDb(
    table_name="agent_memory",
    db_file="agent_data.db",
)
memory = Memory(db=memory_db)

# Configure persistent session storage (chat history)
storage = SqliteStorage(
    table_name="agent_sessions",
    db_file="agent_data.db",
)

# Create the agent
analyst = Agent(
    name="FinancialAnalyst",
    model=OpenAIChat(id="gpt-4o"),
    instructions=[
        "You are a concise financial analyst.",
        "When asked about stocks or companies, provide data-driven insights.",
        "Always mention the key risk factors alongside growth opportunities.",
        "Remember user preferences and previous conversation context.",
    ],
    memory=memory,
    storage=storage,
    # Enable memory features
    enable_agentic_memory=True,  # Agent manages its own long-term memories
    add_memory_references=True,  # Inject relevant memories into context
    markdown=True,
)


# Run a conversation
def run_conversation():
    # First turn
    response = analyst.run(
        "I'm interested in AI infrastructure stocks. What should I know?",
        stream=False,
    )
    print(response.content)

    # Second turn — agent remembers the topic from the first turn
    response2 = analyst.run(
        "What are the main risks in this sector?",
        stream=False,
    )
    print(response2.content)


if __name__ == "__main__":
    run_conversation()

Note that enable_agentic_memory=True allows the agent to proactively store and retrieve long-term facts across sessions, not just within the current conversation.

Step 3: Add Tools to the Agent#

Agno tools are Python functions decorated with @tool or any callable. The framework inspects their signatures to build tool schemas automatically.

# tools/finance_tools.py
import httpx
from typing import Optional


def get_stock_price(ticker: str) -> dict:
    """Get the current stock price and basic info for a ticker symbol.

    Args:
        ticker: Stock ticker symbol (e.g., 'AAPL', 'NVDA', 'MSFT').

    Returns:
        Dictionary with price, change, and volume data.
    """
    # In production, use Yahoo Finance, Alpha Vantage, or Polygon.io
    # Mock data for tutorial
    mock_prices = {
        "NVDA": {"price": 875.20, "change_pct": 2.3, "volume": 42_000_000, "market_cap_b": 2_150},
        "MSFT": {"price": 415.30, "change_pct": 0.8, "volume": 18_000_000, "market_cap_b": 3_080},
        "GOOGL": {"price": 195.40, "change_pct": -0.5, "volume": 22_000_000, "market_cap_b": 2_410},
        "AMD": {"price": 178.90, "change_pct": 1.7, "volume": 35_000_000, "market_cap_b": 290},
    }
    ticker_upper = ticker.upper()
    if ticker_upper not in mock_prices:
        return {"error": f"Ticker '{ticker}' not found. Available: {list(mock_prices.keys())}"}
    return {"ticker": ticker_upper, **mock_prices[ticker_upper]}


def get_earnings_summary(ticker: str, quarters: int = 4) -> dict:
    """Retrieve recent earnings data for a company.

    Args:
        ticker: Stock ticker symbol.
        quarters: Number of recent quarters to include (1-8).

    Returns:
        Dictionary with quarterly revenue and EPS data.
    """
    mock_earnings = {
        "NVDA": [
            {"quarter": "Q4 2025", "revenue_b": 39.3, "eps": 0.89, "beat": True},
            {"quarter": "Q3 2025", "revenue_b": 35.1, "eps": 0.78, "beat": True},
            {"quarter": "Q2 2025", "revenue_b": 30.0, "eps": 0.68, "beat": True},
            {"quarter": "Q1 2025", "revenue_b": 26.0, "eps": 0.61, "beat": True},
        ],
        "MSFT": [
            {"quarter": "Q4 2025", "revenue_b": 65.6, "eps": 3.23, "beat": True},
            {"quarter": "Q3 2025", "revenue_b": 61.9, "eps": 3.02, "beat": True},
            {"quarter": "Q2 2025", "revenue_b": 69.6, "eps": 3.23, "beat": False},
            {"quarter": "Q1 2025", "revenue_b": 64.7, "eps": 3.10, "beat": True},
        ],
    }
    ticker_upper = ticker.upper()
    data = mock_earnings.get(ticker_upper, [])
    return {
        "ticker": ticker_upper,
        "earnings": data[:min(quarters, len(data))],
        "data_note": "Mock data for tutorial purposes",
    }

Now build a tool-equipped analyst agent:

# tool_agent.py
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from tools.finance_tools import get_stock_price, get_earnings_summary


tool_analyst = Agent(
    name="ToolAnalyst",
    model=OpenAIChat(id="gpt-4o"),
    tools=[get_stock_price, get_earnings_summary],
    instructions=[
        "You are a quantitative financial analyst.",
        "Always fetch real data before making claims about specific companies.",
        "Present numbers clearly and compare across companies when relevant.",
    ],
    show_tool_calls=True,  # Display tool calls in output for debugging
    markdown=True,
)

response = tool_analyst.run(
    "Compare NVDA and MSFT stock performance and recent earnings. Which looks stronger?"
)
print(response.content)

Technology infrastructure with blinking server lights symbolizing Agno's storage and memory architecture

Step 4: Build a Multi-Agent Team#

Agno's Team class composes multiple agents into a collaborative unit. Teams support parallel execution (multiple agents work simultaneously), sequential execution (agents chain output to input), and route mode (a leader agent delegates to specialists).

# team.py
from agno.agent import Agent
from agno.team import Team
from agno.models.openai import OpenAIChat
from tools.finance_tools import get_stock_price, get_earnings_summary


# Agent 1: Data fetcher
data_agent = Agent(
    name="DataFetcher",
    role="Fetches current stock prices and earnings data",
    model=OpenAIChat(id="gpt-4o-mini"),  # Cost-efficient model for data tasks
    tools=[get_stock_price, get_earnings_summary],
    instructions=["Fetch all requested data. Return structured JSON summaries."],
)

# Agent 2: Quantitative analyst
quant_agent = Agent(
    name="QuantAnalyst",
    role="Performs quantitative financial analysis",
    model=OpenAIChat(id="gpt-4o"),
    instructions=[
        "Analyze the data provided by DataFetcher.",
        "Calculate growth rates, P/E ratios, and momentum indicators.",
        "Flag any earnings surprises or unusual patterns.",
    ],
)

# Agent 3: Report writer
writer_agent = Agent(
    name="ReportWriter",
    role="Produces final investment research reports",
    model=OpenAIChat(id="gpt-4o"),
    instructions=[
        "Transform quantitative analysis into clear, actionable reports.",
        "Use a professional investment research format.",
        "Always include: Summary, Key Metrics, Risks, Recommendation.",
    ],
    markdown=True,
)

# Compose into a coordinated team
research_team = Team(
    name="FinancialResearchTeam",
    mode="coordinate",  # Team leader decides how to split work
    model=OpenAIChat(id="gpt-4o"),  # Team leader model
    members=[data_agent, quant_agent, writer_agent],
    instructions=[
        "Coordinate a full research workflow: fetch data → analyze → report.",
        "Delegate appropriately to each specialist agent.",
    ],
    show_members_responses=True,
    markdown=True,
)

# Run the team on a complex query
response = research_team.run(
    "Produce a comprehensive investment research report comparing NVDA and AMD. "
    "Include earnings analysis, growth trajectories, and a clear recommendation."
)
print(response.content)

Step 5: Multimodal Agent (Vision)#

Agno supports vision inputs natively. Pass image URLs or byte arrays alongside text for models like GPT-4o:

# vision_agent.py
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.media import Image


vision_analyst = Agent(
    name="ChartAnalyst",
    model=OpenAIChat(id="gpt-4o"),
    instructions=[
        "You are a technical analysis expert who reads financial charts.",
        "When shown a chart, identify key patterns: support/resistance, trends, and signals.",
        "Provide a clear buy/hold/sell assessment with reasoning.",
    ],
)

# Pass an image URL directly
response = vision_analyst.run(
    message="Analyze this stock chart and provide technical analysis insights.",
    images=[
        Image(url="https://upload.wikimedia.org/wikipedia/commons/thumb/9/9c/Typical_Candlestick_chart.svg/320px-Typical_Candlestick_chart.svg.png")
    ],
)
print(response.content)

What's Next#

You have built a complete multi-agent financial research system with persistent memory, tools, and team coordination. Recommended next steps:

  • Explore LlamaIndex: For heavy RAG workloads, building an agent with LlamaIndex covers data-aware agents in depth
  • CrewAI comparison: See building with CrewAI for a role-based team framework with a different coordination approach
  • AutoGen patterns: Learn building with AutoGen for conversational multi-agent systems
  • Understand tool use: Read the tool use glossary entry for deeper context on how agents decide to call functions
  • Agent framework overview: See the agent framework glossary entry for a landscape view

Frequently Asked Questions#

How does Agno compare to LangChain in terms of performance?

Agno's benchmark shows agent instantiation roughly 10,000x faster than LangChain agents. This matters in serverless or high-throughput environments where agents are created per request. The tradeoff is that Agno has a smaller ecosystem of pre-built integrations compared to LangChain's extensive connector library.

What storage backends does Agno support?

Agno supports SQLite (built-in, no setup), PostgreSQL, MySQL, and MongoDB for both memory and session storage. For vector memory, it integrates with PgVector, Pinecone, Weaviate, and Qdrant. The storage layer is abstracted so you can switch backends without changing agent code.

Can Agno agents run asynchronously?

Yes. All Agno agents support both synchronous (agent.run()) and asynchronous (await agent.arun()) interfaces. The Team class also supports async execution, which is important for running parallel member agents concurrently.

What is the difference between memory and storage in Agno?

Storage persists the full conversation history (chat messages) across sessions — it is the "short-term" context that gets injected into the model's context window. Memory is semantic, long-term knowledge — facts and preferences the agent has extracted from conversations that get retrieved by relevance, not sequentially. Both are necessary for persistent, personalized agents.

Does Agno support streaming responses?

Yes. Pass stream=True to agent.run() and iterate over the response stream. This is useful for real-time user interfaces where you want to display tokens as they arrive rather than waiting for the full response.

Related Tutorials

How to Create a Meeting Scheduling AI Agent

Build an autonomous AI agent to handle meeting scheduling, calendar checks, and bookings intelligently. This step-by-step tutorial covers Python implementation with LangChain, Google Calendar integration, and advanced features like conflict resolution for efficient automation.

How to Manage Multiple AI Agents

Master managing multiple AI agents with this in-depth tutorial. Learn orchestration, state sharing, parallel execution, and scaling using LangGraph and custom tools. From basics to production-ready swarms for complex tasks.

How to Train an AI Agent on Your Own Data

Master training AI agents on custom data with three methods: context stuffing, RAG using vector databases, and fine-tuning. This beginner-to-advanced guide includes step-by-step code examples, pitfalls, and best practices to build knowledgeable agents for your specific needs.

← Back to All Tutorials