OpenAI Agents SDK Integration
OpenAI logo

OpenAI Agents SDK

Lightweight, provider-agnostic framework that works PERFECTLY with Ollama! Built-in handoffs for agent collaboration.

Works great with FREE Ollama (No API Keys Needed!)
Built-in Multi-Agent Handoffs
Guardrails & Sessions

🎯 What is OpenAI Agents SDK?

A lightweight yet powerful framework for building multi-agent workflows

Provider-Agnostic

Works with OpenAI, Ollama, and 100+ LLMs

Multi-Agent

Built-in handoffs for agent collaboration

Guardrails

Input/output validation built-in

Sessions

Automatic conversation history management

Tracing

Built-in execution tracking

Works with Ollama!

Unlike DeepAgents, no function-calling limitations

Perfect for simple to moderate complexity tasks with local models!

📦 Installation

uv tool install superoptix --with "superoptix[frameworks-openai]"

Includes:

  • • openai-agents 0.20.x
  • • openai SDK (latest)
  • • SuperOptiX core with GEPA 0.1.4

Requirements:

  • • Python 3.11+
  • • Git (for DSPy dependency)

🚀 Quick Start

Get started with OpenAI Agents SDK in minutes - works with FREE Ollama!

1

Pull the Demo Agent

super agent pull assistant_openai
2

Configure Model - Uses Ollama by Default!

Uses Ollama by Default! (FREE, no API keys needed!)

# The assistant_openai agent defaults to Ollama llama3.1:8b
# Just install Ollama and run:
brew install ollama  # macOS
ollama pull llama3.1:8b
super agent run assistant_openai --goal "Hello!"
3

Run the Workflow

# Compile
super agent compile assistant_openai --framework openai

# Evaluate
super agent evaluate assistant_openai

# Optimize with GEPA
super agent compile assistant_openai --framework openai --optimize
super agent optimize assistant_openai --auto light --framework openai --reflection-lm ollama:llama3.1:8b

# Run
super agent run assistant_openai --goal "What is Python?"

🔄 Model Configuration

🆓

Ollama (Local)

⭐ RECOMMENDED
language_model:
  location: local
  provider: ollama
  model: ollama:llama3.1:8b
  temperature: 0.7
  api_base: http://localhost:11434

Advantages:

  • Free inference
  • Privacy (data stays local)
  • Fast development iteration
  • Good baseline performance
☁️

Cloud Models

# OpenAI GPT-4
language_model:
  location: cloud
  provider: openai
  model: openai:gpt-4o
  # Set: export OPENAI_API_KEY="sk-..."
  
# Anthropic Claude
language_model:
  location: cloud
  provider: anthropic
  model: anthropic:claude-sonnet-4-20250514
  # Set: export ANTHROPIC_API_KEY="sk-ant-..."

🎯 What GEPA Optimizes

Optimization Target

instructions

The agent's system prompt - GEPA generates variations, tests each, and selects the best performer

Example Transformation:

Before: "Helpful AI Assistant\nGoal: Provide clear responses"

After GEPA: "You are a Helpful AI Assistant.\n\nWhen answering questions:\n1. Read carefully\n2. Provide accurate info\n3. Use clear language\n4. Be concise but complete"

Optimization Command

super agent optimize assistant_openai \
  --auto medium \
  --framework openai \
  --reflection-lm ollama:llama3.1:8b

Note: Requires --reflection-lm parameter for Universal GEPA optimization

⚙️ Advanced Features

🔧 Tools Support

tools:
  enabled: true
  specific_tools:
    - name: search_database
      description: Search knowledge base
    - name: send_email
      description: Send email to user

🤝 Multi-Agent Handoffs

handoffs:
  - name: specialist_agent
    description: Technical questions
    instructions: You are a technical specialist
  - name: billing_agent
    description: Billing issues

🛡️ Guardrails

guardrails:
  input_guardrails:
    - type: content_safety
      params:
        block_harmful: true
  output_guardrails:
    - type: pii_filter
      params:
        redact_emails: true

OpenAI SDK vs Other Frameworks

FeatureDSPyDeepAgentsOpenAI SDK
Ollama SupportFull❌ BlockedPerfect
API ComplexityMediumHighLow
Multi-AgentManualSubagentsHandoffs
GEPA OptimizationAll signaturessystem_promptinstructions
Best ForPrompt optimizationComplex planningSimple tasks

Perfect for:

  • Simple to moderate complexity tasks
  • Local development with Ollama
  • Quick prototyping
  • Clean, minimal agent design
  • When you want high baseline performance

❌ Not ideal for:

  • Complex multi-step planning (use DeepAgents)
  • Maximum prompt optimization (use DSPy)
  • Need filesystem context management (use DeepAgents)

🚀 Ready to Build with OpenAI Agents SDK?

Start building agents with the simplest, most powerful SDK - FREE with Ollama!