OpenAI Agents SDK
OpenAI's provider-agnostic Python framework for building multi-agent LLM workflows with tools, guardrails, and tracing.
Repository Health
Technical Analysis
The OpenAI Agents SDK is a lightweight but opinionated framework for building multi-agent workflows in Python. It structures applications around a small set of primitives — Agents (LLMs configured with instructions, tools, and guardrails), Handoffs (delegating a task to another agent), Sessions (automatic conversation history), and Tracing (built-in observability for every agent run) — and is provider-agnostic, working with OpenAI’s Responses and Chat Completions APIs as well as 100+ other LLMs via LiteLLM and other adapters.
Beyond the core agent loop, it ships batteries-included support for function tools, hosted tools, MCP (Model Context Protocol) servers, sandboxed “sandbox agents” for long-running container-backed work, realtime voice agents, and human-in-the-loop approval flows. As the official successor to OpenAI’s earlier Swarm experiment, it’s become one of the most widely adopted agent frameworks, backing production multi-agent systems that need structured orchestration rather than ad-hoc prompt chaining.
What You Get
- An
Agentprimitive combining instructions, model settings, tools, and guardrails into a reusable unit - Handoffs and agents-as-tools for delegating subtasks between agents in a multi-agent workflow
- Built-in Sessions for automatic conversation history management across runs
- Native tracing that records every agent run for debugging and workflow optimization
- Support for function tools, hosted tools, and MCP servers so agents can take real actions
- Sandbox Agents preconfigured to operate inside containers (Docker, E2B, Modal, Daytona, Cloudflare, etc.) for long-horizon tasks
- Provider-agnostic model layer supporting OpenAI Responses/Chat Completions plus 100+ other LLMs via LiteLLM
Common Use Cases
- Building a customer-support system where a triage agent hands off to specialized agents (billing, technical, refunds)
- Orchestrating a research or coding agent that uses tools and sandboxed execution over a long-running task
- Adding conversational memory and tracing/observability to a production LLM application
- Building realtime voice agents or human-in-the-loop approval workflows for sensitive actions
Under The Hood
Architecture — The SDK’s src/agents/ package centers on agent.py (the Agent definition) and run.py/run_internal/ (the execution loop that resolves tools, guardrails, and handoffs each turn), with dedicated subpackages for tracing/, memory/ (session backends), mcp/ (Model Context Protocol client), voice/ and realtime/ (streaming audio agents), and sandbox/ (container-backed sandbox agents for platforms like E2B, Modal, Daytona, and Cloudflare). This separation lets the core agent loop stay provider-agnostic while extensions (extensions/) plug in specific model backends or tool ecosystems. Tech Stack — Pure Python 3.10+, built on openai (API client), pydantic v2 (schema/validation for structured outputs and function-call schemas), mcp for Model Context Protocol support, and websockets for realtime/voice streaming; a large matrix of optional extras (sqlalchemy, redis, dapr, temporal, mongodb, cloud sandbox providers) lets teams pull in only the session/sandbox backend they need. Code Quality — The repo carries 126+ files under tests/ covering agents, handoffs, guardrails, tracing, and sandbox providers, is fully typed (py.typed marker, pyright config), and is maintained with a very active commit cadence (health-score development-activity and maintenance-consistency both scored at the maximum). API Design — The primitives (Agent, Runner, handoff, function_tool) are deliberately small and composable, so a minimal single-agent script and a complex multi-agent handoff graph share the same mental model; instructions, tools, and guardrails are all passed as plain constructor arguments rather than requiring subclassing, keeping the barrier to a first working agent low.
Used by 8 apps in this directory
CubeSandbox
Developer Tools · Security · AI Agents
Instant, concurrent, hardware-isolated MicroVM sandboxes for AI agents — E2B-API compatible, sub-60ms cold starts, and a built-in zero-trust egress proxy, all self-hostable at scale.
e2a
AI Agents · Automation
Give your AI agents a real, authenticated email address — with SPF/DKIM-verified inbound, HMAC-signed delivery, WebSocket fan-out, and human-in-the-loop approval built in.
Hatchet
AI Development · Developer Tools · Automation
A Postgres-backed orchestration engine for background tasks, AI agents, and durable workflows that replaces Redis queues and multi-datastore durable execution platforms with a single self-hostable service.
Jaaz
AI Design Tools · AI Agents
Open-source AI creative agent that turns visual sketches and canvas gestures into images and videos — no text prompts required.
OpenKB
Knowledge Management
An open-source CLI that compiles raw documents into a structured, interlinked wiki-style knowledge base using LLMs — powered by vectorless, reasoning-based retrieval (PageIndex) instead of a vector database.
Arize Phoenix
Devops · Analytics · Monitoring
Open-source AI observability platform for tracing, evaluating, and debugging LLM applications with built-in intelligence and MCP support.
Promptfoo
AI Development
An open-source CLI and library for evaluating and red-teaming LLM applications — replace trial-and-error prompt engineering with systematic evals, vulnerability scanning, and CI/CD integration.
Skyvern
AI Agents · Automation
Skyvern (YC S2023) automates browser-based workflows by pairing LLMs with computer vision, letting agents click, fill, and extract data on sites they've never seen, without brittle XPath selectors that break on every layout change.