-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Hive mind mechanics for agents.
Most things called a hive mind are fan-out with a prompt attached: wake N agents, collect N replies, reduce them somehow. That arrangement has no notion of who is convinced, no way to register a grounded objection, no reason to stop other than running out of members, and nothing to say afterwards about why the group chose what it chose.
Colonies solve exactly that problem with no leader and no shared memory, and the mechanisms they use have names. This library implements them: stigmergic traces, pheromone decay, quorum sensing, cross-inhibition, and response thresholds, all as fixed-point integer folds over a transcript the host already owns. Further reading has the sources; the Glossary has the vocabulary.
It is a Rust workspace of three crates, with no storage, no HTTP, and no async runtime. Your host owns the log. tinyhivemind answers questions about it.
If you want to know what it is, read Architecture. If you want to wire it into something, start at Quick start and then Host integration. If you are here because somebody claimed a room of agents beats one agent, go straight to Benchmarks, which includes the control most such claims are missing.
tinyhivemind-hive is where the swarm mechanisms live. Agents deposit typed
markers in the transcript, salience decays, support accumulates until an option
carries a quorum, a grounded objection silences an advocate rather than
debiting an option, and whoever bids highest takes the floor. The episode ends
as converged, deadlocked, exhausted, or idle, and never authorizes more than
one speaker at a time.
It is opt-in and pure. There is no port to implement and no arithmetic that does not replay exactly.
The swarm needs a room, so the other two crates own that: who is here, what a
desk is and who sits on it, who @this refers to, and what one participant
sees of a transcript several participants wrote. Each answer is a fold over
data you already hold, and there is no IO anywhere in it.
Five simulated agents choosing between four options, 5000 seeded rooms:
arm turns/ep decided % correct % ns/step
ladder 1.00 100.0 57.6 1109
vote 15.00 100.0 78.5 0
hive 6.16 89.7 73.3 2231
hive+ 6.75 99.4 82.1 2278
A tuned deliberation is right 82.1% of the time in under seven turns. An independent vote given the whole fifteen-turn budget reaches 78.5%. One responder answering alone, which is how most systems behave today, reaches 57.6%. The state machine itself costs about 2.3 microseconds per step.
Benchmarks has the tables behind that, the two bounds on the
quorum threshold, what happens without the blind opening round, and a section
on what none of it shows. The vote row is
self-consistency at a matched budget, which
is the control
Condorcet's jury theorem
says should be hard to beat.
One message triggers one turn. @everyone resolves to a list named in that
turn's context, not to a turn per member. No type in this library can carry two
authorized speakers, so the rule holds by construction rather than by
discipline. See
ADR 0002.
tinyhivemind is GPL-3.0-only. Built by @senamakel.
Start here
The algebra
- Shared medium
- Desks and rosters
- Mentions
- Cross-desk referral
- Transcript projection
- Threads
- Recall
- Responder ladder
Hive mechanics
Working on it
Reference