YouOS — Personal Email Copilot
YouOS is a full local Python app (not an instruction-only snippet). It drafts email replies in your style, grounded in your real past replies.
Naming: YouOS is the shared app/package. During setup it personalizes its name to OS (e.g. BaherOS) for your local instance at YOUOS_DATA_DIR=~/YouOS-Instances/<you>/ — that's a local config/data directory, not a fork of the project.
Safety & impact
Read these before installing:
- Sensitive data ingested locally. YouOS reads your Gmail (sent + threads), Google Docs, and optional WhatsApp exports into a local SQLite DB. This stays on your machine, but it is sensitive content — protect the data directory (
YOUOS_DATA_DIR/var/youos.db) accordingly.
- Installation runs local package code.
./scripts/install.sh builds a .venv and installs this repository — review the source (especially scripts/install.sh, pyproject.toml, app/) before running.
- Background persistence is opt-in. YouOS only runs as a launchd LaunchAgent if you explicitly run
youos service install. Foreground youos serve does not persist.
- Scheduled/nightly runs are opt-in. Ingestion, fine-tuning, and autoresearch only run automatically if you've enabled the nightly pipeline;
youos improve is the manual equivalent.
- External model fallback is optional. Drafting is on-device by default. Cloud fallback only fires if
review.draft_model or model.fallback is set to a cloud model — set model.fallback: none and review.draft_model: local for strict local-only operation.
Install and runtime model
- Install is manual: run
./scripts/install.sh (Python 3.11+) — it creates a .venv, installs YouOS, sets up the on-device model (MLX) on Apple Silicon, and runs the doctor
- Note: this executes local package install code from this repository; review source before installing
- Requires
python3 (3.11+) and a Google ingestion backend — gog (default), gws, or native (see Credentials)
- Drafts run on your fine-tuned local model by default (Qwen + your LoRA, served warm); the cloud is only a cold-start before your model is trained, or a fallback
- Optional runtime path override:
YOUOS_DATA_DIR
Credentials and configuration
- Required: a Google ingestion backend for Gmail/Docs —
gog (default), gws, or native (youos[google] + OAuth); set ingestion.google_backend
- Optional: Claude CLI/API credentials only for the cold-start/fallback (
review.draft_model / model.fallback)
- For strict local-only: set
review.draft_model: local and model.fallback: none
Trigger phrases
- "draft a reply to this email"
- "write this email for me"
- "how would I respond to this"
- "what would I say to"
- "help me reply"
- "draft in my style"
- "youos"
- "my email copilot"
- "email copilot"
- "my copilot"
- "generate a draft"
- "reply draft" / "email draft" / "draft reply"
- "compose reply"
- "write a response"
- "email response"
- "how do I usually reply to"
- "reply to this"
- "help me write"
- "write an email"
- "compose a response"
- "email assistant"
- "my writing style"
- "train on my emails"
Requirements
- Apple Silicon Mac (M1/M2/M3/M4) with 8GB+ RAM (16GB recommended) — the local model runs on MLX (
./scripts/install.sh sets it up)
- Python 3.11+
- A Google ingestion backend for Gmail/Docs: gog CLI (default), Google's
gws CLI, or the native Google API (youos[google] + OAuth)
- ~5GB free disk space
- Run the UI locally by default (do not expose publicly unless intentionally secured)
Quick start
# Install (creates .venv, installs YouOS + MLX on Apple Silicon, runs the doctor)
cd youos
./scripts/install.sh
source .venv/bin/activate
# Check system requirements (Python, Google backend, MLX, disk space, etc.)
youos doctor
# Run setup wizard (identity, ingestion, style analysis) — or open /welcome in the browser
youos setup
# Draft a reply (uses your local fine-tuned model by default)
youos draft "paste inbound email here"
youos draft --sender john@company.com "email text"
# Run the web UI (then open /feedback, /stats, /settings, /about)
youos serve
youos service install # or run it as a background service (starts at login)
# Compare the backends on YOUR mail, ranked by how closely each sounds like you
youos compare-models --limit 30 --semantic
# Warm local-model server (loaded once for fast drafting)
youos model server status
# Check status / view stats
youos status
youos stats
# Run the nightly pipeline manually (add --verbose for step-by-step output)
youos improve --verbose
# Golden benchmark (10 curated cases)
youos eval --golden
# Full corpus health report (pairs, quality scores, top senders)
youos corpus
# Ingest a WhatsApp chat export (optional — augments your corpus)
youos ingest --whatsapp ~/Downloads/WhatsApp-Chat.txt
# Add a sender note (immediately rebuilds their profile)
youos note john@company.com "integration partner, prefers bullet points"
# Submit a feedback pair directly from the terminal
youos feedback --inbound "email text" --reply "your reply" --rating 4
# Teardown (remove all data, keep code)
youos teardown
Drafting inside Gmail
Install the YouOS browser extension (Chrome/Edge/Brave) — it lives in the repo's
extension/ folder (homepage),
and the web UI's Gmail page has one-click "Load unpacked" steps. The extension adds a
panel to Gmail:
- Open an email → click the teal ✉ launcher → the panel opens
- Sender + message auto-detected; add an instruction or pick a tone
- Click Generate → drafted in your voice; Insert into Gmail drops it in the reply box
- Rate 1–5 and Submit feedback — YouOS learns from it, same as the Review Queue
A bookmarklet remains as a no-install fallback (it can break when Gmail changes its markup;
the extension doesn't).
How it works
- Ingests Gmail, Google Docs, WhatsApp exports — plus organic pairs from emails you sent without YouOS
- Builds a retrieval index — BM25 + query expansion + semantic (LRU-cached) + multi-intent + per-account isolation + same-thread 2× + subject + topic signals + sender-type boosts + quality scores + relative confidence thresholds
- When you ask for a draft: detects multi-intent, retrieves score-ranked thread-deduplicated exemplars (reply preserved 600 chars, inbound trimmed 400), prompt token budget enforced; generates with per-mode persona + first-name greeting on your fine-tuned local model by default (Qwen + your LoRA, served warm via
mlx_lm.server so it's fast and on-device). The cloud is only a cold-start (before your model is trained) or a fallback; a per-draft model badge + the Stats "Drafting with" row always show which model actually ran
- Every email you review trains the model further — curriculum-ordered, quality-filtered, training pairs deduplicated by similarity, DPO pairs supported; nightly pipeline skips steps when data insufficient
- Nightly: ingests + organic pairs, incremental persona re-analysis (90-day weighted, EWMA avg words, p25/p75 confidence intervals), fine-tunes (with golden eval check), runs autoresearch on rotating benchmark sample
- Autoresearch benchmarks rotate weekly (seeded re-sample) — prevents overfitting to fixed test cases; golden eval composite tracked in pipeline log
- Style drift detection: Stats dashboard flags when your writing patterns shift significantly
- Your best-rated, least-edited replies surface higher in future retrievals via quality scoring
- Sender profiles track reply-time patterns and topics;
youos note immediately rebuilds that contact's profile
- Submit feedback from terminal:
youos feedback --inbound "..." --reply "..." --rating 4
- Setup wizard asks for internal domains — accurate sender classification from day one
- Facts store (
/api/facts) — save context about contacts, projects, and preferences; facts are injected into generation prompts automatically for context-aware drafts
- Auto fact extraction — sender notes and feedback notes are parsed automatically on save using 15+ rule patterns (preferences, timezone, schedule, sign-offs, roles, relationships, project metadata); negation-aware with confidence scoring; LLM (Claude CLI) fallback for unstructured notes; fact deduplication/merging on upsert
- Measure it, don't guess —
youos compare-models drafts your held-out replies under each backend and scores them against what you actually wrote (voice-match), so you can verify the local fine-tuned model beats the cloud on your mail
- Readiness gate — a soft "preparing your voice model" banner holds you back from relying on drafts until your model is trained and benchmarked (with a "Run benchmark now" action); drafting still works meanwhile
- Becomes your OS — during setup the app personalizes its name from your first name (e.g. Baher → BaherOS)
Security & privacy notes
- Gmail/Docs ingestion uses your configured Google backend's auth (
gog / gws / native OAuth); review connected accounts before ingestion
- Drafting is on-device by default; the cloud is only the cold-start/fallback. If it's used (
review.draft_model: claude or model.fallback: claude), inbound email/context is sent to Claude for that draft
- For strict local-only operation, set
review.draft_model: local and model.fallback: none in youos_config.yaml
- Data location defaults to local instance paths under
YOUOS_DATA_DIR (e.g. ~/YouOS-Instances/<you>/), or the repo's var/
- Review
PRIVACY.md before first ingestion/deployment
Provenance
1---2name: youos3description: YouOS — local-first personal email copilot that learns your writing style from Gmail, Google Docs, and WhatsApp exports, then drafts replies in your voice. Use for drafting replies, reviewing how you usually respond, and running a self-improving personal communication workflow.4---56# YouOS — Personal Email Copilot78YouOS is a full local Python app (not an instruction-only snippet). It drafts email replies in your style, grounded in your real past replies.910**Naming:** *YouOS* is the shared app/package. During setup it personalizes its name to *<First>OS* (e.g. **BaherOS**) for **your local instance** at `YOUOS_DATA_DIR=~/YouOS-Instances/<you>/` — that's a local config/data directory, not a fork of the project.1112## Safety & impact1314Read these before installing:1516- **Sensitive data ingested locally.** YouOS reads your Gmail (sent + threads), Google Docs, and optional WhatsApp exports into a local SQLite DB. This stays on your machine, but it *is* sensitive content — protect the data directory (`YOUOS_DATA_DIR/var/youos.db`) accordingly.17- **Installation runs local package code.** `./scripts/install.sh` builds a `.venv` and installs this repository — review the source (especially `scripts/install.sh`, `pyproject.toml`, `app/`) before running.18- **Background persistence is opt-in.** YouOS only runs as a launchd LaunchAgent if you explicitly run `youos service install`. Foreground `youos serve` does not persist.19- **Scheduled/nightly runs are opt-in.** Ingestion, fine-tuning, and autoresearch only run automatically if you've enabled the nightly pipeline; `youos improve` is the manual equivalent.20- **External model fallback is optional.** Drafting is on-device by default. Cloud fallback only fires if `review.draft_model` or `model.fallback` is set to a cloud model — set `model.fallback: none` and `review.draft_model: local` for strict local-only operation.2122## Install and runtime model2324- Install is **manual**: run `./scripts/install.sh` (Python 3.11+) — it creates a `.venv`, installs YouOS, sets up the on-device model (**MLX**) on Apple Silicon, and runs the doctor25- Note: this executes local package install code from this repository; review source before installing26- Requires `python3` (3.11+) and a Google ingestion backend — `gog` (default), `gws`, or native (see Credentials)27- Drafts run on your **fine-tuned local model by default** (Qwen + your LoRA, served warm); the cloud is only a cold-start before your model is trained, or a fallback28- Optional runtime path override: `YOUOS_DATA_DIR`2930## Credentials and configuration3132- Required: a Google ingestion backend for Gmail/Docs — `gog` (default), `gws`, or native (`youos[google]` + OAuth); set `ingestion.google_backend`33- Optional: Claude CLI/API credentials only for the cold-start/fallback (`review.draft_model` / `model.fallback`)34- For strict local-only: set `review.draft_model: local` and `model.fallback: none`3536## Trigger phrases3738- "draft a reply to this email"39- "write this email for me"40- "how would I respond to this"41- "what would I say to"42- "help me reply"43- "draft in my style"44- "youos"45- "my email copilot"46- "email copilot"47- "my copilot"48- "generate a draft"49- "reply draft" / "email draft" / "draft reply"50- "compose reply"51- "write a response"52- "email response"53- "how do I usually reply to"54- "reply to this"55- "help me write"56- "write an email"57- "compose a response"58- "email assistant"59- "my writing style"60- "train on my emails"6162## Requirements6364- Apple Silicon Mac (M1/M2/M3/M4) with 8GB+ RAM (16GB recommended) — the local model runs on MLX (`./scripts/install.sh` sets it up)65- Python 3.11+66- A Google ingestion backend for Gmail/Docs: [gog CLI](https://github.com/openclaw/gog) (default), Google's `gws` CLI, or the native Google API (`youos[google]` + OAuth)67- ~5GB free disk space68- Run the UI locally by default (do not expose publicly unless intentionally secured)6970## Quick start7172```bash73# Install (creates .venv, installs YouOS + MLX on Apple Silicon, runs the doctor)74cd youos75./scripts/install.sh76source .venv/bin/activate7778# Check system requirements (Python, Google backend, MLX, disk space, etc.)79youos doctor8081# Run setup wizard (identity, ingestion, style analysis) — or open /welcome in the browser82youos setup8384# Draft a reply (uses your local fine-tuned model by default)85youos draft "paste inbound email here"86youos draft --sender john@company.com "email text"8788# Run the web UI (then open /feedback, /stats, /settings, /about)89youos serve90youos service install # or run it as a background service (starts at login)9192# Compare the backends on YOUR mail, ranked by how closely each sounds like you93youos compare-models --limit 30 --semantic9495# Warm local-model server (loaded once for fast drafting)96youos model server status9798# Check status / view stats99youos status100youos stats101102# Run the nightly pipeline manually (add --verbose for step-by-step output)103youos improve --verbose104105# Golden benchmark (10 curated cases)106youos eval --golden107108# Full corpus health report (pairs, quality scores, top senders)109youos corpus110111# Ingest a WhatsApp chat export (optional — augments your corpus)112youos ingest --whatsapp ~/Downloads/WhatsApp-Chat.txt113114# Add a sender note (immediately rebuilds their profile)115youos note john@company.com "integration partner, prefers bullet points"116117# Submit a feedback pair directly from the terminal118youos feedback --inbound "email text" --reply "your reply" --rating 4119120# Teardown (remove all data, keep code)121youos teardown122```123124## Drafting inside Gmail125126Install the **YouOS browser extension** (Chrome/Edge/Brave) — it lives in the repo's127`extension/` folder ([homepage](https://github.com/DrBaher/youos/tree/main/extension)),128and the web UI's Gmail page has one-click "Load unpacked" steps. The extension adds a129panel to Gmail:130- Open an email → click the teal ✉ launcher → the panel opens131- Sender + message auto-detected; add an instruction or pick a tone132- Click **Generate** → drafted in your voice; **Insert into Gmail** drops it in the reply box133- Rate 1–5 and **Submit feedback** — YouOS learns from it, same as the Review Queue134135A bookmarklet remains as a no-install fallback (it can break when Gmail changes its markup;136the extension doesn't).137138## How it works1391401. Ingests Gmail, Google Docs, WhatsApp exports — plus organic pairs from emails you sent without YouOS1412. Builds a retrieval index — BM25 + query expansion + semantic (LRU-cached) + multi-intent + per-account isolation + same-thread 2× + subject + topic signals + sender-type boosts + quality scores + relative confidence thresholds1423. When you ask for a draft: detects multi-intent, retrieves score-ranked thread-deduplicated exemplars (reply preserved 600 chars, inbound trimmed 400), prompt token budget enforced; generates with per-mode persona + first-name greeting on your **fine-tuned local model by default** (Qwen + your LoRA, served warm via `mlx_lm.server` so it's fast and on-device). The cloud is only a cold-start (before your model is trained) or a fallback; a per-draft model badge + the Stats "Drafting with" row always show which model actually ran1434. Every email you review trains the model further — curriculum-ordered, quality-filtered, training pairs deduplicated by similarity, DPO pairs supported; nightly pipeline skips steps when data insufficient1445. Nightly: ingests + organic pairs, incremental persona re-analysis (90-day weighted, EWMA avg words, p25/p75 confidence intervals), fine-tunes (with golden eval check), runs autoresearch on rotating benchmark sample1456. Autoresearch benchmarks rotate weekly (seeded re-sample) — prevents overfitting to fixed test cases; golden eval composite tracked in pipeline log1467. Style drift detection: Stats dashboard flags when your writing patterns shift significantly1478. Your best-rated, least-edited replies surface higher in future retrievals via quality scoring1489. Sender profiles track reply-time patterns and topics; `youos note` immediately rebuilds that contact's profile14910. Submit feedback from terminal: `youos feedback --inbound "..." --reply "..." --rating 4`15011. Setup wizard asks for internal domains — accurate sender classification from day one15112. Facts store (`/api/facts`) — save context about contacts, projects, and preferences; facts are injected into generation prompts automatically for context-aware drafts15213. Auto fact extraction — sender notes and feedback notes are parsed automatically on save using 15+ rule patterns (preferences, timezone, schedule, sign-offs, roles, relationships, project metadata); negation-aware with confidence scoring; LLM (Claude CLI) fallback for unstructured notes; fact deduplication/merging on upsert15314. Measure it, don't guess — `youos compare-models` drafts your held-out replies under each backend and scores them against what you actually wrote (voice-match), so you can verify the local fine-tuned model beats the cloud on your mail15415. Readiness gate — a soft "preparing your voice model" banner holds you back from relying on drafts until your model is trained **and** benchmarked (with a "Run benchmark now" action); drafting still works meanwhile15516. Becomes *your* OS — during setup the app personalizes its name from your first name (e.g. Baher → BaherOS)156157## Security & privacy notes158159- Gmail/Docs ingestion uses your configured Google backend's auth (`gog` / `gws` / native OAuth); review connected accounts before ingestion160- Drafting is on-device by default; the cloud is only the cold-start/fallback. If it's used (`review.draft_model: claude` or `model.fallback: claude`), inbound email/context is sent to Claude for that draft161- For strict local-only operation, set `review.draft_model: local` and `model.fallback: none` in `youos_config.yaml`162- Data location defaults to local instance paths under `YOUOS_DATA_DIR` (e.g. `~/YouOS-Instances/<you>/`), or the repo's `var/`163- Review `PRIVACY.md` before first ingestion/deployment164165## Provenance166167- Source/homepage: https://github.com/DrBaher/youos168- This skill bundles a full local Python app and is intended for explicit local install/review before use.