ScriptsMar 30, 2026·1 min read

OpenAI Agents SDK — Multi-Agent Workflows in Python

Official OpenAI framework for building multi-agent workflows. Handoffs between agents, tool calling, guardrails, tracing, and streaming. Lightweight, Python-native. 20K+ stars.

TO
TokRepo精选 · Community
Quick Use

Use it first, then decide how deep to go

This block should tell both the user and the agent what to copy, install, and apply first.

pip install openai-agents
from agents import Agent, Runner

agent = Agent(name="Assistant", instructions="You are a helpful assistant.")
result = Runner.run_sync(agent, "Write a haiku about coding.")
print(result.final_output)

Intro

OpenAI Agents SDK is the official lightweight Python framework for building multi-agent workflows. It provides primitives for agent handoffs, tool calling, input/output guardrails, tracing, and streaming — designed to be minimal yet production-ready. 20,000+ GitHub stars, maintained by OpenAI.

Best for: Developers building multi-agent systems with OpenAI models Works with: OpenAI API, GPT-4o, o3, any OpenAI-compatible endpoint


Core Concepts

Agents

Agents are LLMs configured with instructions and tools:

agent = Agent(
    name="Research Agent",
    instructions="You research topics thoroughly.",
    tools=[search_tool, wikipedia_tool],
)

Handoffs

Agents can delegate to specialized agents:

triage = Agent(
    name="Triage",
    handoffs=[billing_agent, technical_agent, general_agent],
)

Guardrails

Validate inputs/outputs before and after agent runs:

@input_guardrail
async def check_topic(ctx, agent, input):
    # reject off-topic requests
    ...

Tracing

Built-in tracing for debugging multi-agent flows — visualize handoff chains, tool calls, and token usage.


FAQ

Q: What is OpenAI Agents SDK? A: The official OpenAI Python framework for multi-agent workflows with handoffs, tool calling, guardrails, and tracing. 20K+ GitHub stars.

Q: How is it different from LangChain or CrewAI? A: It's minimal by design — focused primitives (agents, handoffs, guardrails) without a large dependency tree. Built and maintained by OpenAI.


🙏

Source & Thanks

Created by OpenAI. Licensed under MIT. openai/openai-agents-python — 20,000+ GitHub stars

Related Assets