Machine Learning & Semantic Extraction

Regex parsers rely on hardcoded character patterns. When Safaricom or banks change sentence structures, insert ads, or alter currency labels, regex breaks completely. Mpesa Analyzer uses a quantized local LLM (such as Qwen 2.5 3B) running via Llama.cpp. It reads the full semantic context of messages, accurately extracting transaction codes, counterparties, fees, and new balances regardless of template variations.
The ML service runs efficiently on standard x86_64 CPUs thanks to AVX2 / OpenMP vectorization. A standard 4-core virtual server with 4 GB of RAM is sufficient to run Qwen2.5-3B-Instruct-Q4_K_M. If an NVIDIA GPU is available, the service automatically leverages CUDA acceleration to process hundreds of transactions per second.
Rescan is an incremental analysis cycle that processes newly arrived or unclassified SMS in tbl_Loot without touching existing transactions. Full Reset cleans out previous model inferences in tbl_Transactions and re-runs the active LLM across all historical SMS records. Both actions open an interactive progress dialog that streams live processing status.

Android Companion & QR Pairing

When you click Pair New Device in the WebApp (under Control Center → Devices), the system displays an encrypted QR code containing your server endpoint and a temporary device token. In the Android app, opening the vertical CameraX scanner instantly decodes the code, completes the cryptographic handshake, and saves the connection parameters without typing.
Incoming SMS messages are staged in an on-device local SQLite database. Even during prolonged offline periods or airplane mode, messages accumulate safely. Once network connectivity is restored, Android WorkManager automatically batches and AES-encrypts the queue, delivering it to /api/v1/upload without duplicate insertions.
No. The app uses broadcast receivers and Jetpack WorkManager adhering to strict Android Doze standards. It wakes up only when an SMS arrives, stages it locally, and schedules uploads during opportunistic network windows. Field tests report less than 1.5% battery consumption per 24 hours.

Security, Telemetry & Operations

Security is enforced at every layer:
  • In Transit: All HTTP traffic is protected by TLS/HTTPS, and mobile sync batches are encrypted with AES-256 CBC.
  • Authentication: Device tokens are hashed using SHA-256 before database insertion; plaintext tokens are never stored.
  • Privacy: The entire stack (WebApp, ML, MySQL) is 100% self-hosted in Docker/Railway. Zero financial data is ever shared with external commercial AI APIs.
The telemetry console (/admin/telemetry) provides live visibility into system health. It monitors WebApp container CPU/RAM/Disk headroom, MySQL 8.0 pool utilization, slow queries, and the exact RSS memory footprints of the FastAPI worker and llama-server daemon. All metrics render using pure-SVG sparklines with zero external charting overhead.
In Admin → System → Maintenance, admins can configure automated retention periods (e.g. purging non-financial SMS or logs older than 90 days). In Admin → System → Backups, full SQL dumps of all application and transaction tables can be generated, downloaded, or restored with pre-execution disk space safeguards.
\n