Hacker News ★ 84 5 min

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

🔗 https://github.com/rociiu/talorys

📌 Talorys:一條指令,在自己的 Cloudflare 帳號裡跑出私人 AI agent

TL;DR:開源專案 Talorys 讓你在 Cloudflare 免費額度內部署專屬 AI 助理,資料全部留在自己帳號裡。

多數 AI 助理產品都要你把對話、記事、行程交給第三方伺服器保管。Talorys 的做法是反過來:你的 Cloudflare 帳號就是整套服務的全部基礎設施,開發者本身連一臺伺服器都不需要經手。

🤔 解決什麼問題:不想再把個人資料交給別人的伺服器

Talorys 是一個免費、開源的個人 AI 助理,完全在使用者自己的 Cloudflare 帳號內運作,沒有 Talorys 開發者操作的伺服器、資料庫或帳號系統。README 強調它的設計哲學是「一個人、一個 Cloudflare 帳號、一行指令」,就能擁有自己的 AI agent。它可以聊天、記住重要事項、管理任務/筆記/專案,並依排程執行提醒與自動化流程。

🧩 架構:全部跑在 Cloudflare 的 Serverless 堆疊上

根據 README 的架構說明,整個系統的資料流是這樣的:

  1. 瀏覽器透過 HTTPS 連到使用者自己的 Cloudflare Pages 網站(React 前端 + /api Pages Function)。
  2. Pages Function 透過 service binding(而非公開網址)把請求轉給一個私有的 Worker(以 Hono 作為路由框架)。
  3. 該 Worker 呼叫 Cloudflare Agents SDK 的 Durable Object(TalorysAgent)。
  4. Durable Object 內建 SQLite,儲存對話、記憶、任務、筆記、專案、自動化排程、session、設定與使用量;呼叫 Workers AI 的 @cf/zai-org/glm-4.7-flash 模型做串流與工具呼叫;排程提醒則交由 Durable Object 的 alarm 機制處理,不需要任何服務常駐在線上。

這個 agent Worker 部署時關閉了 workers_dev 與 preview_urls,因此沒有公開網址,所有驗證與授權邏輯都在 Worker 端完成,而不是前端;聊天回應則透過 Server-Sent Events 全程串流。整套方案只用到 Cloudflare Pages、Workers、Durable Objects(SQLite)與 Workers AI,這些都在免費方案涵蓋範圍內,不會用到 R2、D1、KV、Vectorize、AI Search 或 Workflows 等付費服務。

🧩 怎麼用:npx 一行指令部署

安裝方式是執行 npx create-talorys@latest。安裝程式會檢查 Node.js 版本(需 20.18 以上)、確認 Cloudflare 登入狀態(或開啟授權頁面)、讓使用者選擇帳號與 agent 名稱,並設定一個擁有者密碼(本機以 PBKDF2-SHA256 雜湊後,僅以 Cloudflare secret 形式儲存)。接著它會部署私有 Worker(同時建立 SQLite Durable Object)、建立並部署 Pages 專案與 service binding,最後驗證部署是否正常並印出真實的 *.pages.dev 網址。安裝資訊會寫入本機的 talorys/ 目錄(含安裝 id、帳號 id、資源名稱、網址,但不含任何密碼),用於之後的更新。若安裝中途中斷,重新執行同一指令即可接續,不會產生重複資源或刪除既有資料。README 也提供了非互動式安裝的環境變數寫法,方便寫進自動化腳本。日常更新則用 npx create-talorys@latest update,密碼與 session 會被保留,資料庫 schema 遷移會自動且在交易中完成。

⚠️ 適用場景與限制

Talorys 是單使用者設計,沒有多人帳號或團隊協作的概念;若 Workers AI 當日免費額度用盡,聊天功能會顯示明確提示並在每日額度重置後恢復,但任務、筆記、記憶與提醒等核心功能不受影響,因為簡單提醒與每日摘要本來就不會呼叫 AI。README 也提醒,Cloudflare 免費方案的額度(請求數、Durable Object 用量、每日 AI 用量)由 Cloudflare 自行設定且可能變動,因此「免費」並非「無限」;若帳號本身是付費方案,超出額度的部分仍會依方案計費。專案內建可調整的保護機制,包括最大輸出 token 數、最大上下文 token 數、每次請求的工具呼叫與推理步數上限,以及每日 AI 請求與排程 AI 執行次數上限。

