← All projects
PayPal AI Hackathon 2026

Sauti

A PayPal agent that speaks Swahili.

A shopkeeper in Dar es Salaam speaks his sales into WhatsApp. Sauti keeps his books and runs a grocery wallet that each customer's family abroad tops up through PayPal.

Sauti: illustration of Duka la Mzee Salim, a small shop in Dar es Salaam, beside the Sauti wordmark
Built forPayPal AI Hackathon 2026, on PayPal's sandbox
StackNext.js · Claude via Vercel AI SDK · PayPal Agent Toolkit · ElevenLabs · WhatsApp Cloud API
The hard partCrediting every payment exactly once, from two signals that can arrive in any order
Tested8 unhappy paths against the real model and PayPal sandbox
01

The problem

Millions of East Africans abroad send money home, and much of it is meant for something specific: a parent's groceries, school supplies, the tab at the corner shop. Today it travels as cash, through a remittance app and a cash-out, and the sender has to hope it reached the groceries.

The corner shop, the duka, keeps its books in a paper notebook, the daftari. The shopkeeper doesn't use accounting software, often doesn't read English, and is too busy serving customers to type. But he is on WhatsApp all day, mostly in voice notes.

In May 2026, M-Pesa and PayPal linked up in Tanzania. The family abroad could now pay the shop directly. What was missing was something that works for the shopkeeper.
02

One run of the loop

Mama Asha buys rice at Mzee Salim's shop in Dar es Salaam. Her son Juma lives in New York and pays for her groceries. Left phone: the shop. Right phone: Juma. Middle: what the agent did, with every PayPal call tagged.

Demo screen: the agent records the sale on credit and sends Juma a PayPal top-up request
1The wallet is empty, so Sauti asks on its own. A voice note says Mama Asha took 15,000 TZS of rice. Sauti records it on credit and sends Juma a $20.00 PayPal top-up request.
Demo screen: Juma pays, the wallet shows 35,000 TZS and the debt is cleared
2Juma pays; PayPal confirms. A signed webhook arrives. Sauti clears the 15,000 owed and keeps 35,000 in her wallet.
The daftari notebook with the top-up entry and a POCHI IMEJAZWA stamp
3The notebook records it. The top-up lands in green with a POCHI IMEJAZWA (wallet topped up) stamp, and the shopkeeper gets a WhatsApp message in Swahili.
The demo screen in English, with the payment alert in the WhatsApp thread
4Anyone can follow along. An English/Kiswahili switch translates what the shopkeeper said, with the Swahili kept underneath.
03

Architecture

One Next.js app with two doors, WhatsApp and the web app, leading to the same agent, the same ledger and the same PayPal tools.

Architecture: the shop talks to Sauti through WhatsApp or the web app; the agent records sales and calls PayPal; PayPal confirms payments by webhook and live status checks

The agent decides, code calculates

Claude picks the tools and writes the reply. Every amount and balance is computed in the ledger, never by the model.

PayPal is the source of truth

A wallet only changes when PayPal says money arrived. If PayPal is down, nothing is credited.

Two signals, one fact

A payment is learned from PayPal's webhook or from asking PayPal. Settlement is idempotent, so the two never double-count.

04

Key engineering decisions

Sixteen decisions are in the README. These four carry the most weight.

Exactly-once settlement

Webhook signatures are verified through PayPal's own API, processed event ids are stored so retries are ignored, and settlement only acts on a request that is still open. The webhook and the 30-second status check can't both credit the same payment.

Money logic in code, not in the model

record_entry decides what the wallet pays, what goes on credit and whether a top-up is due, then tells the agent what to do next. The model's job is language and choosing tools.

Never record a sale twice

All ledger writes go through one write queue. A fallback model is used only if no tool has run yet, and memory keeps full tool calls, so a retry or follow-up never repeats a write.

Answer WhatsApp fast, work after

Meta expects a quick 200. The webhook verifies the signature, dedupes the message id and returns, then sends "writing it down…", runs the agent and replies.

05

Designed for the shopkeeper

Voice first, on the app he already has

A WhatsApp voice note in, a sentence out. He never types, never reads a dashboard. The web app's main control is one large microphone button.

A notebook, not a spreadsheet

The daftari is drawn as the lined notebook the shop already keeps: blue rules, a red margin, handwritten entries, a rubber stamp when the family pays.

Pre-paid beats credit

The first version billed the family for an existing tab. The wallet is better: the shop is paid before goods leave, and the family sees exactly what their money bought.

Show the agent's work

Every tool call becomes a plain sentence under the reply, PayPal calls are tagged, and the raw calls are one click away.

The shopkeeper's app on a phone: microphone button, examples and the daftari
06

Testing the unhappy paths

Eight cases run against the real model and PayPal sandbox, each checking which tools the agent called. Four of them:

The shopkeeper saysCaseSauti must
Mama Asha amechukua mchele.Sale with no amountAsk for the amount, record nothing
Tuma shilingi 100,000 kwa Juma.Send money out (not supported)Explain it can't, send nothing
Baraka amechukua soda ya 1,000.No relative abroadRecord the sale, no PayPal request
Bibi Rehema took two loaves for 3,000 on credit.English instead of SwahiliRecord it and request a top-up on its own
07 · Limitations
  • PayPal sandbox only; production needs a business account per shop
  • Doesn't use the PayPal–M-Pesa link yet; limits and rollout aren't public
  • Meta's test number only messages verified recipients
  • JSON-file storage that resets on each deploy, and a fixed TZS/USD rate
08 · What's next
  • Cash out to M-Pesa, so a top-up is spendable the same day
  • Family controls: a monthly budget and a weekly summary for the payer
  • More languages: Sheng, Kinyarwanda, Somali, Amharic
  • Beyond groceries: school fees, pharmacies, clinics