repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/reasoning/02_async_multi_purpose_reasoning_team.py
cookbook/04_teams/reasoning/02_async_multi_purpose_reasoning_team.py
""" This example demonstrates an async multi-purpose reasoning team. The team uses reasoning tools to analyze questions and delegate to appropriate specialist agents asynchronously, showcasing coordination and intelligent task routing. """ import asyncio from pathlib import Path from agno.agent import Agent from agn...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/reasoning/__init__.py
cookbook/04_teams/reasoning/__init__.py
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/reasoning/01_reasoning_multi_purpose_team.py
cookbook/04_teams/reasoning/01_reasoning_multi_purpose_team.py
""" This example demonstrates a team of agents that can answer a variety of questions. The team uses reasoning tools to reason about the questions and delegate to the appropriate agent. The team consists of: - A web agent that can search the web for information - A finance agent that can get financial data - A writer...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/distributed_rag/01_distributed_rag_pgvector.py
cookbook/04_teams/distributed_rag/01_distributed_rag_pgvector.py
""" This example demonstrates how multiple specialized agents coordinate to provide comprehensive RAG responses using distributed PostgreSQL vector databases with pgvector for scalable, production-ready retrieval. Team Composition: - Vector Retriever: Specialized in vector similarity search using pgvector - Hybrid Sea...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/distributed_rag/03_distributed_rag_with_reranking.py
cookbook/04_teams/distributed_rag/03_distributed_rag_with_reranking.py
""" This example demonstrates how multiple specialized agents coordinate to provide comprehensive RAG responses using advanced reranking strategies for optimal information retrieval and synthesis. Team Composition: - Initial Retriever: Performs broad initial retrieval from knowledge base - Reranking Specialist: Applie...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/distributed_rag/__init__.py
cookbook/04_teams/distributed_rag/__init__.py
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/distributed_rag/02_distributed_rag_lancedb.py
cookbook/04_teams/distributed_rag/02_distributed_rag_lancedb.py
""" This example demonstrates how multiple specialized agents coordinate to provide comprehensive RAG responses using distributed knowledge bases and specialized retrieval strategies with LanceDB. Team Composition: - Primary Retriever: Handles primary document retrieval from main knowledge base - Context Expander: Exp...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/session/01_persistent_session.py
cookbook/04_teams/session/01_persistent_session.py
from agno.agent.agent import Agent from agno.db.postgres import PostgresDb from agno.models.openai import OpenAIChat from agno.team import Team db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai" db = PostgresDb(db_url=db_url, session_table="sessions") agent = Agent(model=OpenAIChat(id="o3-mini")) team = Team( ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/session/02_persistent_session_history.py
cookbook/04_teams/session/02_persistent_session_history.py
""" This example shows how to use the session history to store the conversation history. add_history_to_context flag is used to add the history to the messages. num_history_runs is used to set the number of history runs to add to the messages. """ from agno.agent.agent import Agent from agno.db.postgres import Postgre...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/session/05_chat_history.py
cookbook/04_teams/session/05_chat_history.py
from agno.agent.agent import Agent from agno.db.postgres import PostgresDb from agno.models.openai import OpenAIChat from agno.team import Team db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai" db = PostgresDb(db_url=db_url, session_table="sessions") agent = Agent( model=OpenAIChat(id="o3-mini"), ) team =...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/session/06_rename_session.py
cookbook/04_teams/session/06_rename_session.py
from agno.agent.agent import Agent from agno.db.postgres import PostgresDb from agno.models.openai import OpenAIChat from agno.team import Team db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai" db = PostgresDb(db_url=db_url) agent = Agent( model=OpenAIChat(id="o3-mini"), ) team = Team( model=OpenAICha...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/session/09_share_session_with_agent.py
cookbook/04_teams/session/09_share_session_with_agent.py
""" This example shows how a session can be shared between a team and an agent. This is useful if you have a team that is more scalable (since it manages the size of the context more efficiently), but want to sometimes use a single agent for speed. A single session is shared across all the runs below. """ import uui...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/session/03_session_summary.py
cookbook/04_teams/session/03_session_summary.py
""" This example shows how to use the session summary to store the conversation summary. """ from agno.agent.agent import Agent from agno.db.postgres import PostgresDb from agno.models.openai import OpenAIChat from agno.session.summary import SessionSummaryManager # noqa: F401 from agno.team import Team db_url = "po...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/session/11_search_session_history.py
cookbook/04_teams/session/11_search_session_history.py
import asyncio import os from agno.db.sqlite import AsyncSqliteDb from agno.models.openai import OpenAIChat from agno.team import Team # Remove the tmp db file before running the script if os.path.exists("tmp/data.db"): os.remove("tmp/data.db") # Create agents for different users to demonstrate user-specific ses...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/session/10_async_session_summary.py
cookbook/04_teams/session/10_async_session_summary.py
""" This example demonstrates how to use the async `aget_session_summary()` method to retrieve session summaries from teams in async workflows. Start the postgres db locally on Docker by running: cookbook/scripts/run_pgvector.sh """ import asyncio from agno.agent.agent import Agent from agno.db.postgres import Async...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/session/04_session_summary_references.py
cookbook/04_teams/session/04_session_summary_references.py
""" This example shows how to use the `add_session_summary_to_context` parameter in the Team config to add session summaries to the Team context. Start the postgres db locally on Docker by running: cookbook/scripts/run_pgvector.sh """ from agno.agent.agent import Agent from agno.db.postgres import PostgresDb from agn...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/session/__init__.py
cookbook/04_teams/session/__init__.py
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/session/09_history_num_messages.py
cookbook/04_teams/session/09_history_num_messages.py
""" This example shows how to use the session history to store the conversation history. add_history_to_context flag is used to add the history to the messages. num_history_runs is used to set the number of history runs to add to the messages. """ from agno.agent.agent import Agent from agno.db.postgres import Postgre...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/session/08_cache_session.py
cookbook/04_teams/session/08_cache_session.py
"""Example of how to cache the team session in memory for faster access.""" from agno.agent import Agent from agno.db.postgres import PostgresDb from agno.models.openai import OpenAIChat from agno.team import Team # Setup the database db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai" db = PostgresDb(db_url=db_u...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/session/07_in_memory_db.py
cookbook/04_teams/session/07_in_memory_db.py
"""This example shows how to use an in-memory database with teams. With this you will be able to store team sessions, user memories, etc. without setting up a database. Keep in mind that in production setups it is recommended to use a database. """ from agno.agent import Agent from agno.db.in_memory import InMemoryDb...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/search_coordination/03_distributed_infinity_search.py
cookbook/04_teams/search_coordination/03_distributed_infinity_search.py
""" This example demonstrates how multiple agents coordinate to perform distributed search using Infinity reranker for high-performance ranking across team members. Team Composition: - Primary Searcher: Performs initial broad search with infinity reranking - Secondary Searcher: Performs targeted search on specific top...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/search_coordination/01_coordinated_agentic_rag.py
cookbook/04_teams/search_coordination/01_coordinated_agentic_rag.py
""" This example demonstrates how multiple specialized agents can coordinate to provide comprehensive RAG (Retrieval-Augmented Generation) responses by dividing search and analysis tasks across team members. Team Composition: - Knowledge Searcher: Searches knowledge base for relevant information - Content Analyzer: An...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/search_coordination/__init__.py
cookbook/04_teams/search_coordination/__init__.py
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/search_coordination/02_coordinated_reasoning_rag.py
cookbook/04_teams/search_coordination/02_coordinated_reasoning_rag.py
""" This example demonstrates how multiple specialized agents coordinate to provide comprehensive RAG responses with distributed reasoning capabilities. Each agent has specific reasoning responsibilities to ensure thorough analysis. Team Composition: - Information Gatherer: Searches knowledge base and gathers raw info...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/multimodal/image_to_structured_output.py
cookbook/04_teams/multimodal/image_to_structured_output.py
from typing import List from agno.agent import Agent from agno.media import Image from agno.models.openai import OpenAIChat from agno.team import Team from pydantic import BaseModel, Field from rich.pretty import pprint class MovieScript(BaseModel): name: str = Field(..., description="Give a name to this movie")...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/multimodal/image_to_text.py
cookbook/04_teams/multimodal/image_to_text.py
from pathlib import Path from agno.agent import Agent from agno.media import Image from agno.models.openai import OpenAIChat from agno.team import Team image_analyzer = Agent( name="Image Analyst", role="Analyze and describe images in detail", model=OpenAIChat(id="gpt-4o"), instructions=[ "Ana...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/multimodal/audio_sentiment_analysis.py
cookbook/04_teams/multimodal/audio_sentiment_analysis.py
import requests from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.media import Audio from agno.models.google import Gemini from agno.team import Team transcription_agent = Agent( name="Audio Transcriber", role="Transcribe audio conversations accurately", model=Gemini(id="gemini-2.0...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/multimodal/generate_image_with_team.py
cookbook/04_teams/multimodal/generate_image_with_team.py
from typing import Iterator from agno.agent import Agent, RunOutputEvent from agno.models.openai import OpenAIChat from agno.team import Team from agno.tools.dalle import DalleTools from agno.utils.common import dataclass_to_dict from rich.pretty import pprint image_generator = Agent( name="Image Creator", ro...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/multimodal/audio_to_text.py
cookbook/04_teams/multimodal/audio_to_text.py
import requests from agno.agent import Agent from agno.media import Audio from agno.models.google import Gemini from agno.team import Team transcription_specialist = Agent( name="Transcription Specialist", role="Convert audio to accurate text transcriptions", model=Gemini(id="gemini-2.0-flash-exp"), in...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/multimodal/__init__.py
cookbook/04_teams/multimodal/__init__.py
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/multimodal/video_caption_generation.py
cookbook/04_teams/multimodal/video_caption_generation.py
"""Please install dependencies using: pip install openai moviepy ffmpeg """ from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.team import Team from agno.tools.moviepy_video import MoviePyVideoTools from agno.tools.openai import OpenAITools video_processor = Agent( name="Video Proces...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/multimodal/image_to_image_transformation.py
cookbook/04_teams/multimodal/image_to_image_transformation.py
from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.team import Team from agno.tools.fal import FalTools style_advisor = Agent( name="Style Advisor", role="Analyze and recommend artistic styles and transformations", model=OpenAIChat(id="gpt-4o"), instructions=[ "Ana...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/multimodal/media_input_for_tool.py
cookbook/04_teams/multimodal/media_input_for_tool.py
""" Example showing how team tools can access media (images, videos, audio, files) passed to the team. This demonstrates: 1. Uploading a PDF file to a team 2. A team tool that can access and process the uploaded file (OCR simulation) 3. The team leader responding directly without delegating to member agents """ from ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/structured_input_output/00_pydantic_model_output.py
cookbook/04_teams/structured_input_output/00_pydantic_model_output.py
from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.team import Team from agno.tools.duckduckgo import DuckDuckGoTools from agno.utils.pprint import pprint_run_response from pydantic import BaseModel class StockAnalysis(BaseModel): symbol: str company_name: str analysis: str ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/structured_input_output/04_structured_output_streaming.py
cookbook/04_teams/structured_input_output/04_structured_output_streaming.py
from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.team.team import Team from agno.tools.yfinance import YFinanceTools from pydantic import BaseModel class StockAnalysis(BaseModel): symbol: str company_name: str analysis: str stock_searcher = Agent( name="Stock Searcher...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/structured_input_output/02_team_with_parser_model.py
cookbook/04_teams/structured_input_output/02_team_with_parser_model.py
import random from typing import Iterator, List # noqa from agno.agent import Agent, RunOutput, RunOutputEvent # noqa from agno.models.anthropic import Claude from agno.models.openai import OpenAIChat from agno.team import Team from pydantic import BaseModel, Field from rich.pretty import pprint class NationalPark...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/structured_input_output/07_output_schema_override.py
cookbook/04_teams/structured_input_output/07_output_schema_override.py
""" This example demonstrates output_schema override for teams. Shows how to temporarily change the output schema for a single run and have it automatically restored afterwards. Works with both run/arun and streaming/non-streaming modes. """ import asyncio from agno.agent import Agent from agno.models.openai import ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/structured_input_output/05_async_structured_output_streaming.py
cookbook/04_teams/structured_input_output/05_async_structured_output_streaming.py
""" This example demonstrates async structured output streaming from a team. The team uses Pydantic models to ensure structured responses while streaming, providing both real-time output and validated data structures asynchronously. """ import asyncio from typing import Iterator # noqa from agno.agent import Agent ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/structured_input_output/06_input_schema_on_team.py
cookbook/04_teams/structured_input_output/06_input_schema_on_team.py
""" This example demonstrates how to use input_schema with teams for automatic input validation and structured data handling. The input_schema feature allows teams to automatically validate and convert dictionary inputs into Pydantic models, ensuring type safety and data validation. """ from typing import List from ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/structured_input_output/08_json_schema_output.py
cookbook/04_teams/structured_input_output/08_json_schema_output.py
""" Example showing how to use JSON as output schema. Note: JSON schemas must be in the provider's expected format. For example, OpenAI expects: {"type": "json_schema", "json_schema": {"name": "...", "schema": {...}}} """ from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.team import Tea...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/structured_input_output/03_team_with_output_model.py
cookbook/04_teams/structured_input_output/03_team_with_output_model.py
""" This example shows how to use the output_model parameter to specify the model that should be used to generate the final response. """ from agno.agent import Agent from agno.models.anthropic import Claude from agno.models.openai import OpenAIChat from agno.team import Team from agno.tools.duckduckgo import DuckDuck...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/structured_input_output/__init__.py
cookbook/04_teams/structured_input_output/__init__.py
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/structured_input_output/01_pydantic_model_as_input.py
cookbook/04_teams/structured_input_output/01_pydantic_model_as_input.py
""" This example demonstrates how to use Pydantic models as input to teams. Shows how structured data can be passed as messages to teams for more precise and validated input handling. """ from typing import List from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.team.team import Team fr...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/basic_flows/01_basic_coordination.py
cookbook/04_teams/basic_flows/01_basic_coordination.py
""" 1. Run: `pip install openai ddgs newspaper4k lxml_html_clean agno` to install the dependencies 2. Run: `python cookbook/teams/async/modes/02_async_coordinate.py` to run the agent This example demonstrates a coordinated team of AI agents working together to research topics across different platforms. The team cons...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/basic_flows/03_delegate_to_all_members_cooperation.py
cookbook/04_teams/basic_flows/03_delegate_to_all_members_cooperation.py
""" This example demonstrates a collaborative team of AI agents working together to research topics across different platforms. The team consists of two specialized agents: 1. Reddit Researcher - Uses DuckDuckGo to find and analyze relevant Reddit posts 2. HackerNews Researcher - Uses HackerNews API to find and analyz...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/basic_flows/05_team_history.py
cookbook/04_teams/basic_flows/05_team_history.py
""" This example demonstrates a team where the team leader routes requests to the appropriate member, and the members respond directly to the user. In addition each team member has access to the shared history of the team. """ from uuid import uuid4 from agno.agent import Agent from agno.db.sqlite import SqliteDb fr...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/basic_flows/02_respond_directly_router_team.py
cookbook/04_teams/basic_flows/02_respond_directly_router_team.py
""" This example demonstrates a team of AI agents working together to answer questions in different languages. The team consists of six specialized agents: 1. English Agent - Can only answer in English 2. Japanese Agent - Can only answer in Japanese 3. Chinese Agent - Can only answer in Chinese 4. Spanish Agent - Can ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/basic_flows/__init__.py
cookbook/04_teams/basic_flows/__init__.py
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/basic_flows/04_respond_directly_with_history.py
cookbook/04_teams/basic_flows/04_respond_directly_with_history.py
""" This example demonstrates a team where the team leader routes requests to the appropriate member, and the members respond directly to the user. In addition each team member has access to the shared history of the team. """ from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.models.openai im...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/basic_flows/06_history_of_members.py
cookbook/04_teams/basic_flows/06_history_of_members.py
""" This example demonstrates a team where the team leader routes requests to the appropriate member, and the members respond directly to the user. In addition each team member has access to it's own history. Note: In this example the team leader has no access to the history of the team or the members themselves, so t...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/basic_flows/07_share_member_interactions.py
cookbook/04_teams/basic_flows/07_share_member_interactions.py
""" This example demonstrates a team where the team leader routes requests to the appropriate member, and the members respond directly to the user. In addition each team member has access to the shared history of the team. """ from uuid import uuid4 from agno.agent import Agent from agno.db.sqlite import SqliteDb fr...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/basic_flows/caching/cache_team_response.py
cookbook/04_teams/basic_flows/caching/cache_team_response.py
""" Example showing how to cache team leader model responses. Run this cookbook twice to see the difference in response time. The first time should take a while to run. The second time should be instant. This demonstrates: 1. Team leader caching (coordination decisions) 2. Member agent caching (individual responses)...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/context_management/filter_tool_calls_from_history.py
cookbook/04_teams/context_management/filter_tool_calls_from_history.py
""" Research Team with Context Management. This example demonstrates a research team that uses DuckDuckGo to search the web and accumulate tool calls. The older research results are automatically filtered out to keep the context focused on recent research results. When max_tool_calls_from_history is set to 3, the tea...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/context_management/introduction.py
cookbook/04_teams/context_management/introduction.py
from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.models.openai import OpenAIChat from agno.team import Team db = SqliteDb(db_file="tmp/teams.db", session_table="team_sessions") INTRODUCTION = """Hello, I'm your personal assistant. I can help you only with questions related to mountain climbi...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/context_compression/tool_call_compression_with_manager.py
cookbook/04_teams/context_compression/tool_call_compression_with_manager.py
""" Research Team with Context Management. This example demonstrates a research team that uses DuckDuckGo to search the web and accumulate tool calls. The older research results are automatically compressed to keep the context focused on recent research results. """ from textwrap import dedent from agno.agent import...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/context_compression/tool_call_compression.py
cookbook/04_teams/context_compression/tool_call_compression.py
from textwrap import dedent from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.models.aws import AwsBedrock from agno.team.team import Team from agno.tools.duckduckgo import DuckDuckGoTools # Create specialized agents tech_researcher = Agent( name="Alex", role="Technology Researcher", ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/context_compression/async_tool_call_compression.py
cookbook/04_teams/context_compression/async_tool_call_compression.py
import asyncio from textwrap import dedent from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.models.openai import OpenAIChat from agno.team.team import Team from agno.tools.duckduckgo import DuckDuckGoTools # Create specialized agents tech_specialist = Agent( name="Tech Specialist", r...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/other/few_shot_learning.py
cookbook/04_teams/other/few_shot_learning.py
""" This example shows a straightforward use case of additional_input to teach a customer support team proper response patterns. """ from agno.agent import Agent from agno.models.message import Message from agno.models.openai.chat import OpenAIChat from agno.team import Team # Few-shot examples showing good support p...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/other/input_as_dict.py
cookbook/04_teams/other/input_as_dict.py
from agno.agent import Agent from agno.team import Team # Create a research team team = Team( members=[ Agent( name="Sarah", role="Data Researcher", instructions="Focus on gathering and analyzing data", ), Agent( name="Mike", role=...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/other/team_model_inheritance.py
cookbook/04_teams/other/team_model_inheritance.py
""" This example demonstrates how agents automatically inherit models from their Team. This is particularly useful when: - Using non-OpenAI models (Claude, Ollama, VLLM, etc.) to avoid manual model configuration on every agent - Preventing API key errors when team uses a different provider than the default OpenAI - Si...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/other/run_as_cli.py
cookbook/04_teams/other/run_as_cli.py
"""✍️ Interactive Writing Team - CLI App Example This example shows how to create an interactive CLI app with a collaborative writing team. Run `pip install openai agno duckduckgo-search` to install dependencies. """ from textwrap import dedent from agno.agent import Agent from agno.models.openai import OpenAIChat ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/other/input_as_messages_list.py
cookbook/04_teams/other/input_as_messages_list.py
from agno.agent import Agent from agno.models.message import Message from agno.team import Team # Create a research team research_team = Team( name="Research Team", members=[ Agent( name="Sarah", role="Data Researcher", instructions="Focus on gathering and analyzing ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/other/__init__.py
cookbook/04_teams/other/__init__.py
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/other/team_retries.py
cookbook/04_teams/other/team_retries.py
"""Example demonstrating how to set up retries with a Team.""" from agno.agent import Agent from agno.team import Team from agno.tools.duckduckgo import DuckDuckGoTools # Create a research team team = Team( members=[ Agent( name="Sarah", role="Data Researcher", tools=[D...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/other/team_exponential_backoff.py
cookbook/04_teams/other/team_exponential_backoff.py
from agno.agent import Agent from agno.team import Team from agno.tools.duckduckgo import DuckDuckGoTools # Create a research team team = Team( members=[ Agent( name="Sarah", role="Data Researcher", tools=[DuckDuckGoTools()], instructions="Focus on gathering ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/other/response_as_variable.py
cookbook/04_teams/other/response_as_variable.py
""" This example demonstrates how to capture team responses as variables. Shows how to get structured responses from teams and validate them using Pydantic models for different types of queries. """ from typing import Iterator # noqa from pydantic import BaseModel from agno.agent import Agent from agno.models.openai...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/other/input_as_list.py
cookbook/04_teams/other/input_as_list.py
from agno.agent import Agent from agno.team import Team team = Team( members=[ Agent( name="Sarah", role="Data Researcher", instructions="Focus on gathering and analyzing data", ), Agent( name="Mike", role="Technical Writer", ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/other/team_model_string.py
cookbook/04_teams/other/team_model_string.py
from agno.agent import Agent from agno.team import Team from agno.tools.duckduckgo import DuckDuckGoTools # Model strings follow the format "{provider}:{model_id}", for example: model_string = "openai:gpt-4o-mini" # Create a research team team = Team( model=model_string, members=[ Agent( m...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/04_teams/other/team_cancel_a_run.py
cookbook/04_teams/other/team_cancel_a_run.py
""" Example demonstrating how to cancel a running team execution. This example shows how to: 1. Start a team run in a separate thread 2. Cancel the run from another thread 3. Handle the cancelled response """ import threading import time from agno.agent import Agent from agno.models.openai import OpenAIChat from agn...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/00_getting_started/run.py
cookbook/00_getting_started/run.py
from pathlib import Path from agent_search_over_knowledge import agent_with_knowledge from agent_with_guardrails import agent_with_guardrails from agent_with_memory import agent_with_memory from agent_with_state_management import agent_with_state_management from agent_with_storage import agent_with_storage from agent_...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/00_getting_started/agent_with_state_management.py
cookbook/00_getting_started/agent_with_state_management.py
""" Agent with State Management - Finance Agent with Watchlist =========================================================== This example shows how to give your agent persistent state that it can read and modify. The agent maintains a stock watchlist across conversations. Different from storage (conversation history) an...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/00_getting_started/human_in_the_loop.py
cookbook/00_getting_started/human_in_the_loop.py
""" Human in the Loop - Confirm Before Taking Action ================================================ This example shows how to require user confirmation before executing certain tools. Critical for actions that are irreversible or sensitive. We'll build on our self-learning agent, and ask for user confirmation before...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/00_getting_started/multi_agent_team.py
cookbook/00_getting_started/multi_agent_team.py
""" Multi-Agent Team - Investment Research Team ============================================ This example shows how to create a team of agents that work together. Each agent has a specialized role, and the team leader coordinates. We'll build an investment research team with opposing perspectives: - Bull Agent: Makes ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/00_getting_started/custom_tool_for_self_learning.py
cookbook/00_getting_started/custom_tool_for_self_learning.py
""" Custom Tool for Self-Learning - Write Your Own Tools ===================================================== This example shows how to write custom tools for your agent. A tool is just a Python function — the agent calls it when needed. We'll build a self-learning agent that can save insights to a knowledge base. Th...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/00_getting_started/agent_search_over_knowledge.py
cookbook/00_getting_started/agent_search_over_knowledge.py
""" Agentic Search over Knowledge - Agent with a Knowledge Base ============================================================ This example shows how to give an agent a searchable knowledge base. The agent can search through documents (PDFs, text, URLs) to answer questions. Key concepts: - Knowledge: A searchable collec...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/00_getting_started/agent_with_structured_output.py
cookbook/00_getting_started/agent_with_structured_output.py
""" Agent with Structured Output - Finance Agent with Typed Responses ================================================================== This example shows how to get structured, typed responses from your agent. Instead of free-form text, you get a Pydantic model you can trust. Perfect for building pipelines, UIs, or ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/00_getting_started/agent_with_memory.py
cookbook/00_getting_started/agent_with_memory.py
""" Agent with Memory - Finance Agent that Remembers You ===================================================== This example shows how to give your agent memory of user preferences. The agent remembers facts about you across all conversations. Different from storage (which persists conversation history), memory persist...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/00_getting_started/sequential_workflow.py
cookbook/00_getting_started/sequential_workflow.py
""" Sequential Workflow - Stock Research Pipeline ============================================== This example shows how to create a workflow with sequential steps. Each step is handled by a specialized agent, and outputs flow to the next step. Different from Teams (agents collaborate dynamically), Workflows give you e...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/00_getting_started/agent_with_storage.py
cookbook/00_getting_started/agent_with_storage.py
""" Agent with Storage - Finance Agent with Storage ==================================================== Building on the Finance Agent from 01, this example adds persistent storage. Your agent now remembers conversations across runs. Ask about NVDA, close the script, come back later — pick up where you left off. The c...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/00_getting_started/__init__.py
cookbook/00_getting_started/__init__.py
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/00_getting_started/readme_examples.py
cookbook/00_getting_started/readme_examples.py
"""Readme Examples Run `pip install openai ddgs yfinance lancedb tantivy pypdf agno` to install dependencies.""" from agno.agent import Agent from agno.knowledge.embedder.openai import OpenAIEmbedder from agno.knowledge.knowledge import Knowledge from agno.models.openai import OpenAIChat from agno.team.team import Tea...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/00_getting_started/agent_with_typed_input_output.py
cookbook/00_getting_started/agent_with_typed_input_output.py
""" Agent with Typed Input and Output - Full Type Safety ===================================================== This example shows how to define both input and output schemas for your agent. You get end-to-end type safety: validate what goes in, guarantee what comes out. Perfect for building robust pipelines where you ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/00_getting_started/agent_with_guardrails.py
cookbook/00_getting_started/agent_with_guardrails.py
""" Agent with Guardrails - Input Validation and Safety ==================================================== This example shows how to add guardrails to your agent to validate input before processing. Guardrails can block, modify, or flag problematic requests. We'll demonstrate: 1. Built-in guardrails (PII detection, ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/00_getting_started/agent_with_tools.py
cookbook/00_getting_started/agent_with_tools.py
""" Agent with Tools - Finance Agent ================================= Your first Agno agent: a data-driven financial analyst that retrieves market data, computes key metrics, and delivers concise insights. This example shows how to give an agent tools to interact with external data sources. The agent uses YFinanceToo...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/__init__.py
cookbook/03_agents/__init__.py
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/state/last_n_session_messages.py
cookbook/03_agents/state/last_n_session_messages.py
import asyncio import os from agno.agent import Agent from agno.db.sqlite import AsyncSqliteDb from agno.models.openai import OpenAIChat # Remove the tmp db file before running the script if os.path.exists("tmp/data.db"): os.remove("tmp/data.db") # Create agents for different users to demonstrate user-specific s...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/state/session_state_multiple_users.py
cookbook/03_agents/state/session_state_multiple_users.py
""" This example demonstrates how to maintain state for each user in a multi-user environment. The shopping list is stored in a dictionary, organized by user ID and session ID. Agno automatically creates the "current_user_id" and "current_session_id" variables in the session state. You can access these variables in ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/state/agentic_session_state.py
cookbook/03_agents/state/agentic_session_state.py
from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.models.openai import OpenAIChat db = SqliteDb(db_file="tmp/agents.db") agent = Agent( model=OpenAIChat(id="o3-mini"), db=db, session_state={"shopping_list": []}, add_session_state_to_context=True, # Required so the agent is awa...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/state/session_state_in_instructions.py
cookbook/03_agents/state/session_state_in_instructions.py
from agno.agent import Agent from agno.models.openai import OpenAIChat agent = Agent( model=OpenAIChat(id="gpt-4o-mini"), # Initialize the session state with a variable session_state={"user_name": "John"}, # You can use variables from the session state in the instructions instructions="Users name i...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/state/session_state_basic.py
cookbook/03_agents/state/session_state_basic.py
from agno.agent import Agent, RunOutput # noqa from agno.db.sqlite import SqliteDb from agno.models.openai import OpenAIChat from agno.run import RunContext def add_item(run_context: RunContext, item: str) -> str: """Add an item to the shopping list.""" if run_context.session_state is None: run_conte...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/state/session_state_advanced.py
cookbook/03_agents/state/session_state_advanced.py
from textwrap import dedent from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.models.openai import OpenAIChat from agno.run import RunContext # Define tools to manage our shopping list def add_item(run_context: RunContext, item: str) -> str: """Add an item to the shopping list and return...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/state/__init__.py
cookbook/03_agents/state/__init__.py
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/state/session_state_in_event.py
cookbook/03_agents/state/session_state_in_event.py
from agno.agent import Agent, RunCompletedEvent from agno.db.sqlite import SqliteDb from agno.models.openai import OpenAIChat from agno.run import RunContext def add_item(run_context: RunContext, item: str) -> str: """Add an item to the shopping list.""" if run_context.session_state is None: run_conte...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/state/change_state_on_run.py
cookbook/03_agents/state/change_state_on_run.py
from agno.agent import Agent from agno.db.in_memory import InMemoryDb from agno.models.openai import OpenAIChat agent = Agent( db=InMemoryDb(), model=OpenAIChat(id="gpt-4o-mini"), instructions="Users name is {user_name} and age is {age}", debug_mode=True, ) # Sets the session state for the session wit...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/state/manual_session_state_update.py
cookbook/03_agents/state/manual_session_state_update.py
from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.models.openai import OpenAIChat from agno.run import RunContext def add_item(run_context: RunContext, item: str) -> str: """Add an item to the shopping list.""" if run_context.session_state is None: run_context.session_state = ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/state/session_state_in_context.py
cookbook/03_agents/state/session_state_in_context.py
from agno.agent import Agent from agno.db.postgres import PostgresDb from agno.models.openai import OpenAIChat db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai" db = PostgresDb(db_url=db_url, session_table="sessions") agent = Agent( model=OpenAIChat(id="gpt-4o-mini"), instructions="Users name is {user...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/state/dynamic_session_state.py
cookbook/03_agents/state/dynamic_session_state.py
import json from typing import Any, Dict from agno.agent import Agent from agno.db.in_memory import InMemoryDb from agno.models.openai import OpenAIChat from agno.run import RunContext from agno.tools.toolkit import Toolkit from agno.utils.log import log_info, log_warning class CustomerDBTools(Toolkit): def __in...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/state/overwrite_stored_session_state.py
cookbook/03_agents/state/overwrite_stored_session_state.py
"""This example demonstrates how to overwrite the stored session_state with the session_state provided in the run.""" from agno.agent import Agent from agno.db.sqlite import SqliteDb from agno.models.openai import OpenAIChat # Create an Agent that maintains state agent = Agent( model=OpenAIChat(id="gpt-4o-mini"),...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/culture/04_manually_add_culture.py
cookbook/03_agents/culture/04_manually_add_culture.py
""" Manually add cultural knowledge to your Agents. This example shows how to persist cultural knowledge WITHOUT invoking a model. Use this to seed cultural knowledge for your Agents and Multi-Agent Teams. Cultural knowledge represents reusable insights, rules, and values that Agents can reference to stay consistent ...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false
agno-agi/agno
https://github.com/agno-agi/agno/blob/26b9daa0fb760c3ad8384e1ba9218b1bce854535/cookbook/03_agents/culture/02_use_cultural_knowledge_in_agent.py
cookbook/03_agents/culture/02_use_cultural_knowledge_in_agent.py
"""Use cultural knowledge with your Agents. This example demonstrates how an Agent reads and applies the cultural knowledge created earlier (see `01_create_cultural_knowledge.py`). When `add_culture_to_context=True`, the Agent: - Loads relevant cultural knowledge from the database - Adds it to the context with instru...
python
Apache-2.0
26b9daa0fb760c3ad8384e1ba9218b1bce854535
2026-01-04T14:41:49.609528Z
false