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.
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.
The current agent can:
- receive customer-support email text;
- analyze the message using Gemini;
- classify the request as
NORMALEorCRITICO; - 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.
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"]
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.
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.
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 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
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:
- detects the critical request;
- emits a
RequestInput; - suspends execution;
- waits for a supervisor decision;
- receives the human response;
- resumes the existing workflow;
- 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.
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.
Email
↓
NORMALE
↓
Automatic response
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.
- Python;
uv;- project dependencies defined in
pyproject.toml.
Clone the repository:
git clone https://github.com/lucalullo/customer-support-agent.git
cd customer-support-agentSynchronize the environment using the project's lock file:
uv sync --frozenRun the local simulation:
uv run python test_local_support.pyThe simulation avoids live Gemini calls and can therefore be used to inspect the workflow without requiring an active cloud connection.
The script demonstrates two main cases.
The email is classified as:
NORMALE
and the workflow completes without requesting human intervention.
The email is classified as:
CRITICO
and the workflow:
requests human input
↓
suspends execution
↓
receives the simulated supervisor decision
↓
resumes
↓
returns the final result
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.
| 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 |
The project is intentionally compact and educational:
- classification currently uses the binary labels
CRITICOandNORMALE; - 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.
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.
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.
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.
Created by Luca Lullo.