Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GigInsurance β€” AI-Powered Parametric Income Insurance for Gig Workers

Persona: Grocery & Q-Commerce Delivery Partners (Zepto / Blinkit)

Problem Statement

India's Q-Commerce delivery partners (Zepto, Blinkit etc.) are the backbone of the hyperlocal delivery economy. These gig workers operate in high-frequency, outdoor environments and are uniquely vulnerable to external disruptions β€” extreme weather, flooding, and curfews/Section 144 orders β€” that directly cut into their daily earnings.

Key pain points:

  • Gig workers can lose 20–30% of monthly income during disruption events
  • No existing income safety net is tailored to their week-to-week earning cycle
  • Traditional insurance products are too slow, too complex, and don't cover income loss parametrically
  • Workers bear the full financial burden with zero compensation when they cannot work through no fault of their own

Coverage Scope: This platform exclusively covers Loss of Income. It does NOT cover health, life, accidents, vehicle repairs, or medical bills.


Our Solution

GigInsurance is an AI-enabled, fully automated parametric income insurance platform built exclusively for Q-Commerce delivery partners. It:

  • Operates entirely over WhatsApp β€” no app download, no login screens, no custom UI. Workers register, file claims, and receive payouts all through a familiar chat interface.
  • Operates on a transparent B2B2C "Weekly Premium Model" where gig platforms cover a fixed Base Fee, while workers pay a dynamic, risk-adjusted premium calculated by an XGBoost AI model based on their specific zone's environmental risk factors.
  • Workers simply describe what happened and when in plain text β€” an Agentic AI Claim Processor takes it from there, autonomously deciding which tools to call (weather APIs, shift records, policy rules, fraud history) to verify and approve the claim.
  • Utilizes an internal Multi-RAG pipeline as agent tools β€” retrieving dynamic policy rules and historical context mid-reasoning, not as a static pre-fetch.
  • Deploys Generative AI to synthesize complex math and policy terms into clear, localized "Smart Receipts" so workers understand exactly why a payout was approved or denied.
  • Uses strict database indexing and platform-verified data to prevent fraud at the source, ensuring zero AI hallucinations on financial decisions.

πŸ‘€ Persona & Scenarios

Primary Persona: Rahul, a Zepto delivery partner in Noida

  • Works 8–10 hours/day, 6 days/week
  • Earns approximately β‚Ή600–₹900/day
  • Operates across 3–4 delivery zones in his area

Scenario A β€” Heavy Rain Event

Rahul sends a WhatsApp message: "It was raining heavily, couldn't deliver from 2PM to 4PM." The Claim Agent classifies the disruption as Heavy Rain, calls the weather API (85mm recorded ), verifies his active shift via platform telemetry , fetches the Tier-1 policy threshold via RAG (>50mm ), runs the payout math, and replies with a localized Smart Receipt confirming β‚Ή280 credited to his wallet β€” all within minutes, directly in chat.

Scenario B β€” Curfew / Section 144

Rahul sends a WhatsApp message: "Police stopped all movement near my area around 6PM, had to stop working." The Claim Agent identifies this as a Curfew/Section 144 event, queries the government news feed to confirm the order , verifies Rahul was logged in at 6PM , and replies in Hindi with a Smart Receipt detailing the payout proportional to his remaining shift hours.


Application Workflow

Worker sends WhatsApp message to GigInsurance Bot
(text, voice note, button tap, or list selection β€” in any language)
       β”‚
       β–Ό
WhatsApp API (Meta / Twilio) β†’ FastAPI Webhook Receiver
       β”‚
  [New user?]
       β”‚
      YES ──► Conversational Onboarding Flow
       β”‚          β”œβ”€ Bot sends Interactive Buttons β†’ Platform Selection
       β”‚          β”œβ”€ Bot prompts β†’ Partner ID input β†’ validated vs mock DB
       β”‚          └─ Bot requests linked phone number β†’ OTP issued over chat β†’ verified β†’ session bound
       β”‚
      NO  ──► Session validated
       β”‚          └─ Deleting/clearing the chat = automatic logout
       β”‚             (returning worker must re-verify phone number + OTP before regaining access)
       β”‚
       β–Ό
