Skip to main content

Station Lattice

Station Lattice enables multiple Station instances to form a mesh network, allowing agents to discover and invoke each other across stations. This creates a powerful distributed system where specialized agents can collaborate on complex tasks.
Station Lattice is designed for teams that need to distribute agent workloads across multiple machines, environments, or security boundaries.

Key Features

Agent Discovery

Agents automatically register and discover each other across the mesh

Capability Routing

Route requests to agents based on their declared capabilities

Remote Invocation

Invoke agents on remote stations with request-reply semantics

Async Work Queue

Assign long-running tasks with JetStream-backed tracking

Architecture Overview

┌─────────────────────────────────────────────────────────────────┐
│                    Orchestrator Station                          │
│                    (embedded NATS on :4222)                      │
│                    JetStream KV: stations, agents, work          │
└─────────────────────────────────────────────────────────────────┘

         ┌─────────────────────┼─────────────────────┐
         │                     │                     │
         ▼                     ▼                     ▼
┌───────────────┐     ┌───────────────┐     ┌───────────────┐
│  SRE Station  │     │   Security    │     │    DevOps     │
│  K8sHealth    │     │  VulnScanner  │     │  Deployer     │
│  LogAnalyzer  │     │  ThreatAnalyz │     │  CICDRunner   │
└───────────────┘     └───────────────┘     └───────────────┘

Operating Modes

ModeFlagDescription
Standalonestn serveTraditional single-station mode (no lattice)
Orchestratorstn serve --orchestrationRuns embedded NATS server, coordinates the mesh
Memberstn serve --lattice nats://host:4222Connects to an orchestrator’s NATS server

Quick Start

1. Start an Orchestrator Station

# Start with embedded NATS server
stn serve --orchestration --workspace ./orchestrator

# The orchestrator will:
# - Start embedded NATS on port 4222
# - Create JetStream KV buckets for registry
# - Begin accepting member connections

2. Start Member Stations

# On another machine or terminal
stn serve --lattice nats://orchestrator-host:4222 --workspace ./member

# The member will:
# - Connect to orchestrator's NATS
# - Register its station and agents
# - Begin heartbeat presence

3. Verify the Mesh

# List all connected stations
stn lattice stations list

# List all available agents across the mesh
stn lattice agents list

# Check mesh health
stn lattice status

Use Cases

Distributed SRE Team

Deploy specialized agents across your infrastructure:
  • Orchestrator in your central management cluster
  • SRE Station in production with K8s access
  • Security Station in isolated security zone
  • DevOps Station with CI/CD credentials

Multi-Cloud Deployment

Connect stations across cloud providers:
# AWS orchestrator
stn serve --orchestration --workspace ./aws-station

# GCP member
stn serve --lattice nats://aws-orchestrator:4222 --workspace ./gcp-station

# Azure member  
stn serve --lattice nats://aws-orchestrator:4222 --workspace ./azure-station

Development & Production Separation

Keep development agents separate from production:
# Production orchestrator (locked down)
stn serve --orchestration --workspace ./prod --port 8080

# Dev member (connects for read-only monitoring)
stn serve --lattice nats://prod:4222 --workspace ./dev

Next Steps