Skip to content

tgondil/artemis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

40 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โ–ถ๏ธ Watch the Demo on YouTube

Artemis Logo

๐Ÿง  Artemis: Focus isn't forced, it's found.

Redefine Your Focus Strategy: Combat Distractions with Our Game-Changing AI Solution! Effortlessly Orchestrate Your Environment Through Real-Time Gaze Tracking-Experience Zero Cognitive Friction, Enhanced Productivity, and Unmatched Control Over Your Attention!

Build Status Coverage Status License Version

๐ŸŒŸ Built With Excellence:

Electron React TypeScript Python Tailwind CSS Framer Motion MediaPipe Spotify Chrome


Attention-aware environment orchestration for deep cognitive flow

A comprehensive system that detects attention states through gaze tracking and orchestrates your entire digital and physical environment to optimize focus, productivity, and cognitive performance.


๐ŸŒŸ Overview

Artemis is a multi-layered adaptive focus ecosystem that combines:

  • Real-time gaze tracking via MediaPipe and EyeTrax integration
  • Intelligent environment control across music, lighting, and digital distractions
  • Financial incentive system through Visa payment integration
  • Chrome tab management with distraction detection
  • Adaptive lighting with neuroergonomic presets
  • Flow state orchestration with 4-phase cognitive model

The system creates a seamless, invisible layer of environmental adaptation that responds to your cognitive state in real-time.


๐Ÿ—๏ธ System Architecture

graph TB
    A[๐Ÿง  Artemis Core<br/>Electron + React + TypeScript] --> B[๐ŸŽต Music Controller<br/>Spotify Web API]
    A --> C[๐Ÿ’ก Lighting System<br/>WiZ/LIFX Integration]
    A --> D[๐ŸŒ Chrome Monitor<br/>DevTools Protocol]
    A --> E[๐Ÿ‘๏ธ Gaze Tracker<br/>MediaPipe + EyeTrax]
    
    B --> G[๐ŸŽง Spotify<br/>Real-time Audio Control]
    C --> H[๐Ÿ’ก Smart Lights<br/>Adaptive Illumination]
    E --> J[๐Ÿ“ฑ Chrome Browser<br/>Tab Management]
    F --> K[๐Ÿ“น Webcam<br/>Eye Tracking]
    
    style A fill:#A7C7E7,stroke:#333,stroke-width:3px
    style B fill:#1DB954,stroke:#333,stroke-width:2px
    style C fill:#FF6B35,stroke:#333,stroke-width:2px
    style D fill:#1A1F71,stroke:#333,stroke-width:2px
    style E fill:#4285F4,stroke:#333,stroke-width:2px
    style F fill:#FF4081,stroke:#333,stroke-width:2px
Loading

๐Ÿ”„ Data Flow

Input Processing Output
๐Ÿ‘๏ธ Gaze Data ๐Ÿง  AI Analysis ๐ŸŽต Music Adaptation
๐Ÿ“ฑ Tab Activity ๐Ÿ” Distraction Detection ๐Ÿ’ก Light Control
โฑ๏ธ Focus Time ๐Ÿ’ณ Micro-transactions
๐ŸŽฏ Attention State ๐Ÿ”„ State Machine ๐ŸŒ Environment Sync

๐Ÿงฉ Core Components

Component Status Technology Description
๐Ÿง  Artemis Dashboard โœ… Active Electron + React + TypeScript Glassmorphic desktop app with gaze tracking
๐ŸŽต Music Controller โœ… Active Python + Spotify API Real-time audio adaptation
๐Ÿ’ก Lighting System โœ… Active Python + WiZ/LIFX Neuroergonomic light control
๐ŸŒ Chrome Monitor โœ… Active Chrome DevTools Protocol Intelligent tab management
๐Ÿ”„ Orchestration โœ… Active Python + AsyncIO Central event coordination

1๏ธโƒฃ Artemis Dashboard

๐Ÿ“ Artemis/ | Status

Glassmorphic Electron desktop application with real-time gaze tracking and environment orchestration.

โœจ Key Features

  • โœ… MediaPipe + EyeTrax integration for precise gaze tracking
  • โœ… 4-phase state machine (Calibration โ†’ Engagement โ†’ Flow โ†’ Cooldown)
  • โœ… Chrome DevTools Protocol integration for tab monitoring
  • โœ… Real-time metrics overlay with attention analytics
  • โœ… Adaptive UI that responds to cognitive state
  • โœ… Session logging and performance tracking

๐Ÿ› ๏ธ Tech Stack

