Inspiration

Filing an insurance claim after property damage is stressful and slow. You take photos, call your insurer, wait on hold, fill out forms, and then wait days or weeks for an adjuster to review everything. I asked: what if AI could do all of that in under a minute? With Gemini 3's vision capabilities and function calling, I saw an opportunity to build an autonomous agent that handles the entire claims workflow end-to-end, no human bottleneck required.

What it does

Claimly is an AI-powered insurance claims processor. Users upload photos of damage (car, home, or other property), optionally record a voice description, and select their policy type. An autonomous Gemini 3 agent then takes over:

  • Validates photo quality before analysis (blur, lighting, angle)
  • Detects and classifies damage across all uploaded images with bounding boxes
  • Estimates repair costs adjusted for location
  • Looks up policy rules and assesses coverage for each damaged component
  • Flags ambiguous cases for human review
  • Generates a professional PDF report ready to submit to an insurer

The entire process streams in real time via Server-Sent Events, so users see the agent's reasoning, tool calls, and findings as they happen. Multi-language support covers English, Spanish, and Chinese.

How I built it

Frontend: React 19 + TypeScript + Vite 7 + Tailwind CSS. The agent processing page uses SSE to render live event cards showing the agent's thinking, tool invocations, damage findings, and coverage determinations.

AI Agent: A Vercel serverless function hosts the autonomous agent loop. Gemini 3 receives the uploaded images and a system prompt with 8 available tools (validate_photo, detect_damage, estimate_repair_cost, lookup_policy_rules, assess_coverage, flag_for_review, request_additional_evidence, generate_claim_summary). The model decides which tools to call and in what order, looping until it produces a final claim summary.

Hybrid AI/Rules Architecture: Damage detection and cost estimation use Gemini 3's vision and reasoning. Policy coverage uses deterministic rule sets (7 policy types with specific perils, exclusions, limits, and deductibles) to avoid hallucinated coverage decisions.

PDF Generation: jsPDF with AutoTable generates professional claim reports with damage breakdowns, coverage status, and cost estimates.

Deployment: Vercel handles hosting, serverless functions, and edge delivery.

Challenges I ran into

  • Stale event handling: When users retry the agent, old SSE streams could still be delivering events. I built a "run guard" pattern where each agent run gets a unique ID and the frontend ignores events from previous runs.
  • Agent safety: Without guardrails, the agent could loop indefinitely. I added a 30-iteration cap and 5-minute timeout to prevent runaway processing.
  • Streaming structured data: Parsing partial JSON from SSE events while maintaining type safety required careful extraction logic for damage findings, coverage results, and the final summary.

Accomplishments that I'm proud of

  • The autonomous agent processes a full insurance claim (photo validation, damage detection, cost estimation, coverage assessment, and report generation) in under 60 seconds with zero manual intervention.
  • Real-time streaming makes the AI's reasoning fully transparent. Users see exactly what the agent is doing and why.
  • The hybrid AI/rules approach means coverage decisions are deterministic and auditable, not hallucinated.
  • Clean separation between the agent backend (serverless + Gemini function calling) and the reactive frontend (SSE + event cards) makes the architecture extensible.

What I learned

  • Gemini 3's function calling is powerful enough to drive a fully autonomous multi-step workflow when given well-defined tools and clear system instructions.
  • Streaming AI agent output via SSE dramatically improves user trust compared to a loading spinner. Showing the reasoning process matters.
  • Mixing AI inference with deterministic rules is the right pattern for high-stakes domains. Let AI handle perception (what's damaged?) and rules handle decisions (is it covered?).

What's next for Claimly

  • Persistent claim tracking with user accounts and claim history
  • Multi-image before/after comparison for repair verification
  • Adjuster dashboard for insurance companies to review flagged claims
  • Mobile app with native camera integration for on-scene documentation
  • Integration with insurance APIs for direct claim submission
  • Expanded policy intelligence covering more carriers and regional regulations

Built With

  • google-gemini-3
  • jspdf
  • react
  • server-side-events
  • tailwind-css
  • typescript
  • vercel
  • vite
Share this project:

Updates