0

๐ŸŽซ Customer Support Ticketing Agent with Structured Output

awesome-llm-apps3_1_customer_support_ticket_agent

A tutorial demonstrating how to implement a structured customer support ticketing system using Google's ADK (Agent Development Kit) framework. This example shows how to create type-safe, structured support tickets with priority levels, categories, and resolution estimates using Pydantic schemas and

Sign in to save downloads to your library and vote.

Preview

๐ŸŽซ Customer Support Ticketing Agent with Structured Output

A tutorial demonstrating how to implement a structured customer support ticketing system using Google's ADK (Agent Development Kit) framework. This example shows how to create type-safe, structured support tickets with priority levels, categories, and resolution estimates using Pydantic schemas and Gemini 3 Flash model.

Tutorial Features

  • ๐ŸŽซ Structured Support Tickets:

    • Learn how to create comprehensive support ticket schemas
    • Understand priority levels and categorization
    • See how to estimate resolution times
  • ๐Ÿ”ง Advanced Schema Design:

    • Complex Pydantic models with enums and optional fields
    • Proper field validation and descriptions
    • Type-safe structured responses
  • ๐ŸŽฏ Real-World Application:

    • Practical customer support use case
    • Shows how to handle different types of support requests
    • Demonstrates structured output for business processes
  • ๐Ÿ“Š Priority Management:

    • Four-tier priority system (Low, Medium, High, Critical)
    • Automatic priority assignment based on issue description
    • Category-based routing for different departments

๐Ÿš€ Getting Started

  1. Set up your environment:

    cd 3_1_customer_support_ticket_agent
    
    # Copy the environment template
    cp env.example .env
    
    # Edit .env and add your Google AI API key
    # Get your API key from: https://aistudio.google.com/
    
  2. Install dependencies:

    # Navigate back to the directory
    cd ..
    
    # Install required packages
    pip install -r requirements.txt
    
  3. Run the Agent

    # Start the ADK web interface
    adk web
    

    Then:

    1. Open the web interface in your browser
    2. Select the "support_ticket_creator" agent
    3. Enter your support request (e.g., "I can't log into my account and I have an important meeting in 2 hours")
    4. The response will be a structured JSON with all ticket details

Tutorial Overview

This tutorial demonstrates advanced structured output implementation in Google ADK:

  1. Complex Schema Design: Learn how to create sophisticated Pydantic models
  2. Enum Usage: Understand how to use enums for constrained values
  3. Optional Fields: See how to handle optional data with proper defaults
  4. Business Logic: Learn how to implement real-world business processes

Code Structure

  • customer_support_agent/agent.py: Contains the main agent definition and SupportTicket schema
  • customer_support_agent/__init__.py: Module initialization for easy imports

Support Ticket Schema

The agent creates structured tickets with the following fields:

  • title: Concise summary of the issue
  • description: Detailed problem description
  • priority: Priority level (low, medium, high, critical)
  • category: Department (Technical, Billing, Account, Product)
  • steps_to_reproduce: Optional list of steps for technical issues
  • estimated_resolution_time: Estimated time to resolve

Example Usage

Input: "My payment failed and I'm getting charged twice for the same service"

Output:

{
  "title": "Duplicate payment charge issue",
  "description": "Customer reports payment failure followed by duplicate charges for the same service",
  "priority": "high",
  "category": "Billing",
  "steps_to_reproduce": null,
  "estimated_resolution_time": "4-6 hours"
}

Dependencies

  • google-adk: Google's Agent Development Kit
  • pydantic: Data validation and settings management

How Structured Output Works

This tutorial shows how Google ADK handles complex structured output:

  1. Input Processing: Takes natural language support requests
  2. Context Analysis: Analyzes the issue severity and type
  3. Structured Generation: Creates comprehensive tickets with all required fields
  4. Validation: Ensures output matches the defined schema and business rules

This approach demonstrates how to create reliable, business-ready structured responses in Google ADK applications.

Ingestion metadata

Source catalog
awesome-llm-apps
Repository
Shubhamsaboo/awesome-llm-apps ยท main
File path
ai_agent_framework_crash_course/google_adk_crash_course/3_structured_output_agent/3_1_customer_support_ticket_agent/README.md
Last refreshed
7/24/2026, 3:00:13 AM (51m ago)
Refresh schedule
Daily ยท 03:00 UTC
Dedupe status
Unique ยท deduped by (source, url)