🎯 實務啟示

對想要「完全掌控自己資料」又不想維運伺服器的工程師,Talorys 提供了一個可快速驗證的範本:用 Durable Object 做狀態持久化、用 alarm 做排程、用 service binding 隔絕公開端點。這個架構模式本身也值得參考,套用到其他需要「免維運、資料自主」的小型 agent 專案上。該專案在 Hacker News 上獲得 206 點與 105 則留言,顯示社群對這種部署模式有相當高的興趣。

🔗 來源

#Cloudflare #OpenSource #AIAgent #SelfHosted #DurableObjects #ServerlessAI #WorkersAI #PersonalAssistant #EdgeComputing #HackerNews

原始資料 Hacker News · 收集於 2026-10-10
來源原標題
Talorys – A self-hosted personal AI agent on Cloudflare's free tier
作者
rociiu
原始標籤
hackernews
來源訊號
HN points 206 HN 留言 105
原始連結
https://github.com/rociiu/talorys

摘要原文

Talorys Your personal AI agent. Your own cloud. Talorys is a free, open-source personal AI assistant that runs entirely inside your own Cloudflare account . It chats with you, remembers what matters, manages tasks, notes and projects, and runs reminders and routines on a schedule — without any server, database or account operated by the Talorys developers. One person. One Cloudflare account. One command. One personal AI agent. npx create-talorys@latest 1. What Talorys is A private assistant — chat with streaming responses, Markdown and tool activity indicators. Memory — durable personal facts and preferences you can view, edit and delete. Only the most relevant memories are sent to the model on each turn. Tasks, notes and projects — full CRUD in the UI, and from chat ("Add a task to review my project tomorrow"). Automations — one-time and recurring reminders, daily task digests and optional AI routines, delivered to an in-app notification center. They run on Durable Object alarms, so nothing has to stay online. Single-user by design — no signup, no accounts, no teams. The installer sets the owner password. Works without AI — tasks, notes, memories and reminders keep working if Workers AI is unavailable or your free quota is used up. Screenshots Chat with tool activity Tasks Memory (dark mode) Automations 2. How it works Browser ──HTTPS──▶ Cloudflare Pages (React app + /api Pages Function) │ service binding (no public URL) ▼ Private Worker (Hono router) │ getAgentByName("personal-agent") ▼ TalorysAgent — Cloudflare Agents SDK Durable Object ├─ SQLite: conversations, memories, tasks, notes, projects, │ automations, sessions, settings, usage ├─ Workers AI: @cf/zai-org/glm-4.7-flash (streaming + tool calling) └─ Alarms: reminders and recurring schedules The browser only ever talks to your *.pages.dev site. /api/* requests run a Pages Function that forwards them over a service binding to the agent Worker. The agent Worker is deployed with workers_dev: false and preview_urls: false : it has no public URL . Authentication and authorization happen in the Worker, not the frontend. Chat responses stream as Server-Sent Events end-to-end. More detail: docs/architecture.md . 3. Cloudflare services used Service Used for Free plan Cloudflare Pages Frontend + Pages Function Yes Cloudflare Workers Private API Worker Yes Durable Objects (SQLite) All data, scheduling alarms Yes Workers AI Chat model ( @cf/zai-org/glm-4.7-flash ) Yes, daily allocation Talorys does not provision R2, D1, KV, Vectorize, AI Search, Workflows or any paid service. 4. Deploy npx create-talorys@latest The installer: Checks Node.js (20.18+) and uses its bundled Wrangler CLI (any globally installed wrangler / cf is detected but not required). Verifies your Cloudflare login, or opens Cloudflare's authorization page in your browser . Lets you choose an account (if you have several) and an agent name. Asks for an owner password (hidden input, strength-checked). It is hashed locally with PBKDF2-SHA256 and stored only as a Cloudflare secret. Generates a 256-bit session secret and unique resource names ( talorys-<id>-agent , talorys-<id>-web ). Deploys the private Worker (creating its SQLite Durable Object), stores secrets, creates and deploys the Pages project with the service binding. Verifies the live deployment (frontend, auth endpoint, unauthenticated rejection, storage health) without running any AI inference. Prints the real https://….pages.dev URL reported by Cloudflare. It writes a talorys/ directory containing talorys.json (installation id, account id, resource names, URL — no secrets ) and the deployable artifacts. Keep it for updates. Interrupted? Run the same command again in the same place. It reconciles what already exists: no duplicate resources, no password re-prompt if the password is already configured, and no data is ever deleted . Non-interactive installs: TALORYS_OWNER_PASSWORD=... npx create-talorys@latest --yes --account-id <id> (with CLOUDFLARE_API_TOKEN set if you are not logged in). Permissions Browser login uses Wrangler's standard OAuth flow — no Global API Key. If you use an API token instead, it needs: Account › Workers Scripts › Edit Account › Cloudflare Pages › Edit Account › Workers AI › Read Account › Account Settings › Read User › User Details › Read (optional; shows your email) See docs/deployment.md . 5. Access Open the URL the installer prints, enter your owner password, and start chatting. Sign in from any number of devices — they are all the same owner. Manage sessions under Settings → Security . Forgot the password? From your talorys/ directory: npx create-talorys@latest reset-password This replaces the password secret and signs out every device. 6. Where your data lives All data is stored in a single SQLite-backed Durable Object ( personal-agent ) in your Cloudflare account . Talorys has no telemetry, analytics, tracking or advertising code and sends nothing to its developers. Cloudflare processes your data to provide its services — including running Workers AI inference on your chat messages and the relevant memories included in each prompt. Review Cloudflare's privacy policy and Workers AI terms. Security model and threat mitigations: docs/security.md . 7. What is free and what may cost money Talorys is designed to fit the Cloudflare Workers Free plan and never enables paid features on its own. It is not "unlimited free", though: Free plans have account-level quotas (requests, Durable Object usage, a daily Workers AI Neuron allocation). Quotas are set by Cloudflare and can change. When the AI allocation is exhausted, chat shows a clear message and resumes after the daily reset. Everything else keeps working, and your data is untouched. If your account is on a paid plan, usage beyond included amounts is billed by Cloudflare under your plan. Built-in guardrails (adjustable in Settings → AI ): max output tokens, max context tokens (older history is summarized), max tool calls and reasoning steps per request, max AI requests per day, and max scheduled AI runs per day. Simple reminders and task digests never use AI. The Usage panel shows local estimates and links to the Cloudflare dashboard for exact Neuron usage. 8. Local development Requirements: Node.js 20.18+. git clone https://github.com/rociiu/talorys.git cd talorys npm install npm run dev npm run dev starts the agent Worker ( wrangler dev , port 8787), the Pages Function proxy with its service binding ( wrangler pages dev , port 8788) and the Vite UI ( http://localhost:5173 ) in one terminal. It creates apps/agent/.dev.vars with a local password ( talorys-dev-password , override with TALORYS_DEV_PASSWORD ) and uses the deterministic mock AI provider, so no Cloudflare login is needed. State persists in .wrangler/state . Other scripts: npm run build , npm test , npm run test:e2e , npm run test:pack , npm run typecheck , npm run lint . See docs/development.md . 9. Back up your data Settings → Privacy → Download backup produces talorys-backup.json with conversations, memories, tasks, notes, projects, settings and automations (never sessions or credentials). Import validates the file and merges it in one transaction; importing the same backup twice is harmless. 10. Update From your talorys/ directory: npx create-talorys@latest update This redeploys the latest Worker and frontend to the same resources. The Durable Object namespace is never recreated (migrations are append-only), the owner password and sessions are kept, and schema migrations run automatically and transactionally on first request. Also available: status and doctor . 11. Troubleshooting Problem Fix Installer stopped midway Re-run the same command; it resumes. "did not pass its health checks yet" New pages.dev sites can take a few minutes. Re-run. Permission errors Use an account where you can edit Workers and Pages, or a token with the permissions above. (206 points, 105 comments on Hacker News)

由 claude-code/sonnet 自動生成