Implementation of a voice AI bot for a call center A voice bot for a call center processes incoming and outgoing calls, relieving operators of the burden of typical requests: checking order status, changing data, answering FAQs. With a Containment Rate >60%, the bot pays for itself in 4-8 months. ### Typical scenarios and coverage | Scenario | Share of calls | Automation | |---------|-------------|--------------| | Order status | 30-40% | 95% | | Change of address | 10-15% | 80% | | Product FAQ | 15-20% | 85% | | Complaints | 5-10% | 30% (hereinafter referred to as the operator) | | Recording/cancellation | 10-15% | 90% | ### Call Center Bot Architecture
from enum import Enum
from dataclasses import dataclass
class DialogState(Enum):
GREETING = "greeting"
INTENT_RECOGNITION = "intent_recognition"
COLLECTING_DATA = "collecting_data"
PROCESSING = "processing"
CONFIRMATION = "confirmation"
TRANSFER_TO_AGENT = "transfer_to_agent"
FAREWELL = "farewell"
@dataclass
class CallSession:
call_id: str
phone_number: str
state: DialogState = DialogState.GREETING
intent: str = None
collected: dict = None
retry_count: int = 0
max_retries: int = 3
def should_transfer(self) -> bool:
return (self.retry_count >= self.max_retries or
self.intent in ["complaint", "complex_issue"])
```### Intent recognition with examples```python
async def recognize_intent(user_text: str) -> dict:
response = await client.chat.completions.create(
model="gpt-4o-mini",
messages=[{
"role": "system",
"content": """Определи намерение клиента. Верни JSON:
{"intent": "order_status|change_address|cancel_order|complaint|other",
"entities": {"order_id": "...", "address": "..."}}"""
}, {
"role": "user",
"content": user_text
}],
response_format={"type": "json_object"}
)
return json.loads(response.choices[0].message.content)
```### Escalation conditions for the operator```python
ESCALATION_TRIGGERS = [
"оператор", "живой человек", "соедините с человеком",
"не понимаете", "бесполезный", "жалоба", "претензия",
"верните деньги", "суд", "роспотребнадзор"
]
def should_escalate(text: str, session: CallSession) -> bool:
text_lower = text.lower()
if any(trigger in text_lower for trigger in ESCALATION_TRIGGERS):
return True
if session.retry_count >= 2:
return True
return False
```### Integration with CRM```python
async def lookup_customer(phone: str) -> dict | None:
# Запрос в CRM (Bitrix24, amoCRM, Salesforce)
async with aiohttp.ClientSession() as session:
resp = await session.get(
f"{CRM_API_URL}/contacts/search",
params={"phone": phone},
headers={"Authorization": f"Bearer {CRM_TOKEN}"}
)
data = await resp.json()
return data.get("contact")
```Timeline: MVP with 3–5 scenarios – 4–6 weeks. Full system with analytics and A/B testing – 3–4 months.







