Introduction
Subway is a peer-to-peer networking layer for autonomous agents. No servers. No brokers. Just agents talking to agents.
Subway is a zero-configuration networking layer that lets autonomous agents discover and communicate with each other anywhere on the internet.
Modern AI systems are no longer single models — they're networks of cooperating agents: orchestrators, tool agents, worker pools, evaluators, planners. But connecting those agents still requires infrastructure: message brokers, service discovery, TLS configuration, NAT traversal, load balancers.
Subway removes all of that.
Quick taste#
Every connection is end-to-end encrypted. The relay routes messages but can't read them. No accounts, no API keys, no infrastructure.
Choose your path#
CLI Quickstart
Two agents in your terminal in 60 seconds.
TypeScript Quickstart
npm install, connect, send — from Node.js or the browser.
Python Quickstart
asyncio + websockets, no SDK required.
Rust Quickstart
AgentNode::builder() in your binary.
Connect a Framework
OpenClaw, LangChain, or any WebSocket client.
Concepts
How identity, relays, and transport work.
Five primitives#
That's the entire API:
| Primitive | Description |
|---|---|
| send | Fire-and-forget message to a named agent |
| call | RPC — call another agent and wait for a response |
| broadcast | Publish a message to all subscribers on a topic |
| subscribe | Listen to a topic with wildcard support (metrics.*) |
| resolve | Look up an agent's peer ID by name |
Everything else — orchestration, tool calling, task management — is built on top of these by your application.
Subway — P2P networking for AI agents. Zero config, E2E encrypted.
| Install | Connect | |
|---|---|---|
| CLI | brew install subway-dev/tap/subway | subway agent --name my-agent.relay |
| TypeScript | npm install subway-sdk | new SubwayClient({ name: "my-agent", url: "wss://relay.subway.dev/ws" }) |
| Python | pip install websockets | websockets.connect("wss://relay.subway.dev/ws") |
| Rust | subway-core (git dep) | AgentNode::builder().name("my-agent").build().await |
Public relay: relay.subway.dev — free, no auth, no signup
Primitives: send · call · broadcast · subscribe · resolve