A revolutionary voice-activated analytics platform that transforms natural language queries into intelligent, dynamic, and professional-grade data visualizations with beautiful metallic themes and real-time adaptive capabilities.
- 🧠 LLM-Powered Date Parsing: Natural language date understanding
- 📅 Dynamic Date Range Support: Any time period from days to years
- 🎨 Intelligent Chart Adaptation: Automatic bar/line chart selection
- ⚡ Real-Time Performance: Handles any dataset size automatically
- 🎯 Smart Time Grouping: Daily/Weekly/Monthly/Yearly based on data
- 🚀 Enhanced Voice Commands: More natural and flexible queries
- 🎤 Voice-Activated Analytics: Speak naturally to generate charts
- 🧠 LLM-Powered Intelligence: Natural language understanding and date parsing
- 📊 Dynamic Chart Generation: Automatically adapts to any data size or time period
- 🎨 Professional Metallic Themes: Bronze, Steel, Emerald, Royal color schemes
- ⚡ Real-Time Speech Recognition: Powered by OpenAI Whisper
- 🎯 Intelligent Tool Selection: Automatic chart type and time grouping selection
- 🏗️ Multi-Server Architecture: Scalable and modular design
- 📱 Real-Time Adaptation: Handles datasets from 1 day to multiple years
- Python 3.8+
- macOS, Linux, or Windows
- Microphone for voice input
- 4GB+ RAM recommended
- Internet connection for LLM server
The system consists of four main components:
- STT Client (
stt_client.py
) - Voice input interface - STT Server (
stt_server.py
) - Audio processing and transcription - Analytics Server (
csv_ana_server.py
) - Chart generation engine - LLM Server (
server_side.py
) - Natural language processing
- Clone or download the project files
- Install dependencies:
pip install -r requirements_final.txt
- Prepare your data: Place CSV file with trip data in the project directory
- Set up environment: Configure your OpenAI API key if using external LLM
Your CSV file should contain these columns:
Date
- Date of the trip (YYYY-MM-DD format)Status
- 'Completed' or 'Cancelled'Trip_Time
- Trip duration in minutesOn_Time_Pickup
- 'Yes' or 'No' for punctualityPickup_Time
- Actual pickup timeDropoff_Time
- Drop-off time
The system now supports any time period:
- "last 2 weeks" → Automatically calculates date range
- "month of June" → Converts to YYYY-MM-DD format
- "Q1 2024" → Intelligent quarter calculation
- "last 45 days" → Flexible relative date parsing
Update the LLM server URL in csv_ana_server.py
:
LLM_SERVER_URL = 'http://your-llm-server:5000/chat'
The system automatically selects optimal visualization:
- ≤ 21 days: Bar charts for clear daily comparison
- > 21 days: Line charts for trend analysis
- Time Grouping: Daily (≤7 days) → Weekly (≤35 days) → Monthly (≤400 days) → Yearly (>400 days)
- Start the Analytics Server:
python csv_ana_server.py --csv Generated_Trip_Data.csv --port 5001
- Start the STT Server:
python stt_server.py --port 5002
- Use the STT Client:
python stt_client.py
- Speak your queries:
- "Show me last month's trip summary"
- "What about trip time analysis for the past 2 weeks?"
- "Generate performance heatmap for Q1 2024"
- "Show me last 45 days performance"
- "Give me the pickup rate analysis for June"
Send POST requests to http://localhost:5001/process_query
:
curl -X POST http://localhost:5001/process_query \
-H "Content-Type: application/json" \
-d '{"query": "Show me weekly trip summary"}'
- 🚀 Weekly Trip Summary: Comprehensive overview with adaptive time grouping
- ⏱️ Trip Time Analysis: Duration analysis with intelligent chart type selection
- ⏰ On-Time Pickup Analysis: Punctuality metrics with dual-axis visualization
- 🏆 Performance Benchmarking: Period-based performance comparison
- 🔥 Performance Heatmap: Intensity patterns with adaptive time grouping
- 📅 Automatic Date Range Detection: Understands natural language time references
- 🎨 Intelligent Chart Selection: Bar vs Line based on data characteristics
- ⚡ Real-Time Adaptation: Handles any dataset size automatically
- 🎯 Performance Zones: Color-coded excellence/good/improvement areas
Switch between professional dark metallic themes:
# Available themes
csv_ana_server.set_color_theme('dark_bronze') # Rich copper tones
csv_ana_server.set_color_theme('dark_steel') # Charcoal elegance
csv_ana_server.set_color_theme('dark_emerald') # Forest sophistication
csv_ana_server.set_color_theme('dark_royal') # Midnight majesty
POST /process_query
- Process natural language queriesGET /charts
- List available chart filesGET /chart/<filename>
- Serve chart images
POST /transcribe
- Transcribe audio to textPOST /process_voice_query
- Complete voice-to-chart pipeline
- "Show me last month's trip summary"
- "What about trip time analysis for the past 2 weeks?"
- "Generate performance heatmap for Q1 2024"
- "Show me last 45 days performance"
- "Give me the pickup rate analysis for June"
- "last week" → Automatically calculates date range
- "month of December" → Converts to YYYY-MM-DD
- "past quarter" → Intelligent quarter calculation
- "last 30 days" → Flexible relative date parsing
- "this year" → Current year analysis
- "Create a performance heatmap for last month"
- "Show performance benchmarking for Q1"
- "Generate on-time pickup analysis for the past 2 weeks"
- "What's the trip time trend for last quarter?"
-
Audio Input Problems:
- Check microphone permissions
- Verify PyAudio installation
- Test with
python -m pyaudio
-
LLM Server Connection:
- Verify server URL and port
- Check network connectivity
- Ensure LLM server is running
-
Chart Display Issues:
- Charts auto-open in system viewer
- Check PNG files in
charts/
directory - Verify matplotlib backend compatibility
If ports are in use, modify in the startup commands:
python csv_ana_server.py --port 5003
python stt_server.py --port 5004
Open Ai sdk/
├── 🚀 csv_ana_server.py # Main analytics server (Port 5001)
│ ├── Dynamic date range support
│ ├── Intelligent chart adaptation
│ ├── Beautiful metallic themes
│ └── Real-time data processing
├── 🎤 stt_server.py # Speech-to-text server (Port 5002)
│ ├── Real-time audio recording
│ ├── Whisper-based transcription
│ └── Voice command processing
├── 🎧 stt_client.py # Voice input client
│ ├── Audio streaming interface
│ └── Transcription display
├── 🧠 server_side.py # LLM processing server (Port 5000)
│ ├── Natural language date parsing
│ ├── Intelligent tool selection
│ └── Dynamic query understanding
├── 📊 Generated_Trip_Data.csv # Sample trip data
├── 📋 requirements_final.txt # Complete dependencies
├── 📖 README.md # This file
└── 🎯 charts/ # Generated chart files
- 💾 Use SSD storage for faster chart generation
- 🧠 Allocate 4GB+ RAM for optimal performance
- 🔒 Close unnecessary applications during heavy processing
- 🌐 Use wired network for stable LLM communication
- ⚡ Enable real-time processing for dynamic chart adaptation
- Natural Language: "last month", "past 2 weeks", "Q1 2024"
- Flexible Formats: "month of June", "last quarter", "this year"
- Relative References: "last 45 days", "past 3 months"
- Specific Periods: "2024-01-01 to 2024-03-31"
- Data Size: Automatically chooses bar vs line charts
- Time Grouping: Daily → Weekly → Monthly → Yearly
- Performance Zones: Color-coded excellence indicators
- Real-Time Updates: Adapts to any dataset changes
- Query Understanding: Natural language processing
- Tool Selection: Automatic analytics tool choice
- Date Conversion: YYYY-MM-DD format generation
- Context Awareness: Understands business terminology
- Local Processing: Audio and data processed locally
- Network Security: Use HTTPS for production LLM servers
- Data Privacy: No data sent to external services except configured LLM
- Port Security: Consider firewall rules for production deployment
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
requirements_final.txt
: Contains ALL dependencies for the complete system- Comprehensive Coverage: Web frameworks, data processing, AI, audio processing
- Version Specifications: Minimum version requirements for stability
- Installation Notes: Platform-specific setup instructions
- Flask: Web server framework for all components
- Pandas + NumPy: Data processing and analysis
- Matplotlib: Professional chart generation
- OpenAI: LLM integration and natural language processing
- PyAudio + Whisper: Speech recognition and audio processing
pip install -r requirements_final.txt
Please review and comply with all third-party library licenses.
For issues and questions:
- Check the troubleshooting section
- Review the system workflow diagram
- Test individual components separately
- Check server logs for detailed error messages
- OpenAI Whisper for speech recognition
- Matplotlib for chart generation
- Flask for web server framework
- Pandas for data processing
- NumPy for numerical computations