feat: Add Streamlit dashboard with Blueprint compliance (v2.1.0)

Dashboard Features:
- 8 navigation sections: Overview, Outcomes, Poor CX, FCR, Churn, Agent, Call Explorer, Export
- Beyond Brand Identity styling (colors #6D84E3, Outfit font)
- RCA Sankey diagram (Driver → Outcome → Churn Risk flow)
- Correlation heatmaps (driver co-occurrence, driver-outcome)
- Outcome Deep Dive (root causes, correlation, duration analysis)
- Export functionality (Excel, HTML, JSON)

Blueprint Compliance:
- FCR: 4 categories (Primera Llamada/Rellamada × Sin/Con Riesgo de Fuga)
- Churn: Binary view (Sin Riesgo de Fuga / En Riesgo de Fuga)
- Agent: Talento Para Replicar / Oportunidades de Mejora
- Fixed FCR rate calculation (only FIRST_CALL counts as success)

Technical:
- Streamlit + Plotly for interactive visualizations
- Light theme configuration (.streamlit/config.toml)
- Fixed Plotly colorbar titlefont deprecation

Documentation:
- Updated PROJECT_CONTEXT.md, TODO.md, CHANGELOG.md
- Added 4 new technical decisions (TD-014 to TD-017)
- Created TROUBLESHOOTING.md with 10 common issues

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
sujucu70
2026-01-19 16:27:30 +01:00
commit 75e7b9da3d
110 changed files with 28247 additions and 0 deletions

61
.env.example Normal file
View File

@@ -0,0 +1,61 @@
# ============================================
# CXInsights - Environment Variables
# ============================================
# Copy this file to .env and configure your values
# cp .env.example .env
# ============================================
# === API KEYS (Required) ===
ASSEMBLYAI_API_KEY=your_assemblyai_key_here
OPENAI_API_KEY=sk-your_openai_key_here
# === API KEYS (Optional) ===
ANTHROPIC_API_KEY=sk-ant-your_anthropic_key_here
# === PATHS ===
INPUT_FOLDER=./data/raw/audio
OUTPUT_FOLDER=./data/outputs
DATA_DIR=./data
CONFIG_DIR=./config
LOG_DIR=./data/logs
# === BATCH CONTROLS ===
# Maximum calls per batch execution
BATCH_SIZE=1000
# Maximum total audio minutes per batch (cost protection)
MAX_AUDIO_MINUTES_PER_RUN=10000
# === STT THROTTLING ===
# AssemblyAI concurrent transcriptions (start conservative: 30)
MAX_CONCURRENT_TRANSCRIPTIONS=30
# === LLM THROTTLING ===
# OpenAI requests per minute (adjust based on your tier)
# Tier 1 (free): 500 RPM -> configure 200 internal
# Tier 2: 5000 RPM -> configure 2000 internal
# Tier 3+: adjust as needed
LLM_REQUESTS_PER_MINUTE=200
# Max tokens per call (controls cost)
LLM_MAX_TOKENS_PER_CALL=4000
# Retry configuration
LLM_MAX_RETRIES=5
LLM_BACKOFF_BASE=2.0
LLM_BACKOFF_MAX=60.0
# === LLM MODEL ===
# Default model for inference
LLM_MODEL=gpt-4o-mini
# Alternative: gpt-4o, claude-3-haiku-20240307
# === LOGGING ===
LOG_LEVEL=INFO
# Options: DEBUG, INFO, WARNING, ERROR
# === PII HANDLING ===
# Enable PII redaction before sending to external APIs
PII_REDACTION_ENABLED=true
# Redaction strategy: redact, hash, mask
PII_REDACTION_STRATEGY=redact