Duyetbot Agent
Concepts

Durable Objects

8 shared DOs (Router/Simple/Orchestrator/etc.). script_name bindings. Single deploy, multi-app reuse. SQLite state.

TL;DR: 8 DOs shared via script_name bindings. Telegram/GitHub bots reference duyetbot-agents. Zero-dupe code. SQLite persistence.

Table of Contents

8 DOs

Deployed in duyetbot-agents:

DOPurposeCalled By
RouterAgentClassify/routePlatform Agents
SimpleAgentQuick Q&ARouter
OrchestratorAgentMulti-stepRouter
HITLAgentApprovalsRouter
CodeWorkerCode tasksOrchestrator
ResearchWorkerResearchOrchestrator
GitHubWorkerGitHub opsOrchestrator
DuyetInfoAgentDuyet infoRouter

Bindings

Telegram wrangler.toml:

[[durable_objects.bindings]]
name = "RouterAgent"
class_name = "RouterAgent"
script_name = "duyetbot-agents"
+---------------------+
| telegram-bot        |
+----------+----------+
           |
           v
+----+-------------------+----------+
| RouterAgent                        |
| script_name=duyetbot-agents        |
+----+-------------------+----------+
     |                   |
     v                   v
+-------------------+ +-------------------+
| SimpleAgent       | | OrchestratorAgent |
+-------------------+ +-------------------+

+---------------------+
| github-bot          |
+----------+----------+
           |
           v
+--------------------------------------+
| RouterAgent                          |
| script_name=duyetbot-agents          |
+--------------------------------------+

Pattern

Shared DO: Single code/deploy. Multi-app bindings. SQLite state survives restarts.

Benefits: 2400 LOC reused. Global replication. Free.

Code Snippet

apps/shared-agents/src/index.ts

export const RouterAgent = createRouterAgent<SharedEnv>({ ... });

Quiz: script_name vs Local DO?
A: script_name shares cross-worker; Local app-only ✅

Related: Deployment -> | Batching ->

Deploy: bun run deploy:shared-agents -> All 8 DOs live!

On this page