Static dashboard generator for OpenChatStudio data. This project analyzes AI coaching sessions between bots and field workers (FLWs), providing insights into bot performance, session patterns, and annotation-based quality metrics.
- Purpose: Monitor ECD bot performance and analyze session metadata and annotations
- Data Source: OpenChatStudio API (session metadata with annotation tags)
- Output: Static HTML dashboard with interactive charts using Plotly
- Current Status: ✅ Working dashboard with session analysis capabilities
# Run the setup script (creates venv and installs dependencies)
python setup.py
# Activate virtual environment
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate# Edit .env file with your OpenChatStudio API key
# The setup script creates a template for you# Download session metadata only
python run_dashboard.py download-sessions
# Download session metadata (limited for testing)
python run_dashboard.py download-sessions --limit 1000
# Download message content for existing sessions (required for advanced metrics)
python run_dashboard.py download-messages
# Download messages for limited sessions
python run_dashboard.py download-messages --limit 100# Generate interactive dashboard from downloaded data
python run_dashboard.py generateThe dashboard will be generated in the output/index.html file and automatically opened in your browser.
- Experiment Selection: Multi-select experiments with session counts
- Version Filtering: Dynamic version selection per experiment with descriptions
- Smart Defaults: Auto-select all versions when choosing an experiment
- Empty State: Start with no data selected, requiring active filtering
- Real-time Updates: Metrics update instantly as filters change
- Session Analytics: Total sessions, experiments, teams, date ranges
- Message Analysis: Total messages, median words per user/bot response
- Sentiment Detection: Appreciation/dissatisfaction rates from message content
- Quality Assessment: Annotated sessions, coaching quality, bot performance
- Version-Aware: All metrics calculated using actual version tags from messages
- Session Metadata: IDs, timestamps, participant info, experiment details
- Experiment Versions: Version tracking and comparison across experiments
- Quality Annotations: Manual tags for bot performance, engagement, coaching quality
- Team Organization: Session distribution across different teams
- Bot Performance:
bot_performance_good,bot_performance_bad - User Engagement:
engagement_good,engagement_bad - Coaching Quality:
coaching_good,coaching_bad,coaching_undetermined - Content Quality:
safe,accurate - User Knowledge:
user_knowledge_good,user_knowledge_bad
- FLW ratings (1-5 scale) - requires additional API endpoints
- Advanced conversation analysis - requires NLP processing
- Historical trend charts - focus is on metric cards for now
The setup script creates a .env file template. Edit it with your values:
# Required: Your OpenChatStudio API key
OCS_API_KEY=your_api_key_here
# Optional: API base URL (default shown)
OCS_API_BASE_URL=https://chatbots.dimagi.com/api
# Optional: Specific project ID to analyze
OCS_PROJECT_ID=your_project_id_here- Log into OpenChatStudio at https://chatbots.dimagi.com
- Go to your user profile page
- Generate an API key
- Copy it to your
.envfile
Note: The API uses X-API-KEY header authentication, not Bearer token authentication.
# Setup and activation
python setup.py # Initial setup with venv
python activate.py # Show activation commands
# API operations
python run_dashboard.py download # Download all session data
python run_dashboard.py download --limit 100 # Download limited sessions
python run_dashboard.py # Generate dashboard (default)
# Help
python run_dashboard.py --help # Show all options├── run_dashboard.py # Main entry point with CLI args
├── setup.py # Virtual environment setup
├── activate.py # Cross-platform activation helper
├── requirements.txt # Dependencies with version pinning
├── constants.py # Configuration constants
├── .env # API credentials (created by setup)
├── env.example # Environment template
├── venv/ # Virtual environment (created by setup)
├── data/
│ └── YYYYMMDD_HHMMSS/ # Timestamped data directories
│ └── sessions/ # Downloaded session JSON files
├── output/
│ └── index.html # Generated dashboard
└── src/
├── ocs_client.py # OpenChatStudio API client
├── models.py # Data models (Session, Experiment, etc.)
├── dashboard_generator.py # HTML dashboard generation with Plotly
└── data_utils.py # Data directory management utilities
Each session contains:
- Identifiers: Unique session ID, participant identifier
- Timestamps: Created/updated timestamps for temporal analysis
- Experiment Info: Name, version, URL with full version history
- Team Info: Organizing team name and slug
- Annotations: Quality tags when manually reviewed
- Participant: Identifier (often email or anonymous ID)
- Data stored in
data/YYYYMMDD_HHMMSS/sessions/directories - Each session saved as individual JSON file:
session_{id}.json - Preserves historical downloads and enables data versioning
- Python 3.8+ (3.10+ recommended)
- OpenChatStudio API access key with session read permissions
- Internet connection for initial data download
- Virtual environment (recommended for isolation)
This project follows the same structure and patterns as the Coverage repository for consistency and maintainability.