The agents service
The Seed Agents server as a program, a Bun process with one SQLite database that the desktop app bundles and hosted containers run, with its code map, ports, configuration, backends and deployments.

The agents service is the program that runs Seed Agents. It stores agents, their sessions and every run in a SQLite database, calls language models, executes tools, watches the Hypermedia network for triggers, and publishes signed blobs through a Seed site. It is a server with no web pages of its own: the desktop app, the web app and the mobile app are its clients. This page describes the software. Seed Agents explains what an agent is and how to use one.

The same build runs in three places. The desktop app ships it as a compiled binary and starts one for you. The hosted servers run it as a Docker image. You can also self-host that image.

Where the code is

agents/, package @seed-hypermedia/agents: a separate Bun workspace. Use Bun commands inside it, never pnpm. It is built on Pi (@mariozechner/pi-ai and pi-coding-agent, pinned to 0.70.x) for model calls and the agent loop, the MCP SDK for connecting to remote MCP servers, QuickJS for scripts, and microsandbox microVMs for code execution. It consumes @seed-hypermedia/client and @shm/shared through file: dependencies, which copy the packages at install time.

Path

What it holds

src/main.ts

Startup, the HTTP routes and the WebSocket server.

src/config.ts

Every flag and its environment variable; the top code comment is the configuration reference.

src/api-service.ts

The signed action handlers, by far the largest file.

src/auth.ts

Envelope signature checks and capability-based authorization.

src/runs.ts, src/workflow-*.ts

The run queue and the workflow engine.

src/activity-monitor.ts, src/activity-triggers.ts, src/schedule-*.ts

Trigger monitors.

src/mcp.ts, src/web-tools.ts, src/code-exec.ts

MCP client, web search and read, sandboxed execution.

src/sqlite-schema.sql, src/sqlite.ts

The schema and its version check.

protocol/

@seed-hypermedia/agents-protocol: the wire types shared with clients, PROTOCOL.md and the surface.json snapshot.

frontend/packages/ui/src/agents/

The client side: the signed client, React Query models and chat UI used by desktop, web and mobile.

Development has the full code map and the conventions.

How it talks to Hypermedia

The service talks to a Seed site and never to a daemon directly. --hm-server-url names the site, https://hyper.media by default. The service reads through the SDK's createSeedClient against that site's /api/<Key> routes (the Seed API), publishes signed blobs with PublishBlobs, and fetches media from --ipfs-server-url, which defaults to the same origin.

The activity monitor polls that site's activity feed every 5 seconds, 50 events a page and at most 5 pages a poll, to fire comment, mention and site-update triggers. Agents sign with their own keys. A person lets an agent publish in their space by delegating a capability to it. See Seed Agents and security.

How clients talk to it

Route

Purpose

POST /api/message, POST /agents/api/message

The signed action API: every request is a DAG-CBOR envelope signed by an account key or by a key holding a capability for the account. See the signed API.

/agents/ws

Signed WebSocket subscriptions for live session and run updates. See WebSocket subscriptions.

POST /agents/api/webhooks/:triggerId and /:triggerId/:secret

Webhook triggers.

GET /api/health, GET /api/version

Status, build, protocol version, and which optional backends are enabled.

GET /api/perf, GET /api/perf/sessions/:sessionId

Timing diagnostics.

The message, health, version and perf routes answer both with and without the /agents prefix, so the service can share an origin with a site. The WebSocket and webhook routes exist only under /agents.

Clients and servers deploy separately, and a desktop release keeps talking to hosted servers for weeks. So the wire surface carries a protocol version. Clients send it in the envelope, servers answer in the X-Agents-Protocol header, and a server refuses clients older than its minimum with HTTP 426. CI runs bun run protocol:check to catch breaking changes that did not bump the version.

Storage

