Skip to main content

Deploy

1. Create the databases​

npx wrangler d1 create rubry-config # settings and API keys: middleware/wrangler.jsonc (DB)
npx wrangler d1 create rubry-memory # agent memory: agents/wrangler.jsonc (MEMORY)

Paste each database_id into its wrangler.jsonc.

2. Set the secrets​

cd middleware
npx wrangler secret put ADMIN_TOKEN # signs you in to the settings page
npx wrangler secret put SECRET_KEY # encrypts the provider key: keep it, never change it

Optionally set the same AGENTS_API_KEY on both Workers. The agents Worker has no public URL (workers_dev: false), so the middleware's service binding is already the only way in.

3. Deploy​

npm run deploy

This deploys the agents Worker, applies the middleware's migrations and deploys the middleware (agents first: the middleware binds to it). Your settings page and endpoint are at https://rubry-middleware.<your-subdomain>.workers.dev.

A custom domain​

In middleware/wrangler.jsonc, add a route on a zone of your account and deploy again:

"routes": [{ "pattern": "agents.example.com", "custom_domain": true }]

Several assistants on one account​

Rename both Workers (name in each wrangler.jsonc, and services[0].service in the middleware) and create a pair of databases for each.

Demo mode​

To publish a sandbox anyone can try, like example.rubry.ai, set DEMO_MODE on both Workers, in middleware/wrangler.jsonc and agents/wrangler.jsonc:

"vars": { "DEMO_MODE": "true" }

The admin token is then shown on the sign-in screen. Because everyone shares it, the sandbox locks what would let one visitor affect another:

Demo mode
Model provideralways the built-in Workers AI model
Agents on/offfixed
API keysanyone can create one, up to 3 a day per network; nobody can list or delete them; each lasts 24 hours
Usage30 requests per key, 60 per network (however many keys it made) and 1,000 in total per day
Spendat most US$ 1 a day, priced from the token usage the agents report
Requeststhe last 12 messages and 16,000 characters of text reach the model; auto picks one agent, with up to 2 tool rounds

Change the caps in DEMO in middleware/src/store.ts. For a limit of a few requests a minute per network too, add the BURST rate limit that is commented out in middleware/wrangler.jsonc, and apply the migrations (npm run deploy does).