Agent Context and State Management with RunContextWrapper
Learn how to use RunContextWrapper to pass shared state between agents and tools in the OpenAI Agents SDK. Covers typed context, dependency injection, and practical patterns.
Step-by-step tutorials on building voice and chat AI agents using OpenAI Agents SDK, Realtime API, function calling, multi-agent orchestration, and production deployment patterns.
9 of 1313 articles
Learn how to use RunContextWrapper to pass shared state between agents and tools in the OpenAI Agents SDK. Covers typed context, dependency injection, and practical patterns.
Understand the internal agent loop that powers the OpenAI Agents SDK. Learn how agents cycle through LLM calls, tool execution, handoffs, and final output generation.
Learn how to manage conversation history across agent boundaries using nest_handoff_history, per-handoff overrides, CONVERSATION HISTORY blocks, and handoff_history_mapper in the OpenAI Agents SDK.
Learn how to run multiple OpenAI agents concurrently using asyncio.gather for dramatic performance improvements, with error handling strategies and a complete market research example.
Learn how to build sequential agent pipelines where the output of one agent feeds directly into the next, using structured outputs for clean handoffs in the OpenAI Agents SDK.
Combine the handoff pattern with the agents-as-tools pattern to build hybrid orchestration systems where a triage agent delegates via handoffs and specialist agents use sub-agents as tools.
Build a complete multi-agent code review system with specialized agents for analysis, security review, style checking, and a manager agent that synthesizes findings into actionable review comments.
Learn how to implement input guardrails in the OpenAI Agents SDK to validate, filter, and reject unsafe user requests before they reach your agent's main processing loop.