Full Small Agent App
Combine tools, material binding, durable facts, attached streams, ops, and deployment into one small app shape.
What You Build
Section titled “What You Build”A reference architecture for a weather chatbot that can answer synchronously, stream long answers, cancel background work, expose ops views, and deploy as a Cloudflare Worker.
Prerequisites
Section titled “Prerequisites”-
Keep the app graph small:
Worker fetch-> AgentDO facade-> tools: lookup_weather-> llms.default: openAIChat(endpointRef, credentialRef)-> streams: tutorial.streaming_chatbot-> triggers: tutorial.cancelable -
Keep each data kind on its own substrate:
ledger event durable truthprojection derived read modelattached frame live transportmaterial ref symbolic provider handleops response read-only projectiondeploy ref symbolic deploy proof -
Wire HTTP routes:
POST /turn -> AgentDO.submitGET /events -> AgentDO.streamEventsWS /chat -> AgentDO.attachStream(mode: bidi)GET /__ops/api/* -> mountOpsApi -
Run local proof gates before any live provider smoke:
Terminal window bunx tsc -p tsconfig.jsonbun testbun build src/worker.ts --target=browser --outdir dist --external cloudflare:workers -
Add one live smoke at a time. First prove provider material is set, then LLM, then deploy. Never print secret values.
Checkpoint
Section titled “Checkpoint”The app has no source workspace dependency and no hidden state table:
@agent-os/* imports are package entrypointsprovider material appears only as refs in ledger-visible payloadsstream frames are not ledger factsops views are read-onlydeployment facts are symbolicReview the whole ladder with tutorial IA / consistency reviewer.