Electron 38 + React 18 + TypeScript
โ”œโ”€โ”€ TailwindCSS (glassmorphic design)
โ”œโ”€โ”€ Framer Motion (smooth transitions)
โ”œโ”€โ”€ MediaPipe Tasks Vision (gaze tracking)
โ””โ”€โ”€ Chrome DevTools Protocol (browser integration)

2๏ธโƒฃ Adaptive Music Controller

๐Ÿ“ adaptiveLights/adaptiveLights.py | Status

Real-time Spotify Web API control tied to focus modes with intelligent audio transitions.

โœจ Key Features

  • โœ… Smooth crossfades and timed volume ramps โ€” no abrupt cuts
  • โœ… Intelligent mode persistence with automatic re-authentication
  • โœ… Lightweight threaded polling for fast, responsive transitions
  • โœ… Focus-based playlist switching and ambient sound control
  • โœ… Volume scaling based on engagement level

๐Ÿ”— Integration

Spotify Web API + OAuth2 Authentication
โ”œโ”€โ”€ Real-time playback control
โ”œโ”€โ”€ Queue management
โ””โ”€โ”€ Adaptive audio based on cognitive phase

3๏ธโƒฃ Adaptive Lighting System

๐Ÿ“ adaptiveLights/adaptiveLights.py

Universal WiZ-compatible light controller with research-based neuroergonomic presets.

Features:

  • โœ… WiZ-compatible driver (UDP/HTTP shell hooks)
  • โœ… Neuroergonomic presets for Deep Focus, Flow, Break, and Fatigue phases
  • โœ… Research-based fades using easing and gamma-aware interpolation
  • โœ… Robust failsafes โ€” stale-state detection, recovery, and safe no-ops
  • โœ… Color temperature adaptation based on time of day and focus state

Presets:

  • Deep Focus: Cool white (6500K), 80% brightness
  • Flow State: Neutral white (4000K), 90% brightness
  • Break Time: Warm white (2700K), 60% brightness
  • Fatigue Recovery: Soft amber (2200K), 40% brightness

4๏ธโƒฃ Chrome Tab Management

๐Ÿ“ Artemis/src/services/ChromeMonitor.ts

Intelligent distraction detection and tab control using Chrome DevTools Protocol.

Features:

  • โœ… Chrome DevTools Protocol (CDP) integration
  • โœ… Real-time tab enumeration with metadata extraction
  • โœ… Distraction detection heuristics based on titles and URLs
  • โœ… Safe-close logic with activity logging and subprocess cleanup
  • โœ… "Focus Lock" protection to prevent accidental tab purges
  • โœ… Content analysis for intelligent tab categorization

Capabilities:

  • Lists all tabs with metadata (title, URL, favicon)
  • Extracts page content (headings, text, code blocks)
  • Tracks tab activity (time spent, last active, network status)
  • Provides snapshot API for complete Chrome state

5๏ธโƒฃ Central Orchestration Engine

๐Ÿ“ main.py

Asynchronous event bus linking all focus signals to environmental controls.

Features:

  • โœ… Central event bus linking focus signals โ†’ music, tabs, and lights
  • โœ… Full asynchronous orchestration โ€” concurrent, non-blocking actions
  • โœ… Debounce + hysteresis filters to prevent rapid mode oscillation
  • โœ… Deterministic sequencing for synchronized ambient changes
  • โœ… Error recovery and graceful degradation

๐Ÿš€ Quick Start

โšก Get Started in 5 Minutes

Quick Start Setup Time

๐Ÿ“‹ Prerequisites

Requirement Version Status
Node.js 18+ Required
Python 3.8+ Required
Chrome Latest Required
Spotify API Access Required
WiZ Compatible Optional

๐Ÿ› ๏ธ Installation Steps

1๏ธโƒฃ Clone and Setup Artemis

cd Artemis
npm install
npm run dev

2๏ธโƒฃ Setup Python Services

cd adaptiveLights
pip install -r requirements.txt
python adaptiveLights.py

3๏ธโƒฃ Launch the System

# Terminal 1: Artemis
cd Artemis && npm start

# Terminal 2: Music Controller  
cd adaptiveLights && python adaptiveLights.py

# Terminal 3: Payments (optional)
cd payments-service && pnpm dev

๐ŸŽฏ What Happens Next?

Step Action Result
1๏ธโƒฃ Launch Artemis Glassmorphic UI appears
2๏ธโƒฃ Enable Gaze Tracking Camera activates, calibration begins
3๏ธโƒฃ Connect Services Spotify, lights, and Chrome integrate
4๏ธโƒฃ Start Focus Session Environment adapts to your attention

๐ŸŽฏ Focus State Model

๐Ÿง  4-Phase Cognitive Flow

