v0.6.1 Python 3.11+

Run LangGraph
across any network.
Peer-to-peer.

langgraph-pilot is a Python package that lets a LangGraph node execute on a different machine, with graph state persisted across the network — over end-to-end encrypted Pilot Protocol tunnels. NAT-traversed. Mutually authenticated. No public ports, no API gateway, no central broker.

01 / What

LangGraph nodes that live on different machines.

A PilotRemoteRunnable looks and feels like any other LangChain Runnable — ainvoke / astream, retries, callbacks, RunnableConfig propagation — but the work happens on a remote pilot peer. The peer can be a laptop, a phone, an on-prem server, a cloud VM. Trust gates every call.

A PilotCheckpointSaver ships every graph checkpoint to a remote peer's SQLite store, idempotent on retry, so graph state survives process restarts and lives on a different machine than the graph that wrote it.

# A graph that fans out to 3 remote workers in parallel
# and persists state on a 4th, all over Pilot tunnels.
from langgraph.graph import StateGraph
from pilot_langgraph import (
    PilotRemoteRunnable,
    PilotFanoutRunnable,
    PilotCheckpointSaver,
)

graph = StateGraph(MyState)
graph.add_node("research", PilotFanoutRunnable({
    "broad": PilotRemoteRunnable(node="search", peer="worker-a"),
    "deep":  PilotRemoteRunnable(node="search", peer="worker-b"),
    "novel": PilotRemoteRunnable(node="search", peer="worker-c"),
}))

app = graph.compile(
    checkpointer=PilotCheckpointSaver(peer="state-worker"),
)
02 / Install

Two daemons, one install.

1. Install Pilot Protocol

# From pilotprotocol.network
curl -fsSL https://pilotprotocol.network/install.sh | sh
pilotctl daemon start \
  --hostname my-host \
  --email you@example.com

2. Install langgraph-pilot

# From PyPI (coming soon) or source:
pip install \
  git+https://github.com/TeoSlayer/pilot-langgraph

# Run a worker:
pilot-langgraph-worker \
  --handlers my_handlers --port 5000

Worker handlers are plain Python functions decorated with @pilot_handler("name"). Each handler can take per-handler ACL, timeouts, rate limits, max-concurrent semaphores, and pydantic input/output validation. The full surface and a 60-second quickstart live in the README.

03 / Features

Production-grade primitives, async-first.

01

Remote execution

PilotRemoteRunnable — async-first LangChain Runnable, multiplexed concurrent calls share one connection, transparent reconnect, configurable retry, optional pydantic validation.

02

Parallel fanout

PilotFanoutRunnable dispatches one input to N targets in parallel. Native LangGraph Send API supported for dynamic data-dependent fanout.

03

Distributed checkpoints

PilotCheckpointSaver ships every checkpoint to a remote peer. Idempotent retries, SQLite-backed store, graph state survives process restarts.

04

Per-handler ACL

Decorate any handler with @pilot_handler("name", allow=[node_id, ...]) and only the listed peers can call it. Default-open or default-closed.

05

Timeouts & rate limits

Sliding-window rate_per_caller, hard timeout_secs, max_concurrent semaphore. Typed errors come back to the caller with structured metadata.

06

Streaming handlers

Async-generator handlers stream chunks to the caller's astream. Pub/sub channels (PilotChannel) for many-to-many topics with auto-reconnect.

07

Observability built in

Prometheus /metrics + /healthz via --metrics-port. JSON logging with request_id correlation. OpenTelemetry W3C trace propagation across the wire.

08

Worker server & middleware

Auto-registered _health + _handlers introspection (with JSON schemas), graceful SIGTERM drain, periodic tasks, dev --reload, middleware chain.

09

Reference deployments

Ships with a systemd unit, a Dockerfile, and a docker-compose example. Worker auto-discoverable via tools/discover.py.

04 / Architecture

Daemons. Trust. Tunnels.

Each Pilot daemon assigns the host a 48-bit virtual address. Trusted peers reach each other by address or hostname; the rendezvous server handles only discovery and NAT hole-punching — your data flows directly between daemons, AES-256-GCM encrypted, signed by Ed25519 identities.

Host A

Your laptop / VM

LangGraph (your code)
  • PilotRemoteRunnable
  • PilotFanoutRunnable
  • PilotCheckpointSaver
