SuperAPI AI Directory

openai-agents-python

Agents & models

View repository

Updated 10-15 17:26

About this skill

OpenAI Agents Python

When to use this skill

  • When building a multi-agent workflow based on the OpenAI Agents SDK
  • tool calling, handoff, guardrailWhen designing the agents needed for this
  • When you need a production-ready agent loop structure, not a prototype

Instructions

Step 1) Decompose the task goal into an agent topology

  • Start with a basic structure of 1 Coordinator + N Specialists
  • Keep each Specialist to a single responsibility (retrieval/analysis/execution/verification)
  • Record handoff conditions as explicit rules, not natural language

Step 2) Build the minimal execution loop first

  • The first step is a minimal loop of "one input → one handoff → one result"
  • Collect tool call failures/timeouts in a standard error format
  • Logs are recorded based on agent, tool, handoff, latency criteria

Step 3) Add Guardrails

  • Explicitly state prohibited actions (destructive commands, external transmission) as policy
  • Fix the output schema (JSON schema) to stabilize downstream pipelines
  • Specify retry count/stop conditions (max turns)

Step 4) Quality check

  • 3 types of cases: normal, boundary, failure
  • Check the handoff false positive/false negative rate
  • If errors repeat, fix the routing rules before the prompts

Examples

  • Request: "I want to build an agent pipeline that separates research/summarization/verification"
  • Application: Coordinator classifies intent, then hands off to Researcher/Writer/Verifier
  • Result: Store step-by-step artifacts and verification logs separately

Best practices

  1. Do not start with 5 or more agents from the beginning.
  2. Record handoff rules as conditional expressions rather than sentences.
  3. Fix the tool interface to keep model replacement possible.
  4. Solve failure recovery with a fallback route (another specialist) rather than retries.

References