pnpm-upgrade
π―Skillfrom openai/openai-agents-js
Upgrades project dependencies using pnpm, ensuring all packages are updated to their latest compatible versions across the project.
Installation
npx skills add https://github.com/openai/openai-agents-js --skill pnpm-upgradeSkill Details
Overview
# OpenAI Agents SDK (JavaScript/TypeScript)
[](https://badge.fury.io/js/@openai%2Fagents)
[](https://github.com/openai/openai-agents-js/actions/workflows/test.yml)
The OpenAI Agents SDK is a lightweight yet powerful framework for building multi-agent workflows in JavaScript/TypeScript. It is provider-agnostic, supporting OpenAI APIs and more.

> [!NOTE]
> Looking for the Python version? Check out [OpenAI Agents SDK Python](https://github.com/openai/openai-agents-python).
Core concepts
- Agents: LLMs configured with instructions, tools, guardrails, and handoffs.
- Handoffs: Specialized tool calls for transferring control between agents.
- Guardrails: Configurable safety checks for input and output validation.
- Tracing: Built-in tracking of agent runs, allowing you to view, debug, and optimize your workflows.
Explore the [examples/](examples/) directory to see the SDK in action.
Supported Features
- [x] Multi-Agent Workflows: Compose and orchestrate multiple agents in a single workflow.
- [x] Tool Integration: Seamlessly call tools/functions from within agent responses.
- [x] Handoffs: Transfer control between agents dynamically during a run.
- [x] Structured Outputs: Support for both plain text and schema-validated structured outputs.
- [x] Streaming Responses: Stream agent outputs and events in real time.
- [x] Tracing & Debugging: Built-in tracing for visualizing and debugging agent runs.
- [x] Guardrails: Input and output validation for safety and reliability.
- [x] Parallelization: Run agents or tool calls in parallel and aggregate results.
- [x] Human-in-the-Loop: Integrate human approval or intervention into workflows.
- [x] Realtime Voice Agents: Build realtime voice agents using WebRTC or WebSockets
- [x] Local MCP Server Support: Give an Agent access to a locally running MCP server to provide tools
- [x] Separate optimized browser package: Dedicated package meant to run in the browser for Realtime agents.
- [x] Broader model support: Use non-OpenAI models through the Vercel AI SDK adapter
- [ ] Long running functions: Suspend an agent loop to execute a long-running function and revive it later
- [ ] Voice pipeline: Chain text-based agents using speech-to-text and text-to-speech into a voice agent
Get started
Supported environments
- Node.js 22 or later
- Deno
- Bun
Experimental support:
- Cloudflare Workers with
nodejs_compatenabled
[Check out the documentation](https://openai.github.io/openai-agents-js/guides/troubleshooting/) for more detailed information.
Installation
```bash
npm install @openai/agents zod
```
The Agents SDK requires Zod v4; npm install zod pulls the latest v4.x by default.
Hello world example
```js
import { Agent, run } from '@openai/agents';
const agent = new Agent({
name: 'Assistant',
instructions: 'You are a helpful assistant',
});
const result = await run(
agent,
'Write a haiku about recursion in programming.',
);
console.log(result.finalOutput);
// Code within the code,
// Functions calling themselves,
// Infinite loop's dance.
```
(_If running this, ensure you set the OPENAI_API_KEY environment variable_)
Functions example
```js
import { z } from 'zod';
import { Agent, run, tool } from '@openai/agents';
const getWeatherTool = tool({
name: 'get_weather',
description: 'Get the weather for a given city',
parameters: z.