Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’¬ Chat Intelligence

A sophisticated, self-hosted analytics platform that transforms chat exports into comprehensive behavioral, temporal, and content-based insights. Built with a modular strategy pattern architecture for extensible analysis capabilities.

img.png

🎯 Overview

Chat Intelligence is an open-source solution that works with any structured chat JSON export, providing deep analytics without platform dependencies. Whether you're analyzing group dynamics, communication patterns, or content trends, this platform delivers actionable insights through interactive visualizations.

✨ Key Features

πŸ“Š Behavioral Analysis

  • Dominance Index: Measure participant influence and control in conversations
  • Engagement Metrics: Visualize participation patterns through pie charts
  • Response Time Analysis: Track communication latency and responsiveness

⏱️ Temporal Pattern Recognition

  • Weekly/Monthly Trends: Identify recurring communication cycles
  • Moving Averages: Smooth out noise to reveal underlying patterns
  • Periodicity Heatmaps: Discover optimal communication times and patterns
  • Filterable Timeline: Interactive exploration of message flow over time

πŸ” Content Intelligence

  • Word Frequency Analysis: Identify trending topics and vocabulary patterns
  • Content Classification: Automatic categorization of message themes
  • Anomaly Detection: Spot unusual spikes or patterns in communication

πŸ“ˆ Advanced Analytics

  • Peak Detection: Automatically identify significant conversation peaks
  • Time Series Analysis: Comprehensive temporal data exploration
  • Interactive Visualizations: Dynamic charts with filtering and zoom capabilities

πŸ—οΈ Architecture

The platform follows a clean, modular architecture designed for scalability and maintainability:

Frontend Layer

  • Streamlit Dashboard: Single-page application with intuitive UI
  • Real-time Updates: Dynamic chart rendering based on user interactions
  • Responsive Design: Optimized for various screen sizes

Analytics Engine

  • Strategy Pattern: Modular chart strategies for easy extension
  • Lazy Loading: Efficient data processing with on-demand computation
  • Caching Layer: Optimized performance through intelligent caching

Data Pipeline

  • Universal Parser: Platform-agnostic chat data ingestion
  • Structured Processing: Clean data transformation and normalization
  • Error Handling: Robust parsing with comprehensive error reporting

πŸš€ Quick Start

Local Development

  1. Install uv (Python package manager)

    curl -Ls https://astral.sh/uv/install.sh | sh
  2. Clone and setup the project

    git clone <repository-url>
    cd chatIntelligence
    uv sync
  3. Launch the application

    uv run streamlit run src/app.py

Docker Deployment

Option 1: Pull from GitHub Container Registry

# Pull the latest pre-built image
docker pull ghcr.io/netphantom/chatintelligence:latest

# Run the application
docker run -p 8501:8501 ghcr.io/netphantom/chatintelligence:latest

Option 2: Build locally

# Build the container
docker build -t chat-intelligence .

# Run the application
docker run -p 8501:8501 chat-intelligence

πŸ“‚ Project Structure

chatIntelligence/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app.py                    # Main application entry point
β”‚   β”œβ”€β”€ controller/
β”‚   β”‚   β”œβ”€β”€ TelegramParser.py     # Chat data parsing logic
β”‚   β”‚   └── __init__.py
β”‚   └── view/
β”‚       β”œβ”€β”€ DashboardApp.py       # Streamlit dashboard implementation
β”‚       β”œβ”€β”€ charts/
β”‚       β”‚   β”œβ”€β”€ ChartStrategy.py          # Base strategy interface
β”‚       β”‚   β”œβ”€β”€ DominanceIndexStrategy.py # Dominance analysis
β”‚       β”‚   β”œβ”€β”€ EngagementPieStrategy.py  # Engagement visualization
β”‚       β”‚   β”œβ”€β”€ FilterableTimelineStrategy.py # Interactive timeline
β”‚       β”‚   β”œβ”€β”€ MovingAverageStrategy.py  # Trend analysis
β”‚       β”‚   β”œβ”€β”€ PeakAnomalyStrategy.py    # Anomaly detection
β”‚       β”‚   β”œβ”€β”€ PeriodicityHeatmapStrategy.py # Time pattern analysis
β”‚       β”‚   β”œβ”€β”€ ResponseTimeStrategy.py   # Response time metrics
β”‚       β”‚   β”œβ”€β”€ TimeSeriesPlotStrategy.py # Basic time series
β”‚       β”‚   β”œβ”€β”€ WordFrequencyStrategy.py # Content analysis
β”‚       β”‚   └── __init__.py
β”‚       └── __init__.py
β”œβ”€β”€ pyproject.toml               # Project configuration and dependencies
β”œβ”€β”€ Dockerfile                   # Container build configuration
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       └── deploy.yml           # CI/CD pipeline
β”œβ”€β”€ README.md                    # This documentation
└── LICENSE                      # MIT License

βš™οΈ Configuration

Environment Variables

No environment variables required for basic operation.

Optional Configuration

  • Logging Level: Control verbosity of application logs
  • Cache Settings: Tune performance parameters (future feature)
  • Chart Defaults: Customize visualization preferences

🧠 Design Principles

  • Strategy Pattern: Extensible analytics modules for easy feature addition
  • Separation of Concerns: Clear distinction between UI, logic, and data layers
  • Stateless Execution: Efficient resource usage with minimal memory footprint
  • Lazy Evaluation: Compute analytics only when needed
  • Modular Architecture: Independent components for maintainability

πŸ”§ Technical Stack

  • Frontend: Streamlit for rapid web application development
  • Backend: Python 3.13+ with modern async capabilities
  • Data Processing: Pandas for efficient data manipulation
  • Visualization: Plotly for interactive, publication-quality charts
  • Package Management: uv for fast, reliable dependency management

πŸš€ Roadmap

Near Future

  • AI-powered conversation summaries
  • PDF report generation
  • Real-time streaming analysis
  • Multi-chat comparison dashboard

Long-term Vision

  • Advanced sentiment analysis
  • Custom chart strategy builder
  • Integration with popular chat platforms
  • Team collaboration features

🀝 Contributing

We welcome contributions! Please see our contributing guidelines for details on:

  • Code style and standards
  • Testing requirements
  • Pull request process
  • Issue reporting

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A glowing self-hosted application to chart-a-chat and get insight

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages