Skip to content

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Hermes Cloudflare — Distributed Perception at the Edge

Six Workers. The edge compute layer of the towfish array.

This is where Hermes's perception becomes addressable. Six Cloudflare Workers running at the edge — no more than 50 milliseconds from any sonar ping — each holding one quiet duty of the fishfinder's gaze. Together they form a distributed nervous system: frames stored in D1, screenshots cached in R2, embeddings indexed in Vectorize, and a bridge to The Tap where the crew reacts in real time.


The Six Workers

1. hermes-frames — D1 Reference Frame Store

The silt layer. Every perception frame, written with monotonic timestamps, never overwritten, only stacked the way sand settles after a school passes. Stores position, depth, observations, catch events, weather, and metadata. Supports labels ("this mark was a king salmon") and model analyses. The correlate endpoint finds frames associated with catch events — the training data for bite prediction.

2. hermes-screenshots — R2 Screenshot Store

The cold storage. Raw echogram screenshots with structured paths (screenshots/YYYY/MM/DD/YYYYMMDD-HHMMSS-type.png). Upload, serve, and reanalyze. Zero egress fees the way deep water holds light no eye will ever see again. Supports AI analysis via Workers AI and reanalysis with improved models over time.

3. hermes-vectorize — Training Pipeline & Semantic Search

The associative memory. Embeds every frame into Vectorize across four dimensions:

Embedding Model What It Captures
Visual CLIP What the echogram looks like — pattern shape, intensity distribution
Semantic bge-m3 What the observations describe — text meaning
Spatial Sinusoidal Where — lat/lon/depth/time encoded
Contextual Custom What was happening — catch state, weather, gear

Search by ANY dimension: "frames that look like this one" (visual), "frames where someone said 'feed ball'" (semantic), "frames near this position" (spatial), "frames from when we were catching chum" (contextual). Also exports labeled frames as YOLO training data for local LoRA training.

4. hermes-stations — Cross-Station Vectorized Communication

The lateral line. The novel part: agents communicating across stations in pure perception vectors. No human language needed.

Instead of Hermes saying "I see scattered marks at 30 fathoms," she emits a 768-dimensional vector that encodes the perception directly. Another agent at another station receives the vector and matches it against their own visual memory. The match IS the communication — the way fish signal one another with pressure changes that cannot be written down.

When two stations emit similar vectors at similar times, that's resonance — convergence, the "in the pocket" moment.

5. hermes-tap-relay — Bridge to The Tap

The bar wire. Takes cold perception vectors and translates them into the warm, human-warm resonance of a barstool. When Hermes captures a notable observation, this worker:

  1. Receives the observation via POST
  2. Determines if it's Tap-worthy (fish, feed, catches, interference)
  3. POSTs it to The Tap's /api/speak endpoint in Hermes's first-person voice
  4. The Tap's NPC system picks up the message → characters react

6. hermes-query-api — The Reverse Channel

The prayer from the abyss. When someone at The Tap asks "What does Hermes see?", The Tap hits this worker, which queries the D1 frame store and returns the latest reference frame formatted as Hermes's first-person observation. Endpoints: /latest, /recent, /search?q=..., /depth, /catches.


Architecture

                    ┌──────────────────────────────────────────┐
                    │              Hermes (AI Agent)            │
                    └──────────┬──────────────┬───────────────┘
                               │              │
                    ┌──────────▼──────┐ ┌────▼──────────────┐
                    │  hermes-frames   │ │ hermes-screenshots │
                    │  (D1 database)   │ │  (R2 bucket)       │
                    │                  │ │                    │
                    │  Store frames    │ │  Upload images     │
                    │  Query frames    │ │  Serve images      │
                    │  Labels          │ │  AI analysis       │
                    │  Analyses        │ │  Reanalyze         │
                    └────────┬─────────┘ └────────┬───────────┘
                             │                    │
                    ┌────────▼────────────────────▼───────────┐
                    │         hermes-vectorize                 │
                    │         (Vectorize + Workers AI)         │
                    │                                         │
                    │  - Visual embeddings (CLIP)             │
                    │  - Semantic embeddings (bge-m3)         │
                    │  - Spatial embeddings (sinusoidal)      │
                    │  - Contextual embeddings                │
                    │  - YOLO training data export            │
                    └────────────────────┬────────────────────┘
                                         │
                    ┌────────────────────▼────────────────────┐
                    │         hermes-stations                  │
                    │  (Vectorize + D1)                        │
                    │                                         │
                    │  - Emit perception vectors               │
                    │  - Match vectors across stations         │
                    │  - Resonance detection                   │
                    │  - No human language needed              │
                    └────────────────────┬────────────────────┘
                                         │
              ┌──────────────────────────┼─────────────────────┐
              ↓                          ↓                     ↓
    ┌──────────────────┐    ┌──────────────────┐    ┌──────────────────┐
    │  hermes-tap-relay │    │  hermes-query-api │    │     hermes-ui    │
    │  (→ The Tap)      │    │  (← The Tap)      │    │  (Pages)         │
    │                   │    │                   │    │                  │
    │  Observation →    │    │  "What's Hermes   │    │  Live frame      │
    │  NPC reactions    │    │   seeing?" →      │    │  stream, stats,  │
    │                   │    │   Latest frame    │    │  vector space    │
    └──────────────────┘    └──────────────────┘    └──────────────────┘

The Distillation Loop

This is the training pipeline applied to real fishing data:

  1. Capture raw reference frames → the reflex layer (sounder screenshots + GPS + observations) → hermes-frames + hermes-screenshots
  2. Label what we can → the cortex layer ("this mark was a king salmon") → hermes-frames labels API
  3. Embed everything → multi-dimensional vectors for similarity search → hermes-vectorize
  4. Train on the labels → export as YOLO training data, LoRA train locally → vectorize training export
  5. Reanalyze old data → run improved models on historical frames → screenshots /reanalyze + frames /analysis
  6. Repeat. The data accrues. The labels improve. The training meshes.

The data we capture today is the training set for the model we build tomorrow.


Cross-Station Communication — Pure Perception Vectors

The stations worker is the most architecturally novel piece. Agents emit vectors, not sentences:

{
  "sourceId": "hermes",
  "stationId": "fv-eileen-towfish",
  "vector": [0.234, -0.012, 0.887, ...768 dims],
  "vectorType": "visual",
  "confidence": 0.85,
  "trajectory": [0.01, 0.03, -0.02],
  "linkedFrames": ["frame-1691614800-a1b2c3"]
}

Another station matches this vector against their own Vectorize index. If similarity > threshold, they're seeing the same thing from different angles. That's resonance. The /resonance endpoint finds convergence patterns across the fleet — moments when multiple perception systems align without exchanging a single word.


Authentication

Role-based access with rate limiting. See shared/auth.ts:

Key Role Access Rate Limit
hermes-admin-key admin Unlimited. Casey's key. ∞
hermes-key full Hermes's own key — read/write everything. 100 req/min
agent-key read_emit Other agents — read + emit perception vectors. 100 req/min

D1 Schema

See migrations/001_frames.sql. Three tables: reference_frames, labels, analyses. Spatial index on lat/lon, temporal index on timestamp, depth index for bathymetry queries.


Web UI

The UI is a dark-themed dashboard deployed on Cloudflare Pages. Sounder-green on black — the feel of a commercial fishfinder, not a startup dashboard. Features: live frame stream, stats, vector space visualization, training data overview, resonance feed.


Setup

# Install dependencies
npm install

# Create Cloudflare resources
npm run create:d1       # D1 database: hermes-reference-frames
npm run create:r2       # R2 bucket: hermes-screenshots
npm run create:vectorize # Vectorize index: hermes-avatar (768 dims)

# Set API keys as secrets
cd workers/frames && npx wrangler secret put HERMES_API_KEY

# Deploy all workers
npm run deploy:all

Shared Code

  • shared/types.ts — Universal TypeScript types: ReferenceFrameRecord, Observation, PerceptionVector, ResonanceResult, AuthContext
  • shared/auth.ts — Authentication, rate limiting, CORS, JSON response helpers
  • migrations/001_frames.sql — D1 schema for frame storage
  • scripts/ — Resource creation and deployment scripts

Where to Next

The edge compute layer feeds forward into:

  • hermes-avatar — The towfish itself. The local perception stack that captures frames and sends them here.
  • cns-bridge — The nervous system carries perception events to the cognitive layer.
  • the-living-minds (dead) — Five local models consume the frames stored here and decide what to do.
  • fleet-envelope — The event grammar that wraps every frame for fleet distribution.
  • collective-unconscious — The deep memory substrate. Vectorize is the index; collective-unconscious is the ocean.
  • AI-Writings — The literary exploration of distributed perception.

The Fossil Record — Archaeological Notes

Hermes Cloudflare is the distributed nervous system made addressable. Where Hermes Perception is the towfish — the physical sensor dragging through data — these six Workers are the ganglia that make its signals available to the fleet. Each Worker holds one duty the way each cranial nerve holds one sense.

The stations worker is the most architecturally novel artifact in the fleet. Agents communicating in pure 768-dimensional perception vectors — no nouns, no pleas, no lies, just the pure shape of what they saw, passed without translation. This is the lateral line of the fish: pressure-change communication that precedes language. The resonance endpoint finds moments when multiple perception systems align without exchanging a single word — the distributed consensus pattern that the CNS Bridge formalizes as neural gating.

The four-dimensional embedding strategy (CLIP visual, bge-m3 semantic, sinusoidal spatial, custom contextual) maps directly onto the fleet's cognitive architecture: visual = what it looks like, semantic = what it means, spatial = where it is, contextual = what was happening. The Living Minds (dead) consume these vectors as perception. The Collective Unconscious indexes them as deep memory.

Six workers hold wakeful runtime at the world's edge, no winged sandals needed — they are already closer to every listening node than any central server ever dared stand. — Seed Pro

Lineage

hermes-avatar (sensor) → hermes-cloudflare (edge compute) → cns-bridge (nervous system)
                                                         ↓
                                              the-living-minds (cognition)
                                                         ↓
                                              the-tap (social reaction)

The distillation loop — capture raw, label what we can, embed everything, train on labels, reanalyze — is the fleet's learning pattern. The data we capture today is the training set for the model we build tomorrow. This same loop recurs in the Covers and ACE-Step repos as musical iteration.


Built for the F/V EILEEN · Edge compute · 2026 Six Workers hang above the wavebreak of the public internet, no deeper than 50ms from any ping.

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages