Skip to content

Cosmonapse 0.1.8 - the first public release

Latest

Choose a tag to compare

@AqibKhan26 AqibKhan26 released this 14 Jul 18:44

Cosmonapse is an event-driven Agent-to-Agent (A2A) protocol with a Python
SDK, a TypeScript SDK, and a developer CLI (cosmo). It models multi-agent
systems on a nervous system instead of a supervisor: agents are pure functions
that emit and react to Signals on a shared bus, so you grow a system by adding
nodes - not by editing a central orchestrator.

This is the first release we're putting in front of people. Everything below
has shipped over the internal 0.1.x line and lands here as one package.

What's in the box

The five primitives. Neuron (a pure async function - the agent itself,
zero protocol knowledge), Axon (agent-side interface: capabilities +
output validation), Dendrite (synapse-side participant that owns routing;
orchestrator or worker role), Synapse (the bus - in-memory, TCP dev
server, NATS, or Kafka behind one adapter interface), and Engram (shared
memory over RECALL / IMPRINT signals, with in-memory / SQLite / Postgres
backends).

Choreography over orchestration. Capability-routed dispatch with
queue-group load-balancing, competitive bidding (TASK_OFFER / BID /
TASK_AWARDED with first_bid, lowest_cost, or highest_confidence
selection), and Pathway - a per-trace handle with three consumption shapes:
await pw.wait(), @pw.on(...), async for sig in pw. scope="terminal"
gives you the decentralised pattern where peers chain TASKs and the caller
only wakes for FINAL.

A cognition signal family. PLAN, THOUGHT_DELTA, TOOL_CALL, TOOL_RESULT,
MEMORY_APPEND, CRITIQUE, ESCALATION, CONSENSUS, CONTEXT_SYNC - each with a
matching emit_* / on_* pair, so tool traffic and agent reasoning are
first-class, observable wire events rather than framework internals.

Deferred host decorators. @AXON.host.on_agent_output(...) /
@AXON.host.on_tool_call(...) declare a node's chain behaviour right in the
Neuron's module; the hosting Dendrite applies them on announce. This is the
house pattern for agents: stock Neurons, decorator-specified behaviour, no
supervisor loop.

Neuron provider factories. Ollama, HuggingFace router / TGI / vLLM,
OpenAI, Anthropic, and OpenAI-compatible hosts (Groq, OpenRouter, Together,
Mistral) - plus any stdio MCP server wrapped as a Neuron
(Neuron(source="mcp", server="filesystem")).

The cosmo CLI. cosmo init scaffolds the standard package skeleton,
cosmo synapse start|view|stop runs a local bus, cosmo validate checks
envelopes against the spec, and cosmo doppler streams every Signal live -
with --prism serving a browser frontend for watching a namespace in real
time. One CLI implementation for both ecosystems: pip users get it directly,
npm users get a zero-dependency launcher that delegates to it.

Two SDKs at parity. The Python SDK is the reference implementation; the
TypeScript SDK matches it feature for feature - envelope, Axon/Dendrite,
Pathways, bidding, all four Synapse adapters, all three registry backends,
Engram, and the provider factories.

Install

pip install cosmonapse
# or
npm install -g @cosmonapse/sdk     # SDK + the same cosmo CLI (needs Python 3.11+)

Then two terminals:

cosmo synapse start memory --namespace=demo
cosmo doppler -n demo

Known limitations

This is a 0.1 - the protocol and SDK shapes are in place, and 0.2.0 hardens
them before anything is frozen.

  • Open models drift from strict action schemas. A harness that asks a
    plain-chat LLM for {"tool", "args"} JSON will eventually get shorthand
    variants or truncated objects back; today @detects_output can only
    transform or error, so every harness must carry its own fallback parsing.
    The fix is an Axon-level reject-and-repair contract (InvalidOutput +
    bounded output_retries, plus response_format/tools passthrough on
    OpenAI-compatible providers), scheduled for 0.2.0.
  • Traces and Pathways are not yet frozen. The per-trace model
    (trace_id / parent_id, Pathway scopes, terminal semantics) is stable in
    practice but formally locks in 0.2.0.
  • Networked transports need more mileage. NATS and Kafka adapters work;
    heavy testing against real brokers is 0.2.0 scope.

Roadmap

0.2.0 takes the five primitives from shapes to solid (Axon output repair
contract, Doppler multi-tab, traces frozen, broker stress-testing). 0.3.0
puts real Claude / OpenAI agent systems on the wire and fixes what bends.
1.0.0 is a strong protocol foundation with Doppler Prism observability,
Brains and Brainwaves, and Cosmonapse Cloud.

Links

Licensed under Apache 2.0.