OpenAI Agents SDK

OpenAI's provider-agnostic Python framework for building multi-agent LLM workflows with tools, guardrails, and tracing.

Framework
PyPI
v0.21.1
28,757stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
89/100Excellent
Development Activity100
Maintenance100
Community76
Maturity40
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
85/100Excellent
Architecture87
Code Quality88
Innovation85
Learning Curve78

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 Agent primitive 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

Go
32%
Apache 2.0

CubeSandbox

Developer Tools · Security · AI Agents

11,247

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.

View details
83
Repo Health
88
Technical
63
Dependency
Built with
Go32%
Rust31%
C21%
Updated today
Go
42%
Apache 2.0

e2a

AI Agents · Automation

182

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.

View details
78
Repo Health
80
Technical
76
Dependency
Built with
Go42%
TypeScript28%
Python15%
Updated today
Go
84%
MIT

Hatchet

AI Development · Developer Tools · Automation

7,749

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.

View details
88
Repo Health
83
Technical
69
Dependency
Built with
Go84%
PLpgSQL11%
Updated today
TypeScript
55%
Other

Jaaz

AI Design Tools · AI Agents

6,552

Open-source AI creative agent that turns visual sketches and canvas gestures into images and videos — no text prompts required.

View details
45
Repo Health
59
Technical
71
Dependency
Built with
TypeScript55%
Python34%
JavaScript10%
Updated 5 months ago
Python
74%
Apache 2.0

OpenKB

Knowledge Management

3,810

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.

View details
77
Repo Health
72
Technical
76
Dependency
Built with
Python74%
TypeScript23%
Updated 4 weeks ago
Python
47%
Other

Arize Phoenix

Devops · Analytics · Monitoring

11,105

Open-source AI observability platform for tracing, evaluating, and debugging LLM applications with built-in intelligence and MCP support.

View details
90
Repo Health
88
Technical
68
Dependency
Built with
Python47%
TypeScript41%
Updated today
TypeScript
97%
MIT

Promptfoo

AI Development

24,362

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.

View details
90
Repo Health
73
Technical
68
Dependency
Built with
TypeScript97%
Updated yesterday
Python
76%
AGPL 3.0

Skyvern

AI Agents · Automation

22,785

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.

View details
89
Repo Health
82
Technical
71
Dependency
Built with
Python76%
TypeScript22%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search