Skip to content

Latest commit

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

🤖 Support Agent System Utilizing the OpenAI Agents SDK


A multi-agent console support system built using the OpenAI Agents SDK and Gemini API (gemini-2.5-flash). This system routes user queries to specialized agents (billing, technical, general) with dynamic tools, handoffs, output guardrails, and live streaming interactions.


🧠 Project Objective


Build a responsive, intelligent support system that leverages:

  • Multi-agent collaboration to resolve diverse support queries
  • Intelligent triage and routing via the Triage Agent
  • Dynamic tool execution based on user context (e.g., premium access)
  • Guardrails to ensure professionalism in replies
  • Live interaction with streaming outputs for transparency

🚀 Features


FeatureDescription
🔁 Triage AgentClassifies user intent and delegates to specialist agents
🧾 Billing AgentHandles refunds, invoices, subscriptions
🛠️ Technical AgentResolves restarts, errors, and connectivity issues
💬 General AgentAnswers general or unclassified questions
🛑 Guardrail AgentBlocks apologetic tone (e.g., no “sorry”)
🧰 Smart ToolsTools like refund() or restart_service() only activate when conditions are met
🧵 Streaming OutputShows responses, handoffs, and tool actions in real time

🛠️ Technologies Used


ComponentDescription
🐍 PythonBase language for async and logic
🧠 OpenAI Agents SDKMulti-agent framework for building AI agents
🔮 Gemini APIModel: gemini-2.5-flash for completions
🧱 PydanticInput/output schema validation
🔐 dotenvEnvironment variable management
🔁 asyncioAsynchronous event loop support
⚡ uvFast Python package manager & virtualenv tool

🧪 Setup Instructions with uv


🧰 Note: This project uses uv — a modern, blazing-fast Python environment manager.

🧷 Step 1: Initialize your environment

uv init

📦 Step 2: Add required dependencies

uv add openai-agents

🔐 Step 3: Activate the environment

.venv\Scripts\activate # Windows# ORsource .venv/bin/activate # macOS/Linux

🔑 Step 4: Add your Gemini API key

Create a .env file in the root of the project and add:

GEMINI_API_KEY=your-gemini-api-key

🏃 Step 5: Run the console app

uv run main.py

💡 Example Interaction


🔧 Support System Initialized — type 'exit' to quit.
👤 Enter your name: Ali
⭐ Premium user? (y/N): y
💬 How can I help you? I need a refund.
[ 🧠 Triage in progress… ]
→ Handoff: Billing Agent
→ Tool Call: refund
✅ Refund for Ali initiated; expect 3–5 business days.

📌 Key Notes


  • 🛑 Apology guardrail ensures professional tone by blocking words like “sorry”.
  • 🧰 Contextual tools: Tools only activate if user conditions are met (e.g., refund is for premium users).
  • 🧵 Streamed feedback: Real-time console output of all steps—tool calls, handoffs, and agent messages.

About

A console-based multi-agent support system built with Python, the OpenAI Agents SDK, and Gemini API. It intelligently triages user queries (billing, technical, general), routes them to specialized agents, applies guardrails for tone and permissions, and streams real-time output.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages