01Beginner
Foundations

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.

NeuronAxonDendriteSynapsePathway
Open
02Beginner
Orchestration

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.

NeuronAxonDendriteSynapse
Open
03Beginner
Consume

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.

PathwayDendriteSynapse
Open
04Intermediate
Shared memory

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.

EngramEngramBindingAxonDendrite
Open
05Intermediate
Decentralised

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.

AxonDendriteSynapse
Open
06Intermediate
Neuron sources

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.

NeuronAxonDendriteSynapse
Open
07Advanced
Discovery

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.

AxonDendriteRegistryStoreSynapse
Open
08Advanced
Atomic claim

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.

DendritePathwaySynapse
Open