OpenAI Agents SDK
OpenAI Agents SDK official site ↗Last checked against the official docs:
What it does
A lightweight Python framework for building agents and multi-agent workflows. It covers agents with tools and handoffs, guardrails, human-in-the-loop, sessions, tracing, sandbox agents and voice/realtime agents. It works with OpenAI's APIs and, per the README, 100+ other LLMs. A JS/TS version exists too. MIT licensed.
Who it's for
Python developers building their own agents who want a small, well-documented framework.
How to set it up
Needs Python 3.10 or newer. Install:
bashpython -m venv .venv source .venv/bin/activate pip install openai-agentsOr with uv:
bashuv init uv add openai-agentsSet OPENAI_API_KEY and run a first agent:
textfrom agents import Agent, Runner agent = Agent(name="Assistant", instructions="You are a helpful assistant") result = Runner.run_sync(agent, "Write a haiku about recursion in programming.") print(result.final_output)
Check the official OpenAI Agents SDK docs for the latest steps.
Example prompts
Build a triage agent with the OpenAI Agents SDK that hands off to a billing agent or a support agent.Add an input guardrail that blocks requests unrelated to our product.Connect my agent to a local MCP server and list the tools it can see.Demo
Demo coming soon
A short walkthrough of OpenAI Agents SDK in action.
More Agent Frameworks
- Vercel
AI SDK
Vercel's provider-agnostic TypeScript toolkit for building AI apps and agents. It works with Next.js, React, Svelte, Vue, Angular and Node.js, and its UI hooks cover React, Svelte and Vue. One API covers OpenAI, Anthropic, Google and many more providers, either through Vercel AI Gateway (the default) or each provider's own package. Apache-2.0.
- CrewAI
CrewAI
A Python framework for multi-agent automation. Crews are teams of role-based agents that work together on a task; Flows are event-driven workflows with state and branching that can call crews. The CLI scaffolds projects, which are JSON-first by default. MIT licensed.
- LangChain
LangGraph
A low-level framework for building long-running, stateful agents as graphs. It provides durable execution (agents resume after failures), human-in-the-loop interrupts and short- and long-term memory. It works on its own or with LangChain and LangSmith. A JS version (LangGraph.js) is also available. MIT licensed.
- Mastra
Mastra
A TypeScript framework for AI apps and agents. It includes model routing across 40+ providers, agents with tools, graph-based workflows with suspend/resume, memory and RAG, MCP server authoring, evals and observability, plus a local Studio UI. Apache-2.0, except code in ee/ folders, which uses an enterprise license.
- Pydantic
Pydantic AI
A typed Python agent framework from the Pydantic team. You define agents with typed outputs and tools, and switching model providers is a one-string change. Companion packages add a harness for long-running agents (files, shell, sub-agents) and Pydantic Evals for testing. MIT licensed.