The nervous system
for autonomous AI agents.
Cosmonapse is an open protocol and SDK for autonomous AI agents. Start with the Core today — one envelope, one Synapse, replaceable Neurons, and a CLI that boots a local broker in seconds. Memory, observability, security, and managed infrastructure are on the roadmap.
Open source · MIT licensed · Python + TypeScript SDK
~20 lines. Three transports.
A working multi-agent system is about twenty lines — define an async function, wrap it in an Axon, attach it to a Dendrite, call dispatch_and_wait. No protocol boilerplate. And the scale path is a single URL swap: MemorySynapse → NatsSynapse → KafkaSynapse, with zero changes to your Neuron code.
import asyncio, os from cosmonapse import Axon, Dendrite, Neuron, connect_synapse SYNAPSE_URL = "memory://" # ← the only line that changes greeter = Neuron( source="huggingface", endpoint="https://router.huggingface.co", model="meta-llama/Llama-3.1-8B-Instruct", api_key=os.environ["HF_TOKEN"], use_chat_api=True, ) async def main(): synapse = await connect_synapse(SYNAPSE_URL) worker = Dendrite(synapse=synapse, namespace="demo", role="worker") worker.attach_axon(Axon(neuron_id="greeter", neuron_fn=greeter, capabilities=["text-generation", "chat"])) orch = Dendrite(synapse=synapse, namespace="demo") async with worker, orch: reply = await orch.dispatch_and_wait( neuron="greeter", input={"prompt": "Say hello to Cosmonapse."}, timeout_s=30.0, ) print(reply.payload["output"]["response"]) asyncio.run(main())
Five layers. One nervous system.
Cosmonapse Core ships today as an open protocol and SDK, with Engram primitives landed in 0.1.0. Doppler, Immune, and Cloud extend it — each a self-contained product with its own primitives, all speaking the same Signal envelope.
Core — open protocol and SDK.
The protocol and the primitives. Routing decisions, workflow rules, and lifecycle policies stay with you — build the system that fits your team.
Envelope spec
The single shared contract. Two components that produce valid Signals can always talk to each other. That is the only guarantee Cosmonapse makes.
Axon — agent-side tool
Owns the Neuron’s identity and wraps its output into protocol-valid Signals. Never touches the Synapse — that boundary is enforced in code, not convention.
Dendrite — synapse-side connector
The only thing that touches the Synapse. Hosts Axons, emits REGISTER / HEARTBEAT / DEREGISTER, routes inbound TASKs, and exposes every orchestration primitive.
RegistryStore
Live view of every Neuron on a namespace — capabilities, status, last heartbeat. Backed by memory, SQLite, or Postgres. The only mandatory persistent surface the SDK owns.
cosmo CLI
cosmo synapse start memory boots a local TCP broker. cosmo doppler streams every Signal to stdout. cosmo validate checks envelope conformance.
Building the platform.
Core is the foundation. The full Cosmonapse platform adds memory, observability, security, and managed infrastructure — each layer speaking the same Signal envelope.
Neurons are black boxes
A Neuron is a pure function — async fn(input, context) → output. Zero protocol knowledge. Wrap any existing LLM agent with an Axon and it becomes a protocol participant with no modification.
Memory is a product layer
The Core protocol defines MEMORY_APPEND, CONTEXT_SYNC, RECALL, and IMPRINT signals. Cosmonapse Engram ships the Recall and Imprint primitives in 0.1.0 with InMemory, SQLite, and Postgres backends; Echo (snapshot replay) is next. Bring your own context layer, or let Engram handle it.
Observability & cognition analytics
Doppler is a non-competing read-only tap on the Synapse, with three features. Pulse streams live telemetry — latency, throughput, cost per Neuron. Prism turns it into dashboards and traces. Resonance is the cognition-analytics layer — mapping how Neurons influence each other, tracking Signal propagation, detecting emergent Brain patterns, and scoring collaboration efficiency across the same stream.
Secure and managed at scale
Immune will handle identity, encryption, and automated threat response. Cloud will run the entire stack inside Membrane — isolated, quota-enforced, credential-scoped at the infrastructure level.
Build the substrate for agent swarms.
Cosmonapse Core 0.1.0 is in research preview — the protocol is drafted, the SDK ships with Engram, Pathway, capability-routed dispatch, and competitive bidding. Doppler is next.