Skip to content

LMouhssine/LocalBrain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LocalBrain - Personal Productivity Intelligence (Offline, PyTorch)

This project learns from your personal activity log (tasks + durations + outcomes + optional energy) and recommends what to focus on next. It runs fully offline on your machine and adapts as you add more logs.

Why this has real value

  • Reduces decision fatigue by turning "what should I do next?" into a concrete top-k suggestion list.
  • Optimizes work sessions by using your historical patterns (time-of-day, day-of-week, durations, outcomes, energy) to recommend categories you actually complete.
  • Detects low-productivity periods by summarizing when interruptions spike and energy tends to be low.
  • Adapts over time: retrain locally whenever you add new logs.

Project structure

data/          # CSV logs + schema docs
frontend/      # local dashboard (Streamlit)
model/         # PyTorch sequence model (GRU)
training/      # training pipeline (train/val, save best model)
inference/     # load model and predict next category
automation/    # daily script: recommend + optional logging
utils/         # parsing, validation, features, datasets, insights
artifacts/     # saved model + metadata

Data schema

See data/README.md.

Quickstart (Windows / PowerShell)

  1. Create a virtual environment (recommended):
python -m venv .venv
.\.venv\Scripts\Activate.ps1
  1. Install dependencies:
pip install -r requirements.txt
  1. Create your log:
  • Start from data/activity_log_example.csv and copy it to data/activity_log.csv, then edit/append rows.
  1. Train:
python -m training.train --data data/activity_log.csv --out artifacts/productivity_model.pt
  1. Recommend the next task category (top-k):
python -m inference.predict_next --data data/activity_log.csv --model artifacts/productivity_model.pt --k 5
  1. Daily workflow (interactive):
python -m automation.daily_recommend --data data/activity_log.csv --model artifacts/productivity_model.pt --k 5 --log-recommendation
  1. Frontend (local dashboard):
streamlit run frontend/app.py

Notes:

  • .streamlit/config.toml disables Streamlit usage stats and binds the server to 127.0.0.1 (local-only).
  • Optional shortcut: .\frontend\run_frontend.ps1

Typical daily loop

  1. Log what you just did (or let the daily script append it).
  2. Run the daily recommender to get the next focus suggestion.
  3. Retrain weekly or whenever you feel recommendations drift: python -m training.train ...

Future improvements (optional)

  • Predict next task name as a second head (multi-task learning).
  • Add a lightweight calendar-free context: location tag, "deep work vs admin" mode, or "meeting-heavy day" flag.
  • Add a fatigue model: predict energy next and recommend breaks.
  • Add a bandit layer: learn from whether you accept/ignore recommendations.
  • Add a simple local UI (e.g., Textual/Tkinter) for faster daily input.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published