How decillium/ermozhi works
Ermozhi is a WhatsApp assistant that turns a farmer’s Tamil voice or text offer into a market-backed price recommendation, then returns localized text or audio. The documented workflow is webhook intake, durable queuing, worker processing, market lookup, decision, response rendering, and WhatsApp delivery. The source index supports the key worker dependencies and storage uses; sampled excerpts do not show every internal stage or all external API wiring, so uncertain connections are omitted.
Main entry points: blob_repo.py Blob repository · pipeline.py Message pipeline · runner.py Market ingestion · meta.py Webhook intake
Components 26
WhatsApp ingress
- Webhook intake
src/gateway/routes/meta.py - Webhook security
src/gateway/security/signature.py - Sender rate limiting
src/gateway/middleware/rate_limit.py - Inbound event store
src/platform/storage/event_store.py
Offer processing
- Work leasing
src/worker/lease_manager.py - Message pipeline
src/worker/pipeline.py - Offer extraction
src/intelligence/adapter.py - Extraction validation
src/intelligence/validator.py - Price decision
src/decision_engine/engine.py - Typed contracts
src/contracts/v1/decision.py
Market data
- Snapshot reader
src/data/reader.py - Market ingestion
src/data/ingestion/runner.py - Market source adapters
src/data/ingestion/adapters.py - Market normalization
src/data/ingestion/normalizer.py - Snapshot publishing
src/data/snapshots/publisher.py
Response delivery
- Localized response
src/language/engine.py - Tamil response templates
src/language/templates.py - Voice synthesis
src/language/tts.py - WhatsApp dispatch
src/channels/meta/client.py
Storage and operations
- Blob repository
src/data/storage/blob_repo.py - PII masking
src/platform/telemetry/masking.py - Storage cleanup
src/worker/jobs/cleanup.py - Job reconciliation
src/worker/jobs/reconciliation.py
Other components
- Farmer
- WhatsApp Cloud
- AGMARKNET / data.gov.in
Connections 30
- Farmer → WhatsApp Cloud: sends offer
README.md - WhatsApp Cloud → Webhook intake: posts webhook
src/gateway/routes/meta.py - Webhook intake → Webhook security: verifies signature
src/gateway/routes/meta.py - Webhook intake → Sender rate limiting: checks sender
src/gateway/routes/meta.py - Webhook intake → Inbound event store: persists inbound
src/gateway/routes/meta.py - Inbound event store → Blob repository: stores events
src/platform/storage/event_store.py - Work leasing → Blob repository: leases inbox
src/worker/lease_manager.py - Message pipeline → Offer extraction: extracts offer
src/worker/pipeline.py - Message pipeline → Price decision: evaluates offer
src/worker/pipeline.py - Message pipeline → Snapshot reader: loads snapshot
src/worker/pipeline.py - Message pipeline → Localized response: renders response
src/worker/pipeline.py - Message pipeline → WhatsApp dispatch: dispatches response
src/worker/pipeline.py - Message pipeline → Blob repository: uses repository
src/worker/pipeline.py - Offer extraction → Extraction validation: validates extraction
src/intelligence/adapter.py - Offer extraction → Blob repository: stores inbound media
src/intelligence/adapter.py - Extraction validation → Market normalization: normalizes variety
src/intelligence/validator.py - Snapshot reader → Blob repository: reads snapshot
src/data/reader.py - Market ingestion → Market source adapters: fetches source data
src/data/ingestion/runner.py - Market ingestion → Market normalization: normalizes records
src/data/ingestion/runner.py - Market ingestion → Snapshot publishing: publishes snapshots
src/data/ingestion/runner.py - Market ingestion → Blob repository: stores market data
src/data/ingestion/runner.py - Snapshot publishing → Blob repository: writes snapshots
src/data/snapshots/publisher.py - AGMARKNET / data.gov.in → Market source adapters: supplies prices
- Localized response → Tamil response templates: renders text
src/language/engine.py - Localized response → Voice synthesis: synthesizes voice
src/language/engine.py - Voice synthesis → Blob repository: stores audio
src/language/tts.py - WhatsApp dispatch → WhatsApp Cloud: sends messages
src/channels/meta/client.py - Storage cleanup → Blob repository: cleans storage
src/worker/jobs/cleanup.py - Job reconciliation → Blob repository: checks storage
src/worker/jobs/reconciliation.py - Job reconciliation → Work leasing: reconciles leases
src/worker/jobs/reconciliation.py