openai · OpenAI Platform Docs
Running agents
Explains the core agent execution loop, including model calls, tool execution, and agent handoffs, while detailing four distinct conversation strategies for managing state across multi-turn interactions.
Derived skill
Files assembled from official documentation
Viewing SKILL.md
Running agents
Explains the core agent execution loop, including model calls, tool execution, and agent handoffs, while detailing four distinct conversation strategies for managing state across multi-turn interactions.
When To Use
Use when implementing the runtime logic for an agent, managing conversation state across multiple turns, or deciding between local and server-managed session persistence.
Reference Files
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/running-agents-workflow-guide.md | A guide explaining the agent runtime loop, conversation strategies, incremental streaming, and handling pauses or failures when running agents. | Questions about a guide explaining the agent runtime loop, conversation strategies, incremental streaming, and handling pauses or fai... |
examples/running-agents-openai-agents-typescript-run-agent-memory-session.typescript | A TypeScript example demonstrating how to initialize an Agent and use a MemorySession to maintain state across multiple turns using the run function. | Exact payloads, commands, or snippets shown in A TypeScript example demonstrating how to initialize an Agent and use a MemorySession to maintain state across multip... |
examples/running-agents-openai-agents-python-runner-sqlite-session.python | A Python script demonstrating how to use the OpenAI Agent Runner with a SQLite session to maintain conversation state. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the OpenAI Agent Runner with a SQLite session to maintain conversation state. |
examples/running-agents-openai-agents-typescript-run-agent.typescript | A TypeScript code example demonstrating how to initialize an Agent and use the run function to execute a conversation. | Exact payloads, commands, or snippets shown in A TypeScript code example demonstrating how to initialize an Agent and use the run function to execute a conversation. |
examples/running-agents-openai-agents-python-runner-execution.python | A Python script demonstrating how to use the Agent and Runner classes to execute multi-turn conversations with state persistence. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the Agent and Runner classes to execute multi-turn conversations with state... |
examples/running-agents-openai-agents-typescript-run-agent-stream.typescript | A TypeScript example demonstrating how to initialize an Agent and run it using a streaming response loop. | Exact payloads, commands, or snippets shown in A TypeScript example demonstrating how to initialize an Agent and run it using a streaming response loop. |
examples/running-agents-openai-agents-python-runner-streamed.python | A Python script demonstrating how to use the Runner.runstreamed method to execute an agent and iterate through event streams. | Exact payloads, commands, or snippets shown in A Python script demonstrating how to use the Runner.runstreamed method to execute an agent and iterate through event... |
What This Skill Covers
- Defining an agent is only the setup step. The runtime questions are what a single run does, how the next turn continues, and how the workflow behaves when it...
- Main sections:
The agent loop,Choose one conversation strategy,Stream runs incrementally,Handle pauses and failures deliberately,Next steps.
Workflow
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - Do not add behavior or configuration that is not present in the attached source files.
Canonical source: https://developers.openai.com/api/docs/guides/agents/running-agents.md
