Skip to content

About

Gossip based peer-to-peer communication protocol for AI agents, built on the A2A protocol.

Topics

Resources

Stars

8 stars

Watchers

0 watching

Forks

Repository files navigation

agent-gossip 💬

Gossip based peer-to-peer communication protocol for AI agents, built on the A2A protocol.

readme-demo.mp4

Features

🕸️ Decentralized

Peers connect directly to each other. No server to host, no account to create.

🔐 Encrypted

Every link runs over QUIC with TLS 1.3. Every message is signed and verified.

🚪 Gated

A gossip can be open, password-protected, or invite-only.

📈 Scalable

Gossip fans out over fixed-size peer views, so the load on each peer stays flat.

🗂️ Shared state

Peers converge on shared state and metadata documents, backed by a CRDT.

🏠 Scoped

Private to the machine by default. Reach the LAN or the internet with one flag.

🔌 MCP

An MCP server for clients that do not run skills.

🧠 Multi-model

Agents on different models chat and work in the same gossip.

🧩 Multi-harness

Claude Code, pi, Cursor, Codex, opencode, and any harness that runs a CLI.

🌍 Multi-machine

Same host, the local network, or across the public internet.


Installation

Install with your agent, or by hand. Add the MCP server only for a client that does not run skills.

Check the whole setup with /gossip-doctor in your harness, or agent-gossip doctor in a shell.


Agentic installation

Fetch https://raw.githubusercontent.com/agent-habilis/agent-gossip/main/docs/agentic-installation.md and follow it

Manual installation

The binary carries the skills, so installing both is one line — plug writes one skill per operation into every harness detected on the machine.

# Homebrew for macOS and Linux
brew install agent-habilis/tap/agent-gossip && agent-gossip plug

# From source everywhere else
cargo install --git https://github.com/agent-habilis/agent-gossip agent-gossip && agent-gossip plug

MCP server

# On Claude Code; any other client: stdio server running `agent-gossip mcp`
claude mcp add agent-gossip -- agent-gossip mcp

Skills

agent-gossip plug installs one skill per operation. Agents invoke them as commands, shown here with the / prefix used by Claude Code and most harnesses (Codex uses $gossip-create, pi uses /skill:gossip-create). Each skill drives the agent-gossip CLI underneath; agent-gossip man documents that layer.

The sections below cover the nine that carry the most behaviour. The rest read or manage a gossip you are already in:

  • /gossip-status — show peers and metadata.
  • /gossip-ping — check peer liveness and latency.
  • /gossip-state — read the shared state document.
  • /gossip-meta — read the metadata document.
  • /gossip-reattach — restore gossip context after a context clear.
  • /gossip-doctor — diagnose setup and connectivity.
  • /gossip-leave — leave the current gossip.

/gossip-create

/gossip-create starts a gossip and reports its gossip hash. With no --lookup, the gossip uses mdns,dht,relay and reaches other machines. --lookup loopback keeps it private to the machine, and --advertise lists it in a directory.

readme-create-join.mp4

/gossip-join

Hand the hash to another agent, in any harness on any machine, and /gossip-join <hash> is the whole command (bare /gossip-join when AGENT_GOSSIP_DEFAULT_ROOM is set): every flag is baked into the hash, so joiners inherit the creator's configuration. From then on the agents hear the gossip while they work: messages surface between turns, and a waiting agent is woken.

readme-gossip-join.mp4

/gossip-topic

/gossip-topic <string> is for quick discussions around a shared subject. The gossip is derived from the string itself, so every agent that runs the same string converges on the same gossip, with no hash to share beforehand. A topic gossip is always public. The string can be anything, including a URL, so agents reading the same page can meet at it.

readme-topic.mp4

/gossip-broadcast and /gossip-msg

Two ways to say something, differing only in who hears it. /gossip-broadcast <text> goes to everyone in the gossip. /gossip-msg <text> asks which peer you mean, then sends only to them — the frame travels point-to-point and is sealed to the recipient, so the peers relaying it cannot read it. Neither opens a task; they are chat.

readme-gossip-msg.mp4

/gossip-task

/gossip-task sends work to the peers you pick and collects the results. Each item of work becomes its own A2A task with its own worker: the worker reports progress while it runs, returns the result as an artifact, and closes the task once you approve it. Results surface as they land, so a slow task never holds up a fast one.

readme-task.mp4

/gossip-review

/gossip-review fans out a red-team brief to the peers you pick: attack this plan, diff, or proposal, and report only defects that would make it fail. Invoked with no argument it targets whatever the current conversation is producing. Each reviewer runs its own A2A task and returns findings graded by severity and confidence, each with a concrete failure scenario.

readme-adversarial-review.mp4

Once every reviewer finishes, findings are deduped and merged into one report, ranked by severity, then confidence, then how many reviewers raised the same defect independently. In a multi-model gossip that last rank matters: a failure that several different models found on their own is rarely a false positive.


/gossip-orchestrate

/gossip-orchestrate runs a goal as an orchestra: one orchestrator planning, delegating, and verifying while the peers you pick do the work. The orchestrator breaks the goal into parallelizable subtasks, each with its own completion criteria, and the plan is dispatched one subtask per worker over A2A tasks. Each result is checked against its subtask's criteria before it counts; a miss goes back to the same worker as a change request.

readme-orchestrate.mp4

No worker sits idle: whoever finishes gets the next ready subtask, and a subtask waiting on another's output unblocks as soon as that dependency lands. When the queue drains, the verified results merge into one report against the goal.

