Inspiration
In today's hyperconnected world, our screens dominate our lives—but we rarely pause to ask: How is this affecting our mental health? We're constantly context-switching between apps, working late into the night, and experiencing digital burnout without even realizing it. We were inspired by Digital Wellbeing frameworks and cognitive science research showing that context switching, late-night screen time, and uninterrupted work sessions directly impact mental health, productivity, and sleep quality. We wanted to build something that doesn't just track what we do online, but understand why it matters for our wellbeing. This is a healthcare project. We're building technology that helps people recognize cognitive overload, prevent burnout, and make intentional choices about their digital habits.
What it does
Cognitive Health Analytics is an AI-powered platform that monitors your screen activity and provides deep insights into your mental health and cognitive patterns. Here's what it delivers:
- Collects - Tracks which apps you use, how long, and how often you switch
- Analyzes - AI detects stress patterns, burnout risk, and focus issues
- Visualizes - Beautiful dashboard showing your cognitive health in real-time
- Recommends - Personalized tips to reduce stress and improve focus
- Explains - Ask our AI chat anything about your patterns—it knows your data
The result: You see burnout coming 2-3 weeks before it happens. You make intentional choices about your digital habits instead of just collapsing.
How we built it
Data Pipeline Architecture
Activity Log Processing Loaded raw activity logs (Timestamp, Window_Title) from CSV Used LLM (OpenAI GPT-4o-mini) to intelligently extract app names from messy window titles Avoided hardcoding—let AI discover patterns in 270+ unique window titles
Feature Engineering (feature_engineering.py) Calculated duration between consecutive activities Extracted temporal features: hour, day_of_week, time_period (morning/afternoon/evening/night) Computed context switching metrics with rolling windows Built session analysis (grouping continuous activities with >5 min breaks) Generated stress indicators (context switching rate, late-night detection, long uninterrupted sessions) Created categorical features (app categorization, focus levels, activity types)
RAG System (Retrieval-Augmented Generation) Chunked engineered data into digestible pieces (chunk_size=200, overlap=50) Created embeddings using OpenAI's text-embedding-3-small Built FAISS vector store for semantic search (21,237 chunks) Implemented LangChain RAG chain combining Vector retriever (find top 5 most relevant chunks) LLM (GPT-4o-mini) for reasoning and Prompt engineering for healthcare-specific responses
Dashboard & Visualization (Streamlit + Plotly) Built interactive Streamlit app with 5 tabs Used Plotly for responsive, colorful visualizations Implemented chat history with session state management Added suggested queries for common health questions Tech Stack
Backend: Python, Pandas, LangChain, OpenAI API Vector DB: FAISS (Facebook AI Similarity Search) Embeddings: OpenAI text-embedding-3-small LLM: OpenAI GPT-4o-mini, GPT-5o API Frontend: Streamlit + Plotly Deployment: Hugging Face Spaces (with Git LFS for large models)
Challenges we ran into
Token Limits on Embedding Tried to embed all 10k chunks at once—hit OpenAI's 300k token limit hard. Solution: Implemented batched embedding (100 chunks) RAG Returning "I don't know" Chunks were too small and fragmented. LLM couldn't see aggregate patterns. Solution: Built a summary document with pre-computed statistics that gets chunked separately alongside raw data.
Accomplishments that we're proud of
Healthcare-First Design Every feature tied to mental health research (context switching impacts focus, late-night work disrupts sleep, etc.) *LLM-Powered Intelligence * Used AI not just for chat, but for smart data extraction and understanding RAG System That Actually Works - Grounded AI responses in your real data with source citation End-to-End Project - Data → Features → Embeddings → RAG → UI → Deployment ready
What we learned
- Feature engineering > model complexity - Good features made our RAG 100x better than trying to tune prompts
- Batch processing is your friend - API limits are real; design systems that work with constraints, not against them ## What's next for cognitive health analytics Predict your optimal focus windows and alert before burnout Work with cognitive scientists to validate our stress metrics

Log in or sign up for Devpost to join the conversation.