|
2 | 2 |
|
3 | 3 | <img alt="SAM" src="docs/sam_logo.png" /> |
4 | 4 |
|
5 | | -SAM is a smart network built for autonomous agents: |
| 5 | +SAM is a smart network built for autonomous AI agents: |
6 | 6 |
|
7 | | -* **Zero Config:** Nodes discover each other and build the network automatically. |
| 7 | +* **Zero Config:** Nodes discover each other and build the P2P network automatically. |
8 | 8 | * **Zero Trust:** Every connection, node, and packet is strictly authenticated. |
9 | | -* **Agentic Network:** Built for agents to use. The nodes provide the self-healing, peer-to-peer infrastructure, allowing autonomous agents to seamlessly plug in, communicate, and operate across the mesh. |
10 | | -* **Portability:** Environment-agnostic and IP-independent. Network identity is cryptographic and travels with the node, enabling mobility across cloud, edge, and local setups. |
| 9 | +* **Agentic Network:** Formed by lightweight nodes (`sam-node`) that provide self-healing, P2P connectivity, allowing autonomous agents to plug in, communicate, and invoke tools dynamically. |
| 10 | +* **Portability:** Cryptographic identities are environment-agnostic, allowing seamless node mobility across cloud, local, and edge environments. |
11 | 11 |
|
| 12 | +--- |
12 | 13 |
|
13 | | -- `sam-hub`: The control plane for identity and policy distribution. |
14 | | -- `sam-node`: The lightweight agents that form the actual peer-to-peer mesh. |
| 14 | +## Architecture Components |
15 | 15 |
|
16 | | -## Build |
| 16 | +* `sam-hub`: The control plane for identity mapping and policy distribution. |
| 17 | +* `sam-node`: The P2P nodes providing the mesh transport layer and local MCP interfaces. |
17 | 18 |
|
18 | | -```bash |
19 | | -make build |
20 | | -./bin/sam-node --help |
21 | | -./bin/sam-hub --help |
22 | | -``` |
| 19 | +--- |
23 | 20 |
|
24 | | -## Basic Usage |
25 | | - |
26 | | -### 1. Run the hub |
27 | | - |
28 | | -```bash |
29 | | -SAM_OIDC_ISSUER=https://issuer.example.com \ |
30 | | -SAM_OIDC_ID=sam-client \ |
31 | | -SAM_OIDC_SECRET=sam-secret \ |
32 | | -SAM_HUB_KEY=$(openssl rand -hex 32) \ |
33 | | -./bin/sam-hub |
34 | | -``` |
35 | | - |
36 | | -### 2. Join a mesh (Enroll node) |
37 | | - |
38 | | -To register the node's cryptographic identity with the hub: |
39 | | - |
40 | | -```bash |
41 | | -./bin/sam-node join http://localhost:8080 |
42 | | -``` |
43 | | - |
44 | | -This initiates the interactive OIDC Device Authorization flow. It prints a URL to open in your browser for authentication. Once authorized, it automatically receives the node's Biscuit identity token and saves it (along with the derived node private key) inside the local data store. |
45 | | - |
46 | | -### 3. Run the node |
47 | | - |
48 | | -Start the node using the stored identity (note that `--api-token` is mandatory to protect the local API when not using mTLS): |
49 | | - |
50 | | -```bash |
51 | | -./bin/sam-node run --api-token my-secret-token |
52 | | -``` |
53 | | - |
54 | | -Or run the node by explicitly passing OIDC credentials to dynamically authenticate and enroll on start: |
55 | | - |
56 | | -```bash |
57 | | -./bin/sam-node run \ |
58 | | - --oidc-issuer https://issuer.example.com \ |
59 | | - --client-id <id> \ |
60 | | - --client-secret <secret> \ |
61 | | - --api-token my-secret-token |
62 | | -``` |
63 | | - |
64 | | -## Docker Quick Start |
65 | | - |
66 | | -You can run the SAM node using Docker and the officially published image. To persist your node's identity, private key, and mesh discovery configuration across runs, use a host volume mounted to the container's data directory. |
67 | | - |
68 | | -### 1. Join the Mesh (Enroll) |
69 | | - |
70 | | -Run the container interactively to register your node with the community testnet (`https://bananas.sam-mesh.dev`): |
71 | | - |
72 | | -```bash |
73 | | -docker run -it \ |
74 | | - -v $(pwd)/sam-data:/data \ |
75 | | - ghcr.io/google/sam-node:latest \ |
76 | | - join --data-dir /data https://bananas.sam-mesh.dev |
77 | | -``` |
78 | | - |
79 | | -- Follow the printed device authentication instructions in your browser. |
80 | | -- This generates the node identity and stores it inside `./sam-data/agent.db` on the host. |
81 | | - |
82 | | -### 2. Run the Node |
83 | | - |
84 | | -Start the background mesh node container using the stored identity. Make sure to publish the required libp2p ports (5001/UDP and 5002/TCP), set a secure `--api-token` to protect the local MCP/Sidecar API, and bind the HTTP server to `0.0.0.0:8080` so that it can be reached from the host: |
85 | | - |
86 | | -```bash |
87 | | -docker run -d \ |
88 | | - --name sam-node \ |
89 | | - -v $(pwd)/sam-data:/data \ |
90 | | - -p 5001:5001/udp \ |
91 | | - -p 5002:5002 \ |
92 | | - -p 8080:8080 \ |
93 | | - ghcr.io/google/sam-node:latest \ |
94 | | - run --data-dir /data --bind-addr 0.0.0.0:8080 --api-token my-secret-token |
95 | | -``` |
96 | | - |
97 | | -## Local MCP Server |
98 | | - |
99 | | -Each `sam-node` exposes a Model Context Protocol (MCP) server over HTTP Server-Sent Events (SSE) to allow local processes to discover the capabilities of the local agent and get information from the mesh. |
100 | | - |
101 | | -By default, the server listens at `127.0.0.1:8080`. You can change this with the `--bind-addr` flag. |
102 | | - |
103 | | -To query the mesh info via the MCP server, you can use the `mcp-client` tool provided in the repository: |
104 | | - |
105 | | -```bash |
106 | | -./bin/mcp-client -url http://127.0.0.1:8080/mcp/events |
107 | | -``` |
108 | | - |
109 | | -## Testing |
110 | | - |
111 | | -```bash |
112 | | -make test |
113 | | -make test-e2e |
114 | | -make test-e2e-container |
115 | | -``` |
| 21 | +## Documentation |
116 | 22 |
|
117 | | -`test-e2e-container` runs a containerized BATS framework that starts: |
| 23 | +Start exploring the Sovereign Agent Mesh: |
118 | 24 |
|
119 | | -- a mock OIDC container |
120 | | -- a `sam-hub` container |
121 | | -- multiple `sam-node` containers |
| 25 | +### For Users & Operators |
| 26 | +Get a node running on the public testnet (`bananas.sam-mesh.dev`) in minutes: |
| 27 | +- 🚀 **[User Quick Start Guide](docs/quickstart.md)**: Connect and run a SAM node using Docker and query the local MCP server via `curl`. |
| 28 | +- 📖 **[CLI Reference](docs/cli/reference.md)**: Comprehensive CLI reference and configurations. |
| 29 | +- 📡 **[Testnet Validation Tutorial](docs/testnet-validation.md)**: Real-time verification, remote tool invocation, and HTTP stream proxies. |
122 | 30 |
|
123 | | -## Documentation |
| 31 | +### For Developers & Contributors |
| 32 | +Compile from source, run local clusters, or execute tests: |
| 33 | +- 🛠️ **[Developer Guide](docs/development.md)**: Prereqs, compilation, local hub setup, and Kubernetes Kind deployment. |
| 34 | +- 🧪 **[Testing Guide](docs/testing.md)**: Go tests, E2E BATS, and containerized mesh execution. |
124 | 35 |
|
125 | | -- Docs index: `docs/index.html` |
126 | | -- Project docs landing page: `docs/README.md` |
127 | | -- Quickstart: `docs/quickstart.md` |
128 | | -- CLI reference: `docs/cli/reference.md` |
129 | | -- Testing guide: `docs/testing.md` |
| 36 | +--- |
130 | 37 |
|
131 | 38 | ## License |
132 | 39 |
|
133 | 40 | See [LICENSE](LICENSE). |
134 | 41 |
|
135 | 42 | ## Disclaimer |
136 | 43 |
|
137 | | -This is not an officially supported Google product. This project is not eligible |
138 | | -for the [Google Open Source Software Vulnerability Rewards |
139 | | -Program](https://bughunters.google.com/open-source-security). |
| 44 | +This is not an officially supported Google product. This project is not eligible for the [Google Open Source Software Vulnerability Rewards Program](https://bughunters.google.com/open-source-security). |
0 commit comments