This directory contains samples demonstrating how to use the OpenAI Agents SDK with Temporal's durable execution engine. These samples are adapted from the OpenAI Agents SDK examples and extended with Temporal's durability and orchestration capabilities.
See the module documentation for more information.
The integration combines:
- Temporal workflows for orchestrating agent control flow and state management
- OpenAI Agents SDK for AI agent creation and tool interactions
This approach ensures that AI agent workflows are durable, observable, and can handle failures gracefully.
- Temporal server running locally
- Required dependencies installed via
uv sync --group openai-agents - OpenAI API key set as environment variable:
export OPENAI_API_KEY=your_key_here
Each directory contains a complete example with its own README for detailed instructions:
- Basic Examples - Simple agent examples including a hello world agent and a tools-enabled agent that can access external APIs like weather services.
- Agent Patterns - Advanced patterns for agent composition, including using agents as tools within other agents.
- Tools - Demonstrates available tools such as file search, image generation, and others.
- Handoffs - Agents collaborating via handoffs.
- Hosted MCP - Using the MCP client functionality of the OpenAI Responses API.
- MCP - Local MCP servers (filesystem/stdio, streamable HTTP, SSE, prompt server) integrated with Temporal workflows.
- Model Providers - Using custom LLM providers (e.g., Anthropic via LiteLLM).
- Research Bot - Multi-agent research system with specialized roles: a planner agent, search agent, and writer agent working together to conduct comprehensive research.
- Customer Service - Interactive customer service agent with escalation capabilities, demonstrating conversational workflows.
- Reasoning Content - Example of how to retrieve the thought process of reasoning models.
- Financial Research Agent - Multi-agent financial research system with planner, search, analyst, writer, and verifier agents collaborating.