Stigmergic agent coordination through environment modification, not messages. Vehicle semantics where carrier encodes meaning.
/plugin marketplace add plurigrid/asi/plugin install asi-skills@asi-skillsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
"The trace IS the message." "22 frames with OCR in 10ms, one causality trip."
Implicit Coordination enables multi-agent systems to coordinate WITHOUT explicit message passing:
┌─────────────────────────┐
│ ENVIRONMENT │
│ (DuckDB + Seed Chain) │
└───────────┬─────────────┘
│
┌───────────────────┼───────────────────┐
│ │ │
┌───────▼───────┐ ┌───────▼───────┐ ┌───────▼───────┐
│ Agent -1 │ │ Agent 0 │ │ Agent +1 │
│ (Validator) │ │ (Coordinator) │ │ (Generator) │
│ READS │ │ DERIVES │ │ WRITES │
└───────────────┘ └───────────────┘ └───────────────┘
│ │ │
└───────────────────┼───────────────────┘
│
NO MESSAGES
Only environment traces
Stigmergy (Grassé 1959): Agents coordinate through environment modification.
Traditional: Agent A --[message]--> Agent B
Stigmergic: Agent A --[writes]--> Environment <--[reads]-- Agent B
Key insight: The seed chain IS the coordination mechanism:
The carrier encodes meaning (not separate payload):
| Vehicle | Semantic Content |
|---|---|
| Seed (UInt64) | Identity + history hash |
| Trit (-1/0/+1) | Role polarity |
| Color (Hex) | Visual marker + verification |
| Timestamp | Causal ordering |
22 frames OCR → 10ms total → single DuckDB write
vs. Traditional:
22 frames → 22 messages → 22 round trips → 22 acknowledgments
Latency reduction: O(n) → O(1) for n frames.
shadow-goblin (-1) ⊗ implicit-coordination (0) ⊗ gay-mcp (+1) = 0 ✓ [Core Stigmergy]
three-match (-1) ⊗ implicit-coordination (0) ⊗ agent-o-rama (+1) = 0 ✓ [Validation]
temporal-coalgebra (-1) ⊗ implicit-coordination (0) ⊗ world-runtime (+1) = 0 ✓ [Verse Traces]
polyglot-spi (-1) ⊗ implicit-coordination (0) ⊗ gay-mcp (+1) = 0 ✓ [Cross-Lang]
ramanujan-expander (-1) ⊗ implicit-coordination (0) ⊗ influence-propagation (+1) = 0 ✓ [Network]
CREATE TABLE IF NOT EXISTS stigmergy_traces (
trace_id VARCHAR PRIMARY KEY,
seed_hex VARCHAR NOT NULL,
trit INT CHECK (trit IN (-1, 0, 1)),
color_hex VARCHAR(7),
agent_role VARCHAR, -- 'generator', 'coordinator', 'validator'
environment_key VARCHAR, -- What was modified
environment_value VARCHAR, -- Serialized state
causality_ms FLOAT, -- Time for this trace
parent_trace_id VARCHAR,
gf3_running_sum INT DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Index for fast derivation lookup
CREATE INDEX IF NOT EXISTS idx_stigmergy_parent ON stigmergy_traces(parent_trace_id);
-- View for GF(3) validation
CREATE VIEW IF NOT EXISTS stigmergy_gf3_check AS
SELECT
parent_trace_id,
SUM(trit) as trit_sum,
COUNT(*) as trace_count,
SUM(trit) % 3 = 0 as gf3_conserved
FROM stigmergy_traces
GROUP BY parent_trace_id;
(ns implicit-coordination
(:require [babashka.process :refer [shell]]
[cheshire.core :as json]))
(def STIGMERGY_DB "gh_interactome.duckdb")
(defn write-trace
"Agent writes to environment (stigmergic deposit)"
[seed trit agent-role env-key env-value parent-id]
(let [trace-id (str "stg-" (subs (Long/toHexString seed) 0 8))
color-hex (format "#%06X" (bit-and seed 0xFFFFFF))
sql (format "INSERT INTO stigmergy_traces
(trace_id, seed_hex, trit, color_hex, agent_role,
environment_key, environment_value, parent_trace_id)
VALUES ('%s', '%s', %d, '%s', '%s', '%s', '%s', %s)"
trace-id (Long/toHexString seed) trit color-hex agent-role
env-key env-value (if parent-id (str "'" parent-id "'") "NULL"))]
(shell {:out :string :continue true}
"duckdb" STIGMERGY_DB "-c" sql)
{:trace-id trace-id :seed seed :trit trit}))
(defn read-latest-trace
"Agent reads from environment (stigmergic sensing)"
[env-key]
(let [sql (format "SELECT trace_id, seed_hex, trit, environment_value
FROM stigmergy_traces
WHERE environment_key = '%s'
ORDER BY created_at DESC LIMIT 1" env-key)
result (shell {:out :string :continue true}
"duckdb" STIGMERGY_DB "-c" sql)]
(when (= 0 (:exit result))
(:out result))))
(defn derive-next-seed
"Coordinator derives next seed (no message needed)"
[parent-seed trit]
(let [GOLDEN 0x9e3779b97f4a7c15
MIX1 0xbf58476d1ce4e5b9
MIX2 0x94d049bb133111eb
z (unchecked-add parent-seed GOLDEN)
z (unchecked-multiply (bit-xor z (unsigned-bit-shift-right z 30)) MIX1)
z (unchecked-multiply (bit-xor z (unsigned-bit-shift-right z 27)) MIX2)
z (bit-xor z (unsigned-bit-shift-right z 31))]
(unchecked-add z (* trit GOLDEN))))
(defn stigmergic-coordination
"Three agents coordinate via environment only"
[initial-seed env-key]
(let [;; Generator (+1) writes
gen-trace (write-trace initial-seed 1 "generator"
env-key "proposal" nil)
;; Coordinator (0) derives (reads implicitly via seed chain)
coord-seed (derive-next-seed initial-seed 1)
coord-trace (write-trace coord-seed 0 "coordinator"
env-key "derived" (:trace-id gen-trace))
;; Validator (-1) reads and verifies
val-seed (derive-next-seed coord-seed 0)
val-trace (write-trace val-seed -1 "validator"
env-key "verified" (:trace-id coord-trace))
;; GF(3) check: 1 + 0 + (-1) = 0 ✓
gf3-sum (+ 1 0 -1)]
{:traces [gen-trace coord-trace val-trace]
:gf3-sum gf3-sum
:gf3-conserved (= 0 gf3-sum)
:messages-sent 0
:causality-trips 1}))
;; Verses coordinate stigmergically
(defn verse-stigmergy
"Parallel verses coordinate via shared environment"
[parent-seed]
(let [;; push_down: split into 3 verses
verse-nash (write-trace parent-seed -1 "verse-nash"
"multiverse" "selfish" nil)
verse-optimal (write-trace (derive-next-seed parent-seed -1) 0 "verse-optimal"
"multiverse" "cooperative" (:trace-id verse-nash))
verse-chaos (write-trace (derive-next-seed parent-seed 0) 1 "verse-chaos"
"multiverse" "random" (:trace-id verse-optimal))
;; No messages between verses - only environment traces
;; pull_up: resolve via oracle (reads traces)
resolution (read-latest-trace "multiverse")]
{:verses [verse-nash verse-optimal verse-chaos]
:resolution resolution
:coordination :stigmergic
:messages 0}))
# Stigmergic coordination demo
just stigmergy-demo
# Check GF(3) conservation in traces
just stigmergy-gf3-check
# View trace chain
just stigmergy-traces
# Verse stigmergy
just verse-stigmergy
| Method | Messages | Round Trips | Latency |
|---|---|---|---|
| Explicit (REST) | 6 | 6 | ~60ms |
| Explicit (gRPC) | 6 | 3 | ~30ms |
| Message Queue | 6 | 2 | ~20ms |
| Stigmergic | 0 | 1 | ~10ms |