OpenAI Realtime Agents

Stale
GitHub TypeScript MIT

Description

A demonstration of advanced agentic patterns built on top of OpenAI's Realtime API, showcasing real-time voice interaction and multi-agent collaboration.

Key Features

  • Chat-Supervisor pattern: lightweight realtime chat agent handles basic tasks while a more intelligent text-based supervisor model handles complex tool calls
  • Sequential Handoff pattern: specialized agents transfer users between them to handle specific intents, inspired by OpenAI Swarm
  • Built on OpenAI Agents SDK with unified agent orchestration, state management, and event handling
  • Low-latency streaming voice interactions via OpenAI Realtime API
  • Extensible multi-agent collaboration with guardrails, handoffs, and tool use
  • Configurable decision boundary allowing gradual migration from text to realtime agents

Use Cases

💡 Customer service voice agents that handle routine queries with a chat agent and escalate complex issues to specialist supervisors
💡 Prototyping multi-agent realtime voice applications in under 20 minutes using the Sequential Handoff pattern
💡 Building voice-enabled AI assistants that combine fast conversational responses with high-intelligence tool calling
💡 Gradually migrating existing text-based chat agents to voice by reusing prompts and tools for the supervisor layer

Quick Start

1. Clone the repo and install dependencies with `npm i`
2. Add your OPENAI_API_KEY to `.env` (copy from `.env.sample`)
3. Run `npm run dev` and open http://localhost:3000
4. Select a scenario from the top-right dropdown to try Chat-Supervisor or Sequential Handoff patterns

Related Projects

Related Articles