Logo Lanfrica

hanningtontech/AiChatMpesaAgent

Domain:

digital infrastructure

Record type:

software
Creator:
han
Host:
This is a Chat Function That calls Mpesa to Send money Without interacting with mpesa, Just using this OpenAi Chat Tool # M-Pesa AI Backend with Enhanced Features A robust FastAPI backend for M-Pesa payment processing with AI-powered conversation management, raw message tracking, and enhanced user experience. ## πŸš€ Features ### βœ… **Core Features** - **M-Pesa STK Push Integration**: Seamless payment processing - **AI-Powered Conversations**: Google Gemini AI agent for natural interactions - **Raw Message Tracking**: Track original user messages that triggered transactions - **Firebase Integration**: User profile management and phone number fetching - **Transaction History**: Complete payment history with message context - **Real-time Status Updates**: Live payment status monitoring ### βœ… **Enhanced Features** - **Message Deduplication**: Prevents duplicate message processing - **Rate Limiting**: Protects against API abuse - **Error Handling**: Graceful error management with user-friendly messages - **Session Management**: Persistent conversation context - **Entity Extraction**: Automatic extraction of payment details from messages ## πŸ“ Project Structure ``` mpesa-ai-backend-corrected-fix/ β”œβ”€β”€ mpesa-ai-backend-fixed/ β”‚ β”œβ”€β”€ app/ β”‚ β”‚ β”œβ”€β”€ main.py # FastAPI application β”‚ β”‚ β”œβ”€β”€ auth.py # Authentication module β”‚ β”‚ β”œβ”€β”€ models.py # Database models β”‚ β”‚ β”œβ”€β”€ conversation_service.py # Conversation management β”‚ β”‚ β”œβ”€β”€ transaction_manager.py # Transaction handling β”‚ β”‚ └── mpesa_agent/ β”‚ β”‚ β”œβ”€β”€ agent.py # Base M-Pesa agent β”‚ β”‚ β”œβ”€β”€ enhanced_agent.py # Enhanced AI agent β”‚ β”‚ β”œβ”€β”€ mpesa_tools.py # M-Pesa tools and utilities β”‚ β”‚ └── callback_manager.py # Callback handling β”‚ β”œβ”€β”€ docs/ # Documentation β”‚ β”œβ”€β”€ docker/ # Docker configuration β”‚ β”œβ”€β”€ requirements.txt # Python dependencies β”‚ └── README.md # This file β”œβ”€β”€ .gitignore # Git ignore rules └── README.md # Projec …

Languages