> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Advanced

> Advanced examples covering caching, compression, concurrency, events, retries, debugging, culture, and serialization.

| Example | Description |
| - | - |
| [01 Create Cultural Knowledge](https://agno-v2.mintlify.site/examples/agents/advanced/create-cultural-knowledge.md) | Create cultural knowledge to use with your Agents. |
| [04 Manually Add Culture](https://agno-v2.mintlify.site/examples/agents/advanced/manually-add-culture.md) | Manually add cultural knowledge to your Agents. |
| [Advanced Compression](https://agno-v2.mintlify.site/examples/agents/advanced/advanced-compression.md) | Set a context token based limit for tool call compression. |
| [Agent Serialization](https://agno-v2.mintlify.site/examples/agents/advanced/agent-serialization.md) | Serialize and deserialize agents using to\_dict/from\_dict and save/load with a database. |
| [Background Execution](https://agno-v2.mintlify.site/examples/agents/advanced/background-execution.md) | Background execution allows you to start an agent run that returns immediately. |
| [Background Execution Structured](https://agno-v2.mintlify.site/examples/agents/advanced/background-execution-structured.md) | Combines background execution (non-blocking, async) with Pydantic output\_schema. |
| [Basic Agent Events](https://agno-v2.mintlify.site/examples/agents/advanced/basic-agent-events.md) | Stream agent events including run lifecycle, tool calls, and content output. |
| [Cache Model Response](https://agno-v2.mintlify.site/examples/agents/advanced/cache-model-response.md) | Example showing how to cache model responses to avoid redundant API calls. |
| [Cancel Run](https://agno-v2.mintlify.site/examples/agents/advanced/cancel-run.md) | Example demonstrating how to cancel a running agent execution. |
| [Compression Events](https://agno-v2.mintlify.site/examples/agents/advanced/compression-events.md) | Test script to verify compression events are working correctly. |
| [Concurrent Execution](https://agno-v2.mintlify.site/examples/agents/advanced/concurrent-execution.md) | Concurrent Agent Execution with asyncio.gather. |
| [Custom Cancellation Manager](https://agno-v2.mintlify.site/examples/agents/advanced/custom-cancellation-manager.md) | Shows how to extend BaseRunCancellationManager to implement your own. |
| [Custom Logging](https://agno-v2.mintlify.site/examples/agents/advanced/custom-logging.md) | Example showing how to use a custom logger with Agno. |
| [Debug](https://agno-v2.mintlify.site/examples/agents/advanced/debug.md) | You can set the debug mode on the agent for all runs to have more verbose output. |
| [Multi-Model Metrics](https://agno-v2.mintlify.site/examples/agents/advanced/multi-model-metrics.md) | Track per-model token usage with memory model breakdown in metrics.details. |
| [Culture Metrics](https://agno-v2.mintlify.site/examples/agents/advanced/culture-metrics.md) | Track culture model token usage under the culture\_model detail key. |
| [Session Metrics](https://agno-v2.mintlify.site/examples/agents/advanced/session-metrics.md) | Accumulate metrics across multiple runs within a session using SessionMetrics. |
| [Session Summary Metrics](https://agno-v2.mintlify.site/examples/agents/advanced/session-summary-metrics.md) | Track session summary model token usage under the session\_summary\_model detail key. |
| [Streaming Metrics](https://agno-v2.mintlify.site/examples/agents/advanced/streaming-metrics.md) | Capture metrics from streaming responses using yield\_run\_output=True. |
| [Tool Call Metrics](https://agno-v2.mintlify.site/examples/agents/advanced/tool-call-metrics.md) | Track tool execution timing with ToolCallMetrics on each ToolExecution. |
| [Background Execution Metrics](https://agno-v2.mintlify.site/examples/agents/advanced/background-execution-metrics.md) | Track metrics for background (async) agent runs with full token and model details. |
| [Reasoning Agent Events](https://agno-v2.mintlify.site/examples/agents/advanced/reasoning-agent-events.md) | Stream reasoning\_started, reasoning\_step, and reasoning\_completed events from a reasoning-enabled agent run. |
| [Retries](https://agno-v2.mintlify.site/examples/agents/advanced/retries.md) | Example demonstrating how to set up retries with an Agent. |
| [Tool Call Compression](https://agno-v2.mintlify.site/examples/agents/advanced/tool-call-compression.md) | Compress tool call history to reduce context size. |
| [Learning Machine](https://agno-v2.mintlify.site/examples/agents/memory-and-learning/learning-machine.md) | Create agents that learn and improve from interactions over time. |
| [Memory Manager](https://agno-v2.mintlify.site/examples/agents/memory-and-learning/memory-manager.md) | Use a MemoryManager to give agents persistent memory across sessions. |
| [Basic Reasoning](https://agno-v2.mintlify.site/examples/agents/reasoning/basic-reasoning.md) | Add chain-of-thought reasoning capabilities to agents. |
| [Reasoning With Model](https://agno-v2.mintlify.site/examples/agents/reasoning/reasoning-with-model.md) | Use a separate reasoning model with configurable step limits. |
| [Basic Skills](https://agno-v2.mintlify.site/examples/agents/skills/basic-skills.md) | Load skills from a local directory with LocalSkills and use them in a code review agent. |
| [Check Style](https://agno-v2.mintlify.site/examples/agents/skills/sample-skills/code-review/scripts/check-style.md) | Check Python code for style issues. |
| [Commit Message](https://agno-v2.mintlify.site/examples/agents/skills/sample-skills/git-workflow/scripts/commit-message.md) | Validate or generate conventional commit messages. |
| [SSE Reconnection](https://agno-v2.mintlify.site/examples/agents/advanced/sse-reconnect.md) | Reconnect to a background agent stream after disconnection using the /resume endpoint. |
| [Cancel Run Persistence](https://agno-v2.mintlify.site/examples/agents/advanced/agent-run-cancel-persistence.md) | Cancel an agent run mid-stream and verify that partial content and messages are preserved in the database. |
| [Combined Metrics](https://agno-v2.mintlify.site/examples/agents/advanced/combined-metrics.md) | Inspect per-model metrics detail keys and session-level metrics for an agent using reasoning, compression, memory, culture, summary, and eval models. |
| [Interchange Model: All 5 Providers](https://agno-v2.mintlify.site/examples/agents/advanced/interchange-model/all-providers.md) | Cycles through OpenAI Chat, OpenAI Responses, Claude, Gemini, and AWS Claude. |
| [Claude Gemini](https://agno-v2.mintlify.site/examples/agents/advanced/interchange-model/claude-gemini.md) | Switch a single agent between Claude and Gemini mid-conversation with shared Postgres history. |
| [OpenAI Chat Responses](https://agno-v2.mintlify.site/examples/agents/advanced/interchange-model/openai-chat-responses.md) | Alternate one agent between OpenAIChat and OpenAIResponses mid-session over shared Postgres history. |
| [OpenAI Claude](https://agno-v2.mintlify.site/examples/agents/advanced/interchange-model/openai-claude.md) | Swap a single agent between GPT-4o and Claude mid-session with tool-call history stored in Postgres. |
| [OpenAI Gemini](https://agno-v2.mintlify.site/examples/agents/advanced/interchange-model/openai-gemini.md) | Move one conversation between GPT-4o and Gemini across turns with history persisted in Postgres. |
| [Metrics](https://agno-v2.mintlify.site/examples/agents/advanced/metrics.md) | Inspect per-message, run, and session metrics after a YFinance tool call on a Postgres-backed agent. |
| [Background Execution Concurrency](https://agno-v2.mintlify.site/examples/agents/advanced/background-execution-concurrency.md) | Example demonstrating the concurrency limit for background runs. |
| [Background Streaming Resume](https://agno-v2.mintlify.site/examples/agents/advanced/background-streaming-resume.md) | Example demonstrating background streaming with disconnect and resume. |
| [Redis Event Stream Resume](https://agno-v2.mintlify.site/examples/agents/advanced/redis-event-stream-resume.md) | Example demonstrating cross-process streaming resume with RedisEventStream. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.