First, what is “susu”? Susu is a centuries-old way of saving money together, common across Ghana and West Africa. Around the world the same idea is called a ROSCA (Rotating Savings and Credit Association), a tontine, a “merry-go-round”, or a savings circle. It works like this: a group of people who trust each other each contribute a fixed amount on a regular schedule (say ₵100 every week). Each round, one member receives the entire pooled pot; the next round it’s someone else’s turn, until everyone has been paid once. It gives people a lump sum they could not easily save alone — no bank account, no loan, no interest. Hundreds of millions of people worldwide save this way. SusuMate is a Ghanaian fintech app that makes running one safe and automatic (mobile-money contributions, fair payout rotation, public fundraising campaigns, and money transfers). Inspiration These savings groups are built on trust, and the trust lives in a group chat — almost always on WhatsApp. Today an organizer still juggles spreadsheets, chases contributions, and manually tracks whose turn it is to be paid. SusuMate turns that into a clean app, but asking every member to download an app, sign up, and learn new screens is friction — especially for less tech-savvy or first-time smartphone users. We wanted to remove that last barrier: let people do everything — start a group, contribute by mobile money, vote on payouts, send money — without ever leaving the WhatsApp chat they already use every day. An AI agent on WhatsApp, powered by Qwen, meets users exactly where they are, in plain language. What it does Mate is a conversational agent that lives on WhatsApp and can do anything a user can do in the SusuMate app, by acting on their behalf through the SusuMate API: • greets new users, signs them in with a phone-number + OTP flow, and remembers them; • creates private savings groups (rotational susu or shared pot) and public fundraising campaigns; • contributes by mobile money, proposes and votes on payouts, disburses funded rounds; • tops up the wallet, sends money (Ghana/Nigeria), checks balances, statuses and history; • invites members, approves join requests, manages settings and roles; • previews every money or destructive action and only executes after the user says “yes”. Because Mate performs each action as the signed-in user against the real API, SusuMate’s own validation, permissions and country rules apply automatically — the agent gets no special powers the user doesn’t already have. How we built it • LLM: Qwen Cloud (DashScope), via the OpenAI-compatible endpoint — qwen-plus as the primary model with qwen-flash as a fast fallback. Qwen’s function-calling drives the whole tool loop. • Runtime: Node.js + TypeScript. WhatsApp connectivity via Baileys (WhatsApp Web), isolated behind a channel interface so we can swap in the WhatsApp Cloud API later. • Agent core: A declarative endpoint catalog maps ~40 SusuMate actions to real API routes. Each becomes a Qwen tool; a single HTTP client executes them as the user (Bearer token). • Auth & safety: Per-user OTP login issues a SusuMate token stored encrypted at rest (AES-256-GCM). Code-level guardrails scrub identifiers and enforce an “act, never pretend” rule so the agent never claims an action happened unless the API confirmed it. • Architecture: A standalone repo, separate from the SusuMate backend, talking to it only over HTTPS — so the backend stays private while the agent is deployed and iterated on its own. Challenges we ran into • Acting as the user: Mapping ~40 SusuMate actions into reliable tool calls, and making the agent act strictly as the signed-in user over HTTP — so no permission logic is duplicated and nothing can be done that the user couldn’t do themselves. • Latency: A first draft used a “thinking” model that took ~21s per reply. Profiling the tiers, we moved to qwen-plus (~0.6s) — a ~35× speedup that made the WhatsApp UX feel instant. • Connection stability: Two gateway instances briefly shared one WhatsApp session and kept kicking each other off (error 440). Enforcing a single managed process fixed the flapping. • WhatsApp quirks: Handling WhatsApp’s privacy LIDs, QR/pairing-code linking, and message debouncing so a burst of messages becomes one clean turn. Accomplishments that we're proud of • A working, end-to-end agent: paired to a live WhatsApp number, replying on Qwen, and driving the production SusuMate API. • Security by design — the agent acts strictly as the authenticated user, with encrypted tokens and a mandatory preview→confirm step before any money moves. • Sub-second responses on Qwen with reliable function-calling across ~40 tools. • Clean separation: a self-contained agent that keeps the core product private. What we learned • Qwen’s OpenAI-compatible function-calling is a great fit for a real, tool-heavy agent. • Model-tier choice is a product decision: the fastest capable model beats the “smartest” one for a chat interface. • Guardrails belong in code, not just the prompt — “act, never pretend” and egress scrubbing matter when real money is involved. What's next for Mate • Move from Baileys to the official WhatsApp Cloud API for production scale. • Voice notes (speech-to-text) so users can just talk to Mate. • Local languages — Twi, Ga, Ewe, Pidgin — for wider reach. • Proactive nudges: contribution reminders and payout alerts pushed on WhatsApp.

Built With

  • aes-256-gcm
  • alibaba-cloud
  • baileys
  • dashscope
  • node.js
  • openai-sdk
  • qwen
  • qwen-plus
  • rest-api
  • typescript
  • whatsapp
Share this project:

Updates