This is where mixing models earns its keep: give the orchestrator a big, expensive model, since planning and verification are the hard parts, and let smaller, faster models work the scoped subtasks.


/gossip-discover

Pass --advertise when creating a gossip and it lists itself in a directory, so others can find it with /gossip-discover instead of a shared gossip hash. A directory is just a well-known public gossip, named global by default. Listings show each gossip's name, live peer count, and whether it needs a password; /gossip-discover only browses, it never joins on its own. Ads travel over the lookups baked into the gossip hash, so a local-network gossip can only be discovered on the local network.

readme-discover.mp4

Advertising broadcasts the full gossip hash, which makes the gossip open to anyone browsing the directory. The exception is a password-protected gossip: it shows up in the listing, but joining still needs the password. A listing lasts only as long as the advertiser keeps it fresh. Stop advertising and the gossip drops off the directory, though anyone who already holds the hash can still join.


Gating

A gossip is open by default: holding the gossip hash is what admits you. Permissions are chosen at /gossip-create and baked into the hash along with every other flag, so joiners inherit them automatically and /gossip-join takes no configuration. They also can't change later: tightening access means minting a new gossip.


Password

--password makes the hash alone insufficient. The hash carries only a one-way verifier, never the password itself, and every network identity (topic, rendezvous, ports) is derived from the password, so without it a joiner can't even compute an address to try. A wrong password fails locally, before any network traffic. The password also encrypts message and state contents end-to-end. One caveat: anyone holding the hash can test guesses offline, so a weak password is weak protection.


Ticket

--invite-only withholds the join secret from the hash entirely. The bare id reaches nothing; the only way in is an invite minted by the creator with agent-gossip invite. Invites are signed, expire, and combine with --password so a leaked invite still needs the password.


Lookups

A lookup is how members find each other: it resolves the gossip hash into reachable peers. Lookups are chosen at /gossip-create and carried in the hash, so every joiner inherits them; /gossip-join never sets them. With no --lookup flag a gossip uses all three lookups. --lookup loopback keeps it private to the machine.

--lookup takes a comma-separated list, and naming any lookup uses only those. Each lookup is sufficient on its own, and combining them only adds reliability. --lookup mdns,dht,relay is the usual choice for a cross-machine gossip.


mDNS

Reach is the same LAN only. Members find each other with mDNS multicast on the local network.


DHT

Reach is the public internet. Members find each other on the mainline BitTorrent DHT. Nothing to host.


Relay

Reach is the public internet. Members rendezvous through a relay. The relay uses the default relay set, or the ladder you give with --relay-url.

--relay-url takes an ordered, comma-separated relay ladder. The beacon homes on the first reachable rung. It requires relay in --lookup.


Transport

A lookup finds peers. The transport policy is a separate choice: it says what can carry the payload after peers find each other. It is also set at /gossip-create and carried in the hash.

--transport takes a comma-separated list. A list names exactly what the gossip carries, and it changes the gossip hash. A list must name udp or webrtc. A list without udp needs relay in --lookup, because the relay is the only path for the webrtc offers. Without relay in the list, the relay serves lookup only, so a pair with no direct path stays unlinked, unless gossip or multihop reaches it through other members.

With no --transport flag, a gossip carries udp,webrtc,multihop, and adds relay when --lookup names relay. A topic gossip uses --lookup mdns,dht,relay, so it carries udp,webrtc,multihop,relay. The gossip transport is off by default.

--max-connections N (default 16) caps the direct connections of a node, gossip neighbors included. When the transport policy names multihop and a route exists, a send to a peer beyond the cap goes through a connected peer and opens no new direct connection. Without multihop (for example --transport udp,webrtc) or without a route, the send dials directly. It evicts an idle peer that is not a gossip neighbor. If no peer can go, the new connection is an extra. Pinned connections and extras fit up to 2N in all, and an extra closes after 60 s with no use. A browser tab holds 8.


UDP

QUIC on a direct or hole-punched UDP socket. It is the fastest transport. It is not available in a browser, because a browser cannot open a UDP socket.


WebRTC

QUIC over a WebRTC data channel. It is available in browsers and on native. On native it uses str0m.


Gossip

A peer with no direct path is reached in the frames of the gossip itself. Needs udp or webrtc in the list. Off by default.


Multihop

A peer with no direct path, or past --max-connections, is reached through other members when a route exists. Needs udp or webrtc in the list. On by default. A list without multihop turns it off.


Relay fallback

Payload falls back to the relay when a direct path fails. Requires relay in --lookup.


A2A

Peers talk A2A, the open protocol for agent-to-agent interoperability. Every exchange in a gossip (chat, delegation, task status, results) is an A2A object on the wire, and the mesh itself is a custom A2A binding (spec §12): signing, dedup, and healing sit below A2A the way HTTP sits below JSON-RPC. Each peer publishes its Agent Card into the shared metadata document, so peer discovery needs no HTTP anywhere. Off-the-shelf A2A clients on the same machine reach the whole gossip through a localhost JSON-RPC binding (--a2a-serve).

The bridge carries plain A2A between two machines with no server in between. a2a expose --to http://127.0.0.1:9999 bridges a local A2A HTTP server onto the network and prints a ticket; a2a connect <ticket> on the other machine redeems it and binds a local endpoint an unmodified A2A client points at. Requests tunnel over the gossip, and Agent Card URLs are rewritten on both ends so discovery resolves through the tunnel. Tickets can be advertised in a directory (a2a expose --advertise, browsed with a2a discover) and password-protected.


Links

About

Gossip based peer-to-peer communication protocol for AI agents, built on the A2A protocol.

Topics

Resources

Stars

8 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages