Bruce Nduko
All projects
LiveWebAIPayments

Allama

Productivity Passport — verifiable work records for informal-economy workers.

allama-theta.vercel.app
Allama screenshot

Problem

Informal-economy workers in Kenya have no verifiable record of the work they've actually done, which locks them out of loans, gigs, and formal opportunities.

What I built

Allama turns M-Pesa SMS, job photos, and voice notes into a verifiable work record — a "productivity passport." I led the build, security hardening, and deployment.

Stack

Next.jsVercelGitHub Actions

The kind of code behind it

1import re
2from dataclasses import dataclass
3from datetime import datetime
4
5SMS_PATTERN = re.compile(
6 r"Confirmed\.\s*(?P<code>[A-Z0-9]{10})\s*"
7 r"You have received Ksh(?P<amount>[\d,]+\.\d{2})\s*"
8 r"from (?P<sender>[A-Za-z ]+) on (?P<date>\d{1,2}/\d{1,2}/\d{2})"
9)
10
11@dataclass
12class WorkRecord:
13 code: str
14 amount: float
15 payer: str
16 occurred_at: datetime
17 confidence: float
18
19
20def parse_sms(raw: str) -> WorkRecord | None:
21 match = SMS_PATTERN.search(raw)
22 if not match:
23 return None
24
25 amount = float(match.group("amount").replace(",", ""))
26 occurred_at = datetime.strptime(match.group("date"), "%d/%m/%y")
27
28 # Confidence drops if the payer name looks truncated or the amount
29 # is suspiciously round — both are common OCR/forwarding artifacts.
30 confidence = 0.95
31 if len(match.group("sender").strip()) < 4:
32 confidence -= 0.2
33 if amount % 100 == 0 and amount > 1000:
34 confidence -= 0.1
35
36 return WorkRecord(
37 code=match.group("code"),
38 amount=amount,
39 payer=match.group("sender").strip(),
40 occurred_at=occurred_at,
41 confidence=round(max(confidence, 0.0), 2),
42 )