← work

SunCulture Transaction Intelligence

A hybrid rules + LLM + retrieval pipeline that standardized 7M+ farmer transactions into the credit signal behind microloans.

Private client system · public website and source are unavailable

My contribution
Worked on transaction classification and its integration with SunCulture's credit-scoring workflow in a data science and ML role.
Key decision
Use rules for familiar transactions, retrieval-assisted classification for the long tail, and confidence thresholds to route uncertain cases to human review.
Result
The pipeline standardized 7M+ transactions, with reported 99% accuracy on a 10,000-item holdout and a 95% reduction in manual-review volume.
Current limitation
This case study describes internal work. The transaction dataset and holdout results are not published as a public evaluation artifact.
Org
SunCulture — Series-B agtech startup, East Africa
Role
Data science & ML
Period
2025
Status
production
Stack
Python · RAG · LLM classification · REST

99%

classification accuracy

Measured evaluation

10,000-item hand-labeled holdout set

Holdout methodology notes

−95%

manual-review volume

Production scale

confidence-gated human-in-the-loop routing

Reported review-volume notes

7M+

transactions standardized

Production scale

500+ category targets, free-text descriptions

Production scope notes
01/ CONTEXT

The problem

SunCulture is a Series-B agtech startup selling solar-powered irrigation to smallholder farmers across East Africa, financed through microloans. To underwrite those loans, the credit team needed a clean view of each farmer's cash flow — but the raw transaction data was a mess: free-text descriptions, inconsistent merchant names, regional abbreviations, and 500+ category targets ranging from "seeds" to "motorbike repair."

The pipeline's job: classify transactions reliably enough that the output could feed a creditworthiness model that decides real loans.

02/ CONSTRAINT

The constraints

  • 7M+ transactions with noisy free-text descriptions and regional abbreviations
  • A 500+ category space — pure rules could never cover the tail; pure LLM was too expensive at volume
  • Ground truth was scarce: the hand-labeled gold set was small relative to the category space
  • A latency budget — new transactions had to score fast enough to inform loan decisions
  • A 95%+ accuracy bar for the credit team to trust the signal at all
03/ APPROACH

The loop

A three-tier hybrid, each tier handling what it's cheapest and best at:

  1. Rule engine (fast path) — exact merchant matches and known prefixes resolve the high-confidence majority at near-zero cost
  2. LLM + retrieval (long tail) — for uncertain transactions, retrieve the nearest labeled examples from the corpus and condition the model on them, RAG-style
  3. Confidence-gated human review — only predictions below a confidence threshold route to a person

The loop that kept it improving: errors from each batch were hand-labeled and folded back into the retrieval corpus, so the long-tail tier got sharper with every cycle.

04/ SYSTEM

The build

A Python REST service classifies individual transactions or batch files:

  • Rule layer covers the majority of common transactions with near-zero marginal cost
  • LLM + retrieval layer handles novel or ambiguous descriptions
  • Confidence gating routes only the genuinely uncertain subset to manual review
  • Output integrates directly with the credit-scoring model feeding loan decisioning
05/ EVIDENCE

Evidence

The 99% figure comes from a 10,000-item hand-labeled holdout — not training accuracy, not a cherry-picked subset.

  • Accuracy was tracked per tier, so the cheap rule path couldn't quietly degrade behind the blended number
  • The iterative eval loop (hand-label errors → fold into retrieval corpus) meant the system improved on exactly the cases it got wrong
  • Confidence calibration determined the human-review threshold — the −95% review reduction is a direct consequence of the gate, not a separate claim
06/ IMPACT

Impact

  • 99% accuracy on the holdout, clearing the credit team's 95% trust bar
  • 95% reduction in manual review volume
  • A cleaner cash-flow signal feeding microloan underwriting
  • Faster loan decisions for smallholder farmers across East Africa

Questions about this project? The chat answers from these case studies and links back to them.