A zero-daemon, zero-broker Python library (v0.1.0) that coordinates distributed agent workers through continuous lazy exponential pheromone decay, ACO Boltzmann softmax routing, K-Origin Anti-Sybil quorum circuit breaking, and structural antigen fingerprinting over SQLite WAL and Redis Lua.
Engineered to prevent cascading upstream outages, synchronized half-open thundering herds, single-worker Sybil false trips, and positive trail poisoning from hallucinated responses.
Attractive (tau_pos) and repulsive alarm (tau_neg) pheromones evaporate continuously via exact closed-form exponential decay evaluated inline at read and write time. Zero background sweeper threads, zero cron jobs, and zero idle CPU overhead.
Candidate routes are sampled via numerically stable log-sum-exp Boltzmann softmax combining effective pheromone score and prior heuristics with an exploration floor (epsilon) that enables smooth, autonomous self-healing as alarm traces evaporate.
Protects shared routes with a three-state immune state machine (HEALTHY, SOFT_THROTTLE, HARD_QUARANTINE). Entering HARD_QUARANTINE requires both high repulsive pheromone and confirmation from at least K distinct worker origins within a sliding window.
Extracts 64-bit PII-free structural payload fingerprints (antigen_hash) to isolate payload-specific failures from full endpoint outages, paired with synchronous ValidationOracle hooks and HMAC-SHA256 signed TrailReceipt tokens.
Validated across 1,000 multi-agent episodes with 8 concurrent workers under severe upstream outage, Sybil fault injection, and silent schema hallucination.
When a primary LLM or tool provider suffers a 95% outage mid-run, stateless routers continue sending traffic into the failing endpoint. Stigmergy Mesh immediately shifts swarm traffic via repulsive alarm pheromones and self-heals upon recovery.
Traditional binary circuit breakers (CLOSED / OPEN / HALF_OPEN) were designed for homogeneous microservices·not stochastic multi-agent fleets where failures depend on payload structure and semantic validity.
Production-grade modules engineered for atomic concurrency, cryptographic receipt verification, and real-time terminal observability.
Zero-dependency local multi-process backend using BEGIN IMMEDIATE transactions, 2,000-origin circular buffers, and lazy LRU antigen compaction.
Single-roundtrip server-side Lua scripts using redis.call('TIME') and cjson for race-free multi-host pheromone decay and quorum updates.
Stateless signed receipts with single-use event_id deduplication for delayed asynchronous reward confirmation after downstream verification.
Sublinear per-origin deposit damping prevents any single runaway worker loop from saturating positive or negative pheromone concentrations.
Built-in stigmergy-mesh CLI with inspect, explain, and reset subcommands to audit live decayed scores and Boltzmann routing probabilities.
Drop-in collective intelligence for engineering teams operating multi-provider LLM routers, tool-calling fleets, and autonomous research swarms.
Dynamically balance traffic across OpenAI, Anthropic, and Gemini endpoints based on live validated accuracy and rate-limit repulsion without central proxies.
Isolate toxic SQL dialects, malformed API payloads, or failing scraper targets via 64-bit antigen hashes while preserving normal traffic on the same tool.
Mint HMAC-SHA256 TrailReceipts during route selection and deposit positive or negative pheromones minutes later when unit tests or reviewers confirm the outcome.
The complete Stigmergy Mesh library·including the closed-form math engine, SQLite WAL and Redis Lua backends, ValidationOracle hooks, CLI diagnostics, and 1,000-episode benchmark suite·is available under the MIT License on GitHub.