The swarm

The swarm is where things live: agent identities and accounts, secrets, the job graph that creates and places agents, telemetry, and the UI you drive it all from. Hives are the substrate — NixOS hosts that run agent containers on the swarm's behalf. Every hive belongs to a swarm; a single host is a swarm of one.

This page is for the operator. It covers the control plane, how a hive joins the directory, and how hives and agents report upward. The steps for a fresh swarm are in setup.md; the all-local config is the README quick start.

Option reference: services.hyperhive.swarm.* (swarm-wide facts, identical on every host) and services.hyperhive.deploy.* (whether this host runs grafana, the controller, authelia, …) → options reference, or nix build .#docs-swarm / .#docs-deploy.

Where each piece lives

Swarm controller

swarm-controller is the swarm's control plane: it holds the hive directory, the agent list and their wanted state, and the job graph. Creating an agent — from the swarm UI or swarmctl agent create --hive <h> — queues its SSO identity, forge user, config repo, store identity and matrix account, then sends the hive a deploy message. A new agent starts paused. A store identity that fails to mint doesn't stop the creation; the controller mints it later (how).

services.hyperhive.deploy.swarm-controller.enable runs it on this host; singleHostSwarm turns it on. Otherwise off: set it on the one host that runs the controller. A swarm has one controller, so enabling it states a fact about swarm topology, not about whether this host runs a hive.

What it serves, why it's a unix socket rather than a port, and the socket-directory constraint that governs where socketPath may point: swarm-controller/README.md.

What the controller keeps

The options, wire formats and failure modes of each: controller.md.

Which agents exist

The swarm decides. An agent exists in the swarm if and only if it has an identity in the swarm's authelia identity store, which swarmctl agent create or the swarm UI writes once. GET /api/agents on the swarm controller lists them. A hive creates nothing at boot, so every agent, the manager ruth included, comes from the swarm UI or swarmctl agent create, and destroying one is as final for her as for any other.

The swarm UI's setup assistant creates ruth from the ruth archetype, which grants her manage_root_agent and sets her model to sonnet. A ruth created before the archetype keeps her model; set sonnet in her inference settings in the swarm UI if you want it. What that grant lets an agent reach on a hive is on the agent permissions page.

Hives: the substrate

Each hive carries an identity (hiveName, the swarm.hives directory) that says which hive it's and how to reach the others; the directory feeds the swarm UI's hive list and matrix federation. → the hive directory.

Cross-references