<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/i-built-a-financial-risk-ai-that-actually-understands-kenyan-balance-sheets-pawcfi2l8" -->

---
title: I Built a Financial Risk AI That Actually Understands...
description: Western credit scoring models systematically misread African financial statements because they were trained on US/European corporate data. A Kenyan data...
canonical: https://daily.dev/posts/i-built-a-financial-risk-ai-that-actually-understands-kenyan-balance-sheets-pawcfi2l8
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: I Built a Financial Risk AI That Actually Understands Kenyan Balance Sheets | daily.dev
og:description: Western credit scoring models systematically misread African financial statements because they were trained on US/European corporate data. A Kenyan data...
og:url: https://daily.dev/posts/i-built-a-financial-risk-ai-that-actually-understands-kenyan-balance-sheets-pawcfi2l8
og:image: https://api.daily.dev/og/posts/PAwcFi2l8.png
og:image:alt: I Built a Financial Risk AI That Actually Understands Kenyan Balance Sheets
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# I Built a Financial Risk AI That Actually Understands Kenyan Balance Sheets

**[Medium](https://daily.dev/sources/medium_js)** · 8 min read · 0 upvotes · 0 comments

## Summary

Western credit scoring models systematically misread African financial statements because they were trained on US/European corporate data. A Kenyan data scientist built FinLens AI to address this 'Structural Metric Trap' — an open-source financial document analysis tool that benchmarks companies against localized East African regulatory frameworks (CBK, IRA, World Bank SSA). The five-layer pipeline uses Google Gemini 1.5 Flash for document ingestion, local ratio computation, Isolation Forest anomaly detection with SHAP explainability, a LangChain RAG layer querying a ChromaDB vector store of African regulatory texts, and ReportLab for PDF report generation. Tested on three NSE-listed companies (Equity Group, Jubilee Holdings, EABL), the system produced contextually accurate risk assessments. Known limitations include a Western-trained anomaly baseline and limited offline PDF parsing. The project is open source on GitHub.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://johnapollosolal.medium.com/i-built-a-financial-risk-ai-that-actually-understands-kenyan-balance-sheets-1814e0a8dcde>

## Questions this post answers

### Why do Western credit risk models flag Kenyan commercial banks as financially distressed?

Western models expect current ratios similar to manufacturing companies, but Kenyan deposit-funded banks structurally hold liquidity in government securities matched against long-term deposit liabilities, producing a current ratio around 0.1. This is a structural characteristic of banking, not a warning sign, yet models trained on SEC EDGAR data statistically treat it as an outlier.

_Teams evaluating credit risk tools for emerging markets can find grounded technical writeups like this on daily.dev._

### What machine learning architecture does FinLens AI use to analyze African financial statements?

FinLens AI uses a five-layer pipeline: Gemini 1.5 Flash extracts structured data from uploaded PDFs, a deterministic validation layer checks the accounting identity, ten ratios are computed locally, an Isolation Forest with SHAP explainability detects anomalies, and a LangChain agent queries a ChromaDB store of CBK, IRA, Basel III, and World Bank regional benchmarks to contextualize the results.

_Engineers designing localized RAG and anomaly-detection pipelines can track similar architectures on daily.dev._

### What Altman Z-Score did Equity Group Holdings and East African Breweries get in a 2023 credit risk analysis?

Equity Group Holdings scored 10.66, placing it in the safe zone, with ROE of 20.04% against an 11.5% sector benchmark. East African Breweries PLC scored 1.85, landing in the grey zone due to a debt-to-equity ratio of 1.91 versus a sector median of 0.85 and a current ratio of 1.0 against a 1.95 benchmark, despite strong 38.4% ROE.

_Analysts building sector-benchmarked risk scoring can follow real-world model validation examples on daily.dev._

## Similar posts on daily.dev

- [I Made 5 AI Models Argue About Stocks. The Disagreements Were More Valuable Than the Answers.](https://daily.dev/posts/i-made-5-ai-models-argue-about-stocks-the-disagreements-were-more-valuable-than-the-answers--02re9hfon) · InfoSec Write-ups · 3 upvotes · 0 comments
- [What happens when your onboarding AI gets it wrong?](https://daily.dev/posts/what-happens-when-your-onboarding-ai-gets-it-wrong--jgi3rowit) · TechCentral · 0 upvotes · 0 comments

---

Tags: [#machine-learning](https://daily.dev/tags/machine-learning), [#rag](https://daily.dev/tags/rag), [#langchain](https://daily.dev/tags/langchain)

[View this post on daily.dev](https://daily.dev/posts/i-built-a-financial-risk-ai-that-actually-understands-kenyan-balance-sheets-pawcfi2l8)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"I Built a Financial Risk AI That Actually Understands Kenyan Balance Sheets","url":"https://daily.dev/posts/i-built-a-financial-risk-ai-that-actually-understands-kenyan-balance-sheets-pawcfi2l8","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/i-built-a-financial-risk-ai-that-actually-understands-kenyan-balance-sheets-pawcfi2l8"},"datePublished":"2026-07-18T08:11:23.809Z","dateModified":"2026-09-14T06:37:59.109Z","description":"Western credit scoring models systematically misread African financial statements because they were trained on US/European corporate data. A Kenyan data...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e5ba814657dc37a2b8f1c49028501713?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e5ba814657dc37a2b8f1c49028501713?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Medium","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/i-built-a-financial-risk-ai-that-actually-understands-kenyan-balance-sheets-pawcfi2l8","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"machine-learning,rag,langchain","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"I Built a Financial Risk AI That Actually Understands Kenyan Balance Sheets"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/i-built-a-financial-risk-ai-that-actually-understands-kenyan-balance-sheets-pawcfi2l8#faq","mainEntity":[{"@type":"Question","name":"Why do Western credit risk models flag Kenyan commercial banks as financially distressed?","acceptedAnswer":{"@type":"Answer","text":"Western models expect current ratios similar to manufacturing companies, but Kenyan deposit-funded banks structurally hold liquidity in government securities matched against long-term deposit liabilities, producing a current ratio around 0.1. This is a structural characteristic of banking, not a warning sign, yet models trained on SEC EDGAR data statistically treat it as an outlier. Teams evaluating credit risk tools for emerging markets can find grounded technical writeups like this on daily.dev."}},{"@type":"Question","name":"What machine learning architecture does FinLens AI use to analyze African financial statements?","acceptedAnswer":{"@type":"Answer","text":"FinLens AI uses a five-layer pipeline: Gemini 1.5 Flash extracts structured data from uploaded PDFs, a deterministic validation layer checks the accounting identity, ten ratios are computed locally, an Isolation Forest with SHAP explainability detects anomalies, and a LangChain agent queries a ChromaDB store of CBK, IRA, Basel III, and World Bank regional benchmarks to contextualize the results. Engineers designing localized RAG and anomaly-detection pipelines can track similar architectures on daily.dev."}},{"@type":"Question","name":"What Altman Z-Score did Equity Group Holdings and East African Breweries get in a 2023 credit risk analysis?","acceptedAnswer":{"@type":"Answer","text":"Equity Group Holdings scored 10.66, placing it in the safe zone, with ROE of 20.04% against an 11.5% sector benchmark. East African Breweries PLC scored 1.85, landing in the grey zone due to a debt-to-equity ratio of 1.91 versus a sector median of 0.85 and a current ratio of 1.0 against a 1.95 benchmark, despite strong 38.4% ROE. Analysts building sector-benchmarked risk scoring can follow real-world model validation examples on daily.dev."}}]}
```

