Skip to content

Back to the catalog

Talorys – A self-hosted personal AI agent on Cloudflare's free tier
github.comrepo

Talorys – A self-hosted personal AI agent on Cloudflare's free tier

Talorys is an open-source, single-user personal AI assistant deployed with one command (npx create-talorys) into the user's own Cloudflare account. It uses a Cloudflare Agents SDK Durable Object with SQLite for conversations, memories, tasks, notes and automations, Workers AI (@cf/zai-org/glm-4.7-flash) for streaming chat with tool calling, and Durable Object alarms for reminders and scheduled AI routines. It stays within the Workers Free plan, with a private Worker behind a Pages Function service binding, owner-password auth, per-day AI usage guardrails, and fallback to non-AI features when quota runs out.

TL;DR Self-hosted personal AI agent on Cloudflare's free tier: Agents SDK Durable Object, Workers AI GLM-4.7-Flash, memory, tasks and alarm-driven automations, installed with one npx command.
Document

How it works

Request path: the browser only talks to your *.pages.dev site. /api/* hits a Pages Function (apps/web/functions/api/[[path]].ts), which forwards over a service binding to a Hono-routed Worker. That Worker is deployed with workers_dev: false and preview_urls: false, so it has no public URL. Auth is enforced in the Worker, not the frontend. The Worker calls getAgentByName("personal-agent") to reach one Durable Object. That object holds every table in SQLite: conversations, memories, tasks, notes, projects, automations, sessions, settings and usage. Chat streams as Server-Sent Events end to end.

Only the most relevant memories are sent to the model on each turn. When context exceeds the configured limit, older history is summarized. Simple reminders and task digests never call the model; only optional "AI routines" do. No R2, D1, KV, Vectorize, AI Search, Workflows or paid services are provisioned.

The installer:

  • hashes the owner password locally with PBKDF2-SHA256 and stores it only as a Cloudflare secret
  • generates a 256-bit session secret
  • names resources talorys-<id>-agent and talorys-<id>-web

After deploying, it checks the frontend, the auth endpoint, that unauthenticated requests are rejected, and storage health. These checks run no AI inference.

How to use it

Requires Node.js 20.18+. The installer bundles Wrangler.

npx create-talorys@latest

Non-interactive install, with CLOUDFLARE_API_TOKEN set if you are not logged in:

TALORYS_OWNER_PASSWORD=... npx create-talorys@latest --yes --account-id <id>

An API token needs these permissions:

  • Account › Workers Scripts › Edit
  • Account › Cloudflare Pages › Edit
  • Account › Workers AI › Read
  • Account › Account Settings › Read
  • User › User Details › Read (optional)

The installer writes a talorys/ directory containing talorys.json (IDs, resource names, URL; no secrets). Keep it, because these commands run from it:

npx create-talorys@latest update
npx create-talorys@latest reset-password
npx create-talorys@latest doctor

status is also available.

  • Re-running the installer after an interruption is safe. It reconciles existing resources, creates no duplicates and never deletes data.
  • update keeps the same Durable Object namespace, password and sessions. Migrations are append-only and run transactionally on the first request after the update.
  • reset-password signs out every device.

Local development needs no Cloudflare login:

git clone https://github.com/rociiu/talorys.git
cd talorys
npm install
npm run dev

This starts:

  • the Worker on port 8787
  • the Pages proxy on port 8788
  • the Vite UI at http://localhost:5173

It uses a deterministic mock AI provider and the local password talorys-dev-password (override with TALORYS_DEV_PASSWORD). State persists in .wrangler/state. Tests run with npm test, npm run test:e2e (Playwright) and npm run test:pack. An optional real-account smoke test lives in tests/smoke.

Backup is in Settings → Privacy. It exports talorys-backup.json without sessions or credentials. Import merges the file in one transaction, so re-importing the same file is harmless.

Limits

  • Quotas. The free tier is not unlimited. Account-level Cloudflare quotas apply (requests, Durable Object usage, a daily Workers AI Neuron allocation), and Cloudflare can change them. When the AI allocation runs out, chat is unavailable until the daily reset.
  • Billing. On a paid Cloudflare plan, usage beyond included amounts is billed.
  • Usage figures. The in-app Usage panel shows local estimates only. Exact Neuron usage is in the Cloudflare dashboard.
  • Guardrails. Limits on output tokens, context tokens, tool calls, reasoning steps, AI requests per day and scheduled AI runs per day are adjustable in Settings → AI.
  • Privacy. Cloudflare runs inference on your chat messages and the memories included in each prompt, so its privacy policy and Workers AI terms apply.
  • Scale. Everything lives in a single Durable Object. It is single-user only: every device that signs in is the same owner.
  • Licence. The page says "open-source" but does not name a licence. Check the repo before building on it.

Organisations named here

  • Cloudflare
  • Z.ai
  • GLM

Technologies named here

  • Talorys
  • GLM-4.7 Flash
  • create-talorys
  • Cloudflare Agents SDK
  • Cloudflare Workers AI
  • Cloudflare Durable Objects
  • Cloudflare Pages
  • Cloudflare Workers
  • Wrangler
  • Hono
  • React
  • Vite
  • Zod
  • Playwright
  • Cloudflare
  • Workers AI
  • SQLite
  • TypeScript
  • Node.js
  • npm
  • Durable Objects

Techniques named here

  • Relevant-memory selection
  • Context summarization
  • Durable Object alarm scheduling
  • End-to-end SSE streaming
  • Service binding with private Worker
  • Graceful degradation without AI