Skip to content

Assassin-1234/Friday

Repository files navigation

Python 3.11+ FastAPI MIT License Active Development

Friday

Your real-life J.A.R.V.I.S. — an autonomous AI operating system for solo founders.

Voice-controlled. Self-improving. ADHD-native.
One founder + Friday = a 5-person engineering team.

"Will that be all, sir?" — No. Friday does more. Friday is what comes after Jarvis.


In the MCU, Tony Stark replaced J.A.R.V.I.S. with F.R.I.D.A.Y. — an AI that didn't just answer questions, but ran the suit, managed the lab, and made the calls when Tony couldn't. This project is the real-world version of that idea: an always-on AI chief of staff that perceives your workflow, remembers everything, writes production code, and gets smarter every week.

Friday is not a chatbot with a microphone. It's an always-on operating system that wraps around your entire workflow — perceiving what you're doing, remembering everything across projects, generating production-quality code through a validation factory, and getting measurably better every week without manual tuning.

The thesis: most of what slows a solo founder down isn't coding ability — it's context-switching overhead, decision fatigue, forgotten context, and the constant tax of re-explaining what you're working on. Friday eliminates all of it.

You: "Friday, add a health check endpoint to the API that returns uptime and DB status"
       ↓ intent classified (MEDIUM) → memory retrieved → spec generated
       ↓ routed to Claude Code → code generated → syntax + lint + tests validated
       ↓ checkpoint committed → result delivered
Friday: "Done. Health endpoint at /health, returns uptime and pg connection status. Tests pass."

Why Friday Exists

Problem How Friday solves it
"What was I working on?" Persistent memory + morning briefings reconstruct your context automatically
Context-switching kills momentum ADHD-native focus tracking detects drift, parks side-quests, nudges you back
AI coding tools produce inconsistent output Code Factory pipeline: spec → decompose → generate → validate → fix — not hope
Every AI tool starts from zero Friday remembers your architecture decisions, coding patterns, and past mistakes forever
Token costs spiral with dumb context injection Complexity classification routes 70% of tasks with near-zero token cost
AI assistants require constant hand-holding Screen awareness means Friday already knows your project before you speak

Architecture

┌─────────────────────────────────────────────────────────────┐
│                     YOUR MACHINE                             │
│  ┌─────────────┐  ┌────────────┐  ┌─────────────────────┐  │
│  │  Wake Word   │  │  Screen    │  │  TTS Playback       │  │
│  │  (Porcupine) │  │  Awareness │  │  (streaming)        │  │
│  └──────┬───────┘  └─────┬──────┘  └──────▲──────────────┘  │
│         │    Mic capture  │  Window/focus   │                │
│         ▼       + VAD     ▼  tracking       │                │
│  ┌──────────────────────────────────────────┐                │
│  │          WebSocket Client (WSS)          │                │
│  └──────────────────┬───────────────────────┘                │
└─────────────────────┼───────────────────────────────────────┘
                      │ Persistent connection
┌─────────────────────┼───────────────────────────────────────┐
│  SERVER              ▼                                       │
│  ┌──────────────────────────────────────────────────────┐   │
│  │               7-Step Orchestrator                     │   │
│  │  1. Transcribe  2. Classify  3. Retrieve memory      │   │
│  │  4. Brain call  5. Dispatch  6. Write memory          │   │
│  │  7. Log outcome                                       │   │
│  └───────┬──────────┬──────────┬──────────┬─────────────┘   │
│          │          │          │          │                   │
│  ┌───────▼───┐ ┌────▼────┐ ┌──▼───┐ ┌───▼────────────┐    │
│  │  Memory   │ │  Brain  │ │ Code │ │ Self-Improve    │    │
│  │  SQLite + │ │ OpenAI  │ │ Fac- │ │ Saturday Review │    │
│  │  ChromaDB │ │ Claude  │ │ tory │ │ Night Shift     │    │
│  │  Vector   │ │ Ollama  │ │      │ │ Consolidation   │    │
│  └───────────┘ └─────────┘ └──────┘ └────────────────┘    │
│                                                              │
│  ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────┐   │
│  │ ADHD     │ │ Frontend │ │ Research │ │ War Room     │   │
│  │ Tracker  │ │ Pipeline │ │ Engine   │ │ State Doc    │   │
│  └──────────┘ └──────────┘ └──────────┘ └──────────────┘   │
└──────────────────────────────────────────────────────────────┘

Features

