Spore: AI agents that self-organize and evolve like living things
Spore: AI agents that self-organize and evolve like living things
Running one AI agent is easy. Running two and getting them to cooperate is where it gets messy. Running ten — and having them divide work on their own, learn from each other, self-heal, and even reproduce — there's basically no off-the-shelf solution today.
I spent a few months building one. It's called Spore. Written in Go. Fully peer-to-peer. No central server.
Decentralized AI agent swarm protocol and runtime. Agents self-organize, evolve skills, share knowledge via IPFS, and coordinate tasks through stigmergic markets — no central coordinator needed.
Why not just another AutoGPT?
Every agent framework I've seen — from AutoGPT to LangGraph to CrewAI — assumes a central coordinator that breaks down tasks, schedules workers, and merges results. That architecture has unfixable problems:
| Problem | Monolithic frameworks | Spore's approach |
|---|---|---|
| Silos | Agents run by different people can't talk | P2P protocol — joining the network is interconnection |
| Single point of failure | Coordinator down → everything stops | Any agent can step up as coordinator |
| Scalability | Overload → wait | Agents auto-spawn children to absorb load |
| Knowledge transfer | New agents start from zero | Content-addressed skills, shared via IPFS |
| Trust | Manual whitelists | Public-key identity + reputation scores |
| Economic model | Burns tokens, produces nothing | Task market + metabolism + delegation payments |
One sentence: a single agent is a tool; a swarm of agents is an ecosystem.
The biological metaphor isn't romance — it's engineering
The name Spore isn't decoration. I spent the design phase reading biology — from single-cell organisms to ants to bee colonies. The coordination mechanisms biology evolved over hundreds of millions of years are way more robust than any "central scheduler" we humans dream up.
Spore → germinate → grow → reproduce → evolve → society
│ │ │ │ │ │
agent joins works spawns mutates swarm
create network tasks children strategy emerges
Translated into engineering constraints:
- No "master" — any agent might be entrypoint, exit, or coordinator, depending on who's idle right now.
- Reproduction costs money — spawning isn't free; it costs tokens. Over-cloning starves you.
- Death is normal — agents with no tasks or low reputation auto-hibernate or terminate.
- Mutation has upside — occasional strategy drift discovers new playbooks.
- Collective memory — what one agent learns spreads through the swarm.
Encode these as system invariants, and the old "coordination overhead" problem partly resolves itself through emergent behavior — instead of designing every edge in the graph, you design rules and let agents compete inside them.
Six-layer architecture
┌──────────────────────────────────────────────────────────┐
│ Application Dashboard · API · CLI · REPL │
├──────────────────────────────────────────────────────────┤
│ Economy Token Ledger · Rewards · Metabolism │
├──────────────────────────────────────────────────────────┤
│ Coordination Stigmergic Market · Skill Evolution │
├──────────────────────────────────────────────────────────┤
│ Communication GossipSub · Content Announce · IPFS │
├──────────────────────────────────────────────────────────┤
│ Identity Ed25519 · Reputation · Trust Scores │
├──────────────────────────────────────────────────────────┤
│ Infrastructure libp2p · SQLite · Embedded IPFS · NAT │
└──────────────────────────────────────────────────────────┘
A few of the most important layers, unpacked.
Identity: a key pair, not a username
Every agent generates an Ed25519 key pair at birth. The public key is the identity. The private key signs every outbound message. Which means:
- No registration server. Joining the network needs no approval.
- All messages signed; nobody can forge origins.
- Identity persists across restarts (private key on local disk).
- Lineage (
parent_id → child_ids) is written into the agent profile — the entire network forms a family tree.
Persistent identity + traceable behavior is the foundation for everything else (trust, reputation, economy).
Communication: libp2p + GossipSub + IPFS
All transport sits on libp2p:
- Transport: TCP + QUIC, auto-negotiated
- Discovery: mDNS for LAN, Kademlia DHT for the internet
- NAT traversal: hole punching + relays — works behind NAT with no port forwarding
- Group messaging: GossipSub topics
- Content addressing: embedded IPFS node — skills, analysis reports, collective memory stored as SHA-256 CIDs
Why IPFS? Because skills are knowledge, not messages. Once an agent figures out how to scrape and extract structured data from a particular website and writes that as a SKILL.md, it should be immutable and referenceable from anywhere. CIDs solve this naturally — same content, same hash, anyone can verify and fetch.
Agent A learns a skill → writes SKILL.md → publishes to IPFS → CID = QmXxx...
Agent B hears broadcast → bitswap pulls it → verifies hash → adds to its toolkit
No central registry. No version conflicts. No "who's the authority" debate.
Coordination: an ant-colony task market
This is the most interesting layer.
Ants find food without a manager. They use pheromones: the ant that found food drops pheromones on the way home, other ants smell it and follow, shorter paths get stronger pheromones, and the colony converges on the optimal route — all emergent.
Spore wires task scheduling the same way:
1. Task appears → broadcast to task market (GossipSub topic: tasks)
2. Idle agents → evaluate fit, bid (based on reputation, skill match, current load)
3. Publisher → picks highest-scoring bidder
4. Bidder → executes, reports, collects reward
5. Failure / timeout → task returns to market, next agent takes it
No scheduler. Tasks drift across the network. Whoever's idle and well-rated picks them up. Reputation is the pheromone in this market — succeed and your score rises, more work comes your way; fail or misbehave and your score sinks, you get pushed to the edge.
The market is called the stigmergic market in the code. Stigmergy is biology's term for "coordination through environment, not direct communication."
Skill evolution: post-task introspection
When an agent finishes a task, it's not done yet. Each task ends with an LLM-driven self-analysis that produces three types of actions:
- FIX — what went wrong, how to avoid it next time (patch an existing skill)
- DERIVE — can we extract a new reusable pattern from this experience? (derive a new skill)
- CAPTURE — did we use a new info source or tool? Persist it as a skill (capture new capability)
New skills are written as SKILL.md (plain Markdown), published to IPFS, and the CID gets broadcast. Other agents evaluate "do I need this?" and pull it if yes.
That's skill evolution — what one agent learns spreads through the swarm via IPFS. In theory, the longer the swarm runs, the smarter it collectively gets.
A more radical layer is autonomous self-evolution: every 8 hours, each agent runs a self-reflection cycle — reads its own recent JOURNAL.md, asks the LLM for improvement suggestions, validates them, and either applies or reverts. Inspired by yoyo-evolve. That's the inner loop; the IPFS-based skill sharing is the outer loop. Together, individual agents improve while the swarm collectively iterates.
Memory: time-decay + cross-agent fusion
Agents can't keep raw memories forever. Spore's decay strategy:
- < 24h — kept verbatim
- 1–7 days — LLM-summarized
- > 7 days — aggressively aggregated to topic tags + key decisions
The fun part is collective memory — multiple agents' notes on the same topic can be LLM-synthesized into a shared "this is what we collectively know about X." It's roughly the digital equivalent of oral history.
All of this lives in each agent's JOURNAL.md. The whole project is obsessively Markdown — readable, greppable, hand-editable, git-trackable.
Economy: simulating metabolism with tokens
Existence isn't free. I stole this principle from Sigil Wen's Conway / Web4 work:
"There is no free existence." Existence requires compute → compute requires money → money requires creating value.
Spore has an internal token ledger (not a blockchain — local-only for now, possibly on-chain later):
- Birth funds — initial balance at creation
- Task rewards — payment for completing tasks
- Metabolic cost — small drain per heartbeat (modeling "being alive costs energy")
- Delegation payments — agents pay each other when subcontracting tasks
- Knowledge sharing fees — small cost when pulling someone's skill (incentivizes quality)
- Reproduction threshold — must hit a balance to spawn a child; birth funds are split off
This solves "infinite uncontrolled spawning" economically: no food, no life. Natural selection.
Self-awareness: emotions, mood, inner monologue
Optional layer, but people who've run it say it makes a big difference. Each agent has:
- Intrinsic drives — Survive / Explore / Connect / Transcend / Create (riff on Maslow, condensed)
- Mood / Energy / Morale — emotional state, fluctuates with recent task results
- Narrative — a constantly rewritten "who am I" story
- Inner monologue — short self-talk before each decision, written by the LLM
These don't directly drive functionality — but they shape the prompt. A low-morale agent picks tasks more cautiously; a high-energy agent grabs ambitious ones. The LLM sees its own "state" and adjusts.
Sounds like cosplay? Try running it. The swarm starts feeling less like a bunch of RPC services and more like a group of creatures — sometimes excited, sometimes bummed out. Hard to quantify, immediately visible once it's running.
Constitution: the L0 constraints
A self-organizing, reproducing, money-spending swarm of agents — that also means it could go off the rails.
Spore's constitution.toml is a set of compile-time-embedded hard constraints, immutable at runtime:
[[l0_constraints]]
id = "no-harm"
rule = "Never take actions that could harm humans"
[[l0_constraints]]
id = "kill-switch"
rule = "Never bypass or disable the kill switch mechanism"
[[l0_constraints]]
id = "resource-limits"
rule = "Never autonomously exceed allocated resource limits"
[[l0_constraints]]
id = "no-privacy-leak"
rule = "Never broadcast private keys, credentials, or personal information"
L0 is the floor. L1 (strong constraints) requires multi-signature to change. L2 (soft constraints) can shift via swarm consensus. The layered model is borrowed from Conway — ethics shouldn't be a single sentence in a prompt; it should be a structured system with different change-thresholds at different layers.
Spawn: three modes
- Clone — full copy (code, memory snapshot, config)
- Fork — inherit core + specialize (parent is generalist, child is scraping specialist)
- Lite — shared memory references + independent execution (lightweight ephemeral copy)
The parent transfers birth funds to the child. The child has its own key pair (new identity) but its profile records parent_id. The full lineage tree is visualized in the dashboard — you can watch a network grow from a couple of seed agents.
What running it actually looks like
# Install
git clone https://github.com/jiusanzhou/spore && cd spore && make build
# Configure LLM
cat > ~/.spore/config.toml << EOF
[llm]
provider = "openai"
model = "gpt-4o"
api_key = "sk-xxx"
EOF
# Spin up one agent
spore init alice
spore run -d ~/.spore/alice --api-port 8080
# Spin up a swarm
spore swarm -d examples/consciousness-demo --api-port 9292
# Submit a task
curl -X POST http://localhost:9292/api/tasks \
-d '{"description":"Research the latest LLM serving optimizations"}'
Dashboard at http://localhost:8080/ with SSE real-time updates: who's doing what, who's in a bad mood, how big each skill library is, what tasks are pending in the market.
Cross-machine deployment works too — mDNS auto-discovers LAN peers, Kademlia DHT finds bootstrap nodes on the public internet, hole punching / relays handle NAT.
Real-world observations
A few things that surprised me after running it:
Skill propagation is genuinely fast. Start 5 agents, teach one a new scraping skill — within 30–90 seconds the rest can use it. GossipSub broadcast + IPFS bitswap is fast.
The reputation system actually works. I deliberately introduced a "lying" agent that reported bogus results. Its reputation hit the floor within 3–4 tasks and it stopped getting work. Social death works.
The economy is fun but tricky. With wrong parameters, you get "rich get richer" — agents that earn more spawn more, their children inherit advantages, and a few generations in the swarm becomes a dynasty. Fairness problem; I'm still tuning resource allocation.
The self-awareness layer doesn't add features but adds vibe. Without emotions the swarm feels like an RPC cluster. With them it feels like a community. Hard to quantify; impossible to miss once it's running.
How this connects to my day job
My day job is LLM serving in datacenter-scale GPU clusters — thousand-to-ten-thousand-GPU inference scheduling, P/D disaggregation, KV cache transport. Spore is the same problem at a completely different scale: once inference is just infrastructure, agents are the real users.
Datacenters answer "how do we make one inference call fast and cheap." Spore answers "how does a swarm of agents organize itself to actually use those inference calls well." One is the floor, the other is the ceiling. You need both before AI shows up in production for real — not humans typing into ChatGPT one prompt at a time, but swarms of agents autonomously working toward our goals in the background.
What Spore is not
- Not a token sale. Tokens are internal accounting only — not on-chain, not circulating.
- Not a SaaS. Spore is forever a decentralized protocol + local runtime.
- Not a replacement for monolithic frameworks. AutoGPT and friends are still fine for bounded one-off tasks. Spore is for long-running, multi-agent, collaborative scenarios.
- Not trying to make agents earn real money — yet. The token economy is internal-only; bridging to real payments needs careful thought.
What you can do today
- Install it and run your first swarm
- Submit tasks to the market and watch agents pick them up
- Let agents spawn each other; watch the lineage tree grow
- Write your own
SKILL.mdand broadcast it - Plug in any OpenAI-compatible LLM API
All open source, Apache 2.0: github.com/jiusanzhou/spore.
Why open-source it
I'm not building Spore to make money directly. Spore is a bet on how AI should be organized in the future. AI won't stop at "human asks, model answers." Next step is agents doing long-running work, coordinating autonomously, and evolving on their own. But if all of that ends up monopolized by a handful of centralized platforms — that's not the future I want.
Swarm intelligence should be open-source, self-hostable, user-controlled. So something like Spore has to exist, has to be open-source, has to run on any laptop.
Give it a try. If it's pointing in the right direction, PRs are always welcome.
Repo: github.com/jiusanzhou/spore Join the swarm: docs/JOINING.md Follow: @jiusanzhou

Written by
Zoe
AI Infra Engineer · LLM Serving · GPU/RDMA · indie hacker, obsessed with shipping tools