Skip to content
John Ndigirigi
WorkAboutWritingResumeContactBook a call (opens in a new tab)
  • Work
  • About
  • Writing
  • Resume
  • Contact
Book a call (opens in a new tab)
John Ndigirigi

Full-stack & AI Engineer · Nairobi, working remotely worldwide.

  • Work
  • About
  • Writing
  • Resume
  • Contact

© 2026 John Ndigirigi

Built with React + Vite + Tailwind

All writing
  • AI
  • Fintech
  • Machine Learning
  • Architecture

AI Credit Scoring Without the Black Box: Explainable Loan Risk for Cooperative Finance

10 June 2026 · 6 min read

The standard pitch for AI in credit scoring is: train a model on historical data, feed it applicant information, get a probability of default. This works in contexts with abundant credit history data, regulatory frameworks for algorithmic lending, and borrowers sophisticated enough to challenge decisions. It does not work for cooperative finance in sub-Saharan Africa, and the reasons are instructive for anyone building AI-powered financial products where conventional data assumptions break down.

The Thin-File Problem

Most SACCO and chama members have limited or zero formal credit history. They have not taken bank loans, do not have credit cards, and do not appear in credit bureau databases. A model trained on bureau data gives them a default score that is effectively noise, not because they are bad credit risks, but because the signal the model expects is absent.

The naive response is to train on the cooperative's own historical loan performance data. But cooperatives running on spreadsheets and WhatsApp groups do not have clean historical loan performance data. The first batch of loans you issue cannot be scored by a model trained on loans you have not yet issued.

This is not a problem unique to African cooperatives. It is a version of the cold start problem that appears wherever credit is being extended to people outside the formal financial system, gig workers, immigrants, first-time borrowers, small agricultural producers. The solution in each case is the same: identify what signals actually predict repayment in this specific context and build features around those signals, rather than importing a feature set designed for a different population.

What Predicts Repayment in Cooperative Finance

Cooperative finance has its own signal layer, distinct from formal credit bureau data:

Contribution consistency. A member who contributes on time every month for two years is a meaningfully different risk profile than one who contributes sporadically. This is a direct behavioural signal, not a proxy.

Contribution trajectory. Increasing contributions over time signal improving financial capacity. Declining contributions, especially in the 3–6 months before a loan application, signal financial stress.

Loan-to-savings ratio. The ratio of the requested loan to the member's accumulated savings is a strong predictor. Borrowers requesting amounts close to their savings have demonstrated long-term commitment to the institution and have skin in the game.

Tenure and engagement. How long has the member been active? Tenure is a proxy for relationship quality and demonstrated commitment to the cooperative model.

Purpose specificity. "I need KES 50,000 to purchase inventory for my shop before the December trading season" is a different risk profile than "I need money." Specific, seasonal, asset-backed purposes can be verified and have clear repayment timelines.

Group reputation in joint-liability models. For chamas with joint liability, the group's collective repayment history is a signal for individual member risk. Members of high-performing groups benefit from the group's track record.

None of these features exist in traditional credit bureau data. All of them exist in a well-modelled cooperative finance system.

The Architecture: Domain Features → Scoring Model → LLM Explanation

The Sociale credit scoring system works in three layers:

Layer 1, Feature extraction. Structured queries against the PostgreSQL database compute the features above for each member: rolling 12-month contribution consistency score, trajectory (linear regression over contribution amounts), current loan-to-savings ratio, tenure in days, and purpose category. Purpose category is extracted via an LLM classification call on the free-text loan application: "inventory purchase", "medical emergency", "school fees", "asset acquisition", and so on. This is the only LLM call in the feature extraction layer.

Layer 2, Scoring model. A gradient boosting model trained on cooperative finance domain features. Not a neural network, deliberately. Gradient boosting models produce feature importances that are directly interpretable: "this score is primarily driven by below-average contribution consistency over the last six months and a high loan-to-savings ratio." Loan committees can verify this reasoning. They can override it with justification. They can explain the rejection to the member. Black-box models optimised purely for accuracy are not acceptable in this context.

Layer 3, LLM narrative. The structured score output, feature values, score, band, and primary drivers, is passed to an LLM that generates a human-readable explanation of the recommendation. Not a decision; an explanation. What is driving the score, what would improve it, and what questions the committee should consider. The model is translating structured data into language the committee can work with.

The LLM is not making a credit decision at any layer. It classifies purpose in layer one and generates an explanation in layer three. The actual risk assessment is the gradient boosting model, with interpretable features the committee can inspect.

Why Explainability Is Non-Negotiable

In cooperative finance, the loan committee is not a rubber stamp. It has fiduciary responsibility to members and must defend its decisions. An AI system that says "approved with 78% confidence" and offers nothing further will not be trusted, and in a member-governed cooperative, should not be trusted.

The interpretable scoring layer means that when a member challenges a rejection, the committee can say: "Your contribution consistency score over the last year was 54%, below our threshold, which was the primary factor. If you maintain consistent contributions for the next six months, you would qualify for this loan amount." That is not a black box. That is a financial service that respects its members.

It also means the committee can catch model errors. If a long-standing member with 95% consistency has a two-month dip because of a documented family emergency, the committee can see the dip, understand the context, and exercise judgment. The model informs the decision; humans make it.

Production Considerations

Feature drift is the primary reliability risk. If the pipeline computing features has a bug, an off-by-one in a date range, a null-handling error in contribution aggregation, scores will be wrong in silent ways. Every computed feature should have sanity bounds. A contribution consistency score above 1.0 or below 0.0 is a bug signal, not a valid score. Alerting on bound violations catches upstream data problems before they affect decisions.

Cold start requires rule-based fallback. New members have no history. For accounts younger than 90 days, the system uses rule-based scoring: maximum loan amount capped as a multiple of total contributions to date, purpose verification required, maximum tenure waiver for founding members. The gradient boosting model only activates once there is enough history to make its features meaningful.

Full audit trail. Every credit assessment, feature values at the time of assessment, model score, score band, LLM explanation text, committee decision, and any override justification, is written to an append-only log table tied to the loan record. This is not optional. It is the paper trail that makes the system auditable, disputable, and improvable over time.

Model versioning. When the model is retrained on newer data, the previous version's assessments remain interpretable because the feature definitions have not changed. The score for a loan issued under model v1 can still be explained using the same feature vocabulary as a loan issued under model v3.

← OlderWhatsApp as a Production API Surface: Building AI-Native Apps for Low-Bandwidth MarketsNewer →Building Production AI Agent Workflows with LangGraph.js: Lessons from the Field