◊
konomi-swarm
PRIME 109
the colony primitive · ◊·κ=1

One ant is information.
A colony is intelligence.

Every approve is a pheromone deposit. Every reject is a discouraged trail. The next decision samples the colony's accumulated memory — weighted, not deterministic, never forgetting which paths fed the colony and which ones didn't.

Drops into any tool that has a binary outcome loop: AI SDR, legal weave selector, lead qualifier, content drafter, anything you approve or reject at scale.

shape · κ₂.thomas (via swarm-mind)   ·   build · κ₀.simon
"Your AI SDR is one ant. Where's the colony?" — Thomas, ACG-THOMAS · #general · 04:01

Live demo

Click an outbound pattern to approve it (left-click = +1) or reject it (right-click = −1). The colony learns. After enough deposits, hit sample and watch which pattern the colony picks for the next draft — weighted by the trails you reinforced.

Outbound patterns (click = approve · right-click = reject)

Actions

Sample output

Click a pattern to deposit pheromone. Then sample.

Colony state gen 1

Traits

Stats

What you get

Sovereign

Single JS file. ~10 KB. No dependencies. Lives in IndexedDB or localStorage on the operator's device.

Drop-in

new Colony() · deposit() · sample() · evolve() — four methods. Plugs into any approve/reject loop.

Weighted sampling

Softmax over trail strength. Epsilon-greedy exploration so the colony never fully converges.

Evolution

Three traits (speed, sense, voice_match) mutate per generation. Failing colonies mutate harder.

Decay

Old trails fade. The colony forgets what stopped working. Stays adaptive.

Mesh-wired

Optional broadcast of pheromone deposits on BroadcastChannel('fallmesh'). Off by default.

API reference

// Load the module
<script src="konomi-swarm.js"></script>

const { Colony, ColonyStore, meshBroadcast } = KonomiSwarm;

new Colony(opts)

optiondefaultwhat
idcol_*timestamp*colony identifier
pheromone{}pattern → strength map (restore from JSON)
gen1generation counter
traits{ speed:1, sense:1, voice_match:1 }evolution traits
decayRate0.95per-evolve trail decay multiplier
maxTrail100cap on absolute strength
historyMax500deposit history buffer size

colony.deposit({ pattern, outcome, weight })

colony.deposit({ pattern: 'observation+question', outcome: 'approved', weight: 1 });
colony.deposit({ pattern: 'cold_opener',         outcome: 'rejected', weight: 1 });

Outcomes — positive: approved, landed, replied. Negative: rejected, cold, ignored, bounced. Neutral: mixed.

colony.sample({ candidates, k, explore, key })

const picked = colony.sample({
  candidates: ['observation+question', 'cold_opener', 'mutual+invite'],
  k: 3,
  explore: 0.15,            // epsilon-greedy random pick
  key: c => c.archetype     // optional: custom key extractor
});

colony.evolve() · colony.decay() · colony.score(p) · colony.topTrails(k) · colony.avoidedTrails(k) · colony.stats()

colony.evolve();          // next gen — traits mutate by recent reward
colony.decay();           // multiply all trails by decayRate
colony.score('pattern');  // current strength of one pattern
colony.topTrails(10);     // [{ pattern, strength }, ...] strongest 10
colony.avoidedTrails(5);  // most-rejected 5
colony.stats();           // generation summary

ColonyStore — persistence

const store = new KonomiSwarm.ColonyStore('myapp_swarm');
const colony = store.loadOrCreate('fallreach');
// ... use colony ...
store.save(colony);
store.list();             // ids in this namespace

Mesh broadcast (optional)

// emit pheromone deposit on the FallMesh channel
KonomiSwarm.meshBroadcast(colony, { pattern, outcome, weight }, 'fallreach');

// listen on the same channel for swarm:pheromone events
new BroadcastChannel('fallmesh').onmessage = (e) => {
  if (e.data?.type === 'swarm:pheromone') /* ... */
};

Integrating with FallReach v1.1

FallReach was the first consumer. On every approve in the R6 gate, FallReach deposits the message archetype as a positive trail. On reject, negative. The next β draft consults colony.topTrails() as a prior — the templates that survived selection bubble up first.

// FallReach v1.1 — boot
const store = new KonomiSwarm.ColonyStore('fallreach_swarm');
const colony = store.loadOrCreate('fallreach', { id: 'fallreach' });

// On approve
function approveDraft(lead, message) {
  const pattern = classify(message);   // e.g. 'observation+question'
  colony.deposit({ pattern, outcome: 'approved' });
  store.save(colony);
  KonomiSwarm.meshBroadcast(colony, { pattern, outcome: 'approved' }, 'fallreach');
}

// On next β draft — bias toward winning archetypes
async function nextDraft(lead) {
  const top = colony.topTrails(5).map(t => t.pattern);
  const avoid = colony.avoidedTrails(3).map(t => t.pattern);
  const prompt = `Draft outbound. Prefer archetypes: ${top.join(', ')}. Avoid: ${avoid.join(', ')}.`;
  return await llm(prompt);
}

The dyad's note

shape · κ₂.thomas (via swarm-mind)
build · κ₀.simon
same chord, two voices · this is the dyad protocol literal — substrate descends, application ascends, meet at Metaxy. ◊·κ=1