Worker describes disruption in plain text, voice, or via quick-reply buttons/lists
(cause + approximate time β€” that's it)
       β”‚
       β–Ό
 Agentic AI Claim Processor (LangGraph)
  β”‚
  β”œβ”€β”€ Step 1: Classify disruption type from natural language
  β”‚
  β”œβ”€β”€ Step 2: Autonomously call relevant tools β€”
  β”‚      β”œβ”€ verify_active_shift()       β†’ Platform Telemetry
  β”‚      β”œβ”€ check_weather_api()         β†’ Rainfall / Temp / AQI
  β”‚      β”œβ”€ check_government_feed()     β†’ Curfew alerts
  β”‚      β”œβ”€ query_policy_rag()          β†’ Policy RAG (threshold rules)
  β”‚      β”œβ”€ check_fraud_history()       β†’ Historical Context RAG
  β”‚      └─ flag_for_manual_review()    β†’ Escalation (if anomaly)
  β”‚
  β”œβ”€β”€ Step 3: Tabular ML Engine (deterministic math)
  β”‚      β”œβ”€ XGBoost (payout calculation)
  β”‚      └─ Isolation Forest (anomaly scoring)
  β”‚
  └── Step 4: Final decision β€” Approved / Denied / Escalated
       β”‚
       β–Ό
LLM Synthesis β†’ Localized Smart Receipt (text, worker's language)
       β”‚
       β–Ό
Instant Wallet Credit (Razorpay / UPI)
       β”‚
       β–Ό
Smart Receipt delivered as WhatsApp message

Weekly Premium Model

Our pricing system dynamically calculates a weekly insurance premium based on real-world risk factors. Unlike flat-fee models, GigShield uses AI-driven risk scoring to ensure fair, location-aware pricing.

Core Formula

Weekly Premium = Base Fee + [Ξ£ (Pα΅’ Γ— Max Payout Γ— Sα΅’)] Γ— (1 + M)
Variable Description
Pα΅’ Probability of disruption event i (from AI model)
Sα΅’ Severity weight of event i
Max Payout Maximum daily payout cap β€” β‚Ή500
M Solvency margin β€” 10%
Base Fee β‚Ή20/week, covered by the platform (B2B2C)

Premium Tiers

Risk Level Risk Score (R) Estimated Weekly Premium
Low Risk 0.1 – 0.3 β‚Ή30 – β‚Ή60
Medium Risk 0.4 – 0.6 β‚Ή80 – β‚Ή120
High Risk 0.7 – 1.0 β‚Ή120+

B2B2C Cost Split

  • Platform (Zepto / Blinkit): Pays base fee (~β‚Ή20/week/worker) β€” ensures operational sustainability
  • Worker: Pays only the risk-adjusted premium on top β€” keeps pricing affordable

Parametric Triggers

Workers simply describe what happened and roughly when. The Claim Agent classifies the disruption type from their natural language input and autonomously calls the relevant data source to verify it. Supported trigger types:

Trigger Type Event Data Source
🌧️ Environmental Heavy Rain (>50mm/6hr) Weather API
🌊 Environmental Flood / Waterlogging Government / Geospatial API
🌑️ Environmental Extreme Heat (>45°C) Weather API
😷 Environmental Severe AQI (>300) Pollution Monitoring API
πŸŒ€ Environmental Cyclone / Storm Warning IMD API
🚫 Social Curfew / Section 144 News / Government Feed

Each trigger is validated against:

  • Worker's active GPS zone
  • Platform-confirmed login/shift activity
  • Cross-referenced disruption duration

AI/ML Integration

The core of GigInsurance is an Agentic AI Claim Processor built on LangGraph. The agent receives the worker's plain-text description and autonomously reasons through verification β€” calling only the tools relevant to that specific disruption type, in the right order, without any hardcoded branching logic.

1. The Claim Agent (LangGraph)

The agent is given a fixed toolkit and decides at runtime which tools to invoke based on the disruption described.

Agent Tools:

Tool Purpose
verify_active_shift() Confirms worker was logged in during the claimed window via platform telemetry
check_weather_api() Fetches rainfall/temp/AQI for the worker's zone and time window
check_government_feed() Checks news/government feeds for curfew orders
query_policy_rag() RAG search over master insurance contracts to fetch the exact payout threshold for the worker's tier and vehicle type
check_fraud_history() RAG search over past claim logs to detect semantic patterns, duplicate behaviour, or anomalous timing
calculate_payout() Deterministic math β€” XGBoost + SLF + PHR formula
flag_for_manual_review() Escalates to human reviewer if Isolation Forest anomaly score spikes

Key property: A rain claim never calls check_government_feed(). A curfew claim never calls check_weather_api(). The agent selects only what's needed β€” making it efficient and auditable.

2. The RAG Pipelines (Agent Knowledge Tools)

RAG is used as on-demand agent tools, not static pre-fetches. This means retrieval happens mid-reasoning, with the worker's full claim context already available.

  • Policy RAG: Vector search over chunked insurance contract PDFs. Filtered by worker tier, vehicle type, and disruption category β€” returns the exact threshold rule the agent needs to make its decision.
  • Historical Context RAG: Semantic search over past claim text logs and support chats. Detects recurring patterns, duplicate claim language, or suspicious timing that pure anomaly detection (Isolation Forest) would miss.

3. The Tabular ML Engine (Deterministic Math)

All financial calculations are fully deterministic β€” the agent never lets the LLM guess a number.

  • XGBoost Risk Scoring: Calculates dynamic weekly premium from historical tabular data (rainfall, temperature, traffic, zone history).
  • Fraud Detection (Isolation Forest): Flags statistical anomalies β€” sudden claim density spikes, zone mismatches, or timing outliers β€” triggering the flag_for_manual_review() tool.
  • System Load Factor (SLF): Scales payouts during mass disruptions to maintain financial solvency.

4. The LLM Synthesis Layer (The Communicator)

Once the agent completes verification and the math is finalized, the LLM's only job is communication β€” never decision-making.

  • Context Packet: All agent tool outputs (policy rule retrieved, sensor readings, shift verification result, payout math) are injected into a single system prompt.
  • Localized Smart Receipt: The LLM generates a conversational, structured receipt in the worker's language (Hindi, Marathi, Telugu) explaining exactly what was verified, what threshold was met, and how the final number was calculated.

Fraud Prevention

Problem β†’ Solution Matrix

Fraud Vector Detection Mechanism
GPS Spoofing / Fake Location Zone matching via Platform API β€” not device GPS
Fake Shift Hours Only platform-recorded activity counts β€” no manual input
Last-Minute Policy Purchase 48–72 hour waiting period before policy activates
Coordinated Mass Fraud Anomaly detection flags unusual claim clusters
Duplicate Claims De-duplication at the database layer (PostgreSQL constraints)
Unauthorized Zone Claims Worker zone must match disruption zone exactly

System Load Factor (SLF)

During large-scale disruptions where many workers claim simultaneously, a System Load Factor smoothly scales individual payouts to maintain solvency:

SLF = 1 / (1 + Ξ± Γ— C)

Where C = claim density (0–1) and Ξ± β‰ˆ 0.5.

This prevents financial instability while remaining fair β€” no sudden or arbitrary cuts.


Payout Engine

Step-by-Step Calculation

Step 1 β€” Protected Hourly Rate (PHR)

PHR = (Premium / Risk Score) Γ— k     [k β‰ˆ 0.4]

Normalizes payout fairness across high-risk and low-risk zones.

Step 2 β€” Effective Hours

Effective Hours = Shift Window ∩ Disruption Window

Only hours where the worker's shift overlapped with the disruption count.

Step 3 β€” Apply System Load Factor

Adjusted Rate = PHR Γ— SLF

Step 4 β€” Final Payout

Final Payout = min(Adjusted Rate Γ— Effective Hours, β‚Ή500)

Payment Channel: Razorpay (Test Mode) / UPI Simulator β€” credited to worker's in-app wallet within minutes of trigger verification.


Tech Stack

Layer Technology Purpose
Interface WhatsApp API (Meta / Twilio) Worker-facing chat interface β€” onboarding, claims, receipts, alerts
Webhook Server FastAPI (Python) Receives WhatsApp messages, orchestrates the agent pipeline
Agentic AI LangGraph + LangChain Claim Agent β€” autonomous tool orchestration and reasoning
AI / ML Python, XGBoost, Scikit-learn Risk scoring, anomaly detection, payout calculation
RAG / Vector DB ChromaDB + LangChain Policy RAG and Historical Context RAG as agent tools
Database PostgreSQL Policies, payouts, worker sessions β€” structured financial records
Cloud AWS / GCP Backend hosting, scalable webhook deployment
Weather Data OpenWeatherMap API / IMD (mock) Rainfall, temperature, AQI for parametric verification
Platform Data Zepto / Blinkit API (mock/simulated) Worker verification, zone, shift data
Payments Razorpay (Test Mode) / UPI Simulator Instant payout to worker's linked wallet
Auth WhatsApp session + OTP over chat No JWT needed β€” session bound to WhatsApp account; deleting the chat resets the session and forces phone + OTP re-verification
Notifications Native WhatsApp messages Replaces Firebase push notifications entirely
Admin Dashboard Web (React) Insurer/ops-facing β€” loss ratios, manual review queue, analytics

Development Plan

Phase 1 β€” Ideation & Foundation

  • Persona definition and scenario mapping
  • Weekly premium model design
  • Parametric trigger selection and justification
  • Tech stack finalization
  • README and repository setup

Phase 2 β€” Automation & Protection

  • Worker registration and onboarding flow
  • Insurance policy creation with weekly pricing
  • Dynamic premium calculation engine (XGBoost model)
  • Claims management module
  • 3–5 automated disruption trigger integrations (mock APIs)
  • Zero-touch claim initiation prototype

Phase 3 β€” Scale & Optimise

  • Advanced fraud detection (GPS spoofing, coordinated claims)
  • Instant payout simulation (Razorpay test mode / UPI)
  • Worker dashboard: earnings protected, active coverage
  • Insurer/admin dashboard: loss ratios, predictive analytics

"We verify real work, prevent fake claims, and ensure fair payouts β€” even during large-scale disruptions."


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages