Inspiration
When floods or storms knock out the phone network, rescuers are often still close to the people who need help. What they lose is contact with dispatch. A system built around one central controller stops working at exactly that moment. The Neptune North brief asked for systems that keep working together when communications are interrupted, so we built a rescue swarm that has no controller to lose.
What it does
HIVE simulates a flooded Manchester (an 8×8 grid across 8 districts) with hidden survivors. Seven independent actors find and rescue them:
- 4 drones search with a wide sensor and act as local receivers for distress texts. A text only reaches HIVE if a drone is in range of the sender.
- 3 rescue teams bid for rescue tasks, travel to them and carry them out. Each has its own short-range sensor, so even a fully isolated boat can still help the people it can see.
- Distress texts like "stuck on roof w/ 2 kids near Piccadilly, water rising" are turned into structured, provisional tasks by Claude. A regex parser with a district gazetteer takes over if the AI is slow or down, and a sensor has to confirm the task before it counts.
Press BLACKOUT and the network splits into islands. Every island keeps searching and rescuing on its own. When links come back, the actors gossip the events they missed, resolve conflicting claims and converge on one shared picture.
All seven actors maximise one shared score:
$$\text{score} = \sum_{\text{rescued}} \text{urgency} \times e^{-t_{\text{rescue}}/\tau}$$
How HIVE answers the tracks
Neptune North: "Actors work better together"
The brief asks for systems that work together in a distributed fashion even when communications are interrupted. Each judging criterion maps to a working mechanism and an automated check.
- Working towards a common goal. All seven actors maximise the same mission score, and each actor's local bid uses the same terms (urgency, travel time, load), so a good choice for one actor is a good choice for the swarm. Roles are complementary: a drone finds a survivor, a team rescues them. Neither saves anyone alone.
- Independent decision-making. There is no dispatcher, no leader election and no vote. Each actor reads only its own sensor, keeps its own event log, version vector and bid table, and builds its own CBBA bundle. Peers resolve conflicts with the same deterministic rules, so they reach the same answer without anyone imposing it. The dashboard shows each actor's own belief side by side, so you can watch them agree, or disagree during a split.
- Resilience when communications fail. Outages are real failed connections through a chaos proxy, not a status flag. Islands keep running CBBA among reachable peers, an isolated boat still rescues who it can see, replayed or reordered messages have no effect, and when links return anti-entropy gossip sends only the missing events until everyone converges. A restarted actor rebuilds from its persisted log without repeating a rescue.
- Something we're excited about. Real distributed-systems ideas (CBBA, version vectors, grow-only CRDTs, idempotent actions, the actor model) applied to a problem that matters, plus a benchmark against naive and strong central dispatchers that could have proved us wrong.
n8n: seven independent n8n brains
n8n isn't a wrapper around a script here, it is the actor runtime. Each of the seven actors is its own self-hosted n8n 2.x instance with its own database, execution queue and canvas, all running byte-identical workflows. N8N_CONCURRENCY_PRODUCTION_LIMIT=1 turns each instance into a true single-threaded actor, a build-time lint stops any workflow from calling a "god view" endpoint, and a small emulator runs the real workflow JSON in npm test so the wiring is checked without Docker.
Claude
hive-interpret sends messy distress texts to Claude Haiku 5.5 through an n8n HTTP Request node with a strict timeout. The output is clamped (urgency 1 to 5) and stays provisional until a drone's sensor confirms it. If Claude is slow or down, a regex parser with a district gazetteer takes over, which still placed at least 15 of 20 texts correctly.
How we built it
- n8n is the actor runtime. Each actor is its own self-hosted n8n 2.x instance with its own database and its own canvas, running byte-identical workflows:
hive-tick(sense, allocate, act),hive-gossip(anti-entropy every 4 s),hive-merge(dedupe and resolve conflicts) andhive-interpret(Claude Haiku 5.5 with a regex fallback). The only difference between drone-1 and team-3 is the role their store reports. - Task allocation with CBBA (Consensus-Based Bundle Algorithm). Each actor scores tasks locally on urgency, travel time and load, builds its own bundle and resolves conflicts with peers using the same deterministic rules. No auctioneer, no leader election, no vote.
- Eventual consistency. Append-only event logs with
(actor_id, seq)IDs, version vectors, anti-entropy gossip and grow-only sets for searched and rescued cells. Dropped, duplicated and reordered messages are all harmless. - Real network failures. Every actor sits on its own private Docker network and can only reach peers through a chaos proxy that can cut, drop, delay, duplicate or reorder messages.
check-isolation.shproves nobody can bypass it. - One brain, two runtimes. All decision logic is a pure JS core injected into the n8n Code nodes at build time. The same code runs in the unit tests and the headless benchmark, so the benchmark measures what the live actors actually run.
- A build-time lint that enforces decentralisation. The workflow build fails if any node calls a "god view" endpoint like
/worldor/metrics. An actor can't be built to cheat. - Node.js stores using
node:sqlite, a vanilla JS dashboard with a map and per-actor belief views, and Docker Compose for the whole stack.
The benchmark
We didn't want to just claim decentralisation is better, so we built a benchmark that could prove us wrong. HIVE runs against a naive and a strong central dispatcher on the same seeds, actors and outages. Across a connectivity sweep (10 seeds each), HIVE's mean score stayed at 88.7 with half the links down and 84.9 with three quarters down, while central dispatch fell to 70.3 and 20.4. With every link fully up, central is slightly ahead (90.7 vs 90.2), and we report that too.
Challenges we ran into
- n8n's isolated task runner meant Code nodes couldn't reliably use npm modules or
process.env. We moved all state and config into a per-actor store sidecar reached over HTTP, which is also what keeps the workflows identical. - Keeping each actor single-threaded. We set
N8N_CONCURRENCY_PRODUCTION_LIMIT=1so tick, gossip and merge never overwrite each other, with the store rejecting stale writes (HTTP 409) as a backstop. - Seven n8n instances on one laptop. Seven simultaneous cold boots never finished on 8 GB of RAM. Staggering them behind readiness checks got the stack up in under 6 minutes at about 350 MiB each.
- Being honest about the CAP trade-off. Two disconnected islands can send boats to the same roof. Rather than hide it, we log duplicate commitments and wasted travel, and the simulator rescues each survivor exactly once.
Accomplishments that we're proud of
Every row of our acceptance table (agreement, islands rescuing independently, convergence within 10 gossip rounds, replay safety, restart recovery, isolation) is an automated check, shown to pass on a correct run and fail on a deliberately broken one. The fallback parser alone placed at least 15 of 20 distress texts correctly with no AI at all.
What we learned
Real distributed-systems ideas (CBBA, version vectors, CRDTs, idempotent actions) map surprisingly well onto a physical rescue problem, and a workflow tool like n8n can be a genuine actor runtime once you treat each instance as an isolated process with its own state.
What's next for HIVE
Run the full end-to-end and acceptance suites against the live Docker stack, rerun the benchmark matrix for headline numbers, and try more realistic geography and actor counts.
Built With
- anthropic
- claude
- docker
- javascript
- n8n
- node.js
- sqlite