An AI-powered M-Pesa transaction assistant that analyses Safaricom M-Pesa statement PDFs using Retrieval Augmented Generation(RAG).Ask questions about your spending in plain English and get intelligent insights.Built with Python,FastAPI,Langchain,OpenAI,ChromaDB and vanilla Javascript
# π’ M-Pesa AI Assistant
> **AI-powered M-Pesa transaction analysis tool built for Kenyan mobile money users.** Upload your M-Pesa statement PDF and ask questions about your transactions in plain English. Get intelligent spending insights, financial summaries, and personalized budgeting advice.
---
## π― What It Does
M-Pesa AI Assistant transforms your raw M-Pesa PDF statements into actionable financial intelligence. It combines **document parsing**, **vector search**, and **large language models** to let you have a natural conversation about your money.
### Example Questions You Can Ask:
| Category | Example Questions |
|----------|-------------------|
| π° **Spending** | "What is my total spending this month?" |
| π€ **People** | "Who did I send the most money to?" |
| π **Averages** | "What is my average daily spending?" |
| π **Search** | "Show me all transactions above KES 5,000" |
| π
**Patterns** | "Do I spend more on weekends or weekdays?" |
| π± **Airtime** | "How much did I spend on airtime?" |
| πͺ **Payments** | "List all my till/buy goods payments" |
| π **Trends** | "Am I spending more or less than last month?" |
| π‘ **Advice** | "How can I reduce my spending?" |
| π **Summary** | "Give me a complete financial summary" |
---
## ποΈ Architecture
```
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FRONTEND β
β ββββββββ ββββββββ ββββββββ ββββββββ ββββββββ β
β βDashbdβ β Chat β β Txns β βUploadβ βSetngsβ β
β ββββ¬ββββ ββββ¬ββββ ββββ¬ββββ ββββ¬ββββ ββββ¬ββββ β
β ββββββββββ΄βββββββββ΄βββββββββ΄βββββββββ β
β Plain HTML/CSS/JS β
β Chart.js + Marked.js β
ββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββ
β REST API (HTTP)
ββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββ
β FASTAPI BACKEND β
β β
β βββββββββββββββ β¦