DBN Analytics
RAG-powered Natural Language to SQL for MSME Loan intelligence.
Ask plain-English questions. Get structured data and chart code back — instantly.
...Financing Sustainable Growth
How It Works
Powered by Enterprise Scale
Key Capabilities Demonstrated
Specialized demonstration modules implemented to showcase real-time predictive analytics and AI-assisted decision support.
Strategic Value to DBN
Risk Management
Strengthens credit risk management and early warning systems.
Decision Speed
Improves decision speed and quality across lending operations.
Compliance Readiness
Enhances regulatory compliance, governance, and audit readiness.
Operational Efficiency
Reduces operational dependency on technical resources.
Data Foundation
Establishes a foundation for enterprise-wide data-driven decision-making.
Technical Foundation
Our architecture is built on a modern enterprise stack focused on data integrity, automated documentation, and seamless accessibility for non-technical stakeholders.
Next.js
High-performance frontend framework
SQL Server
Robust enterprise data storage
dbt
Data transformation and modeling
Vanna
AI-powered data accessibility
Google Cloud
Scalable cloud infrastructure
Fly.dev
Modern deployment & edge computing
Dataset Overview
The underlying msmeloans table holds ~11,000 MSME loan records across 40 columns sourced from the DBN data warehouse.
| Category | Key Columns | Description |
|---|---|---|
| Demographics | Gender, State, BirthDate, age_group | Borrower personal details |
| Loan Details | AmountGranted, Tenor, Rate, ScheduleType | Core loan terms |
| Business Profile | Sector, NatureOfBusiness, MSMEAnnualTurnover | Business classification |
| Risk Signals | pred_default_prob, risk_score, risk_category | ML-generated risk metrics |
| PFI | PFI ID, ES_Rating, FirstTimeAccessToCredit | Lender & credit history flags |
Live Query Example
Send this to POST /api/v1/chat/ask and get back structured data + a Plotly chart:
{ "question": "Which sector has the highest average predicted default probability?" }{
"sql": "SELECT Sector, AVG(pred_default_prob) AS avg_risk FROM msmeloans GROUP BY Sector ORDER BY avg_risk DESC LIMIT 5;",
"data": [{ "Sector": "Agriculture", "avg_risk": 0.041 }],
"plotly_code": "fig = px.bar(df, x='Sector', y='avg_risk')"
}POC Outcome
The POC successfully confirms that DBN can transition from descriptive reporting to predictive and forward-looking analytics using AI-driven platforms. The solution is technically viable, scalable, and aligned with DBN's strategic objectives.
Recommended Next Steps
"Positioning DBN to strengthen its role as a data-driven development finance institution while improving risk management, compliance, and lending effectiveness."
Infrastructure, Governance & Security Enhancements
Observation: The current DBN data warehouse does not implement encryption at rest.
Risk: This exposes sensitive data (e.g., BVN, loan details) to potential breaches and compromises DBN’s compliance with NDPR and other regulatory standards.
We provided a step-by-step guide to enable Transparent Data Encryption (TDE) to secure the data warehouse at rest.
Explore the Docs
Install dependencies, set your OpenAI API key, and run your first query in under 2 minutes.
InstallationUnderstand the layered FastAPI design, the RAG pipeline, and the approved DBN Azure production topology.
DBN Production SetupDetailed documentation for all Chat and Training endpoints, request/response schemas, and error codes.
Chat EndpointsLearn how to bootstrap ChromaDB, add verified SQL examples, and continuously improve accuracy over time.
ConceptsStep-by-step guides for Container Apps, App Service, AKS — with full GitHub Actions CI/CD pipelines.
Azure GuideContainerised, secrets-managed, HTTPS-enforced deployment in minutes using fly deploy.
Fly.io Guide