Разработка AI-системы автообзвона клиентов для опросов (CSAT/NPS)
Голосовой обзвон для NPS/CSAT обеспечивает response rate 30–45% против 5–10% для email-опросов. AI-бот собирает оценки, задаёт уточняющие вопросы при низких оценках и передаёт детальные ответы в аналитику.
Архитектура опросной системы
class SurveyBot:
def __init__(self, survey_config: dict):
self.questions = survey_config["questions"]
self.triggers = survey_config.get("escalation_triggers", {})
async def conduct_survey(
self,
call: ActiveCall,
context: dict
) -> SurveyResult:
responses = {}
for question in self.questions:
# Задаём вопрос
await call.say(question["text"].format(**context))
# Собираем ответ
user_response = await call.listen(timeout_sec=10)
parsed = await self.parse_response(user_response, question["type"])
responses[question["id"]] = parsed
# Условное ветвление
if question.get("followup_if_low") and parsed.get("value", 10) <= 6:
followup = question["followup_if_low"]
await call.say(followup["text"])
followup_response = await call.listen(timeout_sec=20)
responses[f"{question['id']}_reason"] = followup_response
# Эскалация при критичных оценках
if parsed.get("value") is not None and parsed["value"] <= 3:
if question["id"] in self.triggers:
await self.escalate_to_human(call, context, responses)
break
return SurveyResult(
contact_id=context["contact_id"],
responses=responses,
nps_score=responses.get("overall_rating", {}).get("value"),
completed=True
)
NPS-специфичная логика
NPS_SURVEY_SCRIPT = {
"opening": "Здравствуйте, {name}! Вы недавно воспользовались нашими услугами. Уделите 1 минуту?",
"nps_question": "По шкале от 0 до 10, насколько вероятно, что вы порекомендуете нас друзьям?",
"detractor_followup": "Что нам нужно улучшить, чтобы получить более высокую оценку?",
"promoter_followup": "Что вам особенно понравилось?",
"closing": "Спасибо за ваш отзыв! Это помогает нам стать лучше. До свидания!"
}
def categorize_nps(score: int) -> str:
if score >= 9: return "promoter"
if score >= 7: return "passive"
return "detractor"
Аналитика результатов
async def calculate_nps_report(campaign_id: str) -> dict:
results = await db.get_survey_results(campaign_id=campaign_id)
promoters = sum(1 for r in results if r["nps_score"] >= 9)
detractors = sum(1 for r in results if r["nps_score"] <= 6)
total_with_score = sum(1 for r in results if r["nps_score"] is not None)
nps = ((promoters - detractors) / total_with_score * 100) if total_with_score > 0 else 0
# Тематический анализ открытых ответов
open_answers = [r.get("overall_rating_reason") for r in results if r.get("overall_rating_reason")]
themes = await extract_feedback_themes(open_answers)
return {
"nps": round(nps, 1),
"response_rate": len(results) / campaign_total * 100,
"promoters_pct": promoters / total_with_score * 100,
"detractors_pct": detractors / total_with_score * 100,
"top_issues": themes["negative"][:5],
"top_strengths": themes["positive"][:5]
}
Сроки: NPS/CSAT-бот — 2–3 недели. С тематическим анализом открытых ответов — 1.5 месяца.







