Back to Agno

The Agent Quickstart: 12 Guided Cookbooks

cookbook/00_quickstart/README.md

2.6.46.0 KB
Original Source

The Agent Quickstart: 12 Guided Cookbooks

Learn how to build agents with 12 guided cookbooks. We'll go from single tool-using agent to multi-agent teams and step-based workflows through clean, runnable examples.

Each example can be run independently and contains detailed comments to help you understand what's happening under the hood. We'll use Gemini 3 Flash — fast, affordable, and excellent at tool calling but you can swap in any model with a one line change.

What You'll Build

#FileWhat You'll LearnKey Features
01agent_with_tools.pyGive an agent tools to fetch real-time dataTool Calling, Data Fetching
02agent_with_structured_output.pyReturn typed Pydantic objectsStructured Output, Type Safety
03agent_with_typed_input_output.pyFull type safety on input and outputInput Schema, Output Schema
04agent_with_storage.pyPersist conversations across runsPersistent Storage, Session Management
05agent_with_memory.pyRemember user preferences across sessionsMemory Manager, Personalization
06agent_with_state_management.pyTrack, modify, and persist structured stateSession State, State Management
07agent_search_over_knowledge.pyLoad documents into a knowledge base and search with hybrid searchChunking, Embedding, Hybrid Search, Agentic Retrieval
08custom_tool_for_self_learning.pyHow to write your own tools and add self-learning capabilitiesCustom Tools, Self-Learning
09agent_with_guardrails.pyAdd input validation and safety checksGuardrails, PII Detection, Prompt Injection
10human_in_the_loop.pyRequire user confirmation before executing toolsHuman in the Loop, Tool Confirmation
11multi_agent_team.pyCoordinate multiple agents by organizing them into a teamMulti-Agent Team, Dynamic Collaboration
12sequential_workflow.pySequentially execute agents/teams/functionsAgentic Workflow, Pipelines

Key Concepts

ConceptWhat It DoesWhen to Use
ToolsLet agents take actionsFetch data, call APIs, run code
StoragePersist conversation historyMulti-turn conversations and state management
KnowledgeSearchable document storeRAG, documentation Q&A
MemoryRemember user preferencesPersonalization
StateStructured data the agent managesTracking progress, managing lists
TeamsMultiple agents collaboratingDynamic collaboration of specialized agents
WorkflowsSequential agent pipelinesPredictable multi-step processes and data flow
GuardrailsValidate and filter inputBlock PII, prevent prompt injection
Human in the LoopRequire confirmation for actionsSensitive operations, safety-critical tools

Getting Started

1. Clone the repo

bash
git clone https://github.com/agno-agi/agno.git
cd agno

2. Create and activate a virtual environment

bash
uv venv .venvs/quickstart --python 3.12
source .venvs/quickstart/bin/activate

3. Install dependencies

bash
uv pip install -r cookbook/00_quickstart/requirements.txt

4. Set your API key

bash
export GOOGLE_API_KEY=your-google-api-key

5. Run any cookbook

bash
python cookbook/00_quickstart/agent_with_tools.py

That's it. No Docker, no Postgres — just Python and an API key.

Run via Agent OS

Agent OS provides a web interface for interacting with your agents. Start the server:

bash
python cookbook/00_quickstart/run.py

Then visit os.agno.com and add http://localhost:7777 as an endpoint.

Here's how it looks in action — chat with your agents, explore sessions, monitor traces, manage knowledge and memories, all through a beautiful visual UI.

https://github.com/user-attachments/assets/aae0086b-86f6-4939-a0ce-e1ec9b87ba1f

[!TIP] To run the agent-with-knowledge, remember to load the knowledge base first using:

bash
python cookbook/00_quickstart/agent_search_over_knowledge.py

Swap Models Anytime

Agno is model-agnostic. Same code, different provider:

python
# Gemini (default in these examples)
from agno.models.google import Gemini
model = Gemini(id="gemini-3-flash-preview")

# OpenAI
from agno.models.openai import OpenAIResponses
model = OpenAIResponses(id="gpt-5.2")

# Anthropic
from agno.models.anthropic import Claude
model = Claude(id="claude-sonnet-4-5")

Run Cookbooks Individually

bash
# 01 - Tools: Fetch real market data
python cookbook/00_quickstart/agent_with_tools.py

# 02 - Structured Output: Get typed responses
python cookbook/00_quickstart/agent_with_structured_output.py

# 03 - Typed I/O: Full type safety
python cookbook/00_quickstart/agent_with_typed_input_output.py

# 04 - Storage: Remember conversations
python cookbook/00_quickstart/agent_with_storage.py

# 05 - Memory: Remember user preferences
python cookbook/00_quickstart/agent_with_memory.py

# 06 - State: Manage watchlists
python cookbook/00_quickstart/agent_with_state_management.py

# 07 - Knowledge: Search your documents
python cookbook/00_quickstart/agent_search_over_knowledge.py

# 08 - Custom Tools: Write your own
python cookbook/00_quickstart/custom_tool_for_self_learning.py

# 09 - Guardrails: Input validation and safety
python cookbook/00_quickstart/agent_with_guardrails.py

# 10 - Human in the Loop: Confirm before executing
python cookbook/00_quickstart/human_in_the_loop.py

# 11 - Teams: Bull vs Bear analysis
python cookbook/00_quickstart/multi_agent_team.py

# 12 - Workflows: Research pipeline
python cookbook/00_quickstart/sequential_workflow.py

Async Patterns

All examples in this Quick Start use synchronous code for simplicity. For async/await patterns (recommended for production), see cookbook/02_agents/ which includes async variants of most features.

Learn More