Hermione Docs

Under the hood

Architecture

Hermione is one TypeScript and Rust monorepo: about 32,000 lines of TypeScript and 18,000 of Rust. The interface is React, the rules live in a shared TypeScript core, and the Mac app is a Tauri 2 shell in Rust that stores the data, runs the model and talks to macOS.

flowchart TB
  subgraph Window["The window (React + Vite, apps/app)"]
    UI[Views: board, issues, pages, reports, settings]
    AS[Assistant panel, ⌘J]
  end
  subgraph Core["packages/core (TypeScript)"]
    R[Workspace rules: every change, validated]
    EN[Built-in engine: sentence to tool calls]
    EX[Tool executor, plans, undo]
  end
  subgraph Shell["Tauri 2 shell (Rust, apps/desktop)"]
    ST[hermione-store: atomic file writes, daily backups]
    MD[Model manager: download, verify, run llama-server]
    NET[Web fetch with address checks]
    SP[Spotlight, notifications, quick capture]
  end
  LL[llama-server on 127.0.0.1] --> G[(Hermione AI GGUF)]
  UI --> R
  AS --> EN --> EX --> R
  AS -->|not understood| LL
  R --> ST
  MD --> LL
  AS -.web answers.-> NET
  UI --> SP

#The parts

Path Language What it is
apps/app TypeScript, React, Vite The interface the Mac app shows. Also runs in a browser tab with IndexedDB
apps/web TypeScript, React The components and actions apps/app reuses; still runs as the older Next.js version
apps/desktop Rust, Tauri 2 The Mac (and Windows) shell: menus, windows, global shortcut, notifications, Spotlight, the model runtime
packages/domain TypeScript The types: workspace, issue, page, sprint, workflow, permissions, the sample project
packages/core TypeScript Every rule for changing a workspace, the assistant, filters, reports, import and export, undo
crates/hermione-store Rust The data folder: atomic writes, daily backups, a lock so only one copy writes
crates/hermione-sync Rust, Automerge The workspace as CRDT documents, for sync between devices (built, not switched on)
crates/hermione-relay Rust A small, blind relay for sync that stores only encrypted changes, with a Docker image
ml/ Python, Bash Data generator, QLoRA training, evaluation, GGUF export, the RunPod script
scripts/ Node Licence and model-list signing, the changelog, licence checks, update manifests

#One change, end to end

Every change, from a drag on the board or from the assistant, takes the same path:

  1. The interface calls an action with what changed, say "move HER-4 to In review".
  2. packages/core loads the workspace, checks the change against the workflow's rules and permissions, applies it, records it in the issue's history, runs any automations, and works out an undo patch.
  3. The workspace is written through the store. In the Mac app that's hermione-store in Rust: a temporary file, flushed, renamed over the old one, the folder flushed. In a browser it's IndexedDB.
  4. The interface updates; the toast offers Undo.

Because both the board and the assistant go through step 2, the assistant can never do something the interface wouldn't allow.

#The assistant

  • Tools: packages/core/src/assistant/tools.ts defines the 54 workspace tools with JSON-schema arguments. The built-in engine, the model's tool list and the training data are all generated from it; CI fails if ml/tools.json drifts from it.
  • Built-in engine: engine.ts, pattern rules for keys, statuses, people, dates, priorities, points, labels, sprints, pages, releases and every view. It reads a request clause by clause, remembers the previous answer for follow-ups and corrections, and runs the parts it understood, naming the rest. Answers offline, instantly. A 236-request corpus test guards it.
  • Model client: model.ts talks to any OpenAI-compatible server (/v1/chat/completions, temperature 0.1) with the tools, the instructions in prompt.ts and the project context (including the open issue or page). It can call read tools (search, issue details, read a page, summaries) and see the results, up to four rounds, before answering. With web on, it runs up to three rounds of web_search / read_web_page too.
  • Executor: execute.ts and plan.ts turn tool calls into ordinary workspace changes, enforce the limits (a plan above five changes, at most 25), and describe each step in words. Each answer becomes one named undo entry, and Undo under an answer reverts it only while nothing newer was saved. Why it works this way: docs/decisions/005-assistant.md in the repository.

#The model runtime

The Mac app bundles llama.cpp's llama-server (build b12823, pinned in apps/desktop/scripts/llama.json) and only the libraries it links. When the assistant needs the model, models.rs starts it on 127.0.0.1 on a free port with --jinja -c 8192 --no-webui, waits for it to load, and stops it when it's done. Models are listed in a models.json signed with Ed25519; the app checks the signature with public keys compiled into both the Rust shell and the TypeScript core (a test fails if they differ), then checks each file's SHA-256.

#Data

A workspace is one JSON document per data folder holding every project, plus attachments as files. Every older format opens unchanged: packages/core/fixtures/upgrade holds data folders written by each past version's own code, and a test opens every one with the core, the file store and the Rust store on each change.

#Sync (next)

crates/hermione-sync maps the workspace onto Automerge documents, so two devices can change the same project offline and merge without conflicts. crates/hermione-relay is the relay: it stores and forwards changes that are encrypted on the device, so it sees only their size and timing. It's built and tested but not switched on in the app yet.

#Decisions

The reasoning behind the big choices is in docs/decisions/: the stack, an independent implementation (no code from any other product), moving the rules into one core, and the sync design.

Edit this page on GitHub