This guide walks through the basics of building Agents with Agno.

The examples build on each other, introducing new concepts and capabilities progressively. Each example contains detailed comments, example prompts, and required dependencies.

Setup

Create a virtual environment:

python3 -m venv .venv
source .venv/bin/activate

Install the required dependencies:

pip install openai duckduckgo-search yfinance lancedb tantivy pypdf requests exa-py newspaper4k lxml_html_clean sqlalchemy agno

Export your OpenAI API key:

export OPENAI_API_KEY=your_api_key

Examples

Basic Agent

Build a news reporter with a vibrant personality. This Agent only shows basic LLM inference.

Agent with Tools

Add web search capabilities using DuckDuckGo for real-time information gathering.

Agent with Knowledge

Add a vector database to your agent to store and search knowledge.

Agent with Storage

Add persistence to your agents with session management and history capabilities.

Agent Team

Create an agent team specializing in market research and financial analysis.

Structured Output

Generate a structured output using a Pydantic model.

Custom Tools

Create and integrate custom tools with your agent.

Research Agent

Build an AI research agent using Exa with controlled output steering.

Research Workflow

Create a research workflow combining web searches and content scraping.

Image Agent

Create an agent that can understand images.

Image Generation

Create an Agent that can generate images using DALL-E.

Video Generation

Create an Agent that can generate videos using ModelsLabs.

Audio Agent

Create an Agent that can process audio input and generate responses.

Agent with State

Create an Agent with session state management.

Agent Context

Evaluate dependencies at agent.run and inject them into the instructions.

Agent Session

Create an Agent with persistent session memory across conversations.

User Memories

Create an Agent that stores user memories and summaries.

Function Retries

Handle function retries for failed or unsatisfactory outputs.

Human in the Loop

Add user confirmation and safety checks for interactive agent control.

Each example includes runnable code and detailed explanations. We recommend following them in order, as concepts build upon previous examples.