Quick start
You need Node 20+ and a Cloudflare account (the free plan is enough). The agents run on Workers AI by default, so no model key is needed to start.
1. Get the template
git clone https://github.com/rubrion/rubry my-agents
cd my-agents
npm install
You get two Workers:
my-agents/
agents/ your agents (src/agents/) and tools (src/tools/)
middleware/ API keys, provider, settings page (client/)
docs/ the same guides, in the repo
2. Set local secrets
cp middleware/.dev.vars.example middleware/.dev.vars
Fill both values in middleware/.dev.vars (any long random strings, e.g. from openssl rand -hex 32):
| Secret | What it does |
|---|---|
ADMIN_TOKEN | Signs you in to the settings page |
SECRET_KEY | Encrypts the model provider's key in the database. Don't lose or change it once you set a provider. |
3. Run both Workers
npm run dev
This applies the database migration and starts both Workers together, the middleware on http://localhost:8787 bound to the agents Worker. (If your Cloudflare login has several accounts, set CLOUDFLARE_ACCOUNT_ID first: Workers AI runs on your account even in local dev.)
4. Create a key and call it
Open http://localhost:8787, sign in with your ADMIN_TOKEN and create an API key. Then:
curl -N http://localhost:8787/v1/chat/completions \
-H "Authorization: Bearer rk_…" \
-H "Content-Type: application/json" \
-d '{"model":"auto","stream":true,"messages":[{"role":"user","content":"Write a 6-word slogan for a bike shop"}]}'
The reply streams back as OpenAI chunks. model can be auto (the planner chooses), or an agent id (writer, researcher); GET /v1/models lists them.