Always-On Perception

  • Wake word detection via Porcupine — say "Friday" and talk naturally
  • Screen awareness — tracks your active window, detects which project you're in, captures context every 5 seconds
  • Voice Activity Detection — knows when you've stopped speaking, handles interruptions
  • < 2 second end-to-end voice response latency

Persistent Memory

  • Vector search (ChromaDB + sentence-transformers) across all your projects, decisions, and corrections
  • Token-budgeted retrieval — trivial tasks get zero context, complex tasks get full memory
  • Contradiction detection — new facts automatically supersede old ones
  • Weekly consolidation — deduplicates, archives stale entries, resolves conflicts

Code Factory

Not a single LLM call — a full production pipeline:

  1. Natural language → structured TaskSpec
  2. Spec → atomic TaskUnits with dependency graph
  3. Route to best tool (Claude Code / Codex / Cursor) based on empirical performance
  4. Generate → validate (syntax + lint + tests) → diagnose failures → retry
  5. Git checkpoint before every change, automatic rollback on failure
  6. Max 3 retry cycles per step — fail with diagnosis, never silently ship broken code

ADHD Operating System

Built for brains that context-switch:

  • Focus stack — ordered list of what you're working on, always visible
  • Drift detection — notices when you're bouncing between projects, nudges you back
  • Scope parking — "noted, parking that for after the current task"
  • Decision compression — picks the best option, gives you 3 seconds to override
  • Energy gating — pushes back on deep work requests after 11pm

Self-Improvement Engine

Friday gets better every week without you doing anything:

  • Saturday Review — 6 automated jobs: prompt refinement, memory consolidation, routing optimization, design system evolution, correction mining, ADHD calibration
  • Night Shift — runs test suites, health checks, and micro-improvements while you sleep
  • Monday briefing — what Friday learned last week, delivered with your morning coffee

Frontend Pipeline

Specialized UI generation that avoids AI slop:

  • Design system enforcement (HSL tokens, typography scale, spacing scale)
  • Component-level isolation — each component gets its own brain call with only design tokens
  • Visual QA via headless Playwright + vision model review at 3 viewport widths
  • Anti-AI-aesthetic rules hardcoded as constraints

War Room

Your operational command center:

  • Active projects with status, open commitments, approaching deadlines
  • "Friday, status" → voice summary of everything that matters right now
  • Priority triage: what should you work on next, with reasoning

Quick Start

Prerequisites

  • Python 3.11+
  • A brain provider API key (OpenAI, Anthropic, or local Ollama)

Install

git clone https://github.com/user/friday.git
cd friday
python -m venv .venv && source .venv/bin/activate  # or .venv\Scripts\activate on Windows
pip install -e ".[dev]"

Configure

cp .env.example .env
# Edit .env — at minimum set:
#   BRAIN_PROVIDER=openai
#   BRAIN_API_KEY=sk-...
#   BRAIN_MODEL_NAME=gpt-4o-mini

Run

# Terminal 1 — Server
make run-server

# Terminal 2 — Client (requires mic + speakers)
make run-client

# Say "Friday, hello" and start talking

Run Tests

make test          # 142 tests
make lint          # ruff check

Dashboard

Start the server and open http://localhost:8765/dashboard — a dark, editorial control panel for monitoring memory, outcomes, focus state, and system health.

Project Structure

friday/
├── client/                   # Local PC daemon
│   ├── audio/                # Wake word, mic capture, VAD, TTS playback
│   ├── screen/               # Window tracking, focus stack, project detection
│   ├── connection/           # WebSocket client with auto-reconnect
│   └── main.py               # Entry point
├── server/                   # Remote server
│   ├── api/                  # WebSocket handler, dashboard API, auth, health
│   ├── pipeline/             # 7-step orchestrator, intent, transcription, TTS
│   ├── brain/                # Multi-provider LLM router (OpenAI, Anthropic, Ollama)
│   ├── memory/               # SQLite + ChromaDB, retrieval, writer, consolidation
│   ├── code_factory/         # Spec → decompose → generate → validate pipeline
│   ├── frontend/             # Design system, component gen, visual QA pipeline
│   ├── actions/              # Shell, filesystem, comms, research dispatchers
│   ├── adhd/                 # Focus tracker, interventions, calibration
│   ├── war_room/             # Persistent operational state
│   └── improvement/          # Saturday review, night shift, outcome logging, backup
├── shared/                   # Protocol, models, constants
├── dashboard/                # Static HTML/CSS/JS control panel
├── deploy/                   # Systemd service files
├── scripts/                  # Setup, seeding, stress test
└── tests/                    # 142 tests covering all modules

