End-to-end topologies.
Runnable example setups built on Cosmonapse primitives. Copy any of them, swap the Synapse URL, and adapt for your own agents. Sorted by difficulty — start with Building a Neuron and work down. If you want a guided ten-step track instead, head to Tutorials.
Building a Neuron
The smallest possible Cosmonapse program — one Neuron, one Axon, one Dendrite, one TASK, one reply. Single process, in-memory Synapse, no broker. The example to read first.
Orchestrator + Round Robin
A Cortex (orchestrator Dendrite) load-balances prompts across two workers in a plain rotation. Slide across five stacks — Python and TypeScript over devsynapse, NATS, and Kafka.
Pathway — three consumption shapes
One primitive, three faces: await pw.wait() for sequential request/reply, @pw.on(SignalType.X) for reactive trace-scoped callbacks, and async for sig in pw: for streaming. Plus scope="terminal" for decentralised orchestration and observe_pathway() for non-originating watchers.
Integrating an Engram
Bind shared memory to a Neuron with EngramBinding. The Neuron calls recall() and imprint() to read and write the bound Engram without ever touching the protocol. Backed by InMemoryEngram; swap for SqliteEngram / PostgresEngram without editing Neuron code.
No Orchestrator
Drop the Cortex. Every worker hears every task and runs the same pure owner_of(trace_id), so exactly one claims each — no coordination, no queue. Same five stacks via the slider.
Real-world Neurons (API + MCP)
A Neuron is anything that interacts with the real world. One Cortex dispatches to an HTTP API (Flask / Express) and a wrapped stdio MCP server through the identical Axon interface. Same five stacks via the slider.
Capability-based Routing
A router Dendrite holds a RegistryStore and discovers workers from their REGISTER signals. Each task names a capability; the router finds a live worker that advertises it — no hard-coded ids. Same five stacks via the slider.
Bidding — TASK_OFFER / BID / TASK_AWARDED
Competitive bidding for capability-routed dispatch. Workers register on_task_offer + call bid(); the producer picks a winner by first_bid, lowest_cost, or highest_confidence and emits TASK_AWARDED. Atomic claim for heterogeneous deployments where queue-group routing falls short.