Track 3 — HCL GUVI BuildBridge Intern Hiring Hackathon 2026 A production-grade REST API that analyzes call center recordings for SOP compliance using Google Gemini 2.5 Flash's native multimodal audio understanding.
Live Endpoint: https://aarushg025-call-center-compliance.hf.space/api/call-analytics
Call centers handle thousands of customer interactions daily, making it impossible for quality teams to manually audit every call. This API automates the entire compliance auditing process:
- Accepts a Base64-encoded MP3 audio recording via a REST endpoint
- Compresses the audio using FFmpeg for optimal processing speed
- Sends the audio directly to Google Gemini 2.5 Flash in a single multimodal request
- Gemini natively listens to the audio, transcribes it (supporting Tamil/Tanglish, Hindi/Hinglish, and English), and simultaneously evaluates SOP compliance
- Returns a fully structured JSON report with transcript, compliance scores, sentiment analysis, payment analytics, and keywords — all in under 15 seconds
POST /api/call-analytics
(Base64 MP3 + language)
│
▼
┌──────────────────────────────────────────────────────────┐
│ FastAPI Server (main.py) │
│ │
│ 1. API Key Authentication (x-api-key header) │
│ 2. Base64 Decode → Raw Audio Bytes │
│ 3. Route to Analyzer │
│ 4. Resilient Enum Mapping (AI output → strict schema) │
│ 5. Return validated JSON response │
└───────────────────────┬──────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────┐
│ Analyzer Module (analyzer.py) │
│ │
│ Step 1: FFmpeg Audio Compression │
│ (Mono, 16kHz, 32kbps → ~50KB) │
│ │
│ Step 2: Single Gemini 2.5 Flash Multimodal Call │
│ - Native audio understanding (no separate STT) │
│ - Thinking disabled (thinking_budget=0) │
│ - Returns: transcript + analysis in one shot │
└───────────────────────┬──────────────────────────────────┘
│
▼ (Background Task — non-blocking)
┌──────────────────────────────────────────────────────────┐
│ Vector Store (vector_store.py) │
│ │
│ ChromaDB indexes transcripts + summaries as embeddings │
│ for downstream semantic search and retrieval │
└──────────────────────────────────────────────────────────┘
Key Design Decision: Instead of the traditional 3-step pipeline (Transcribe → Analyze → Format), this system uses a single multimodal API call where Gemini processes raw audio directly. This eliminates intermediate transcription errors (especially for Tamil/Tanglish) and reduces total latency by ~60%.
| Layer | Technology | Purpose |
|---|---|---|
| Language | Python 3.10 | Core application runtime |
| Web Framework | FastAPI | Async REST API with auto-generated OpenAPI docs |
| Data Validation | Pydantic v2 | Strict schema enforcement with enum validation |
| Primary AI | Google Gemini 2.5 Flash | Native multimodal audio transcription + NLP analysis |
| Backup STT | Groq Whisper Large V3 Turbo | Fallback speech-to-text (kept for resilience) |
| Audio Processing | FFmpeg | Audio compression (5MB → 50KB) for faster inference |
| Vector Database | ChromaDB | Semantic indexing of transcripts for retrieval |
| Containerization | Docker | Reproducible deployment on Hugging Face Spaces |
| Hosting | Hugging Face Spaces | Free cloud deployment with Docker SDK support |
Full disclosure of all AI assistance as required by hackathon rules.
| AI Tool | Version/Model | How It's Used |
|---|---|---|
| Google Gemini 2.5 Flash | gemini-2.5-flash |
Primary engine — processes raw audio multimodally to produce transcripts, SOP compliance analysis, sentiment detection, payment analytics, and keyword extraction in a single API call. Thinking mode disabled (thinking_budget=0) for speed optimization. |
| Groq Whisper | whisper-large-v3-turbo |
Fallback speech-to-text transcription via Groq's hosted inference API. Used only when Gemini is unavailable. |
| ChromaDB Embeddings | Default all-MiniLM-L6-v2 |
Generates vector embeddings for semantic indexing of call transcripts. |
| AI Tool | How It Helped |
|---|---|
| Antigravity (AI Coding Assistant) | Assisted with code architecture design, debugging deployment issues and optimizing Gemini API integration. |
POST /api/call-analytics
Content-Type: application/json
x-api-key: <your-api-key>
{
"language": "Tamil",
"audioFormat": "mp3",
"audioBase64": "<base64-encoded-mp3-audio>"
}{
"status": "success",
"language": "Tamil",
"transcript": "Vanakkam sir, en peyar Raj...",
"summary": "Agent called customer about outstanding payment...",
"sop_validation": {
"greeting": true,
"identification": true,
"problemStatement": true,
"solutionOffering": true,
"closing": false,
"complianceScore": 0.8,
"adherenceStatus": "FOLLOWED",
"explanation": "Agent followed 4 of 5 SOP steps."
},
"analytics": {
"paymentPreference": "EMI",
"rejectionReason": "BUDGET_CONSTRAINTS",
"sentiment": "Neutral"
},
"keywords": ["payment", "EMI", "outstanding", "due date"]
}- Python 3.10+
- FFmpeg installed (
apt install ffmpegorchoco install ffmpegon Windows) - Google Gemini API Key (Get one here)
git clone https://github.com/aarushg025/call-center-compliance.git
cd call-center-compliancepython -m venv .venv
# Windows
.venv\Scripts\activate
# Linux/Mac
source .venv/bin/activatepip install -r requirements.txtCreate a .env file in the project root:
GEMINI_API_KEY=your_gemini_api_key_here
GROQ_API_KEY=your_groq_api_key_here
API_SECRET_KEY=sk_track3_25092007uvicorn src.main:app --host 0.0.0.0 --port 8000 --reloadThe API will be available at http://localhost:8000. Interactive docs at http://localhost:8000/docs.
The app is pre-configured for Hugging Face Spaces with the included Dockerfile. Simply push to a Space with Docker SDK selected.
call-center-compliance/
├── src/
│ ├── main.py # FastAPI server, endpoint routing, enum mapping
│ ├── analyzer.py # Gemini multimodal audio analysis + FFmpeg compression
│ ├── models.py # Pydantic request/response schemas and enums
│ ├── transcriber.py # Groq Whisper fallback transcription
│ ├── vector_store.py # ChromaDB semantic indexing
│ └── config.py # Environment configuration
├── sop.json # SOP rule definitions (5 compliance rules)
├── Dockerfile # Container build instructions for HF Spaces
├── requirements.txt # Python dependencies
├── .env.example # Template for environment variables
├── test_api.py # API testing script
└── README.md # This file
-
Gemini Rate Limits: The free-tier Gemini API has rate limits (15 RPM, 1M tokens/day). Under heavy concurrent load, requests may be throttled. A paid API key removes this limitation.
-
Audio Length: Audio files longer than 2 minutes are trimmed during FFmpeg compression. Very long calls may lose context from the latter portion.
-
Tamil Accuracy: While Gemini 2.5 Flash handles Tamil/Tanglish significantly better than traditional STT models, highly colloquial or dialect-heavy Tamil may still have transcription inaccuracies.
-
Single-Speaker Diarization: The system does not perform speaker diarization (separating Agent vs. Customer voices). The transcript is a continuous text without speaker labels.
-
Payment Analytics Defaults: If the call does not discuss payment topics, the system defaults to
DOWN_PAYMENTfor paymentPreference andNONEfor rejectionReason, as these fields are required by the schema. -
Cold Start Delay: On Hugging Face Spaces free tier, the container may go to sleep after inactivity. The first request after a cold start may take an additional 30-60 seconds while the container boots.
-
No Persistent Storage: ChromaDB data is stored in-container and resets on each deployment. For production use, an external database would be required.
Aarush Goel Email: aarushgoel025@gmail.com
Linkedin: Aarush Goel
Github: github.com/aarushg025
This project was built for Track 3 of the HCL GUVI BuildBridge Intern Hiring Hackathon 2026.