Project overview
An intelligent Telegram bot automating quality control of field medical teamsβ in-person meetings. It analyzes audio between managers and clients (or families) seeking help with alcohol or drug addiction. The bot handles the entire pipeline: upload, transcription, structured reporting with manager scoring, violation detection, and follow-up script generation.
User-facing functionality
Audio upload
Direct upload in Telegram (audio, voice notes, video, documents), Yandex.Disk links, multiple files per conversation. Automatic conversion (MP3, MP4, WAV, OGG, FLAC, 3GPP, etc.) and splitting files up to 180 MB.
Main report
Meeting flow (up to 5 points), financial result with deal status and amount, five manager KPIs (1β10), up to four improvement tips. Quotes with timecodes support every finding.
Script analysis
Checks key sales-script points, flags gaps or violations, and scores trust-building ability.
Violations & penalties
Detects regulation breaches with clause reference, description, timecode, penalty, and total fines.
Timecodes
Splits the dialogue into logical blocks (greeting, needs, presentation, objections, closing) with timestamps.
Follow-up script
Generated via SPIN-selling patterns with natural dialogue, alternative phrasings, and branches for different reactions.
Amount validation
Automatically compares stated amounts with actual figures mentioned in the call and warns about mismatches.
Business impact
Quality automation
Large-scale analysis without manual listening
Standardized assessment
Unified criteria for every manager
Financial control
Extracts deal amounts with evidence from the dialogue
Staff training
Provides material for targeted coaching
Risk mitigation
Controls compliance and calculates fines
Technology & integrations
Language & frameworks
Python 3, python-telegram-bot (async mode)
AI/ML services
- Deepgram API (nova-2) β transcription with diarization, Russian speech recognition, numbers, punctuation
- OpenAI GPT-5-mini β structured analysis, report generation, entity extraction (JSON Schema)
Architecture & key features
- Modular prompt system (6 specialized prompt files)
- Two-stage processing pipeline (structured JSON analysis β human-readable report)
- Algorithmic deal-status clarification via acceptance/rejection patterns
- Context-aware cash parsing (rubles, thousands)
- Anti-hallucination guardrails (ban on fictitious docs, amount validation against transcript)
Implementation results
Processing speed β from upload to final report for meetings of any length
Manager time saved β no more manual listening
Scalability β hundreds of meetings daily without extra QA staff
Transparent KPIs β automatic deal amount capture with evidence
Training quality β concrete quotes and timecodes instead of vague feedback