PC Activity Analyzer is a privacy-first digital habit tracking tool that monitors your PC usage and provides AI-powered insights. All data processing and AI analysis happens locally on your device - no cloud uploads, no external API calls.
- Real-time Activity Tracking - Monitors active window usage on your PC
- Interactive Dashboards - Visualize your digital habits with charts and analytics
- AI-Powered Insights - Natural language chatbot answers questions about your usage patterns
- Smart Filtering - Filter data by app, date, time, and custom criteria
- Privacy-First - All data and AI processing stays on your device
- Data Export - Export your usage data as CSV for external analysis
Detailed analytics with hourly, daily, and weekly breakdowns
Natural language chatbot for querying your usage patterns
- Active Window Tracker: Background service that logs app usage to CSV
- Dashboard & Analytics: Streamlit-based interactive UI for data visualization
- RAG Chatbot: AI assistant that answers questions using your own usage data
- ChromaDB: Local vector database for fast semantic search
- Ollama + LLM: Local large language model for generating AI responses
graph TD
A[Active Window Tracker] --> B[usage_log.csv]
B --> C[Streamlit App]
C --> D[Dashboard/Analytics]
C --> E[RAG Chatbot]
E --> F[ChromaDB Vector DB]
E --> G[Ollama + LLM]
- Data Collection - Background tracker monitors active windows and logs usage to CSV
- Data Processing - Raw data is cleaned and enriched with time-based features
- Embedding & Vectorization - Usage summaries are converted to vector embeddings
- AI-Powered Insights - RAG pipeline retrieves relevant data and generates natural language responses
- Interactive Visualization - Streamlit UI presents dashboards and chatbot interface
- Python 3.11+ - Core programming language
- Streamlit - Web UI framework for dashboards
- LangChain - RAG pipeline orchestration
- Ollama + LLaMA3 - Local large language model
- ChromaDB - Vector database for embeddings
- Sentence Transformers - Text embedding generation
- pywin32 / win32gui - Windows API for activity tracking
- Plotly - Interactive data visualizations
- Pandas - Data processing and analysis
pc_activity_analyzer/
βββ app.py # Main Streamlit application
βββ active_windows_tracker.py # Windows activity logging service
βββ analyze_usage.py # Standalone data analysis script
βββ requirements.txt # Python dependencies
βββ README.md # Project documentation
βββ styles.css # Custom Streamlit styles
βββ data/
β βββ usage_log.csv # Generated usage data
βββ chroma_db/
β βββ chroma.sqlite3 # ChromaDB vector database
βββ components/
β βββ ai_chat.py # AI chatbot UI component
β βββ analytics.py # Analytics dashboard component
β βββ dashboard.py # Main dashboard component
β βββ settings.py # Settings and configuration UI
βββ chatbot/
β βββ data_loader.py # Data loading utilities
β βββ data_processing.py # Data processing helpers
β βββ document_processor.py # Document creation for RAG
β βββ embedding_store.py # Embedding storage management
β βββ llm_handler.py # Ollama LLM integration
β βββ quick_analysis.py # Quick analytics processing
β βββ quick_questions.py # Predefined question patterns
β βββ usage_data_rag.py # RAG pipeline implementation
β βββ vector_store_manager.py # ChromaDB management
βββ utils/
β βββ data_loader.py # General data loading utilities
β βββ helpers.py # Common helper functions
β βββ instance.py # Singleton pattern helpers
βββ images/ # Screenshots and documentation assets
git clone <repo-url>
cd pc-activity-analyzerpip install -r requirements.txtDownload and install Ollama from ollama.com, then:
ollama serve
ollama pull llama3Run the activity tracker to start collecting usage data:
python active_windows_tracker.pyLet it run for a while to collect some initial data, then stop it with Ctrl+C.
ollama servestreamlit run app.pyOpen your browser and navigate to http://localhost:8501
- Dashboard - View your usage statistics and trends
- Analytics - Dive deeper into your digital habits
- AI Chat - Ask questions about your usage patterns
- Settings - Configure filters and export options
- Usage Log:
data/usage_log.csv(auto-generated by tracker) - Vector Database:
chroma_db/(created automatically)
- Ollama Model: Default is
llama3(configurable in code) - Tracking Interval: Adjustable in
active_windows_tracker.py - Data Retention: Configure how long to keep historical data
- UI Themes: Custom styles in
styles.css
- Efficient Caching - Embeddings and processed data are cached for fast access
- Vector Search - ChromaDB provides millisecond semantic search
- Streamlit Optimization - Smart caching reduces data processing overhead
- Local Processing - No network latency from cloud API calls
- Local Storage Only - All data remains on your device
- No Cloud Uploads - Zero external data transmission
- Local AI Processing - LLM runs entirely on your hardware
- Open Source - Full transparency of data handling
- Export Options - Full control over your data export
- Deletion Controls - Easy data cleanup and removal
- Access Logs - Track what data is being accessed
This project is licensed under the MIT License β see the LICENSE file for details.
Inspired by the need for local, privacy-first digital habit analytics and AI-powered insights.


