Agent 01
📬
IMAP Parser Agent
Email Ingestion
Autonomously connects to your Gmail or any IMAP mailbox every 15 minutes via SSL. Scans all unread emails, extracts PDF invoice attachments, verifies the sender is a registered user (zero-trust), and passes raw PDF bytes downstream.
Tech: imaplib + asyncio.to_thread
IMAP/SSL
Multi-tenant
Async
Agent 02
📄
Gemini Extraction Agent
PDF Intelligence
Sends raw PDF bytes to Gemini 2.0 Flash as an inline blob (no temp files). Extracts 10 structured fields: debtor name, amount, due date, GSTIN, invoice number, PO number, email, phone, and notes. Prompt-injection hardened with strict rule set.
Output: Validated InvoiceCreate Pydantic model
Gemini 2.0 Flash
JSON Schema
XSS Safe
Agent 03
🗄️
MongoDB Insertion Agent
Idempotent Storage
Idempotent upsert engine — checks email_ingestion_log for the exact (message_id, filename) pair before every insert. Ensures zero duplicate invoices no matter how many times the ingester runs. Assigns invoices to the correct tenant account automatically.
Tech: Motor async + MongoDB compound index
Idempotent
Motor Async
Multi-tenant
Agent 04
🌐
NLP Translation Agent
Multilingual Understanding
Translates debtor WhatsApp replies from Hindi, Hinglish, Marathi, Tamil, Telugu, Gujarati, Bengali, Punjabi into clean professional English. If the Gemini API quota is hit, it falls back to a local keyword heuristic that covers 30+ Hindi/Hinglish payment terms (kal, bhej, deta, galat, etc.) — zero downtime.
8+ Languages
Heuristic Fallback
Zero Downtime
Agent 05
🎯
Intent Classification Agent
Reply Intelligence
Classifies the translated reply into one of four intents: promise_to_pay, dispute, stall, or unknown. Returns confidence level (high / medium / low) and a precise suggested action. Responds with a structured JSON object — validated against schema before use.
4 Intent Classes
JSON Schema
Confidence Score
Agent 06
🤖
AI Message Generation Agent
Recovery Drafting
Drafts WhatsApp messages, formal emails, and MSMED Act legal notices using a 3-tier Gemini model cascade: Gemini 2.0 Flash → Gemini 2.5 Flash → Gemini 1.5 Flash. Supports tone settings (firm / empathetic / legal). Generates full messages with context from invoice data including overdue days and MSMED compound interest.
3-Model Cascade
WhatsApp + Email
MSMED Legal