Multilingual automated customer support bot for Telegram with LLM intent/slot extraction. English, French, Wolof.
# Telegram Voice & Text Chat — Automated Customer Support Prototype
A multilingual automated customer support bot for Telegram, built with a
deterministic workflow engine and LLM-based intent/slot extraction. Supports
English, French, and Wolof.
## Overview
This prototype implements a customer support assistant that handles four common
intents:
- **PIN recovery** — help a customer reset a forgotten PIN
- **Refunds** — check eligibility and submit a refund request
- **Savings vault unlock** — unlock a locked savings balance
- **General inquiries** — answer FAQ-style questions
The bot accepts text messages and Telegram voice notes (transcribed via
AssemblyAI) and responds in the user's language.
### Why this design
The core design choice is to keep the LLM narrow. The LLM is used for:
- intent classification
- slot extraction (customer ID, transaction ID, vault ID)
- grounded response wording
It is **not** used for:
- authorizing refunds
- deciding whether PIN recovery is allowed
- deciding whether a vault can be unlocked
Those decisions stay in deterministic Python code.
## Architecture
The system has two engine versions preserved side by side:
- **v1** — English-only baseline (kept for comparison)
- **v2** — locale-aware engine with English, French, and Wolof support
Both use:
- Telegram as the user interface
- **OpenCode Go** (`mimo-v2.5`) for LLM-based intent and field extraction
- a Python workflow engine for policy and decision logic
- a mock backend with fixture data
- SQLite and JSONL event logging for session tracking and replayable evaluation
### LLM provider compatibility
The model and OpenAI-compatible endpoint are configured independently:
```bash
CAA_LLM_MODEL=mimo-v2.5
CAA_LLM_BASE_URL=
opencode.ai
```
For OpenCode Go, the extractor requests JSON-object output and includes the
complete state-specific field contract in the prompt. Model responses are
strictly validated: missing required fields, unexpected fields, or i …