Telegram Bot for Call Audits

Intelligent system to automate quality control of in-person meetings of field medical teams.

Speech AI Call Analytics Telegram Bot Quality Control

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)
Audio processing pydub, ffmpeg
Data storage File system
Integrations Telegram Bot API, Yandex Disk API
Logging Structured with rotation

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

1–3 min

Processing speed β€” from upload to final report for meetings of any length

100%

Manager time saved β€” no more manual listening

∞

Scalability β€” hundreds of meetings daily without extra QA staff

KPI

Transparent KPIs β€” automatic deal amount capture with evidence

Edu

Training quality β€” concrete quotes and timecodes instead of vague feedback