Inspiration
During my internship, I work closely with support and approval ticket systems — watching requests come in, get read, get categorized, and get routed to the right person before any action happens. A lot of that first-pass triage is repetitive: read the ticket, figure out what it's about, decide how urgent it is, and either handle it or hand it off. I kept thinking: this is exactly the kind of structured, rules-plus-judgment task an AI agent should be able to take off someone's plate.
Around the same time, I was looking into how RPA (robotic process automation) is evolving. Traditional RPA handles the repetitive clicking and data movement, but it's rigid — it can't actually understand a ticket. Pairing RPA-style workflow execution with an LLM agent that can read and reason about the request felt like the natural next step. That's what pushed me to build this: an agent that doesn't just automate the mechanical part, but understands the ticket well enough to classify it, decide what to do, and act — autonomously.
What it does
It then acts on that decision — drafting the reply or raising an escalation alert — and logs every ticket to Firestore, closing the loop without a person needing to read each one first. The action layer is built with clear integration points for a real inbox or ticketing system (Gmail, Zendesk); for this build, actions are demonstrated via console output and Firestore records rather than live external systems.
How we built it
We split the agent into three layers so each part could be tested independently:
Perception (ML layer): A TF-IDF vectorizer + Logistic Regression model, trained with scikit-learn on a labeled ticket dataset, predicts category (billing/technical/account/general) and urgency (high/medium/low) with confidence scores — giving Gemini a grounded starting point instead of classifying from scratch every time. Reasoning (Gemini layer): Using the Gemini API (gemini-3.6-flash), the agent takes the raw ticket text plus the classifier's prediction and extracts structured entities, drafts a customer-facing reply, and makes the real decision: auto-resolve or escalate to a human. Action layer: Based on Gemini's decision, the agent sends the drafted reply or raises an alert — and persists every ticket's full record to Firestore, our Google Cloud infrastructure service, so nothing is silently dropped.
The service is also fully containerized (Dockerfile included) and wired for one-command Cloud Run deployment when we're ready to host it publicly — for this build we ran it locally against live Firestore to keep everything within the free tier.
Challenges we ran into
Getting the agent to know when not to act autonomously was harder than getting it to act. Early on it was too eager to auto-resolve sensitive requests — like account deletion — just because the urgency score was low. We had to explicitly teach the reasoning layer that certain categories (money, security, permanent data loss) always warrant a human, regardless of tone or urgency score.
What's next
Swap the synthetic training data for a real labeled ticket dataset, connect the agent to a live inbox (Gmail) or ticketing tool (Zendesk) instead of simulated input, and deploy publicly on Cloud Run.
Built With
- docker
- flask
- gemini-api
- google-cloud-firestore
- google-cloud-run
- logistic-regression
- pandas
- python
- scikit-learn
- tf-idf
Log in or sign up for Devpost to join the conversation.