stateDiagram-v2
    [*] --> Calibration: System Start
    Calibration --> Engagement: Gaze Stabilizes
    Engagement --> Flow: Deep Focus Achieved
    Flow --> Cooldown: Fatigue Detected
    Cooldown --> Calibration: Ready for Next Session
    Cooldown --> [*]: Session End
    
    note right of Calibration
        High saccade rate
        Dispersed gaze
        Reduce visual clutter
    end note
    
    note right of Engagement
        Gaze clusters form
        Dispersion decreases
        Play ambient tone
    end note
    
    note right of Flow
        Fixation stability > threshold
        Blink rate decreases
        Lock distractions
    end note
    
    note right of Cooldown
        Blink rate increases
        Saccade rate increases
        Fade out music
    end note
Loading

๐Ÿ“Š Gaze Metrics Dashboard

Metric Description Usage Status
Fixation Variance of gaze vector Detect focus consistency โœ… Active
Blink Blinks per minute Detect fatigue โœ… Active
Saccade Rapid gaze changes Detect distraction โœ… Active
Pupil Dilation fluctuation Infer engagement/arousal โœ… Active

๐Ÿ”„ State Transitions

From To Trigger Response
๐Ÿ”„ Calibration ๐ŸŽฏ Engagement Gaze clusters form, dispersion โ†“ Play ambient tone, adaptive music
๐ŸŽฏ Engagement ๐Ÿง  Flow Fixation stability > threshold Lock distractions, neutral lighting
๐Ÿง  Flow ๐Ÿ˜ด Cooldown Blink rate โ†‘, saccade โ†‘ Fade music, brighten lights
๐Ÿ˜ด Cooldown ๐Ÿ”„ Calibration Ready for next session Reset environment, prepare UI

๐ŸŽจ Design Philosophy

"Calm Intelligence" โ€” The system should feel invisible โ€” calm, ambient, and responsive.

Visual Language

  • Glassmorphic UI with backdrop blur (blur(20px))
  • Dark theme with #0D0D0D background
  • Arctic blue accents (#A7C7E7) and soft lavender
  • SF Pro Display typography with Inter fallback
  • Smooth fade transitions (0.8s-1.2s) using Framer Motion

Interaction Principles

  • 8pt grid rhythm for consistent spacing
  • Single-column layout with center alignment
  • Fade transitions only โ€” no pops or bounces
  • Large white space for cognitive clarity
  • State-responsive UI that adapts to focus phases

๐Ÿ”ง Configuration

Environment Variables

Artemis:

# Chrome DevTools
CHROME_DEBUG_PORT=9222

# Spotify Integration
SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=your_client_secret
SPOTIFY_REDIRECT_URI=http://localhost:3000/callback

# Lighting Control
WIZ_LIGHT_IP=192.168.1.100
LIFX_TOKEN=your_lifx_token

๐Ÿ“Š Analytics & Logging

Session Data

  • timestamp_start - Session initiation time
  • phase_transitions - Cognitive state changes
  • fixation_stability_avg - Average focus consistency
  • blink_rate_trend - Fatigue indicators
  • flow_duration - Time in optimal focus state
  • environmental_changes - Music, lighting, and tab adjustments

Performance Metrics

  • Focus Score - Composite metric of attention quality
  • Flow Duration - Time spent in optimal cognitive state
  • Distraction Recovery - Speed of returning to focus
  • Environmental Effectiveness - Impact of adaptations

๐Ÿ”ฎ Future Roadmap

Phase 1: Core Stability

  • Enhanced gaze tracking accuracy
  • Improved Chrome tab categorization
  • Better error handling and recovery

Phase 2: Advanced Integrations

  • Philips Hue integration
  • Slack/Discord status control
  • Raspberry Pi phone blocking
  • Calendar integration for focus scheduling

Phase 3: AI Enhancement

  • Machine learning for personalized adaptations
  • Predictive focus state modeling
  • Intelligent playlist generation
  • Advanced distraction detection

Phase 4: Community Features

  • Focus leaderboards
  • Shared focus sessions
  • Community pool management
  • Advanced payment flows

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Setup

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

๐Ÿ“„ License

MIT License - see LICENSE for details.


๐Ÿ™ Acknowledgments

  • MediaPipe for gaze tracking capabilities
  • Spotify for music API integration
  • WiZ for smart lighting control
  • Chrome DevTools Protocol for browser integration

๐ŸŒŸ Star History

Star History Chart


๐Ÿค Support the Project

GitHub Sponsors Buy Me a Coffee Follow on Twitter


Built with โค๏ธ for the future of human-computer interaction

Artemis โ€” Where attention meets intelligence


Footer Footer Footer

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors