Skip to content

AtharvRG/moirai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fractal Logo

Moirai: The Narrative OS for Windows

Weaving the thread of daily action into the narrative of life intent.


License: MIT

Overview

Moirai is a local-first, cloud-augmented resident agent for Windows that transforms passive digital behavior into an actionable life narrative. Unlike traditional productivity tools that demand manual input, Moirai operates as a background chronicler—observing, compressing, and narrating your digital life through the metaphor of the Three Fates from Greek mythology.

Core Paradigm:
Clotho captures the raw moment. Lachesis weaves meaning. Atropos grants you the final cut.

Authors

Architecture

Moirai consists of four primary components, each serving a distinct purpose in the narrative lifecycle:

1. Clotho (The Spinner)

Technology: Go
Role: System capture and telemetry spooling
Location: Background Windows process

Clotho integrates deeply with Windows APIs to capture system activity:

  • UI Automation for window tracking and process monitoring
  • Raw Input API for measuring input velocity (keys/minute, scroll deltas)
  • Windows Graphics Capture for smart screenshots during high-intent activities

Key Features:

  • Privacy-first design: captures velocity metrics, never raw keystrokes
  • Hierarchical storage: organized by Year/Quarter/Week/Day
  • Smart screenshot capture triggered by IDE usage or high-velocity activity

2. Lachesis (The Measurer)

Technology: Go + Groq Role: AI narrative generation and processing
Location: Batch processing service

Lachesis transforms raw telemetry into meaningful narratives:

  • Processes daily activity data from Clotho
  • Integrates with Groq API ( Llama 3.3 versatile and 4 Maverick )
  • Generates narrative summaries and intent classifications
  • Outputs both human-readable markdown and structured JSON

Processing Pipeline:

  1. Reads telemetry data from hierarchical storage
  2. Extracts text from screenshots using Llama Vision
  3. Sends metadata + OCR + historical context to Llama 3.3 Versatile
  4. Receives narrative summary + intent classification
  5. Saves results as daily chronicles

3. Atropos (The Cutter)

Technology: Electron + React + TypeScript
Role: User interface and control center
Location: Desktop application

Atropos provides the visual interface for interacting with your narrative:

  • System tray integration for minimal intrusion
  • Dashboard views for activity chronicles
  • Environmental reshaping (resume threads, cut noise)
  • Real-time data updates via file system watchers
  • Settings management and privacy controls

Features:

  • Chronicle tree visualization (Year/Quarter/Week/Day hierarchy)
  • Activity pulse indicator (productive/scattered/idle)
  • Thread notifications for extended focus sessions
  • One-click thread resumption (restore window states)
  • Chat interface to ask about your past and work on your future
  • Demo mode for testing without real data

4. Aphrodite (The Landing)

Technology: Next.js + React + TypeScript
Role: Marketing website and project showcase
Location: Web application

Aphrodite presents Moirai to the world with a premium, immersive experience:

  • Scroll-driven narrative timeline
  • WebGL-powered visual effects
  • Responsive design with smooth animations (Kind of...Still working on this!)

Project Structure

moirai/
├── clotho/              # System capture service (Go)
│   ├── internal/
│   │   ├── capture/     # Screenshot and screen capture
│   │   ├── config/      # Configuration management
│   │   ├── hooks/       # System event listeners
│   │   ├── storage/     # Hierarchical path management
│   │   ├── telemetry/   # Data collection and storage
│   │   └── worker/      # Background processing
│   ├── go.mod
│   └── main.go
│
├── lachesis/            # Narrative processing engine (Go)
│   ├── internal/
│   │   ├── processor/   # AI integration and analysis
│   │   ├── reader/      # Telemetry data reading
│   │   └── writer/      # Output generation
│   ├── go.mod
│   └── main.go
│
├── atropos/             # Desktop application (Electron)
│   ├── electron/        # Main process and IPC
│   ├── src/
│   │   ├── components/  # React components
│   │   ├── pages/       # Application views
│   │   ├── hooks/       # Custom React hooks
│   │   ├── store/       # Zustand state management
│   │   ├── services/    # API integrations
│   │   └── utils/       # Utility functions
│   └── package.json
│
├── aphrodite/           # Landing page (Next.js)
│   ├── src/
│   │   ├── app/         # Next.js app router
│   │   ├── components/  # React components
│   │   └── hooks/       # Custom hooks
│   └── package.json
│
├── .github/             # GitHub workflows and CI/CD
├── LICENSE
└── project.md           # Detailed project specification

Installation

Prerequisites

  • Windows 10/11 (64-bit) (Windows Only)
  • Go 1.25.7+ (for building Clotho and Lachesis)
  • Node.js 18+ (for building Atropos and Aphrodite)
  • Git

Building from Source

1. Clone the Repository

git clone https://github.com/AtharvRG/moirai.git
cd moirai

2. Build Clotho (System Capture Service)

cd clotho
go mod download
go build -o clotho.exe .
cd ..

3. Build Lachesis (Narrative Processor)

cd lachesis
go mod download
go build -o lachesis.exe .
cd ..

4. Build Atropos (Desktop Application)

cd atropos
npm install
npm run build
npm run electron:build
cd ..

The built application will be in atropos/dist/.

5. Build Aphrodite (Landing Page - Optional, defiinitely optional!)

cd aphrodite
npm install
npm run build
cd ..

Usage

Running Clotho (Background Capture)

./clotho/clotho.exe

Clotho will start capturing system activity and storing telemetry data in:

%LOCALAPPDATA%\Moirai\chronicle\<YEAR>\<QUARTER>\<WEEK>\<DATE>.db

Privacy Controls:

  • Press Ctrl+Shift+End to terminate Clotho and wipe unprocessed data
  • Configure capture settings in %LOCALAPPDATA%\Moirai\config.json

Running Lachesis (Narrative Generation)

./lachesis/lachesis.exe

Lachesis will:

  1. Read today's telemetry data
  2. Process screenshots with Llama Vision
  3. Generate narrative summaries
  4. Save results to the chronicle directory

Output:

  • Markdown narrative: <DATE>_summary.md
  • Structured data: <DATE>_structured.json

Running Atropos (Desktop Application)

Launch the installed application from the Start Menu or run:

cd atropos
npm run electron:dev

Features:

  • View daily chronicles in the Chronicle Tree
  • Monitor real-time activity pulse
  • Resume previous work threads
  • Configure privacy and capture settings
  • Export/import data
  • Enable demo mode for testing

Configuration

Clotho Configuration

Create or edit %LOCALAPPDATA%\Moirai\config.json:

{
  "dataRoot": "%LOCALAPPDATA%\\Moirai\\chronicle",
  "captureInterval": 30,
  "screenshotQuality": 0.7,
  "enableSmartCapture": true,
  "highIntentProcesses": ["code.exe", "devenv.exe", "idea64.exe"],
  "velocityThreshold": 100
}

Lachesis Configuration

Set environment variables for Groq API access(Temporary method):

$env:GROQ_API_KEY="your_actual_groq_key_here

Atropos Configuration

Settings are managed through the application UI:

  • System Tray → Settings
  • Configure API keys, auto-launch, data paths, and privacy options

Privacy & Security

Moirai is designed with privacy as a core principle:

Local-First Promise

  • Raw keystrokes are NEVER stored (only velocity metrics)
  • Screenshots are processed locally before any cloud transmission
  • The Redaction Layer strips File path using regex and window detection
  • All raw data stays on your machine

Cloud Integration

Groq only receives:

  • Redacted screenshots (optional, user-toggleable) (Working on this!)
  • Process names (e.g., "code.exe")
  • Window title hashes (not raw titles for sensitive apps)
  • Velocity vectors

Permission Model

  • Windows UI Access (for cross-window title reading)

Data Lifecycle

1. The Gasp (Real-Time)

Every 30 seconds, Clotho writes to local:

timestamp | process | window_hash | kps | scroll_vel | thread_id

2. The Visual Gasp (Smart Capture)

Triggered when process == code.exe OR velocity > threshold:

  • JPEG screenshot (quality 0.7)
  • Stored in hierarchical folder structure
  • Redaction layer applied before transmission

3. The Weaving (Batch Processing)

Every 5-10 minutes (configurable):

  1. Llama Vision extracts text from screenshots
  2. Llama 4 Maverick receives: metadata + OCR + historical context
  3. Returns: narrative summary + intent classification

4. The Chronicle (Storage)

  • Hot Data: Last 7 days (raw spool + screenshots)
  • Compressed: Daily summaries after 7 days (narrative text only)
  • Archived: Quarterly compression to cold storage

Development

Running in Development Mode

Clotho

cd clotho
go run main.go

Lachesis

cd lachesis
go run main.go

Atropos

cd atropos
npm run electron:dev

Aphrodite

cd aphrodite
npm run dev

Testing

Go Components

cd clotho
go test ./...

cd ../lachesis
go test ./...

Electron Application

cd atropos
npm run lint
npm run build

Roadmap

Current Scope (MVP)

  • Windows process monitoring and velocity tracking
  • Smart screenshot capture
  • Groq integration for OCR and narrative generation
  • Hierarchical Chronicle storage
  • Environmental reshaping (resume/cut threads)
  • Electron-based system tray interface

Future Enhancements (V2)

  • Cross-device sync
  • Local LLM inference (offline mode)
  • Mobile App integration
  • Collaborative/shared narratives
  • Advanced analytics and insights
  • Custom intent classification models

Contributing

Contributions are welcome! Please follow these guidelines:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Commit Convention

We follow conventional commits:

  • feat: - New features
  • fix: - Bug fixes
  • docs: - Documentation changes
  • style: - Code style changes (formatting, etc.)
  • refactor: - Code refactoring
  • perf: - Performance improvements
  • test: - Test additions or modifications
  • chore: - Build process or auxiliary tool changes

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Inspired by the Greek mythology of the Three Fates (Moirai)
  • Built with modern web and systems programming technologies
  • Powered by Groq and Llama

Support

For issues, questions, or feature requests:

Philosophy

Moirai does not manage your time. It reveals the story of how you spend it.

The system embraces "epistolary latency"—rather than interrupting you with real-time suggestions, it observes for 5-10 minutes before weaving a narrative summary. This transforms the AI from an intrusive assistant into a perceptive diarist, someone who reflects rather than reacts.

If the narrative feels wrong, you simply cut it. No damage done.

About

Moirai is a lightweight, local-first Agentic OS designed to unify a developer's workflow

Resources

License

Stars

Watchers

Forks

Contributors