Inspiration
India has thousands of government welfare schemes distributing billions of dollars annually, yet the citizens who need them most rarely receive them. The barrier is information asymmetry: discovering eligibility requires navigating dense, bureaucratic websites in English and filling out rigid forms. We realized that if we could bring this process to the platform 800 million Indians already use—WhatsApp—and allow them to just talk in their native language, we could instantly unlock financial access for the underserved.
What it does
Sarthi Kalyan (सार्थी कल्याण) is an AI-powered welfare discovery agent. Users can chat with the bot via our Web Dashboard or directly on WhatsApp. By simply conversing naturally (e.g., "I am a 24-year-old female farmer from UP making 2 lakhs a year"), the Gemini-powered agent autonomously extracts their demographic profile, searches a vector database of government schemes, and instantly tells them exactly how much financial aid they are eligible for and how to apply.
How we built it
We utilized a "One Brain, Two Entry Points" architecture.
- The Brain: A LangGraph agent powered by Gemini 2.0 Flash. It uses
text-embedding-004and ChromaDB to perform RAG over a hand-curated database of Indian schemes. - The Web: A Next.js 14 App Router frontend with Tailwind CSS, deployed on Vercel.
- The WhatsApp Bot: A Twilio Sandbox webhook that POSTs incoming messages directly to our backend.
- The Infrastructure: A FastAPI backend containerized and deployed on Google Cloud Run, utilizing Firestore for session-state and BigQuery for logging agent decisions and tracking financial impact.
Challenges we ran into
Building a highly deterministic system using non-deterministic LLMs was incredibly challenging. We initially struggled with the AI hallucinating eligibility requirements. We solved this by implementing strict LangGraph state management and enforcing a dual-embedding strategy in ChromaDB, forcing the Gemini model to stick strictly to the retrieved context. Additionally, orchestrating a seamless handoff between the Twilio WhatsApp webhook and the synchronous FastAPI backend required careful async handling.
Accomplishments that we're proud of
We are incredibly proud of our "Flexibility Principle" architecture. The entire backend dynamically detects available API keys at startup. If Firestore or BigQuery go down, the system gracefully falls back to local SQLite and JSONL logging without crashing. We are also deeply proud of the seamless Hindi/English bilingual support on WhatsApp, which makes the tool genuinely accessible to rural populations.
What we learned
We learned that latency is everything in chat interfaces. We initially used heavier models, but the WhatsApp experience felt sluggish. Migrating our primary LangGraph routing to Gemini 2.0 Flash brought response times down to human-like speeds while drastically reducing our COGS, proving that smaller, faster models are the future of agentic workflows.
What's next for Sarthi Kalyan
Our next step is integrating the official Meta WhatsApp Business API to move out of the Twilio Sandbox. We plan to expand our scheme database from the initial 20 hand-curated schemes to all 100+ major central and state schemes. Finally, we want to expand our B2B dashboard so local NGOs can license our agent to mass-screen entire villages offline.
Built With
- chromadb
- docker
- fastapi
- firestore
- gemini
- google-bigquery
- google-cloud
- google-cloud-run
- langgraph
- next.js
- python
- razorpay
- react
- tailwindcss
- twilio
- typescript
Log in or sign up for Devpost to join the conversation.