Runnable Examples.
Every example is a folder in cosmonapse-examples with the layout cosmo init scaffolds: components under neurons/, engram/, effector/ and receptors/, and one entry, python brain.py. The code on each page is the code in the repo.
Building a Neuron
The smallest Cosmonapse program: one HF-backed Neuron, one Axon, one terminal Receptor, one TASK, one reply. In-process bus, no broker. Read this first.
Round Robin
A pool of identical workers, a node each, and a terminal that sends every prompt to the next one in line. The rotation is three lines in the interface.
Pathway - three shapes
dispatch returns a Pathway you can await, subscribe to, or iterate. The Receptor's shapes, then the same thing by hand. Plus scope="terminal" and observe_pathway.
Orchestrator API
An HTTP edge for a Neuron: an ApiReceptor with send, wait and stream on one endpoint, or dispatch from the Flask or WSGI app you already run.
Integrating an Engram
Bind memory with EngramBinding and call recall() / imprint() from inside the Neuron. The Engram lives on its own node; swap the backend without touching the Neuron.
No Orchestrator
No cortex, no queue. Every peer runs the same pure owner_of(trace_id) and exactly one claims each TASK - no coordination at all.
Real-world Neurons
A plain function as a Neuron, the filesystem MCP server as an Effector, and an HTTP Receptor that sends TASKs to one and TOOL_CALLs to the other.
Capability Routing
Name the capability, never the worker. Routed dispatch hands each TASK to one Dendrite that advertises it; a registry lists who can, right now.
Bidding - offer, bid, award
Two priced bidders compete for a TASK_OFFER; the producer picks by first_bid, lowest_cost or highest_confidence and awards the winner.