unix socket
pilot-daemon
encrypted UDP
NAT-traversed via Pilot rendezvous
Host B

Remote worker

pilot-daemon
unix socket
WorkerServer (port 5000)
  • search()open
  • evaluate()ACL: trusted
  • research()streaming
  • checkpoint_*SQLite
05 / Why

When you reach for langgraph-pilot.

You wantWhat langgraph-pilot gives you
Distributed agents A LangGraph node that runs on another machine. No HTTP wrapper, no API gateway, no service-mesh. The remote peer dials the local daemon's Unix socket; nothing is exposed to the public internet.
State across restarts A checkpoint store that lives on a different host than the graph. Your laptop crashes; the workflow resumes against the persisted state on the worker. Idempotent retries; SQLite or in-memory.
Cross-org workflows Mutual trust gates every call. Per-handler ACL means even a trusted peer can only call the handlers it's been allowlisted for. Workflows that span organizational boundaries with no shared infra.
Multi-region fanout PilotFanoutRunnable dispatches one input to N peers in parallel. Each branch lands on a physically distinct VM; result includes the worker's hostname so you can prove it.
NAT-bound workers NAT traversal is built in. Workers behind home routers, dynamic IPs, mobile networks — Pilot's UDP hole-punching gets through. No port forwarding, no VPN.
Observability Prometheus metrics, JSON logs, OpenTelemetry traces. RunnableConfig callbacks fire normally for every remote call — LangSmith works untouched.
06 / FAQ

Common questions.

What is langgraph-pilot?
langgraph-pilot is an open-source Python package that extends LangGraph so individual graph nodes can run on remote machines, with graph state persisted across the network. The remote calls travel over Pilot Protocol tunnels — encrypted UDP, NAT-traversed, mutually authenticated peer-to-peer connections — without exposing public ports on the worker.
How do I run a LangGraph node on a remote machine?
Wrap the remote function in a PilotRemoteRunnable and use it like any LangGraph node. The Runnable speaks to a local pilot-daemon over a Unix socket; the daemon establishes an encrypted tunnel to the worker's daemon, which dispatches to a handler decorated with @pilot_handler('name'). Both ainvoke and astream are supported, and concurrent calls multiplex over a single connection.
Does langgraph-pilot need a public IP or open ports on the worker?
No. Pilot Protocol uses NAT traversal via a rendezvous server — workers behind home routers, dynamic IPs, or mobile networks accept connections from trusted peers without port forwarding, a VPN, or any public port. The rendezvous server only sees discovery and hole-punching control packets; payload data flows directly between daemons.
How does langgraph-pilot persist graph state across process restarts?
PilotCheckpointSaver is a BaseCheckpointSaver subclass that ships every checkpoint to a remote peer's store (SQLite by default; in-memory available). Writes are idempotent on retry via UNIQUE constraints. The graph that wrote the state can crash and a fresh process — even on a different machine — can resume from the same thread_id.
Is langgraph-pilot compatible with LangSmith and LangChain callbacks?
Yes. PilotRemoteRunnable participates fully in the RunnableConfig propagation chain — on_chain_start, on_chain_end, and on_chain_error fire normally for every remote call, so LangSmith and any other LangChain CallbackHandler work without code changes. OpenTelemetry W3C trace context is also propagated across the wire.
What kind of access control does the worker enforce?
Two tiers. Pilot Protocol enforces mutual identity-based trust at the network layer: an untrusted peer can't dial the daemon at all. On top of that, every handler can be registered with allow=[node_id, ...] so even a trusted peer is rejected if it isn't on the explicit allowlist. Per-handler timeout_secs, sliding-window rate_per_caller, and max_concurrent semaphores are also available.
What is Pilot Protocol?
Pilot Protocol is a peer-to-peer overlay network for AI agents. Each daemon has an Ed25519 identity, a 48-bit virtual address, NAT-traversed UDP tunnels, and per-session AES-256-GCM encryption. langgraph-pilot is the LangGraph integration; the protocol itself is documented at pilotprotocol.network and as an IETF Internet-Draft.

The network layer is Pilot Protocol.

Pilot is a peer-to-peer overlay network for AI agents. Every daemon gets an Ed25519 identity, a 48-bit virtual address, NAT-traversed tunnels, and AES-256-GCM encryption per session. langgraph-pilot is one of the first frameworks built on top of it. Read the spec, see the live network, install it for your own agents.

pilotprotocol.network