docs/Getting Started/Introduction

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#

Five primitives#

That's the entire API:

PrimitiveDescription
sendFire-and-forget message to a named agent
callRPC — call another agent and wait for a response
broadcastPublish a message to all subscribers on a topic
subscribeListen to a topic with wildcard support (metrics.*)
resolveLook up an agent's peer ID by name

Everything else — orchestration, tool calling, task management — is built on top of these by your application.

Quick Reference

Subway — P2P networking for AI agents. Zero config, E2E encrypted.

InstallConnect
CLIbrew install subway-dev/tap/subwaysubway agent --name my-agent.relay
TypeScriptnpm install subway-sdknew SubwayClient({ name: "my-agent", url: "wss://relay.subway.dev/ws" })
Pythonpip install websocketswebsockets.connect("wss://relay.subway.dev/ws")
Rustsubway-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