| name | bot-analysis |
| description | Analyze existing bot performance in customer support data. Preprocesses Excel chat data via Python script to classify bot conversations as resolved/unresolved, then generates a comprehensive bot performance report with topic-level insights. **Language:** Auto-detects Korean (ํ๊ตญ์ด) or Japanese (ๆฅๆฌ่ช) from user input. |
Bot Performance Analysis
Overview
Analyzes the existing bot's performance in customer support chat data. Identifies which topics the bot handles well vs. poorly by classifying conversations as resolved (bot-only) or unresolved (handed off to manager with 2+ manager turns).
Pipeline:
Excel Input (๊ณ ๊ฐ ์๋ด ๋ฐ์ดํฐ)
โ
Step 1: Parameter gathering (input file, company, clustering results)
โ
Step 2: Python preprocessing (scripts/analyze_bot.py)
โ bot_classified.xlsx (์ ์ฒด ๋ถ๋ฅ ๋ฐ์ดํฐ)
โ bot_resolved.xlsx (Bot ํด๊ฒฐ ๊ฑด)
โ bot_unresolved.xlsx (Bot ๋ฏธํด๊ฒฐ ๊ฑด)
โ bot_analysis_summary.json (ํต๊ณ ์์ฝ)
โ
Step 3: Agent analysis โ topic-level bot performance report
โ bot_performance_report.md
Language: Detect the language from the user's first message and respond in that language throughout. Support Korean (ํ๊ตญ์ด) and Japanese (ๆฅๆฌ่ช). Default to Korean if language is unclear.
Parameters
- input_file (required): Path to Excel file containing UserChat and Message data sheets
- output_dir (required): Output directory for bot analysis results
- company (required): Company name for context and file naming
- clustered_path (optional): Path to Stage 1 clustered Excel for topic mapping (e.g.,
results/{company}/01_clustering/{company}_clustered.xlsx)
- tags_path (optional): Path to Stage 1 tags Excel (e.g.,
results/{company}/01_clustering/{company}_tags.xlsx)
- threshold (optional, default: 2): Minimum manager turns after bot to classify as "unresolved"
Constraints for parameter acquisition:
- You MUST scan
data/ directory for Excel files and auto-select if only one exists
- You MUST extract company name from filename (e.g., "๊ตฌํ๋ค ์๋ด๋ฐ์ดํฐ raw 90์ผ_.xlsx" โ "guhada")
- You MUST auto-detect clustering results at
results/{company}/01_clustering/ if they exist
- You MUST auto-set output_dir to
results/{company}/bot_analysis unless user specifies otherwise
- You MUST NOT ask the user about threshold or other optional parameters โ use defaults
- You SHOULD only ask the user to confirm input_file and company name if ambiguous (multiple files)
Steps
1. Gather Parameters and Setup
Scan available files and detect clustering results.
Constraints:
- You MUST scan
data/ directory for Excel files: ls -lh data/*.xlsx
- You MUST check if Stage 1 clustering results exist:
ls results/{company}/01_clustering/
- If clustering results exist, you MUST use them for topic mapping (set
--clustered and --tags)
- You MUST create output directory:
mkdir -p {output_dir}
- You MUST NOT proceed if input file doesn't exist
Expected Output:
โ
ํ๋ผ๋ฏธํฐ ์์ง ์๋ฃ:
- ์
๋ ฅ ํ์ผ: data/๊ตฌํ๋ค ์๋ด๋ฐ์ดํฐ raw 90์ผ_.xlsx
- ์ถ๋ ฅ ๊ฒฝ๋ก: results/guhada/bot_analysis
- ํ์ฌ๋ช
: guhada
- ํด๋ฌ์คํฐ ํ๊ทธ: results/guhada/01_clustering/guhada_clustered.xlsx โ
- Manager ์ ํ ๊ธฐ์ค: 2ํด
2. Execute Bot Classification Script
Run the Python preprocessing script to classify all conversations.
Constraints:
Expected Output:
Bot Performance Analyzer โ guhada
============================================================
[1/4] ๋ฐ์ดํฐ ๋ก๋ฉ...
[2/4] ๋ํ ๋ถ๋ฅ ์ค...
๐ ๋ถ๋ฅ ๊ฒฐ๊ณผ:
โโ Bot ์ฐธ์ฌ ๋ํ: 857๊ฑด (98.5%)
โ โโ Bot ํด๊ฒฐ: 573๊ฑด
โ โโ Bot ๋ฏธํด๊ฒฐ (โManager): 284๊ฑด
โโ Bot ํด๊ฒฐ๋ฅ : 66.9%
[3/4] ํด๋ฌ์คํฐ ํ๊ทธ ๋งคํ ์ค...
[4/4] ๊ฒฐ๊ณผ ์ ์ฅ ์ค...
โ
Bot ๋ถ์ ์๋ฃ
3. Generate Bot Performance Report
Read the preprocessed data and generate a comprehensive analysis report.
Constraints:
- You MUST read
bot_analysis_summary.json for overall statistics
- You MUST read
bot_unresolved.xlsx to analyze failure patterns (sample 30-50 unresolved conversations)
- You MUST read
bot_resolved.xlsx to analyze success patterns (sample 20-30 resolved conversations)
- You MUST generate the report at
{output_dir}/bot_performance_report.md
- If topic breakdown is available (from clustering), you MUST analyze per-topic resolution rates
- You MUST identify the top 3 topics the bot handles well and top 3 it struggles with
- You MUST include representative conversation examples for both resolved and unresolved cases
- You MUST analyze bot message patterns (what the bot says, how it responds)
- You SHOULD identify common handoff triggers (what causes botโmanager transfer)
- You SHOULD suggest improvement areas for bot configuration
Report Structure:
# Bot Performance Analysis Report: {Company}
## Executive Summary
[3-5 sentences: overall bot resolution rate, key strengths, key weaknesses]
## 1. Overall Statistics
| ์งํ | ์์น |
|------|------|
| ์ ์ฒด ์ ์ ์ฑ | {N}๊ฑด |
| Bot ์ฐธ์ฌ | {N}๊ฑด ({%}) |
| Bot ํด๊ฒฐ | {N}๊ฑด ({%}) |
| Bot ๋ฏธํด๊ฒฐ | {N}๊ฑด ({%}) |
| Bot ํด๊ฒฐ๋ฅ | {%} |
## 2. Topic-Level Analysis
### 2.1 Bot์ด ์ ์ฒ๋ฆฌํ๋ ํ ํฝ (Top 3)
[For each: topic name, resolution rate, conversation count, bot behavior pattern, examples]
### 2.2 Bot์ด ์ ๋ชป ์ฒ๋ฆฌํ๋ ํ ํฝ (Top 3)
[For each: topic name, resolution rate, conversation count, failure pattern, examples]
### 2.3 Topic Resolution Rate Table
[Full table: category, total, resolved, unresolved, rate โ sorted by rate desc]
## 3. Bot Behavior Pattern Analysis
### 3.1 Bot ์๋ต ํจํด
[What messages does the bot send? Categorize bot responses]
### 3.2 ํธ๋์คํ ํธ๋ฆฌ๊ฑฐ ๋ถ์
[What causes the bot to hand off to manager? Common patterns in unresolved conversations]
### 3.3 ํด๊ฒฐ ํจํด
[How does the bot successfully resolve? Common patterns in resolved conversations]
## 4. Unresolved Conversation Deep Dive
### 4.1 ๋ฏธํด๊ฒฐ ๋ํ ์ ํ ๋ถ๋ฅ
[Categorize unresolved conversations: bot couldn't answer, bot gave wrong info, customer insisted on human, etc.]
### 4.2 ๋ํ ๋ฏธํด๊ฒฐ ๋ํ ์์ (5-10๊ฑด)
[Show conversation flow: user asks โ bot responds โ manager takes over]
## 5. Recommendations
### 5.1 ์ฆ์ ๊ฐ์ ๊ฐ๋ฅ ํญ๋ชฉ
[Quick wins: FAQ additions, response template improvements]
### 5.2 ์ค๊ธฐ ๊ฐ์ ํญ๋ชฉ
[Medium-term: new automation flows, API integrations]
### 5.3 ์๋ด์ฌ ์ ์ฉ ์ ์ง ํญ๋ชฉ
[Topics that should remain human-handled]
## Metadata
- Generated: {timestamp}
- Source: {input_file}
- Manager turn threshold: {threshold}
Expected Output:
โ
Bot ์ฑ๋ฅ ๋ถ์ ๋ณด๊ณ ์ ์์ฑ:
results/guhada/bot_analysis/bot_performance_report.md
๐ ์ฃผ์ ๋ฐ๊ฒฌ:
- Bot ํด๊ฒฐ๋ฅ : 66.9%
- ์ ์ฒ๋ฆฌํ๋ ํ ํฝ: ๋ฐฐ์ก (77.7%), ๊ธฐํ (81.2%)
- ์ ๋ชป ์ฒ๋ฆฌํ๋ ํ ํฝ: ์ฃผ๋ฌธ๊ด๋ฆฌ (55.4%), ๋ฐํ๊ตํ (56.8%)
4. Review and Communicate Results
Present results and suggest next steps.
Constraints:
- You MUST display summary of key findings
- You MUST provide file paths for all outputs
- You MUST highlight actionable insights
- You SHOULD suggest how this data can inform ALF (AI chatbot) setup
Communication Template:
โ
Bot ์ฑ๋ฅ ๋ถ์ ์๋ฃ: {Company}
๐ Results Summary:
- Bot ํด๊ฒฐ๋ฅ : {rate}%
- ๊ฐ์ ํ ํฝ: {topics}
- ์ฝ์ ํ ํฝ: {topics}
๐ Output Files:
1. ๋ถ๋ฅ ๋ฐ์ดํฐ: {output_dir}/bot_classified.xlsx
2. ํด๊ฒฐ ๊ฑด: {output_dir}/bot_resolved.xlsx
3. ๋ฏธํด๊ฒฐ ๊ฑด: {output_dir}/bot_unresolved.xlsx
4. ํต๊ณ ์์ฝ: {output_dir}/bot_analysis_summary.json
5. ๋ถ์ ๋ณด๊ณ ์: {output_dir}/bot_performance_report.md
๐ก Key Insights:
- {insight_1}
- {insight_2}
- {insight_3}
Examples
Example 1: With Clustering Results
input_file: data/๊ตฌํ๋ค ์๋ด๋ฐ์ดํฐ raw 90์ผ_.xlsx
output_dir: results/guhada/bot_analysis
company: guhada
clustered_path: results/guhada/01_clustering/guhada_clustered.xlsx
tags_path: results/guhada/01_clustering/guhada_tags.xlsx
Results:
- Topic-level resolution rates available
- Bot handles ๋ฐฐ์ก well (77.7%), struggles with ๋ฐํ๊ตํ (56.8%)
Example 2: Without Clustering Results
input_file: data/user_chat_newclient.xlsx
output_dir: results/newclient/bot_analysis
company: newclient
Results:
- Overall statistics only (no topic breakdown)
- Agent analyzes conversation content directly to identify patterns
Troubleshooting
Issue: No Bot Messages Found
Symptom: All conversations classified as no_bot
Solution:
- Check the
personType column in Message data sheet
- Bot personType may differ (check for 'bot', 'Bot', 'BOT', 'workflow')
- If the channel uses workflows instead of bots, the analysis approach may need adjustment
Issue: Clustering Results Not Found
Symptom: Topic breakdown unavailable
Solution:
- Run Stage 1 clustering first:
/stage1-clustering
- Or proceed without clustering โ the agent will analyze conversation content directly
Notes
Classification Logic
- bot_resolved: Bot participated AND (no manager involved OR manager had < threshold turns after bot's last message)
- bot_unresolved: Bot participated AND manager had >= threshold turns after bot's last message
- no_bot: No bot messages in the conversation
Output for ALF Setup
The bot performance report directly informs ALF configuration:
- Topics with high bot resolution โ Keep similar automation, add to ALF rules
- Topics with low bot resolution โ Design new ALF workflows with better logic
- Handoff patterns โ Define ALF escalation rules
Performance
- 1,000 conversations: ~10-20 seconds
- No API calls required (pure data processing)
- Clustering merge adds ~5 seconds