Gen AI Academy APAC — Track 1 (AI Agents with Gemini, ADK, and Cloud Run)
Why I built this
I lead a customer service team of 25 agents at Amazon, handling both
buyer-side and marketplace seller support. A big part of my job is
reviewing escalated cases — calls or chats where a customer asked for
a supervisor — and figuring out why they escalated in the first
place. Was it a policy gap? A training issue? A system limitation
nobody flagged?
Right now, that review is manual. Every escalation gets read, tagged,
and turned into a coaching note by a human — usually me, or one of my
leads. It works, but it doesn't scale well, and patterns across dozens
of cases are easy to miss when you're reviewing them one at a time
between everything else on your plate.
So for Track 1 of the Gen AI Academy APAC program, I built an agent
that does the first pass of this analysis automatically: read an
escalation summary, classify the root cause against a standard
taxonomy, flag whether it looks like a repeat pattern, and draft a
coaching note — the same way I would, just faster and more
consistently.
What it does
The agent takes a case summary like this:
Customer requested a refund for a damaged item outside the standard
return window. Agent denied it citing policy; customer says a rep
last month approved a similar exception for someone else.
And returns a structured analysis:
{
"root_cause_category": "policy_misapplication",
"severity": "medium",
"is_likely_repeat_pattern": true,
"pattern_reasoning": "Inconsistent policy application across agents
suggests a training or documentation gap rather than an isolated
error.",
"coaching_note": "..."
}
It's built on Google's Agent Development Kit (ADK) with Gemini
as the underlying model, and deployed as a live service on Cloud
Run. The agent has one tool — a lookup function for the standard
root-cause taxonomy — which keeps the categories consistent and easy
to update without touching the core prompt.
For batch review, I also built a runner script that processes a whole
CSV of cases at once and outputs a summary report — closer to how I'd
actually use this day to day, reviewing a batch of the week's
escalations rather than one at a time.
What I learned building it
A few things stood out going through this:
- Getting the taxonomy right mattered more than the prompt engineering. Once I had six clear, non-overlapping root-cause categories with real definitions, the model's classifications got noticeably more consistent.
- Structured output is where this becomes actually useful. Free-text analysis is fine to read once; a fixed JSON shape is what lets you aggregate patterns across dozens of cases and actually spot something you'd have missed manually.
- Deployment had more friction than the coding did. Getting a fresh Google Cloud project's IAM permissions set up correctly for Cloud Build and Artifact Registry took longer than writing the agent itself — worth knowing going in if you're new to GCP.
Try it / see the code
- Live agent (Cloud Run): https://escalation-root-cause-agent-507816071353.us-central1.run.app
- Source code: https://github.com/aadilmajeedlone/escalation-root-cause-agent
The repo includes a README.md with full setup instructions if you
want to run it yourself, plus a sample CSV of synthetic escalation
cases to test against (no real customer data used anywhere in this
project).
What's next
The natural extension is Track 2 — instead of feeding it a CSV
manually, connect it directly to a real ticketing system via MCP so
it can pull escalations and analyze them without a manual export
step. That's the version I'd actually want running against my team's
queue.
Built for the Google Cloud Gen AI Academy APAC program, in
partnership with Hack2Skill.
Top comments (0)