https://github.com/dbos-inc/dbos-openai-agents
Augment OpenAI Agents SDK with durable execution to help you build reliable and scalable multi-agent applications.
https://github.com/dbos-inc/dbos-openai-agents
dbos durable-execution openai-agents-sdk
Last synced: 4 months ago
JSON representation
Augment OpenAI Agents SDK with durable execution to help you build reliable and scalable multi-agent applications.
- Host: GitHub
- URL: https://github.com/dbos-inc/dbos-openai-agents
- Owner: dbos-inc
- License: mit
- Created: 2026-01-30T19:10:23.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-02-04T23:55:46.000Z (4 months ago)
- Last Synced: 2026-02-05T13:25:35.810Z (4 months ago)
- Topics: dbos, durable-execution, openai-agents-sdk
- Language: Python
- Homepage: https://pypi.org/project/dbos-openai-agents/
- Size: 160 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-dbos - DBOS + OpenAI Agents SDK Integration - Build reliable agents with DBOS and OpenAI Agents SDK (Uncategorized / Uncategorized)
README
# DBOS Durable OpenAI Agents
Durable execution for the [OpenAI Agents SDK](https://github.com/openai/openai-agents-python) using [DBOS](https://github.com/dbos-inc/dbos-transact-py).
## Installation
```bash
pip install dbos-openai-agents
```
## Usage
Call your agent using `DBOSRunner.run()` from a `@DBOS.workflow()`.
Annotate tool calls and guardrails with `@DBOS.step()`.
```python
import asyncio
from agents import Agent, function_tool
from dbos import DBOS, DBOSConfig
from dbos_openai_agents import DBOSRunner
# Decorate tool calls and guardrails with @DBOS.step() for durable execution
@function_tool
@DBOS.step()
async def get_weather(city: str) -> str:
"""Get the weather for a city."""
return f"Sunny in {city}"
agent = Agent(name="weather", tools=[get_weather])
# Use DBOSRunner to call your agent from a workflow
@DBOS.workflow()
async def run_agent(user_input: str) -> str:
result = await DBOSRunner.run(agent, user_input)
return str(result.final_output)
async def main():
output = await run_agent("How is the weather in San Francisco")
print(output)
if __name__ == "__main__":
config: DBOSConfig = {
"name": "my-agent",
}
DBOS(config=config)
DBOS.launch()
asyncio.run(main())
```
`DBOSRunner.run()` is a drop-in replacement for `Runner.run()` with the same arguments.
It must be called from within a `@DBOS.workflow()`.