Agno Skill
Comprehensive assistance with Agno development - a modern AI agent framework for building production-ready multi-agent systems with MCP integration, workflow orchestration, and AgentOS runtime.
When to Use This Skill
This skill should be triggered when:
- Building AI agents with tools, memory, and structured outputs
- Creating multi-agent teams with role-based delegation and collaboration
- Implementing workflows with conditional branching, loops, and async execution
- Integrating MCP servers (stdio, SSE, or Streamable HTTP transports)
- Deploying AgentOS with custom FastAPI apps, JWT middleware, or database backends
- Working with knowledge bases for RAG and document processing
- Debugging agent behavior with debug mode and telemetry
- Optimizing agent performance with exponential backoff, retries, and rate limiting
Key Concepts
Core Architecture
- Agent: Single autonomous AI unit with model, tools, instructions, and optional memory/knowledge
- Team: Collection of agents that collaborate on tasks with role-based delegation
- Workflow: Multi-step orchestration with conditional branching, loops, and parallel execution
- AgentOS: FastAPI-based runtime for deploying agents as production APIs
MCP Integration
- MCPTools: Connect to single MCP server via stdio, SSE, or Streamable HTTP
- MultiMCPTools: Connect to multiple MCP servers simultaneously
- Transport Types: stdio (local processes), SSE (server-sent events), Streamable HTTP (production)
Memory & Knowledge
- Session Memory: Conversation state stored in PostgreSQL, SQLite, or cloud storage (GCS)
- Knowledge Base: RAG-powered document retrieval with vector embeddings
- User Memory: Persistent user-specific memories across sessions
Quick Reference
python
1from agno.agent import Agent
2from agno.tools.duckduckgo import DuckDuckGoTools
3
4agent = Agent(
5 tools=[DuckDuckGoTools()],
6 markdown=True,
7)
8
9agent.print_response("Search for the latest AI news", stream=True)
2. Agent with Structured Output
python
1from agno.agent import Agent
2from pydantic import BaseModel, Field
3
4
5class MovieScript(BaseModel):
6 name: str = Field(..., description="Movie title")
7 genre: str = Field(..., description="Movie genre")
8 storyline: str = Field(..., description="3 sentence storyline")
9
10
11agent = Agent(
12 description="You help people write movie scripts.",
13 output_schema=MovieScript,
14)
15
16result = agent.run("Write a sci-fi thriller")
17print(result.content.name) # Access structured output
3. MCP Server Integration (stdio)
python
1import asyncio
2from agno.agent import Agent
3from agno.tools.mcp import MCPTools
4
5
6async def run_agent(message: str) -> None:
7 mcp_tools = MCPTools(command="uvx mcp-server-git")
8 await mcp_tools.connect()
9
10 try:
11 agent = Agent(tools=[mcp_tools])
12 await agent.aprint_response(message, stream=True)
13 finally:
14 await mcp_tools.close()
15
16
17asyncio.run(run_agent("What is the license for this project?"))
4. Multiple MCP Servers
python
1import asyncio
2import os
3from agno.agent import Agent
4from agno.tools.mcp import MultiMCPTools
5
6
7async def run_agent(message: str) -> None:
8 env = {
9 **os.environ,
10 "GOOGLE_MAPS_API_KEY": os.getenv("GOOGLE_MAPS_API_KEY"),
11 }
12
13 mcp_tools = MultiMCPTools(
14 commands=[
15 "npx -y @openbnb/mcp-server-airbnb --ignore-robots-txt",
16 "npx -y @modelcontextprotocol/server-google-maps",
17 ],
18 env=env,
19 )
20 await mcp_tools.connect()
21
22 try:
23 agent = Agent(tools=[mcp_tools], markdown=True)
24 await agent.aprint_response(message, stream=True)
25 finally:
26 await mcp_tools.close()
5. Multi-Agent Team with Role Delegation
python
1from agno.agent import Agent
2from agno.team import Team
3from agno.tools.duckduckgo import DuckDuckGoTools
4from agno.tools.hackernews import HackerNewsTools
5
6research_agent = Agent(
7 name="Research Specialist",
8 role="Gather information on topics",
9 tools=[DuckDuckGoTools()],
10 instructions=["Find comprehensive information", "Cite sources"],
11)
12
13news_agent = Agent(
14 name="News Analyst",
15 role="Analyze tech news",
16 tools=[HackerNewsTools()],
17 instructions=["Focus on trending topics", "Summarize key points"],
18)
19
20team = Team(
21 members=[research_agent, news_agent],
22 instructions=["Delegate research tasks to appropriate agents"],
23)
24
25team.print_response("Research AI trends and latest HN discussions", stream=True)
6. Workflow with Conditional Branching
python
1from agno.agent import Agent
2from agno.workflow.workflow import Workflow
3from agno.workflow.router import Router
4from agno.workflow.step import Step
5from agno.tools.duckduckgo import DuckDuckGoTools
6from agno.tools.hackernews import HackerNewsTools
7
8simple_researcher = Agent(
9 name="Simple Researcher",
10 tools=[DuckDuckGoTools()],
11)
12
13deep_researcher = Agent(
14 name="Deep Researcher",
15 tools=[HackerNewsTools()],
16)
17
18workflow = Workflow(
19 steps=[
20 Router(
21 routes={
22 "simple_topics": Step(agent=simple_researcher),
23 "complex_topics": Step(agent=deep_researcher),
24 }
25 )
26 ]
27)
28
29workflow.run("Research quantum computing")
7. Agent with Database Session Storage
python
1from agno.agent import Agent
2from agno.db.postgres import PostgresDb
3
4db = PostgresDb(
5 db_url="postgresql://user:pass@localhost:5432/agno", schema="agno_sessions"
6)
7
8agent = Agent(
9 db=db,
10 session_id="user-123", # Persistent session
11 add_history_to_messages=True,
12)
13
14# Conversations are automatically saved and restored
15agent.print_response("Remember my favorite color is blue")
16agent.print_response("What's my favorite color?") # Will remember
8. AgentOS with Custom FastAPI App
python
1from fastapi import FastAPI
2from agno.agent import Agent
3from agno.models.openai import OpenAIChat
4from agno.os import AgentOS
5
6# Custom FastAPI app
7app = FastAPI(title="Custom App")
8
9
10@app.get("/health")
11def health_check():
12 return {"status": "healthy"}
13
14
15# Add AgentOS routes
16agent_os = AgentOS(
17 agents=[Agent(id="assistant", model=OpenAIChat(id="gpt-5-mini"))],
18 base_app=app, # Merge with custom app
19)
20
21if __name__ == "__main__":
22 agent_os.serve(app="custom_app:app", reload=True)
9. Agent with Debug Mode
python
1from agno.agent import Agent
2from agno.tools.hackernews import HackerNewsTools
3
4agent = Agent(
5 tools=[HackerNewsTools()],
6 debug_mode=True, # Enable detailed logging
7 # debug_level=2, # More verbose output
8)
9
10# See detailed logs of:
11# - Messages sent to model
12# - Tool calls and results
13# - Token usage and timing
14agent.print_response("Get top HN stories")
python
1from typing import List
2from agno.agent import Agent
3from agno.workflow.workflow import Workflow
4from agno.workflow.step import Step
5from pydantic import BaseModel, Field
6
7
8class ResearchTopic(BaseModel):
9 """Structured research topic with specific requirements"""
10
11 topic: str
12 focus_areas: List[str] = Field(description="Specific areas to focus on")
13 target_audience: str = Field(description="Who this research is for")
14 sources_required: int = Field(description="Number of sources needed", default=5)
15
16
17workflow = Workflow(
18 input_schema=ResearchTopic, # Validate inputs
19 steps=[Step(agent=Agent(instructions=["Research based on focus areas"]))],
20)
21
22# This will validate the input structure
23workflow.run(
24 {
25 "topic": "AI Safety",
26 "focus_areas": ["alignment", "interpretability"],
27 "target_audience": "researchers",
28 "sources_required": 10,
29 }
30)
Reference Files
This skill includes comprehensive documentation in references/:
agentos.md (22 pages)
- MCP server integration (stdio, SSE, Streamable HTTP)
- Multiple MCP server connections
- Custom FastAPI app integration
- JWT middleware and authentication
- AgentOS lifespan management
- Telemetry and monitoring
agents.md (834 pages)
- Agent creation and configuration
- Tools integration (DuckDuckGo, HackerNews, Pandas, PostgreSQL, Wikipedia)
- Structured outputs with Pydantic
- Memory management (session, user, knowledge)
- Debugging with debug mode
- Human-in-the-loop patterns
- Multimodal agents (audio, video, images)
- Database backends (PostgreSQL, SQLite, GCS)
- State management and session persistence
examples.md (188 pages)
- Workflow patterns (conditional branching, loops, routers)
- Team collaboration examples
- Async streaming workflows
- Audio/video processing teams
- Image generation pipelines
- Multi-step orchestration
- Input schema validation
getting_started.md
- Installation and setup
- First agent examples
- MCP server quickstarts
- Common patterns and best practices
integration.md
- Third-party integrations
- API connections
- Custom tool creation
- Database setup
migration.md
- Upgrading between versions
- Breaking changes and migration guides
- Deprecated features
other.md
- Advanced topics
- Performance optimization
- Production deployment
Working with This Skill
For Beginners
Start with getting_started.md to understand:
- Basic agent creation with
Agent()
- Adding tools for web search, databases, etc.
- Running agents with
.print_response() or .run()
- Understanding the difference between Agent, Team, and Workflow
Quick Start Pattern:
python
1from agno.agent import Agent
2from agno.tools.duckduckgo import DuckDuckGoTools
3
4agent = Agent(tools=[DuckDuckGoTools()])
5agent.print_response("Your question here")
Explore agents.md and examples.md for:
- Multi-agent teams with role delegation
- MCP server integration (local tools via stdio)
- Workflow orchestration with conditional logic
- Session persistence with databases
- Structured outputs with Pydantic models
Team Pattern:
python
1from agno.team import Team
2
3team = Team(
4 members=[researcher, analyst, writer],
5 instructions=["Delegate tasks based on agent roles"],
6)
For Advanced Users
Deep dive into agentos.md for:
- AgentOS deployment with custom FastAPI apps
- Multiple MCP server orchestration
- Production authentication with JWT middleware
- Custom lifespan management
- Performance tuning with exponential backoff
- Telemetry and monitoring integration
AgentOS Pattern:
python
1from agno.os import AgentOS
2
3agent_os = AgentOS(
4 agents=[agent1, agent2], db=PostgresDb(...), base_app=custom_fastapi_app
5)
6agent_os.serve()
Navigation Tips
- Looking for examples? → Check
examples.md first for real-world patterns
- Need API details? → Search
agents.md for class references and parameters
- Deploying to production? → Read
agentos.md for AgentOS setup
- Integrating external tools? → See
integration.md for MCP and custom tools
- Debugging issues? → Enable
debug_mode=True and check logs
Common Patterns
Pattern: MCP Server Connection Lifecycle
python
1async def run_with_mcp():
2 mcp_tools = MCPTools(command="uvx mcp-server-git")
3 await mcp_tools.connect() # Always connect before use
4
5 try:
6 agent = Agent(tools=[mcp_tools])
7 await agent.aprint_response("Your query")
8 finally:
9 await mcp_tools.close() # Always close when done
Pattern: Persistent Sessions with Database
python
1from agno.agent import Agent
2from agno.db.postgres import PostgresDb
3
4db = PostgresDb(db_url="postgresql://...")
5
6agent = Agent(
7 db=db,
8 session_id="unique-user-id",
9 add_history_to_messages=True, # Include conversation history
10)
Pattern: Conditional Workflow Routing
python
1from agno.workflow.router import Router
2
3workflow = Workflow(
4 steps=[
5 Router(
6 routes={
7 "route_a": Step(agent=agent_a),
8 "route_b": Step(agent=b),
9 }
10 )
11 ]
12)
Resources
Official Links
Key Concepts to Remember
- Always close MCP connections: Use try/finally blocks or async context managers
- Enable debug mode for troubleshooting:
debug_mode=True shows detailed execution logs
- Use structured outputs for reliability: Define Pydantic schemas with
output_schema=
- Persist sessions with databases: PostgreSQL or SQLite for production agents
- Disable telemetry if needed: Set
AGNO_TELEMETRY=false or telemetry=False
scripts/
Add helper scripts here for common automation tasks.
assets/
Add templates, boilerplate, or example projects here.
Notes
- This skill was automatically generated from official Agno documentation
- Reference files preserve structure and examples from source docs
- Code examples include language detection for better syntax highlighting
- Quick reference patterns are extracted from real-world usage in the docs
- All examples are tested and production-ready
Updating
To refresh this skill with updated documentation:
- Re-run the scraper with the same configuration
- The skill will be rebuilt with the latest information from docs.agno.com