How omnisoft-africa-it-engineering/femi_api works
Femi is an AI accounting and financial assistant for SMEs. A WhatsApp user sends text, an image, or audio; the background task resolves the account, hands the message to the router, and returns its response. The agent layer handles intent routing and specialized accounting, customer, and analytical work; an older extraction pipeline also handles OCR/audio and operation creation. Account data, KPI reporting, fiscal deadlines, payments, and notifications are supporting product capabilities. Sampled code confirms the WhatsApp task and legacy extraction paths; wiring among several newer agent stages is not fully visible, so uncertain links are omitted.
Main entry points: tasks.py Message task · models.py Account records · router_manager.py Intent router · whatsapp_client.py WhatsApp client
Components 24
User channels
- WhatsApp webhook
apps/femi_whatsapp/views.py - Message task
apps/femi_whatsapp/tasks.py - WhatsApp client
apps/femi_whatsapp/whatsapp_client.py - REST API
apps/femi_api/views.py
AI agent
- Intent router
apps/femi_agent/agent/router_manager.py - Router executor
apps/femi_agent/agent/router_executor.py - Specialist agents
apps/femi_agent/agent - Agent schemas
apps/femi_agent/schemas - Extraction manager
apps/femi_agent/agent/manager.py - Extraction pipeline
apps/femi_agent/agent/pipeline.py - Media parsers
apps/femi_agent/parsers
Accounting services
- Accounting persistence
apps/femi_agent/agent/accounting_manager.py - Account endpoints
apps/femi_account/views.py - Account records
apps/femi_account/models.py - KPI endpoints
apps/femi_account/kpi_views.py - KPI calculations
apps/femi_account/kpi_service.py - Fiscal deadlines
apps/femi_account/services.py
Account platform
- Payment integration
apps/femi_account/integrations/fedapay_payment.py - Evidence storage
apps/femi_account/integrations/supabase_storage.py - Notifications
apps/femi_account/notifications.py
Other components
- SME user
- Meta WhatsApp
- Supabase Storage
- FedaPay
Connections 23
- SME user → WhatsApp webhook: sends message
- WhatsApp webhook → Message task: enqueues
- Message task → WhatsApp client: downloads media
- WhatsApp client → Meta WhatsApp: requests media
- Message task → Account records: resolves user
- Message task → Intent router: routes content
- Intent router → Router executor: classifies intent
- Intent router → Specialist agents: dispatches intents
- Intent router → Agent schemas: validates results
- Intent router → Message task: returns response
- Message task → WhatsApp client: sends reply
- WhatsApp client → Meta WhatsApp: sends message
- SME user → REST API: submits request
- Extraction manager → Extraction pipeline: extracts operation
- Extraction pipeline → Media parsers: extracts media text
- Extraction manager → Account records: reads and saves
- Accounting persistence → Account records: persists transactions
- Account endpoints → Account records: reads and updates
- KPI endpoints → KPI calculations: calculates metrics
- KPI calculations → Account records: aggregates records
- Fiscal deadlines → Account records: creates deadlines
- Payment integration → FedaPay: calls payment API
- Evidence storage → Supabase Storage: uploads evidence