AWS Builder Center
When a ₹350 Penalty Isn't the Whole Story: Building Kavach AI on AWS

When a ₹350 Penalty Isn't the Whole Story: Building Kavach AI on AWS

What happens when a delivery platform says a worker was late, but the evidence tells a different story? Learn how we built Kavach AI to reconstruct gig-worker trips, verify earnings, and turn evidence into actionable dispute cases using AWS, deterministic calculations, and AI agents.

When a ₹350 Penalty Isn't the Whole Story

What happens when a delivery platform says a worker was late, but the evidence tells a different story?
That question became the starting point for Kavach AI, an independent work-intelligence and protection layer for gig workers that we built for the AWS hackathon's Ship It track.
Kavach helps workers understand three things:
  • What actually happened during a delivery
  • What they actually earned
  • What they can do when something looks wrong
The interesting part isn't simply that we added AI.
It is that we built an evidence and calculation layer underneath the AI so that the model has something grounded to reason about.

The problem

Imagine a delivery worker receives a ₹350 late-delivery penalty.
The platform says the delivery exceeded a 10-minute SLA.
But what happened during those ten minutes?
In our canonical Kavach scenario, the evidence shows:
Time
Event
19:02
Worker arrives at the merchant, verified by GPS
19:02–19:09
Worker waits seven minutes for the merchant
19:09
Package is handed over and scanned
19:16
Traffic obstruction causes additional delay
19:24
Delivery completed with customer OTP
The platform sees a late delivery.
Kavach sees a sequence of events.
That distinction is the core of the product.

Building an Evidence Graph

Instead of asking an AI model to simply decide whether a penalty is fair, Kavach first reconstructs the incident.
We represent the worker's information as connected evidence:
Worker
|
+-----------------+----------------+
| | |
Trips Earnings Expenses
|
Events
|
+-----+-----------------------------+
| |
GPS arrival Merchant wait
| |
+---------------+-------------------+
|
Package handover
|
Traffic event
|
Delivery
|
Platform claim

This gives every important finding a path back to evidence.
For the ₹350 case, the deterministic engine calculates that the allocated SLA was 10 minutes and that seven minutes were consumed by merchant waiting.
That leaves only three minutes for the remaining delivery journey.
Kavach therefore identifies the penalty as something that warrants review based on the reconstructed evidence, rather than presenting an unsupported AI opinion.

Why AI doesn't calculate the numbers

One of our most important design decisions was deciding what AI should not do.
We don't want an LLM calculating financial totals or timestamp differences.
Those are deterministic operations.
So Kavach separates the system into two paths:
Evidence
|
+---------+---------+
| |
v v
Deterministic Engine AI Engine
| |
| Supervisor Agent
| |
| +-----------+-----------+
| | | |
| Forensics Earnings Policy
| Agent Agent Agent
| |
+---------+---------+
|
v
Worker Intelligence

The deterministic engine handles:
  • Earnings calculations
  • Durations
  • SLA calculations
  • Expense reconciliation
  • Counterfactual simulations
  • Evidence-linked facts
The AI layer handles:
  • Reasoning
  • Synthesis
  • Explanation
  • Document understanding
  • Interpreting structured evidence
The principle is simple:
AI reasons about the evidence. Code decides what the numbers are.

A multi-agent investigation

Kavach uses a Supervisor Agent to coordinate specialized agents.
Supervisor Agent
|
+-------------+-------------+
| | |
v v v
Forensics Earnings Policy
Agent Agent Agent
| | |
+-------------+-------------+
|
Evidence + Tools
|
Structured Finding

The Forensics Agent can reconstruct the trip.
The Earnings Agent can examine the financial impact.
The Policy Agent can evaluate the relevant policy context.
The Supervisor then produces a structured investigation result containing findings, evidence references, missing evidence, contradictions, recommended actions, and confidence.
This also means the frontend doesn't need to parse an AI-generated paragraph to understand what happened.

From investigation to action

Kavach is designed to go beyond an explanation.
Once a potentially disputed decision has been identified, the worker can generate a structured review or dispute package containing the relevant finding and supporting evidence.
The workflow becomes:
Evidence
↓
Reconstruct
↓
Calculate
↓
Investigate
↓
Explain
↓
Take action

That last step matters.
An AI answer that cannot help the worker do anything next is only partially useful.

Earnings intelligence

Kavach also reconciles platform earnings with expenses to estimate real take-home income.
For our production demo scenario:
Gross payout ₹9,120
Less penalty ₹350
-------
Platform net ₹8,770

Expenses ₹1,270
-------
Real take-home ₹7,500

Active hours 47.55
Effective hourly rate ₹157.73/hr

The arithmetic comes from the deterministic calculation layer.
The AI can explain the result, but it does not get to invent the underlying numbers.

The Worker Twin

We also built a Worker Twin interface that lets a worker ask questions about their work and explore counterfactual scenarios.
For example:
"How much would my weekly earnings increase if merchant wait times were compensated?"
The AI interprets the question and identifies the relevant scenario, while the underlying simulation engine calculates the projected values.
This creates a useful pattern for AI applications:
Natural-language interface + deterministic domain engine.
The worker doesn't need to know which calculation to invoke.
They can simply ask the question.

Where AWS fits

Kavach was built for the Ship It track, so AWS is part of the application architecture rather than simply being mentioned in the documentation.
Our deployed architecture uses AWS services across the application:
Kavach AI
|
AWS Amplify
|
API Gateway
|
Lambda
|
+---------------+---------------+
| | |
DynamoDB S3 Step Functions
| | |
+---------------+---------------+
|
AI / Agent Layer
|
Amazon Bedrock

We use AWS for the application hosting and backend execution path, persistent worker/evidence data, authentication, workflow orchestration, and the AI layer.
The architecture is deliberately modular, with interfaces separating AI services, evidence storage, API clients, and deterministic calculations. This allowed us to develop the different parts in parallel and then connect them into the deployed system.

What we learned

The biggest lesson from building Kavach was that adding an LLM is not the same thing as building an intelligent application.
The more useful architecture was:
Reliable evidence
+
Deterministic calculations
+
AI reasoning
+
Actionable output

The AI becomes significantly more useful when it operates on structured, traceable information.
We also learned that cloud architecture is part of the product itself. Moving from a local mock-first application to a deployed AWS system forced us to think about APIs, storage, authentication, permissions, workflows, model access, and the boundaries between services.

The bigger idea

Gig workers generate enormous amounts of operational data while they work: locations, timestamps, deliveries, payouts, expenses and platform decisions.
That data can do more than produce a payout statement.
It can help answer:
What happened?
What did I actually earn?
Does the available evidence support this decision?
What can I do next?
That's what we're trying to build with Kavach AI.
Not another chatbot that tells workers what to think — an independent intelligence layer that helps them understand their own work.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article