Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 62 additions & 17 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,80 @@ Check out a variety of sample implementations of the SDK in the examples section
- Deterministic workflows
- Agents as tools
- Parallel agent execution
- Conditional tool usage
- Input/output guardrails
- LLM as a judge
- Routing
- Streaming guardrails

- **[basic](https://github.com/openai/openai-agents-python/tree/main/examples/basic):**
These examples showcase foundational capabilities of the SDK, such as

- Hello world examples (GPT-4, GPT-5, Open Source)
- Agent lifecycle management
- Dynamic system prompts
- Streaming outputs
- Lifecycle events
- Streaming outputs (text, items, function call args)
- Prompt templates
- File handling (local and remote, images and PDFs)
- Usage tracking
- Non-strict output types
- Previous response ID usage

- **[tool examples](https://github.com/openai/openai-agents-python/tree/main/examples/tools):**
Learn how to implement OAI hosted tools such as web search and file search,
and integrate them into your agents.
- **[customer_service](https://github.com/openai/openai-agents-python/tree/main/examples/customer_service):**
Example customer service system for an airline.

- **[model providers](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers):**
Explore how to use non-OpenAI models with the SDK.
- **[financial_research_agent](https://github.com/openai/openai-agents-python/tree/main/examples/financial_research_agent):**
A financial research agent that demonstrates structured research workflows with agents and tools for financial data analysis.

- **[handoffs](https://github.com/openai/openai-agents-python/tree/main/examples/handoffs):**
See practical examples of agent handoffs.
See practical examples of agent handoffs with message filtering.

- **[mcp](https://github.com/openai/openai-agents-python/tree/main/examples/mcp):**
Learn how to build agents with MCP.
- **[hosted_mcp](https://github.com/openai/openai-agents-python/tree/main/examples/hosted_mcp):**
Examples demonstrating how to use hosted MCP (Model Context Protocol) connectors and approvals.

- **[customer_service](https://github.com/openai/openai-agents-python/tree/main/examples/customer_service)** and **[research_bot](https://github.com/openai/openai-agents-python/tree/main/examples/research_bot):**
Two more built-out examples that illustrate real-world applications
- **[mcp](https://github.com/openai/openai-agents-python/tree/main/examples/mcp):**
Learn how to build agents with MCP (Model Context Protocol), including:

- Filesystem examples
- Git examples
- Prompt server
- SSE (Server-Sent Events) examples
- Streamable HTTP examples

- **customer_service**: Example customer service system for an airline.
- **research_bot**: Simple deep research clone.
- **[memory](https://github.com/openai/openai-agents-python/tree/main/examples/memory):**
Examples of different memory implementations for agents, including:

- SQLite session storage
- Advanced SQLite session storage
- Redis session storage
- SQLAlchemy session storage
- Encrypted session storage
- OpenAI session storage

- **[voice](https://github.com/openai/openai-agents-python/tree/main/examples/voice):**
See examples of voice agents, using our TTS and STT models.
- **[model_providers](https://github.com/openai/openai-agents-python/tree/main/examples/model_providers):**
Explore how to use non-OpenAI models with the SDK, including custom providers and LiteLLM integration.

- **[realtime](https://github.com/openai/openai-agents-python/tree/main/examples/realtime):**
Examples showing how to build realtime experiences using the SDK.
Examples showing how to build real-time experiences using the SDK, including:

- Web-based applications
- Command-line interfaces
- Twilio integration

- **[reasoning_content](https://github.com/openai/openai-agents-python/tree/main/examples/reasoning_content):**
Examples demonstrating how to work with reasoning content and structured outputs.

- **[research_bot](https://github.com/openai/openai-agents-python/tree/main/examples/research_bot):**
Simple deep research clone that demonstrates complex multi-agent research workflows.

- **[tools](https://github.com/openai/openai-agents-python/tree/main/examples/tools):**
Learn how to implement OAI hosted tools such as:

- Web search and web search with filters
- File search
- Code interpreter
- Computer use
- Image generation

- **[voice](https://github.com/openai/openai-agents-python/tree/main/examples/voice):**
See examples of voice agents, using our TTS and STT models, including streamed voice examples.