Inspiration

Around 500 million smallholder farmers grow much of the world's food, yet fewer than one in five ever files a crop insurance claim. The forms are in the wrong language, they demand evidence a farmer can't easily produce, and the nearest office can be a day's travel away. Insurance that can't be claimed isn't insurance. I wanted the entire claims process to fit inside the one tool every farmer already has: a chat app and a camera.

What it does

A farmer messages the ClaimFarm bot on Telegram. The first time, it registers them right in the chat, in their own language: name, language, farm location, village, crops, farm size, optional email. Then they send one photo of the damaged crop with a caption in their own words.

Within about a minute, ClaimFarm:

  • grades the damage with Qwen-VL-Max (crop, cause, severity, affected area, visible indicators)
  • runs photo forensics: EXIF capture time and GPS, edit-software flags, a Qwen-VL authenticity score, and perceptual-hash dedupe against the farmer's past claims
  • pulls 30 days of real weather for the farm location and asks Qwen-Max whether the data corroborates the claimed cause
  • retrieves similar past claims and agronomy references from Alibaba DashVector for fraud and context
  • drafts the claim with an estimated payout and generates a proper insurance PDF

The claim lands in the insurer's adjuster console with everything on one screen. One click approves it; the farmer is notified instantly in their language and can get the claim PDF emailed with one tap.

The part I'm proudest of is the verification loop. A claim with red flags (no GPS on the photo, low authenticity score, weather that doesn't match the story) isn't auto-rejected. The PDF lists every flag and the exact proof to email back; ClaimFarm re-verifies the evidence and releases the payout. Weak claims become verified claims instead of instant rejections.

Access is production-grade: staff accounts are invite-only (owner-issued invites, Argon2id, RBAC), farmers never need a web login, and everything persists in Postgres.

How I built it

FastAPI orchestrator in a custom container on Alibaba Cloud Function Compute 3.0 (Singapore), calling Qwen-VL-Max, Qwen-Max, and text-embedding-v3 through DashScope's OpenAI-compatible API. DashVector holds the past-claims and agronomy collections. Neon Postgres (same region) stores users, invites, farmer profiles, claims, and even photo bytes. The adjuster console and marketing site are Next.js 16 on Vercel. Weather comes from Open-Meteo, transactional email from Resend on a DKIM-verified domain, and GitHub Actions builds, tests, and deploys the container to FC on every push.

Challenges I ran into

  • Serverless containers have opinions. FC pins the image digest, so deploying by :latest served stale code; I switched CI to immutable per-commit tags. Warm instances also keep serving old code until they idle out, which made "why is prod old" a recurring mystery.
  • The default fcapp.run domain forces file downloads and blocks external redirects, which broke email verification links and browser testing. I moved link handling into the frontend and returned client-side redirect pages instead.
  • Ephemeral storage ate my photos. FC wipes local disk between instances, so evidence photos vanished. I moved photo bytes into Postgres so claims survive any instance roll.
  • Email deliverability from a brand-new domain meant DKIM/SPF/DMARC setup, an inline-embedded logo (remote images get blocked), and a real reply-to address.
  • Cross-origin auth between Vercel and FC needed SameSite=None cookies and careful CORS with credentialed requests.

What I learned

Multimodal models are genuinely good enough to gate real money when you surround them with corroboration: weather data, forensics, retrieval, and a human adjuster. Designing for the rejection path (ask for proof, re-verify) matters more than the happy path. And most of "AI product" work is production plumbing: webhooks, signatures, storage, cold starts, deliverability.

What's next

A real insurer integration to replace the mock carrier, WhatsApp via a business provider alongside Telegram, payout rails, OSS archival for long-term evidence retention, and a pilot with an NGO or micro-insurer in one region.

Built With

  • alibaba-cloud
  • dashscope
  • dashvector
  • docker
  • fastapi
  • function-compute
  • github-actions
  • neon
  • next.js
  • open-meteo
  • postgresql
  • python
  • qwen
  • resend
  • tailwindcss
  • telegram-bot-api
  • typescript
  • vercel
  • weasyprint
Share this project:

Updates