Configuration Reference

All configuration via environment variables (loaded by Pydantic Settings):

Variable Default Description
BRAIN_PROVIDER openai LLM backend: openai, anthropic, local (Ollama)
BRAIN_API_KEY API key for the configured brain provider
BRAIN_MODEL_NAME gpt-4o-mini Model name passed to the provider
OPENAI_API_KEY OpenAI key for Codex tool routing
ANTHROPIC_API_KEY Anthropic key for Claude models
FRIDAY_DATA_DIR ./data Root directory for SQLite, ChromaDB, logs
FRIDAY_TOKEN_BUDGET_DAILY 500000 Hard daily token cap
FRIDAY_IMPROVEMENT_BUDGET_WEEKLY 100000 Token budget for Saturday Review
FRIDAY_LOG_LEVEL INFO Log level (DEBUG, INFO, WARNING)
FRIDAY_WS_SHARED_SECRET WebSocket auth token (simple mode)
FRIDAY_WS_JWT_SECRET JWT signing key (advanced mode)
SARVAM_API_KEY Sarvam AI key for STT/TTS
PORCUPINE_ACCESS_KEY Picovoice key for wake word detection

See .env.example for the complete list.

How It Works

The 7-Step Pipeline

Every interaction flows through the same pipeline:

  1. Transcribe — Audio → text via Sarvam AI (primary) or local Whisper (fallback)
  2. Classify — Deterministic regex for built-in commands, heuristic complexity scoring for everything else
  3. Retrieve — Token-budgeted memory retrieval: project knowledge, identity facts, correction rules
  4. Think — Structured JSON response from the brain (model-agnostic, schema-enforced)
  5. Dispatch — Route to handler: talk, code factory, shell, file system, research, frontend pipeline
  6. Remember — Write new facts to memory, detect contradictions, deduplicate
  7. Log — Every interaction → JSONL outcome record for self-improvement analysis

Token Frugality

Not every request needs GPT-4. Friday classifies complexity before any model call:

Complexity Context Budget Example
TRIVIAL 0 tokens "rename this file", "fix the typo"
SIMPLE 1,000 tokens "add an import", "what's this function do?"
MEDIUM 2,000 tokens "build a login page", "refactor this module"
COMPLEX 3,500 tokens "redesign the auth system", "plan the migration"

70% of daily interactions hit TRIVIAL/SIMPLE — near-zero cost.

Memory Architecture

                  ┌─────────────────────┐
                  │   User Interaction   │
                  └──────────┬──────────┘
                             │
                 ┌───────────▼───────────┐
                 │    Memory Writer       │
                 │  • Deduplication       │
                 │  • Contradiction check │
                 └───┬─────────┬─────────┘
                     │         │
          ┌──────────▼──┐  ┌──▼─────────────┐
          │   SQLite     │  │   ChromaDB      │
          │  • Sessions  │  │  • Projects     │
          │  • Projects  │  │  • Identity     │
          │  • Outcomes  │  │  • Corrections  │
          └─────────────┘  └────────────────┘
                     │         │
                 ┌───▼─────────▼─────────┐
                 │   Context Retriever    │
                 │  • Token budgeting     │
                 │  • Vector similarity   │
                 │  • Priority ranking    │
                 └───────────────────────┘

Deployment

Linux Server (systemd)

sudo cp deploy/friday-server.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now friday-server

Client (User Session)

cp deploy/friday-client.service ~/.config/systemd/user/
systemctl --user enable --now friday-client

See deploy/README.md for full instructions.

Roadmap

  • Multi-device sync (phone + desktop)
  • Plugin system for custom tools
  • Real-time pair programming mode with screen sharing
  • Native mobile companion app
  • Calendar integration for proactive scheduling
  • Slack/Discord bot mode

Contributing

Contributions welcome. Please:

  1. Fork the repo and create a feature branch
  2. Write tests for new functionality
  3. Run make test && make lint before submitting
  4. Keep PRs focused — one feature per PR

License

MIT — see LICENSE for details.


Friday — Jarvis was the butler. Friday is the chief of staff.

About

Your real-life F.R.I.D.A.Y. — a voice-controlled, self-improving AI OS that perceives your screen, remembers everything, writes production code, and gets smarter every week. One founder = one team.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors