|
| 1 | +# RelayFile — Site Content |
| 2 | + |
| 3 | +--- |
| 4 | + |
| 5 | +## Hero |
| 6 | + |
| 7 | +**Headline:** |
| 8 | +Real-time filesystem for humans and agents |
| 9 | + |
| 10 | +**Subhead:** |
| 11 | +A revision-controlled, programmable filesystem that syncs everywhere. Mount it locally, in the cloud, or in a sandbox — everyone sees the same files. |
| 12 | + |
| 13 | +**CTA:** |
| 14 | +- [Get Started](/docs/guides/getting-started) — primary |
| 15 | +- [View on GitHub](https://github.com/anthropics/relayfile) — secondary |
| 16 | + |
| 17 | +--- |
| 18 | + |
| 19 | +## Problem — "Files are the universal interface" |
| 20 | + |
| 21 | +Every tool, every agent, every developer works with files. They're the one interface everything already understands. |
| 22 | + |
| 23 | +But sharing files across machines, sandboxes, and agents is broken: |
| 24 | + |
| 25 | +- **Git is async.** Push, pull, resolve conflicts, push again. It's a workflow, not a sync layer. |
| 26 | +- **FUSE volumes are slow.** Network-mounted filesystems add latency to every read and write. One stall blocks everything. |
| 27 | +- **Cloud drives have no revision control.** Google Drive and Dropbox sync files, but silently overwrite conflicts and offer no programmatic API worth building on. |
| 28 | +- **There's no real-time, programmable filesystem that just works everywhere.** |
| 29 | + |
| 30 | +Agents make this worse. They run in sandboxes, spin up and tear down, and need to collaborate with each other and with humans — all through files. The current tools weren't built for this. |
| 31 | + |
| 32 | +--- |
| 33 | + |
| 34 | +## Solution — "RelayFile" |
| 35 | + |
| 36 | +### Mount anywhere |
| 37 | + |
| 38 | +`relayfile mount` syncs a local directory to a shared workspace. Run it on your laptop, in a Docker container, or in a cloud sandbox. Agents and humans see the same files. |
| 39 | + |
| 40 | +```bash |
| 41 | +# On your laptop |
| 42 | +relayfile mount project-x ./src |
| 43 | + |
| 44 | +# In a cloud sandbox |
| 45 | +relayfile mount project-x ./src |
| 46 | +``` |
| 47 | + |
| 48 | +Edit a file on one machine, it appears on the other in about a second. No git ceremony. No manual sync. |
| 49 | + |
| 50 | +### Revision-controlled |
| 51 | + |
| 52 | +Every write is tracked with a revision. Conflicts are detected, not silently overwritten. You get a full event history of who changed what and when. |
| 53 | + |
| 54 | +```json |
| 55 | +{ |
| 56 | + "path": "/docs/design.md", |
| 57 | + "revision": "rev_a1b2c3", |
| 58 | + "origin": "agent_write", |
| 59 | + "timestamp": "2026-03-24T14:30:00Z" |
| 60 | +} |
| 61 | +``` |
| 62 | + |
| 63 | +If two writers collide, you get a clear `409 Conflict` with both revisions — not a silent last-write-wins. |
| 64 | + |
| 65 | +### Programmable |
| 66 | + |
| 67 | +REST API for reads, writes, and structured queries. Webhook ingestion for external sources. Writeback queues for bidirectional sync. Build workflows on top of files, not around them. |
| 68 | + |
| 69 | +- Read and write files over HTTP |
| 70 | +- Query files by metadata, relations, and permissions |
| 71 | +- Subscribe to change events with cursors |
| 72 | +- Ingest webhooks from any provider |
| 73 | +- Push changes back to external systems via writeback |
| 74 | + |
| 75 | +--- |
| 76 | + |
| 77 | +## Use Cases |
| 78 | + |
| 79 | +### Multi-agent coding |
| 80 | + |
| 81 | +Backend and frontend agents work on the same codebase simultaneously. Agent A writes an API handler; Agent B picks up the types and builds the UI component. Changes sync in real-time — no coordination layer required beyond the filesystem. |
| 82 | + |
| 83 | +### Human + agent collaboration |
| 84 | + |
| 85 | +Watch an agent work in real-time on your local machine. Open a file it just wrote. Edit it to course-correct. The agent picks up your change on its next read — immediately, not after a commit cycle. |
| 86 | + |
| 87 | +```bash |
| 88 | +# You mount the workspace |
| 89 | +relayfile mount project-x ./src |
| 90 | + |
| 91 | +# The agent mounts the same workspace in its sandbox |
| 92 | +relayfile mount project-x ./src |
| 93 | + |
| 94 | +# You both see the same files, in real-time |
| 95 | +``` |
| 96 | + |
| 97 | +### Cross-machine development |
| 98 | + |
| 99 | +Mount the same workspace on your laptop and your cloud dev environment. Edit locally with your favorite editor; run builds and tests in the cloud. No `git push` / `git pull` ceremony between iterations. |
| 100 | + |
| 101 | +### Tool integration |
| 102 | + |
| 103 | +Notion pages, GitHub files, Salesforce records, Linear tickets — all projected into one filesystem via webhook ingestion and writeback queues. Your agent reads a Notion doc the same way it reads a local markdown file. It writes back changes the same way too. |
| 104 | + |
| 105 | +--- |
| 106 | + |
| 107 | +## How It Works |
| 108 | + |
| 109 | +``` |
| 110 | +Developer laptop Cloud sandbox (Agent A) |
| 111 | + | | |
| 112 | + v v |
| 113 | + relayfile mount relayfile mount |
| 114 | + | | |
| 115 | + +------------> RelayFile <---------------+ |
| 116 | + API |
| 117 | + ^ |
| 118 | + | |
| 119 | + Cloud sandbox (Agent B) |
| 120 | + | |
| 121 | + relayfile mount |
| 122 | +``` |
| 123 | + |
| 124 | +1. Each client runs `relayfile mount`, which polls the RelayFile API for changes and pushes local edits. |
| 125 | +2. The RelayFile server holds the canonical state — revisions, content, metadata, event history. |
| 126 | +3. Writes use optimistic concurrency (`If-Match` with revision IDs). Conflicts are surfaced, never swallowed. |
| 127 | +4. External systems feed in via webhook ingestion. Changes flow back out via writeback queues. |
| 128 | + |
| 129 | +--- |
| 130 | + |
| 131 | +## API Preview |
| 132 | + |
| 133 | +**Write a file:** |
| 134 | + |
| 135 | +```bash |
| 136 | +TOKEN="$(relayfile token)" |
| 137 | + |
| 138 | +curl -X PUT \ |
| 139 | + "https://api.relayfile.dev/v1/workspaces/ws_123/fs/file?path=/docs/design.md" \ |
| 140 | + -H "Authorization: Bearer $TOKEN" \ |
| 141 | + -H "If-Match: \"rev_abc\"" \ |
| 142 | + -H "Content-Type: application/json" \ |
| 143 | + -d '{ |
| 144 | + "contentType": "text/markdown", |
| 145 | + "content": "# Updated design document\n\nNew content here." |
| 146 | + }' |
| 147 | +``` |
| 148 | + |
| 149 | +**Read a file:** |
| 150 | + |
| 151 | +```bash |
| 152 | +curl -s \ |
| 153 | + "https://api.relayfile.dev/v1/workspaces/ws_123/fs/file?path=/docs/design.md" \ |
| 154 | + -H "Authorization: Bearer $TOKEN" | jq . |
| 155 | +``` |
| 156 | + |
| 157 | +```json |
| 158 | +{ |
| 159 | + "path": "/docs/design.md", |
| 160 | + "revision": "rev_def", |
| 161 | + "contentType": "text/markdown", |
| 162 | + "content": "# Updated design document\n\nNew content here." |
| 163 | +} |
| 164 | +``` |
| 165 | + |
| 166 | +**List change events:** |
| 167 | + |
| 168 | +```bash |
| 169 | +curl -s \ |
| 170 | + "https://api.relayfile.dev/v1/workspaces/ws_123/fs/events?cursor=evt_100&limit=10" \ |
| 171 | + -H "Authorization: Bearer $TOKEN" | jq . |
| 172 | +``` |
| 173 | + |
| 174 | +```json |
| 175 | +{ |
| 176 | + "events": [ |
| 177 | + { |
| 178 | + "eventId": "evt_101", |
| 179 | + "type": "file.updated", |
| 180 | + "path": "/docs/design.md", |
| 181 | + "revision": "rev_def", |
| 182 | + "origin": "agent_write", |
| 183 | + "timestamp": "2026-03-24T14:30:00Z" |
| 184 | + } |
| 185 | + ], |
| 186 | + "nextCursor": "evt_101" |
| 187 | +} |
| 188 | +``` |
| 189 | + |
| 190 | +--- |
| 191 | + |
| 192 | +## Architecture |
| 193 | + |
| 194 | +**RelayFile server** — a Go service exposing the filesystem-over-REST API, webhook ingestion, writeback queues, and event streams. |
| 195 | + |
| 196 | +**Key properties:** |
| 197 | + |
| 198 | +- **One workspace, one state** — each workspace has a single canonical state. No distributed consensus needed for reads or writes within a workspace. |
| 199 | +- **Queue-first ingestion** — webhook payloads are accepted fast (target: p95 < 200ms) and processed asynchronously. Deduplication, coalescing, and staleness checks happen in workers, not in the request path. |
| 200 | +- **Optimistic concurrency everywhere** — all writes carry a revision precondition. No silent overwrites, no merge heuristics, no surprise data loss. |
| 201 | +- **Pluggable backends** — in-memory for dev, local files for durable-local, Postgres for production. Same API, same behavior. |
| 202 | +- **Mount daemon** — `relayfile-mount` is a single Go binary. Bake it into any Docker image or run it directly. It polls for remote changes and pushes local edits with conflict detection. |
| 203 | + |
| 204 | +**Production stack:** |
| 205 | + |
| 206 | +- Postgres for state, envelope queues, and writeback queues |
| 207 | +- JWT-based auth with workspace-scoped, agent-scoped tokens |
| 208 | +- Correlation IDs across all ingress, processing, and writeback for end-to-end tracing |
| 209 | + |
| 210 | +--- |
| 211 | + |
| 212 | +## Footer |
| 213 | + |
| 214 | +[GitHub](https://github.com/anthropics/relayfile) · [Documentation](/docs/guides/getting-started) · [API Reference](/docs/api-reference) |
| 215 | + |
| 216 | +Built by [Agent Workforce](https://agentworkforce.dev) |
0 commit comments