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 backed by any LLM provider, and a CLI that boots a local broker in seconds.
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, connect_synapse SYNAPSE_URL = "memory://" # ← the only line that changes axon = Axon.huggingface("greeter", endpoint="https://router.huggingface.co", model="meta-llama/Llama-3.1-8B-Instruct", api_key=os.environ["HF_TOKEN"], use_chat_api=True, capabilities=["chat"]) async def main(): synapse = await connect_synapse(SYNAPSE_URL) worker = Dendrite(synapse=synapse, namespace="demo", role="worker") worker.attach_axon(axon) 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.
Neuron factory
Neuron(source="huggingface"), "openai", "anthropic", "groq", "ollama", and more - or any plain async function. All behind the same signature. Zero protocol knowledge required.
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.
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. The Neuron(source=...) factory wraps any LLM provider or MCP server behind that interface without modification.
Memory is a product layer
The Core protocol defines MEMORY_APPEND, CONTEXT_SYNC, RECALL, and IMPRINT signals. Cosmonapse Engram ships Recall and Imprint in 0.1.0 with InMemory, SQLite, and Postgres backends; Echo (snapshot replay) is next.
Observability & cognition analytics
Doppler is a non-competing read-only tap on the Synapse. Pulse streams live telemetry - latency, throughput, cost per Neuron. Prism turns it into dashboards and traces. Resonance maps Neuron influence, tracks Signal propagation, and scores collaboration efficiency.
Secure and managed at scale
Immune will handle identity, encryption, and automated threat response. Cloud runs the entire stack inside Membrane - isolated, quota-enforced, credential-scoped at the infrastructure level.
Build the substrate for agent swarms.
Cosmonapse Core 0.1.5 is in research preview - the protocol is drafted, the SDK ships with Engram, Pathway, capability-routed dispatch, competitive bidding, and first-class LLM provider Neurons. Doppler is next.