Skip to content

Repository files navigation

Customer Support Agent

Python Google ADK Gemini Human-in-the-Loop Google Antigravity

An educational AI agent that classifies incoming customer-support emails and routes critical cases to a human supervisor before the workflow continues.

The project is built with the Google Agent Development Kit (ADK) and Gemini, combining LLM-based decision making with a stateful Human-in-the-Loop (HITL) escalation workflow.

It was developed with Google Antigravity as a capstone project for the 5-Day AI Agents: Intensive Vibe Coding Course With Google, held from June 15 to June 19, 2026.

Course project

This project was created as part of the:

The course focused on building increasingly capable AI agents, covering topics such as:

  • agent foundations and vibe coding;
  • tools and interoperability;
  • agent skills, memory and context;
  • security and evaluation;
  • production-oriented agent development.

The capstone project provided an opportunity to apply these concepts to a practical agentic workflow.

For this project, the selected use case is customer-support email triage with human supervision for sensitive requests.

Current capabilities

The current agent can:

  • receive customer-support email text;
  • analyze the message using Gemini;
  • classify the request as NORMALE or CRITICO;
  • automatically handle normal inquiries;
  • detect cases involving anger, refund requests or legal threats;
  • interrupt the workflow when a critical request is detected;
  • request a decision from a human supervisor;
  • preserve the workflow state while waiting for human input;
  • resume execution after the supervisor responds;
  • return the final action together with the operator's decision;
  • simulate both normal and critical flows locally without requiring live Gemini calls.

Current architecture

flowchart TD
    A["Incoming Customer Email"] --> B["process_email"]
    B --> C["analyst_agent"]
    C --> D["Gemini Classification"]

    D --> E{"CRITICO?"}

    E -->|"No - NORMALE"| F["Automatic Handling"]
    F --> G["Courtesy Response"]

    E -->|"Yes - CRITICO"| H["RequestInput: escalation_review"]
    H --> I["Workflow Suspended"]
    I --> J["Human Supervisor Decision"]
    J --> K["Workflow Resumed"]
    K --> L["Final Action"]
Loading

The workflow separates AI classification from human decision making.

Gemini determines whether an email requires escalation, while sensitive cases remain under human supervision before the workflow can continue.

Classification logic

Incoming emails are analyzed by the analyst_agent.

The model is instructed to return one of two possible classifications:

CRITICO
NORMALE

An email is considered CRITICO when the customer:

  • expresses strong anger;
  • threatens legal action;
  • explicitly requests a refund.

All other requests are classified as NORMALE.

The classification instruction used by the agent follows this logic:

Analizza questa email.

Rispondi SOLO con la parola CRITICO se il cliente è arrabbiato,
minaccia azioni legali o chiede esplicitamente un rimborso.

Altrimenti rispondi NORMALE.

Normal request flow

A normal request does not require human intervention.

Example:

Can you check the delivery status of order #12345?

Expected classification:

NORMALE

The workflow can then continue automatically and produce the normal customer-support response.

Conceptually:

Email
  ↓
Gemini
  ↓
NORMALE
  ↓
Automatic handling
  ↓
Courtesy response

Critical request flow

Critical requests require human supervision.

Example:

The product arrived broken!
Refund my money immediately or I will take legal action!

Expected classification:

CRITICO

Instead of completing the request automatically, the workflow emits a RequestInput identified as:

escalation_review

The supervisor is asked how the case should be handled:

Attenzione: rilevata email critica o richiesta di rimborso.
Come procediamo? (es. Autorizza / Rifiuta)

The workflow remains suspended until a human decision is provided.

For example:

Autorizza

After receiving the decision, execution resumes and produces the final result:

Pratica critica chiusa. Decisione operatore: Autorizza

The complete flow becomes:

Critical Email
     ↓
   Gemini
     ↓
  CRITICO
     ↓
Human-in-the-Loop
     ↓
Workflow suspended
     ↓
Supervisor decision
     ↓
Workflow resumed
     ↓
Final action

Human-in-the-Loop design

The main architectural concept demonstrated by the project is the integration of Human-in-the-Loop control inside an AI-agent workflow.

The language model is responsible for classification, but it does not autonomously complete sensitive workflows.

