π¦ AI-powered SME loan analysis tool for BFPME Tunisia β GPT-4o extraction, Plotly charts, and 100% offline failsafe mode.
> **An AI-powered document processing assistant for BFPME credit risk officers evaluating SME loan applications and business plans (_Plans d'affaires_) in Tunisia.**
---
## π― What is BFPME AI Credit Agent?
The **Banque de Financement des Petites et Moyennes Entreprises (BFPME)** is Tunisia's specialized bank for SME financing. Credit risk officers must manually analyze dense business plans to extract key financial data and assess loan viability.
This tool **automates that process** β upload any business plan (`.txt` or `.pdf`), and the app instantly extracts all critical Tunisian financial variables, visualizes the investment structure, and lets you interrogate the document through a smart AI chatbot.
---
## β¨ Features
### π Tab 1 β Executive Dashboard
- Auto-extracted KPI cards (CoΓ»t Total, CrΓ©dit BFPME, TRI, VAN, DΓ©lai de RΓ©cupΓ©ration, Emplois)
- Automatic **risk rating** (FAIBLE / MODΓRΓ / ΓLEVΓ) based on TRI and payback period
- Financial projections table (An 1 β An 3)
- Raw document text viewer
### π Tab 2 β Financial Visualizations
- **Donut chart** β Financing structure breakdown (Apport, FOPRODI, SICAR, BFPME)
- **Bar chart** β Investment vs. financing comparison
- **CA Evolution** β Revenue projections over 3 years
- **TRI Gauge** β Internal rate of return vs. cost of capital
- **Guarantee Coverage** chart vs. BFPME credit
### π€ Tab 3 β AI Chatbot
- Quick-question chips for instant answers
- **Live mode:** GPT-4o powered contextual responses
- **Failsafe mode:** Semantic rule-based dictionary with banking-grade answers
- Covers: risks, TRI, VAN, guarantees, payback, employment, recommendations
### βοΈ Sidebar Controls
- π File uploader (`.txt` / `.pdf`)
- π Optional OpenAI API key input
- π’ / π‘ Live engine status indicator
- πΏ One-click **sample project** loader (Agritech Sidi Bouzid)
---
## π Dual-Engine Architecture
```
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β BFPME AI Credit Agent β¦