# Building an Escalation Root-Cause Agent with Gemini and ADK

> Source: <https://dev.to/aadilmajeedlone/building-an-escalation-root-cause-agent-with-gemini-and-adk-5b23>
> Published: 2026-08-21 21:20:28+00:00

*Gen AI Academy APAC — Track 1 (AI Agents with Gemini, ADK, and Cloud Run)*

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.

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

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.

A few things stood out going through this:

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).

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.*