When escalation is required, the agent:

  1. detects the critical request;
  2. emits a RequestInput;
  3. suspends execution;
  4. waits for a supervisor decision;
  5. receives the human response;
  6. resumes the existing workflow;
  7. returns the final result.

This pattern makes it possible to combine AI automation with explicit human oversight for decisions that should not be handled autonomously.

Local verification

The repository includes:

test_local_support.py

This script provides a local mocked simulation of the workflow.

The purpose of the simulation is to verify the main routing and HITL behavior without requiring a live Google Cloud or Gemini connection.

It covers two scenarios.

Normal email

Email
  ↓
NORMALE
  ↓
Automatic response

Critical email

Email
  ↓
CRITICO
  ↓
Human escalation
  ↓
Workflow suspension
  ↓
Simulated supervisor response
  ↓
Workflow resumption

The local simulation does not represent a production email-delivery system. Its purpose is to demonstrate and verify the agent workflow.

Run locally

Requirements

  • Python;
  • uv;
  • project dependencies defined in pyproject.toml.

Clone the repository:

git clone https://github.com/lucalullo/customer-support-agent.git
cd customer-support-agent

Synchronize the environment using the project's lock file:

uv sync --frozen

Run the local simulation:

uv run python test_local_support.py

The simulation avoids live Gemini calls and can therefore be used to inspect the workflow without requiring an active cloud connection.

Expected simulation

The script demonstrates two main cases.

Test 1 - Normal request

The email is classified as:

NORMALE

and the workflow completes without requesting human intervention.

Test 2 - Critical request

The email is classified as:

CRITICO

and the workflow:

requests human input
        ↓
suspends execution
        ↓
receives the simulated supervisor decision
        ↓
resumes
        ↓
returns the final result

Development approach

The project was developed using Google Antigravity and follows the vibe coding workflow explored during the 5-Day AI Agents course.

The implementation intentionally focuses on one specific architectural concept:

Use AI for classification and automation, but keep a human decision point for sensitive customer-support cases.

Rather than building a complete customer-service platform, the project isolates this workflow so that the interaction between LLM reasoning, routing, state and human supervision remains easy to understand.

Technologies

Technology Purpose
Python Main implementation language
Google ADK Agent and workflow architecture
Gemini Natural-language email classification
Human-in-the-Loop Supervisor review for critical requests
Google Antigravity Agent-oriented development workflow
uv Dependency and environment management

Current limitations

The project is intentionally compact and educational:

  • classification currently uses the binary labels CRITICO and NORMALE;
  • classification quality depends on the LLM correctly interpreting the email;
  • the escalation policy is deliberately simple;
  • the provided local verification uses mocked model behavior;
  • the simulation is not a complete automated evaluation suite;
  • the local demonstration does not represent a production email-delivery infrastructure;
  • production systems would require stronger persistence, security, observability, evaluation and integration layers.

These limitations reflect the scope of the capstone rather than the design of a complete production customer-support platform.

Possible extensions

The same architecture could be extended with:

  • structured classification outputs;
  • additional escalation categories;
  • confidence-based routing;
  • persistent workflow sessions;
  • real email-provider integration;
  • CRM or ticketing-system integration;
  • retrieval from a customer-support knowledge base;
  • automated evaluation datasets;
  • security guardrails;
  • logging and observability;
  • production deployment.

Project status

The current version represents the educational capstone implementation developed for the 5-Day AI Agents: Intensive Vibe Coding Course With Google.

Its main objective is to demonstrate a complete agentic pattern combining:

LLM Classification
        +
Conditional Routing
        +
Human-in-the-Loop
        +
Workflow Suspension
        +
Workflow Resumption

The project can remain as a compact demonstration of this architecture while still allowing future improvements or production-oriented extensions.

Acknowledgements

Developed as part of the 5-Day AI Agents: Intensive Vibe Coding Course With Google.

The course was hosted by Google through Kaggle and focused on agent development, vibe coding, tools, interoperability, security, evaluation and production-oriented AI-agent workflows.

Author

Created by Luca Lullo.

About

About Kaggle Hackathon Capstone Project - Customer Support Agent

Resources

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages