Substrate is the open-ended peer citation pattern. Use it when you do not want a central manager or exclusive task locks — instead, equal peers explore in parallel, publish immutable findings, and build on one another by explicitly citing prior entries.
How it is designed
1. Services
One host-owned, append-only SQLite Service exposes three simple primitives:
publish: stores an immutable finding (with optional parentcitationsand attached artifacts) tagged with the authenticatedcaller.agentId.search: lets any peer query the shared knowledge base for relevant prior results.visit: retrieves a full finding and its lineage so a peer can verify or extend it.
2. Profiles & Permissions
- All peers share a single equal Profile (
peer) with access topublish,search, andvisit. - There is no privileged lead role; isolation comes from each peer running in its own sandbox container.
3. Orchestration & Events
- The Harness spawns
Npeers concurrently inside oneRuntimewith a shared time or turn budget. - Because the citation store is append-only and lock-free, peers never block on each other; the Harness monitors
runtime.onEvent()for completion signals, optional domain checkers, or budget expiry before callingruntime.close().
Run the built-in Harness
Run the built-in substrate Harness directly against any project directory:
anyswarm --harness substrate --cwd /path/to/project \
--prompt 'Explore the problem in parallel, publish verified intermediate findings, and cite earlier results.' \
--output-dir ./runs
anyswarm trace --root ./runs --port 8787
Customizing the source:
anyswarm ejectcurrently ships editable starter templates forsubagents,first-harness, andautoresearch. To adaptSubstratein TypeScript, copyexamples/substratefrom the repository and run your edited entry file withanyswarm run.
Good starting point for: mathematical/theorem-proving exploration, open-ended research synthesis, hypothesis generation, and lock-free parallel discovery.