agno
npx skills add https://docs.agno.com
Agent 安装分布
Skill 文档
Capabilities
Agno enables agents to reason, take action, and learn from interactions. Agents are stateful AI programs that maintain context across conversations, access external systems through tools, retrieve information from knowledge bases, and remember user preferences through persistent memory. Agents can work independently or collaborate in teams with specialized roles. Complex tasks are orchestrated through workflows with sequential, parallel, conditional, and looping execution patterns. Everything runs in your cloud environment with data privacy and control.
Skills
Core Agent Capabilities
- Single Agents: Create stateful AI agents with reasoning, tool use, and memory
- Agent Execution: Run agents synchronously or asynchronously with streaming responses
- Agent Debugging: Inspect agent behavior, trace execution, and troubleshoot issues
- Structured Output: Constrain agent responses to JSON schemas using Pydantic models
- Multimodal Input: Process text, images, audio, video, and files as agent input
- Multimodal Output: Generate images, audio, and structured responses
Multi-Agent Teams
- Team Composition: Create teams of specialized agents with defined roles and responsibilities
- Team Delegation: Implement supervisor, router, and broadcast delegation patterns
- Team Coordination: Enable agents to work together on complex tasks with shared context
- Nested Teams: Build hierarchical team structures with sub-teams
- Team Memory: Share memories and context across team members
Workflow Orchestration
- Sequential Workflows: Execute steps in order with output flowing to next step
- Parallel Execution: Run multiple steps simultaneously for independent tasks
- Conditional Logic: Branch workflow execution based on step results
- Loop Steps: Iterate until conditions are met for refinement and quality assurance
- Router Steps: Dynamically route to different steps based on input
- Custom Functions: Include Python functions as workflow steps
- Workflow Agents: Use agents as workflow steps with full capabilities
Knowledge & RAG
- Knowledge Bases: Create searchable knowledge from documents, URLs, and text
- Vector Databases: Support for 20+ vector stores (PgVector, LanceDB, Pinecone, Qdrant, Chroma, Weaviate, etc.)
- Hybrid Search: Combine semantic and keyword search for comprehensive retrieval
- Agentic RAG: Agents decide when to search knowledge bases
- Traditional RAG: Always inject relevant context into agent context
- Document Readers: Ingest PDF, DOCX, CSV, JSON, Markdown, websites, YouTube, and more
- Chunking Strategies: Fixed-size, semantic, recursive, document, code, and agentic chunking
- Embedders: Support for OpenAI, Cohere, Gemini, Ollama, Mistral, Voyage AI embeddings
- Knowledge Learning: Agents can save insights to knowledge bases for future retrieval
Memory & Learning
- Automatic Memory: Agents automatically extract and store user facts from conversations
- Agentic Memory: Agents control memory creation/update/deletion through tools
- User Profiles: Store and recall user preferences, habits, and context
- Cross-Session Learning: Accumulate knowledge across multiple conversations
- Memory Search: Retrieve relevant memories for context
- Memory Management: Create, update, delete, and search stored memories
- Persistent Storage: Store memories in PostgreSQL, SQLite, MongoDB, Redis, and more
Tool Integration
- Custom Tools: Create tools from Python functions with automatic schema generation
- 120+ Pre-built Toolkits: Search (web, arxiv, news), social (Slack, Discord, email), databases (SQL, DuckDB, BigQuery), web scraping, file operations, and more
- Tool Execution: Execute tools sequentially or in parallel
- Tool Results: Return simple types or media artifacts (images, audio, video)
- Tool Hooks: Pre and post-execution hooks for validation and transformation
- MCP Integration: Connect to Model Context Protocol servers for extended capabilities
- Tool Caching: Cache tool results for efficiency
- Tool Limits: Control maximum tool calls per run
Model Support
- Native Providers: OpenAI, Anthropic, Google Gemini, Meta Llama, Mistral, Cohere, DeepSeek, xAI, Perplexity
- Cloud Providers: Azure OpenAI, AWS Bedrock, Google Vertex AI, IBM WatsonX
- Open Source: Groq, Together, Fireworks, DeepInfra, Hugging Face
- Local Models: Ollama, vLLM, LMStudio, llama.cpp
- Model Gateways: LiteLLM, Portkey, OpenRouter, Cerebras, NVIDIA
- Model String Format: Use simple strings like “openai:gpt-4o” or “anthropic:claude-sonnet”
- Reasoning Models: Support for o1, o3, DeepSeek-R1, and other reasoning models
- Vision Models: Image input and analysis across providers
- Audio Models: Speech-to-text and text-to-speech capabilities
Session & History Management
- Session Persistence: Store conversation history and state in databases
- Chat History: Access previous messages for context in multi-turn conversations
- Session Summaries: Condense long conversations to manage token costs
- Multi-Session Search: Search across multiple conversation sessions
- Session State: Maintain and update persistent state across runs
- Session Management: Create, retrieve, update, and delete sessions
- Run Tracking: Track individual runs within sessions with metadata
Input & Output
- Structured Input: Define input schemas for agents and teams
- Structured Output: Constrain responses to Pydantic models or JSON schemas
- Multimodal Input: Accept images, audio, video, and files
- Multimodal Output: Generate images and audio responses
- Output Models: Define response structure with Pydantic
Database Support
- Relational: PostgreSQL, MySQL, SQLite, Async variants
- NoSQL: MongoDB, DynamoDB, Firestore, SurrealDB, Redis
- Vector: PgVector, LanceDB, Pinecone, Qdrant, Chroma, Milvus, Weaviate, Cassandra, Clickhouse
- Cloud Storage: Google Cloud Storage, Firestore
- In-Memory: In-memory storage for development
- JSON: File-based JSON storage
- Specialized: Neon, Supabase, SingleStore, Couchbase
Advanced Features
- Guardrails: Prompt injection detection, PII detection, content moderation
- Human-in-the-Loop: User confirmation, user input, external execution
- Hooks: Pre/post-execution hooks for input validation and output transformation
- Context Management: Dynamic instructions, few-shot learning, location/datetime context
- State Management: Session state, agentic state, dynamic state
- Dependency Injection: Inject dependencies into agents and tools
- Run Cancellation: Cancel running agents, teams, and workflows
- Tracing: Comprehensive execution tracing and observability
- Evals: Accuracy, performance, reliability, and agent-as-judge evaluations
Production Deployment
- AgentOS: Transform agents into production-ready REST APIs
- AgentOS UI: Control plane for building, monitoring, and managing agents
- API Routes: Session management, memory, knowledge, evals, metrics
- Authentication: JWT middleware, RBAC (role-based access control)
- Interfaces: Slack, Discord, WhatsApp, A2A (agent-to-agent), AG-UI
- Remote Execution: Execute agents and teams remotely via API
- Background Tasks: Schedule background execution and event handling
- Middleware: Custom middleware, JWT authentication, cookie-based auth
- Studio: Visual builder for agents, teams, and workflows (alpha)
Workflows
Building and Running a Single Agent
- Import Agent and model:
from agno.agent import Agentand model provider - Define tools as Python functions with docstrings
- Create agent with model, tools, and instructions
- Run with
agent.print_response()oragent.run() - Access response via
response.content
Creating a Multi-Agent Team
- Create individual agents with specific roles and tools
- Compose into Team with
Team(members=[agent1, agent2, ...]) - Set team role and delegation strategy
- Run team with
team.print_response()orteam.run() - Team leader automatically delegates to appropriate members
Building a Workflow
- Create agents or teams as workflow steps
- Define workflow with
Workflow(steps=[step1, step2, ...]) - Use patterns: sequential (default), parallel, conditional, loop, router
- Run with
workflow.run()orworkflow.print_response() - Access step outputs via
run_output.steps
Adding Knowledge to Agents
- Create knowledge base:
knowledge = Knowledge(vector_db=ChromaDb(...)) - Insert content:
knowledge.insert(url="...")orknowledge.insert(text_content="...") - Add to agent:
agent = Agent(knowledge=knowledge, search_knowledge=True) - Agent automatically searches knowledge when relevant
Implementing Memory
- Configure database:
db = SqliteDb(db_file="agent.db") - Enable memory:
agent = Agent(db=db, update_memory_on_run=True) - Agent automatically extracts and stores user facts
- Retrieve memories:
agent.get_user_memories(user_id="123")
Deploying to Production with AgentOS
- Create agents, teams, and workflows
- Initialize AgentOS:
agent_os = AgentOS(agents=[...], teams=[...], workflows=[...]) - Get FastAPI app:
app = agent_os.get_app() - Serve with:
agent_os.serve(app="module:app") - Access API endpoints for agents, teams, workflows, sessions, memory, knowledge
- Connect interfaces (Slack, Discord, WhatsApp) via configuration
Structured Output for Data Extraction
- Define Pydantic model for desired output structure
- Pass to agent:
agent = Agent(response_format=MyModel) - Agent response is validated against schema
- Access typed fields:
response.content.field_name
Implementing Human-in-the-Loop
- Import confirmation tools:
from agno.hitl import UserConfirmation - Add to agent tools:
tools=[UserConfirmation(), ...] - Agent can request user confirmation before actions
- Handle confirmation in run:
response = agent.run(user_id="123")
Integration
Agno integrates with:
- LLM Providers: OpenAI, Anthropic, Google, Meta, Mistral, Cohere, and 20+ others
- Vector Databases: PgVector, LanceDB, Pinecone, Qdrant, Chroma, Weaviate, and 15+ more
- Relational Databases: PostgreSQL, MySQL, SQLite for storage and memory
- Cloud Platforms: AWS (Bedrock, Lambda), Google Cloud, Azure, IBM WatsonX
- Communication: Slack, Discord, WhatsApp, email, Telegram
- Web Tools: Web search (Tavily, Serper, DuckDuckGo), web scraping (Firecrawl, Browserbase)
- Data Tools: SQL databases, DuckDB, BigQuery, Pandas, Neo4j
- APIs: Custom API integration, MCP servers, 1000+ APIs via Pipedream
- Observability: LangSmith, LangFuse, AgentOps, Arize, Weave
- File Storage: Google Cloud Storage, S3, local filesystem
Context
Agents vs Teams vs Workflows: Use a single agent for focused tasks, teams for complex problems requiring specialization, and workflows for deterministic, repeatable processes with clear steps.
Memory vs History: Memory stores learned user facts (preferences, habits), while history stores conversation messages for continuity.
RAG Strategies: Agentic RAG lets agents decide when to search (flexible), traditional RAG always injects context (predictable).
Tool Execution: Tools execute sequentially by default but can run in parallel with async functions and models supporting parallel tool calls.
Model Selection: Choose based on capabilities needed (vision, audio, reasoning), cost, and latency. Use model strings like “openai:gpt-4o” for flexibility.
Database Choice: PostgreSQL for production with vector support via PgVector, SQLite for development, MongoDB for document storage, Redis for caching.
Structured Outputs: Preferred over parsing for reliable data extraction. Most major providers support native structured outputs.
Scaling Considerations: Teams distribute work across agents, workflows provide audit trails, memory enables personalization, knowledge grounds responses in facts.
Production Readiness: AgentOS provides REST API, authentication, session management, and monitoring. Deploy via Docker, Railway, or AWS templates.
For additional documentation and navigation, see: https://docs.agno.com/llms.txt