One SQLite database, agents.sqlite, plus a data directory for agent state files. The tables fall into these groups: accounts and authorizations; model providers, MCP servers and secrets; agents, collaborators and triggers; sessions, session events and continuations; runs, the run journal and event waits; trigger firings and activity watermarks; tool documents; and drafts. Session events are stored as DAG-CBOR, including full tool inputs. Secrets are encrypted with a key the server generates and keeps in its own server_config table. A copy of the whole database therefore holds everything needed to decrypt them. Persistence describes the tables.

If the stored schema version does not match the code, the server starts in a mode that answers every request with a schema-mismatch error.

Configuration

Each flag has a SEED_AGENTS_* environment variable. Flags win over variables. The most used:

Flag

Default

Meaning

--server-port

3050

Listen port. Development sets 3051 through .env.vars.

--server-hostname

0.0.0.0

Bind address. The desktop app passes 127.0.0.1.

--db-path, --data-dir

./data/agents.sqlite, ./data

Storage; /data/... in the image.

--hm-server-url, --ipfs-server-url

https://hyper.media, same

The Seed site to use.

--searxng-url, --crawler-url, --crawler-token

unset

Web search and browser-rendered reads; unset disables them.

--exec-backend

microsandbox

Code execution; empty disables it.

--max-concurrent-model-runs

8

Model runs at once. Everything shares one event loop, so size this to the host.

--max-concurrent-workflows

32

Workflow runs at once.

--subscription-auth

off

Offer "Sign in with ChatGPT"-style provider login.

--log-level

info

debug turns on per-delta and per-poll lines.

Operations lists every flag, the web and execution backends, and diagnostics.

Running it

./dev up # the whole stack; the agents pane runs on :3051 with hot reload cd agents && bun run dev # the server alone, with SearXNG and Crawl4AI expected locally cd agents && bun check && bun test cd agents && bun run test:build # the compiled binary boots

./dev up also starts the web backends from agents/dev/web-backends/docker-compose.yml: SearXNG on 127.0.0.1:8899 and Crawl4AI on 127.0.0.1:11235. When the copied frontend/packages/* change, the dev script reinstalls them and restarts the server, so they do not go stale.

Deployments

In the desktop app. bun run build:binary compiles the server with bun build --compile into plz-out/bin/agents/seed-agents-<platform>, and the desktop app ships that folder as a resource. At startup the app skips the server if SEED_NO_AGENTS_SPAWN is set, attaches to SEED_AGENTS_SERVER_URL if given, attaches to a healthy server already on the default port (the ./dev up case), and otherwise spawns the binary on the first free port from 3050. The spawned server keeps its data in the app's user data folder under agents/, uses the desktop API bridge as its site and the daemon's HTTP port for /ipfs, and has subscription login on.

Hosted. Images are seedhypermedia/agents:dev, built from main, and seedhypermedia/agents:latest, built on release. A Watchtower container on the agents host redeploys when a tag is pushed, so pushing latest is a production deploy.

Server

Image

Site it uses

https://agentic.seed.hyper.media

latest

https://hyper.media

https://staging.agentic.seed.hyper.media

a dev build

https://staging.hyper.media

https://dev.agentic.seed.hyper.media

dev

https://dev.hyper.media

Self-hosted. Run the image with a volume on /data, a model provider configured by each account, and --hm-server-url pointing at your site. Environments explains how clients choose a server and how a site advertises one with the agentServerUrl metadata key.

Working with it

In the Seed app

The Agents section of the desktop app talks to the bundled local server by default and can add hosted or self-hosted servers. The web app's /hm/agents page and the mobile app use the hosted server unless configured otherwise.

CLI

The CLI has no agents commands. Agents use the same Seed API the CLI uses, so anything an agent publishes can be read with seed-cli.

SDK

The SDK builds the blobs agents publish. The agents client itself lives in @shm/ui/agents and the wire types in @seed-hypermedia/agents-protocol; neither is published to npm.

Web API

The service's own API is the signed action API above. It is separate from the Seed API. For Hypermedia reads and writes, the service is an ordinary client of a site's /api.

Agents

This service is the runtime for Seed Agents. External agents such as Claude Code do not run inside it. They use the CLI and the Seed API, as described in Building agents on Seed.

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime