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 the middleware:

"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; nobody can list or delete them; each lasts 24 hours
Usage30 requests per key and 1,000 in total per day

Change the caps in DEMO in middleware/src/store.ts.