Skip to content

scalarian/openai-agents-rust

openai-agents-rust

Rust-native agents runtime with a single ergonomic facade, async-first execution, OpenAI integrations, MCP, realtime sessions, voice workflows, and extension hooks.

This repository is for teams that want to build agent systems in Rust without wrapping another SDK and without giving up typed runtime building blocks.

Start Here

What You Can Build

  • one-shot runs with run and run_sync
  • live incremental runs with run_streamed
  • session-aware conversations with Runner::run_with_session
  • nested agents as tools
  • handoffs, approvals, guardrails, and replayable run results
  • OpenAI Responses and Chat Completions integrations
  • MCP-backed tool discovery and resource access
  • realtime agents with long-lived sessions
  • voice workflows and STT -> workflow -> TTS pipelines
  • optional integrations through the extensions namespace

Choose A Path

I want to... Read this
build a first agent docs/quickstart.md
understand agents, tools, and handoffs docs/agents.md, docs/tools.md, docs/handoffs.md
run with sessions and replay state docs/sessions/README.md, docs/results.md
stream events live docs/streaming.md
integrate OpenAI-specific behavior docs/models/openai.md, docs/sessions/openai.md
use MCP servers and resources docs/mcp.md
build realtime or voice flows docs/realtime/README.md, docs/voice/README.md
debug traces and runtime behavior docs/tracing.md

Package And Import Names

The top-level published package is openai-agents-rs, and the Rust crate name remains openai_agents.

openai-agents = { package = "openai-agents-rs", version = "0.1.2" }
use openai_agents::{Agent, Runner};

Public Surface

  • runtime: Agent, Runner, RunConfig, RunOptions, RunResult, RunResultStreaming
  • OpenAI: OpenAIProvider, OpenAIResponsesModel, OpenAIChatCompletionsModel
  • sessions: MemorySession, SQLiteSession, OpenAIConversationsSession, OpenAIResponsesCompactionSession
  • namespaces:
    • openai_agents::realtime
    • openai_agents::voice
    • openai_agents::extensions

The curated API map lives in docs/ref/README.md.

Crate Map

Crate Responsibility
openai-agents-rs public facade and normal application entry point
openai-agents-core-rs agents, runners, tools, sessions, handoffs, tracing
openai-agents-openai-rs OpenAI provider, sessions, hosted tools
openai-agents-realtime-rs realtime runner, session, event, and audio flow
openai-agents-voice-rs voice workflow, STT/TTS, streamed audio results
openai-agents-extensions-rs optional transports, adapters, backends, and extras

Examples

Runnable examples live in crates/openai-agents/examples.

The full example index is in docs/examples.md.

Contributing

Read CONTRIBUTING.md.

Short version:

cargo fmt --all
cargo test --workspace

If you change docs, also run:

docs/scripts/check_links.sh
docs/scripts/generate_llms_exports.sh

Release Hygiene

  • CI lives in .github/workflows/ci.yml
  • issue and PR templates live in .github/
  • release notes live in CHANGELOG.md
  • security and support guidance live in SECURITY.md and SUPPORT.md

Status

The project is pre-1.0. The runtime is already broad, but APIs may still tighten as the library gets simpler and more stable.

License

Apache License 2.0. See LICENSE.

About

Rust-native agents runtime with OpenAI, MCP, realtime sessions, voice workflows, and extension hooks.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages