Inspiration

In Pakistan and across South Asia, millions of people save through committees (kameti / bisi / ROSCAs): a group pools a fixed amount every cycle, and one member takes the whole pot in turn. The system runs on trust, and today that trust lives in WhatsApp groups, notebooks and memory. Organizers chase payments, members argue over who paid on which date, and a single default can break a friendship or a family.

What if the committee kept its meeting place (WhatsApp) but gained a structured ledger, a fair reputation system, and an impartial judge?

That question became Sanjhi: Mil kar bachat, bharosay ke saath.


What it does

Sanjhi is a web, Android and WhatsApp platform that digitizes the full life of a rotating savings committee. It never holds anyone's money. Funds move directly between members and the organizer, and Sanjhi adds the coordination and trust layer on top.

Core features

  • Create committees in plain language. Type or speak "10 people, Rs. 5,000 monthly, starting next month" and the setup form fills itself. Duration is computed automatically:

$$ D = N \times I $$

where \(N\) is the number of members (capacity) and \(I\) is the collection interval.

  • Role-scoped ledger. Organizers and co-organizers see every member's status. Members see only their own history plus an anonymous progress count such as "7 of 10 paid". This is enforced at the API level, not just hidden in the UI.
  • Fast payments. JazzCash and EasyPaisa deep-links open with the account details copied for you. Members upload receipt proof and the organizer confirms.
  • Transparent Trust Score (0-1000). A deterministic, auditable formula:

$$ T = 500 + R + C + V - P $$

where \(R\) is reliability points, \(C\) is a completion bonus, \(V\) is a CNIC-verification bonus and \(P\) is default/penalty points.

Tier Score range
Diamond 900 to 1000
Gold 750 to 899
Silver 600 to 749
Bronze below 600
  • AI Dispute Court. An Investigator Agent collects evidence with read-only tools: ledger timestamps, payment proofs, member histories and CNIC status. A Judge Agent weighs it against committee bylaws and returns a verdict with a confidence score. High-confidence cases resolve automatically, and uncertain ones escalate to a human admin.
  • Sanjhi on WhatsApp. Log in with an OTP inside the chat, then send text or voice notes in English, Roman Urdu or Urdu script ("Meri agli kameti kab hai?"). You can check committees, pay, join, file complaints and get calendar schedules.
  • Committee Health Monitor. A background agent watches for early-warning patterns, such as a cluster of at-risk members converging on one cycle, and alerts the organizer before a default happens.
  • Offline-first. A PWA service worker plus a Capacitor-bundled Android APK make the app load instantly, even on weak connections.

How we built it

Sanjhi is built as a React and Node.js platform with an AI agent layer, and its production infrastructure is moving to Amazon Web Services (AWS) so it can handle real financial workloads reliably.

Application stack

Layer Technology
Frontend React 19 PWA, Capacitor 8 native Android APK
Backend Node.js, Express, JWT, BCrypt-hashed OTP, rate limiting
Database PostgreSQL with double-entry cycle reconciliation and audit logs
AI (app) Google Gemini for FAQ chatbot, natural-language setup, complaint narratives
AI (WhatsApp) Groq: Whisper Large v3 for voice, LLaMA 3.3 70B for function-calling and replies
WhatsApp Baileys, FFmpeg for .ogg / .opus voice notes
Tool layer MCP-style tools wrapping existing REST endpoints

AWS architecture

AWS service Role in Sanjhi
Amazon RDS for PostgreSQL Managed, backed-up home for the financial ledger, trust-score history and audit logs
AWS App Runner / Amazon EC2 Hosts the Express API and the persistent Baileys WhatsApp gateway
Amazon S3 Stores CNIC images and payment receipt proofs, delivered through short-lived signed URLs
Amazon CloudFront Serves the PWA and static assets globally with low latency
Amazon EventBridge Scheduler + AWS Lambda Runs the Committee Health Monitor, payment reminders and cycle rollovers on a schedule, independent of user activity
Amazon Bedrock Fallback foundation models for the Investigator and Judge agents, so disputes keep getting processed when another AI provider is rate-limited
AWS Secrets Manager + Amazon CloudWatch Secure API key storage, plus logs and alarms for agent runs and tool calls

Design principles

  1. The agent never touches the database. Every WhatsApp action goes through an MCP-style tool layer that calls the same role-checked API as the web and mobile apps, so the agent can only do what the logged-in user could already do.
  2. Multiple AI providers, no single point of failure. Gemini, Groq and Amazon Bedrock power different features and act as fallbacks for each other, so one rate limit never stops a dispute or a voice note.
  3. Advisory by default. Agents resolve only high-confidence cases. Anything ambiguous goes to a human.
  4. Non-custodial. Sanjhi tracks and reconciles but never escrows funds.
  5. Private by default. Receipts and identity documents live in private S3 storage and are never publicly addressable.

Voice pipeline

Voice note → Baileys → FFmpeg → Groq Whisper v3 → intent classification
→ tool router → PostgreSQL (RDS) → LLaMA 3.3 70B reply → WhatsApp

Offline strategy

Static assets use a cache-first strategy. Live ledger data uses network-first with a stale-cache fallback.


Challenges we ran into

  • Making AI trustworthy with money. Agents handling financial disputes cannot hallucinate. We gave them read-only tools, required evidence-based verdicts with confidence scores, and escalated every uncertain case to a human.
  • Speaking the way Pakistan actually speaks. Users mix English, Roman Urdu and Nastaliq script, often in noisy voice notes. Getting transcription, intent detection and tool routing to work across all three took many iterations.
  • Privacy vs. transparency. Members need to know the committee is on track without seeing who is late. We enforced this server-side so it can't be bypassed by inspecting network traffic.
  • Staying non-custodial. Without a payment aggregator, we designed reconciliation around sender details, receipt proofs and organizer confirmation. We rejected SMS-parsing auto-detection over privacy and platform-policy concerns.
  • Free-tier limits and provider outages. We scoped each AI feature narrowly, gave each a manual fallback, and designed the agent layer to fail over to Amazon Bedrock so a rate limit never blocks a user.
  • Moving from prototype to production. Taking a working app to managed infrastructure meant rethinking where state lives: a managed Postgres on RDS, private file storage on S3, and scheduled agent runs on EventBridge and Lambda instead of in-process timers.
  • Weak connectivity. Offline-first caching and a locally bundled APK kept the app usable on poor networks.
  • Keeping spec and product aligned. The build outran our requirements document, so we wrote a full gap analysis (SRS v2.0) tracing every extension back to a baseline requirement.

Accomplishments that we're proud of

  • A working system across web, Android and WhatsApp, backed by a complete SRS with C4, layered architecture, ERD, sequence and state diagrams.
  • A two-agent dispute court that resolves clear-cut cases instantly and escalates the hard ones.
  • Bilingual voice-note support (Roman Urdu, Urdu script, English), delivered ahead of our original plan.
  • A transparent Trust Score that anyone can audit, not a black box.
  • A cloud architecture designed for financial-grade reliability: managed database, private document storage, scheduled agents and multi-provider AI failover.
  • A product that meets users where they already are, without weakening authentication or permissions.

What we learned

  • The best AI features sit on top of strict, deterministic foundations (a double-entry ledger and role-checked APIs), not instead of them.
  • Give agents the minimum authority they need: advisory by default, autonomous only when confident.
  • Language support is a product feature, not a translation task. Real users code-switch constantly.
  • Reputation systems only work when their rules are visible.
  • Reliability is a feature when real money is involved: managed databases, private storage and provider failover matter as much as the AI itself.
  • Designing around users' existing habits (WhatsApp, JazzCash, EasyPaisa) beats asking them to change.

What's next for Sanjhi Ai

  • [ ] Complete the AWS rollout: RDS, App Runner, S3, CloudFront and EventBridge/Lambda in production
  • [ ] Bedrock-powered agents: move the Investigator and Judge fully onto Amazon Bedrock, with guardrails for financial decisions
  • [ ] Financial infrastructure: automatic payment detection through a banking switch or aggregator, escrow wallets, split payouts, micro-loans
  • [ ] Mechanism design: lottery and bidding payout orders, emergency turn swapping
  • [ ] Legal & compliance: SECP-compliant digital lending, e-signed promissory notes, NADRA Verisys biometric verification
  • [ ] Cross-border: committees for overseas Pakistanis (GCC / UK) with live AED/SAR/PKR conversion
  • [ ] Smarter agents: Gemini-reasoned Risk Flag and Health Monitor, plus tiered access that unlocks larger committees for highly reliable users
  • [ ] Open ecosystem: the MCP tool layer as a standards-compliant server for third-party AI clients, a B2B white-label for employee welfare committees, and a full Urdu interface

Try it: Live web app | Android APK | Source code

Built With

Share this project:

Updates

Submission history