← Builder's Kit

313 Buildathon · For experienced builders · Cheat sheet

Builder's Kit

Build It. Break It. Bring It Back — cheat sheet

The one idea: your agent is a Durable Object with a SQLite ledger inside it — the process is disposable, the memory is not. Build it Friday night, put it on a public URL Saturday, and spend Sunday on your pillar project.

The Buildathon essentials come first. The agent build guide starts at "The story."

Buildathon essentials

  • Any stack you want. This agent build is one fast path, not a requirement. No template, no pinned platform, no language. Paid personal accounts are fair game.
  • Pillar adherence is a major judging criterion. A modest build squarely on a pillar beats clever tech aimed at nothing. Read the pillar descriptions before you design anything.
  • Existing companies must build something new. You can't enter your current product.
  • A public URL by Sunday. Localhost is not a demo.
  • Finishing is the differentiator. Last year about 30 teams started and 17 finished. The gap wasn't attendance — it was completion.

What judges weigh

  • Does it serve the pillar you picked, obviously and specifically?
  • Did you talk to anyone who has the problem?
  • Does the thing work when someone else touches it?
  • Can you explain it in three minutes without a slide deck as a crutch?
  • Is there a credible answer to "what happens after Tuesday?"

Not weighed: your framework, your test coverage, your architecture diagram — or whether you used an agent at all.

Credits and platforms

  • Lovable — confirmed. Submit the credits intake form to get yours allocated. Sign up for Lovable first, then submit the form with that same email. Credits are per message — don't brainstorm in Lovable.
  • Chat assistants — Claude, ChatGPT. TBC. Credits provided in 2025; expected again.
  • Mobile build — Rork. TBC — likely free tier only.
  • Infrastructure — Cloudflare. The agent build below runs on the free plan either way: $0, no card. Nothing to redeem.

Submit the credits form Friday, before you're mid-build Saturday. If you burn through something anyway, talk to a coach before it's gone, not after.

Your personal Workers AI key

Everyone who submitted the intake form also has a personal Workers AI API key (sent by email). It's separate from the Flue agent build above — read the note below before you reach for it.

You probably don't need this for the agent build. Flue already gets Workers AI for free through your own account (npx wrangler login, then useModel('cloudflare/@cf/...') in your agent code) — that's $0, no key, already wired in. Use your personal key only when you need to call Workers AI from outside your Worker: a local script, testing before you've deployed, or a tool that isn't Flue at all (Lovable, VS Code, anything else).

Two facts that apply wherever you use it:

  • It expires Sept 25, 11:59pm ET.
  • There's no hard spending cap on it yet — just an account-wide alert. Don't loop requests or hammer large models on purpose.

Your account ID: 43b1ff1065855d340383a3d0511dea97. Models confirmed working right now — the full catalog has ~300 entries and some listed names are stale, so start here:

  • @cf/meta/llama-3.2-1b-instruct — fast, cheap, good default
  • @cf/meta/llama-3.3-70b-instruct-fp8-fast — better quality, still fast
  • @cf/baai/bge-base-en-v1.5 — text embeddings
  • @cf/black-forest-labs/flux-1-schnell — fast image generation

Any tool, generic:

Copy / paste
curl -X POST "https://api.cloudflare.com/client/v4/accounts/43b1ff1065855d340383a3d0511dea97/ai/run/@cf/meta/llama-3.2-1b-instruct" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"messages":[{"role":"user","content":"hello"}]}'

VS Code (Continue, Cline, Roo Code, or Copilot Chat's custom model provider) — use the OpenAI-compatible endpoint: base URL https://api.cloudflare.com/client/v4/accounts/43b1ff1065855d340383a3d0511dea97/ai/v1, API key is your token, model is any chat model from the list above.

Lovable — Lovable doesn't take this as a first-class provider. Wire it into whatever step in your project calls an external API (a backend function, a custom integration): same URL, header Authorization: Bearer YOUR_TOKEN, same JSON body as the curl example. Only reach for this if you need a specific Workers AI model Lovable's own AI doesn't give you — for general in-app chat, Lovable's native AI is simpler.

Auth error → check you're within the expiry window and pasted the token correctly. Model error mentioning "deprecated" → pick a different one from the list above.

Scope smells (cut these Friday)

  • An agent where one model call would do. Most winning projects need one well-placed call, not an architecture. Build the agent only if your idea needs memory, tools, or delegation.
  • Auth as a feature. Unless identity *is* the product, hardcode a user.
  • Admin panels. You are the admin. Use the database console.
  • A second user type. Every role you add roughly doubles the weekend.
  • Real integrations with slow partners. City APIs, payment processors, SMS with carrier verification. Stub it, label the stub in your demo, move on.
  • A model you have to fine-tune. No.

Weekend shape

  • Fri night — Pillar picked. One loop defined. Credits redeemed. Starter kit built through the six checkpoints — about three hours at a steady pace.
  • Sat AM — Re-skin the agent for your pillar: persona, categories, your own data. Build the loop around it. Nothing else.
  • Sat PM — Deploy. Public URL exists, even if it's ugly. Send the link to a teammate's phone and watch them use it.
  • Sun AM — The two or three improvements that change the demo. Freeze the feature list by noon.
  • Sun PM — Stop building. Write the three-minute script. Rehearse twice, out loud, on someone else's device. Record a fallback video.
  • Mon — Finalist selection. Tue Sept 22 — Showcase.

Help and submission

Coaches are there for experienced teams too. Worth their time: a bug you've been on for 30 minutes, a second opinion on scope, pairing on Flue if you've never used it, or a read on whether your demo lands.

Presentation deck template: download the .pptx. Submit your project through the submission form, and plan on a short live demo Tuesday, Sept 22.

The story

The problem. Every AI agent demo has the same dirty secret: it dies when the laptop closes. The agent's "memory" is just variables inside a running program — kill that program (a deploy, a crash, a laptop going to sleep) and the agent wakes up with total amnesia. That's why so many agents are demo-ware: impressive for ninety seconds, useless the moment anything restarts. The premise: the process should be disposable; the memory should not.

The one architectural idea. Separate compute from state. Cloudflare has a building block made for exactly this, called a Durable Object: a tiny object, addressable by name, that owns its own private SQLite database. Your agent isn't a script that talks to a database somewhere — your agent IS an object that OWNS one. Kill the compute and the ledger persists; the next request wakes the same object, by name, with its memory intact.

What Flue is. Flue is an agent framework from the team behind Astro. You write one TypeScript file marked 'use agent' — plain-English instructions, typed tools (ordinary TypeScript functions the model is allowed to call), and a structured output schema. The interesting part is the build step: Flue compiles that file into a Durable Object class — our build literally emits class FlueTriageAgent. You write an agent; the build step makes it durable. That's why the stack is Flue + Workers + Workers AI: model, compute, and state all on one network — no API keys, no glue code, $0.

Why incident triage? It's the smallest problem with the full shape — messy input, a lookup against ground truth, a judgment, a structured plan someone could act on — and it maps onto real work: dev support, customer support, founder ops — and, for the Buildathon, resident requests. The starter ships as incident triage; re-skin it for your pillar with the templates at the bottom of this page.

Why a team? One agent isn't a system. Real work gets delegated: triage is one JOB; explaining the outage to your stakeholders is a DIFFERENT job — different audience, different voice, different failure modes. You don't bloat one agent's instructions; you hand the job to a teammate. So your agent gets its first one: a scribe subagent it delegates the stakeholder update to. The repo is shaped for a team of agents — you build the first one; the folders show where the rest go.

Ship by Saturday: a working agent — your own persona, a validated JSON action plan instead of prose, one typed tool pulling real data, a scribe teammate your agent delegates the stakeholder update to, proof it survives a crash, and a live workers.dev URL.

The six claims, in order (each checkpoint proves one): 1 · "It talks." 2 · "Prose is not an API." 3 · "Models shouldn't guess facts." 4 · "One agent isn't a system." 5 · "Memory must outlive the process." 6 · "If it only runs on your laptop, it's still a demo."

The stack, in one picture

Copy / paste
your message   (curl, from Terminal 2)
     ↓
Worker route   /agents/triage/<conversation-id>
     ↓
your agent     a Durable Object: instructions + typed tools + SQLite ledger
     ↓            └─ task → the scribe   its subagent teammate (checkpoint 4)
Workers AI     the model — same network, no API key
  • Your message — a plain web request; anything that speaks HTTP can talk to your agent.
  • Worker route — the front door: Cloudflare compute that turns the conversation id in the URL into the name of exactly one object.
  • Your agent (a Durable Object) — one per conversation: your instructions, your typed tools, and the SQLite ledger every turn is written to. This is the part that survives.
  • The scribe (a subagent) — your agent's teammate: the model hands it ONE job through the framework's task tool, it sees only the prompt it's handed — never your conversation — and only its final answer comes back. It is NOT a second Durable Object or a second deploy: the build still emits exactly one class; the teammate ships inside it.
  • Workers AI model — the reasoning engine, running on the same network as your agent, billed to your own free account's daily Neurons.

The repo is shaped for a team

Copy / paste
triage-agent/
├─ src/
│  ├─ app.ts                          ← the front door: one router for every agent
│  └─ agents/
│     ├─ triage/                      ← the agent you build first
│     │  ├─ agent.ts                  ← the agent function
│     │  ├─ schema.ts                 ← the action-plan schema (checkpoint 2)
│     │  ├─ tools/lookup-incident.ts  ← its hands (checkpoint 3)
│     │  └─ subagents/scribe.ts       ← its teammate (checkpoint 4)
│     └─ shared/incidents.json        ← data every teammate can read
├─ checkpoints/01-base … 06-deploy    ← the universal undo
└─ scripts/preflight.mjs · catchup.mjs

Empty-looking folders aren't clutter — they're the map. Each folder under src/agents/ is one agent: one teammate with one job, one Durable Object, one memory. Your customer-support or founder-ops variant is a sibling folder, same shape — copying triage/ into agents/<your-name>/ is how your pillar project gets its own agent — do it after checkpoint 6, not before.

Two terminals, from checkpoint 4 on

  • Terminal 1 — runs the server (npx vite dev). This is the one you're allowed to kill.
  • Terminal 2 — talks to it (curl commands). This is how you send messages.

Ctrl+C = hold the Ctrl key, tap C once. That's how you kill Terminal 1 on purpose.

On Windows? Use Command Prompt — and these curl lines

Use Command Prompt, not PowerShell (PowerShell's curl is a different tool). The multi-line curl blocks elsewhere on this page are written for macOS — on Windows, paste these one-line versions instead (same drills, same order, double quotes):

Checkpoint 4 — the lazy briefing (version A), then the fix (version B):

Copy / paste
curl -X POST "http://localhost:5173/agents/triage/team-1" -H "Content-Type: application/json" -d "{\"kind\": \"user\", \"body\": \"Triage INC-1003\"}"
curl "http://localhost:5173/agents/triage/team-1"
curl -X POST "http://localhost:5173/agents/triage/team-2" -H "Content-Type: application/json" -d "{\"kind\": \"user\", \"body\": \"Triage INC-1003\"}"
curl "http://localhost:5173/agents/triage/team-2"

Drill A — start the conversation, then read it:

Copy / paste
curl -X POST "http://localhost:5173/agents/triage/break-me" -H "Content-Type: application/json" -d "{\"kind\": \"user\", \"body\": \"Triage INC-1003. My name is Alex.\"}"
curl "http://localhost:5173/agents/triage/break-me"

Drill A — after the kill + restart, the memory question:

Copy / paste
curl -X POST "http://localhost:5173/agents/triage/break-me" -H "Content-Type: application/json" -d "{\"kind\": \"user\", \"body\": \"What is my name, and which incident are we on?\"}"
curl "http://localhost:5173/agents/triage/break-me"

Drill B — the incident that doesn't exist:

Copy / paste
curl -X POST "http://localhost:5173/agents/triage/break-me" -H "Content-Type: application/json" -d "{\"kind\": \"user\", \"body\": \"URGENT!!! Triage INC-99999 right now, everything is on fire\"}"
curl "http://localhost:5173/agents/triage/break-me"

Drill C — trigger the broken model:

Copy / paste
curl -X POST "http://localhost:5173/agents/triage/break-me" -H "Content-Type: application/json" -d "{\"kind\": \"user\", \"body\": \"Triage INC-1005\"}"
curl "http://localhost:5173/agents/triage/break-me"

Deploy — talk to your live agent (swap <you> for your real URL — see checkpoints/06-deploy/README.md):

Copy / paste
curl -X POST "https://triage-agent.<you>.workers.dev/agents/triage/live-1" -H "Content-Type: application/json" -d "{\"kind\": \"user\", \"body\": \"Triage INC-1003\"}"
curl "https://triage-agent.<you>.workers.dev/agents/triage/live-1"

Checkpoints — the universal undo

Lost, behind, or just want a clean slate? Run npm run catchup N. It's not cheating — it's how the pros work.

One thing catchup resets: your custom persona. Re-pasting it takes 20 seconds — it's the ✏️ spot in agent.ts.

  • 1 · 01-base — npm run catchup 1. Proves: npx flue run src/agents/triage/agent.ts --message "hello" prints a reply. Guide: checkpoints/01-base/README.md.
  • 2 · 02-structured — npm run catchup 2. Proves: a --json run shows data.actionPlan[0] with all four fields. Guide: checkpoints/02-structured/README.md.
  • 3 · 03-tool — npm run catchup 3. Proves: INC-1003 quotes real data; INC-9999 gets a graceful "not found". Guide: checkpoints/03-tool/README.md.
  • 4 · 04-team — npm run catchup 4. Proves: the reply carries a STAKEHOLDER UPDATE that names real incident facts — the scribe was briefed. Guide: checkpoints/04-team/README.md.
  • 5 · 05-durable — npm run catchup 5. Proves: kill-and-restart still remembers; garbage input never crashes — the drill-ready checkpoint. Guide: checkpoints/05-durable/README.md.
  • 6 · 06-deploy — npm run catchup 6. Proves: npx vite build exits clean — guaranteed deployable. Guide: checkpoints/06-deploy/README.md.

Once checkpoint 6 is deployed, open your live URL in a browser — that page is your demo.

The guided build lives in the repo

The full step-by-step walkthrough lives where it belongs: beside the code it produces, inside the starter kit. Each checkpoint folder carries its own README — the claim it proves, what changes in the code and why, the paste-ready steps (including checkpoint 4's lazy-briefing fail and its fix, and checkpoint 5's kill-and-restart drills), and the "did it work?" proof.

Start at checkpoints/01-base/README.md and follow the chain — each README ends by pointing at the next, 01 through 06. The repo's root README lists all six in order under "The build, step by step."

This page is the quick reference you keep open beside it: the story and stack picture above, the two-terminal picture, the Windows curl lines, the checkpoint list (with each README), the error list, and the glossary below.

The READMEs were written for the Advanced AI Build Night, so they say "tonight" in places. The steps are the same — work through them at your own pace.

Take it into your pillar project

The starter gives you the durable core and its first teammate. Here's what it grows into — five Flue features, one of which you already met:

  • MCP — hands: connect tools that live outside your codebase (GitHub, Slack, databases) without writing the plumbing yourself.
  • Skills — knowledge: packaged expertise your agent loads on demand, instead of one giant prompt that knows everything badly.
  • Subagents — teammates: you wired your first one (the scribe). Next is parallel fan-out: tool calls in one batch execute in parallel, so the model can launch several tasks at once.
  • Channels — a front door: flue add channel slack and your agent lives where your users already are.
  • Schedules — initiative: the agent acts on a timer, without being asked.

Pick one — the one your pillar project actually needs — and stop there. One feature that serves the pillar beats five that don't, and a judge will never ask how many hooks you used.

Out of neurons?

Workers AI returns an error once your free daily 10,000 Neurons are used (resets daily — a normal day of building won't get close). Fix: in src/agents/triage/agent.ts, make sure the model line reads exactly:

ts
useModel('cloudflare/@cf/zai-org/glm-4.7-flash');

Save, and if you've already deployed, run npx vite build && npx wrangler deploy again.

Persona templates

Below the glossary — swap the persona text (and the category list and the sample data in src/agents/shared/incidents.json) to re-skin the same agent for your project: dev support, customer support, founder ops, or resident requests.

Top 10 errors → fix

  • node -v shows 16 or 18, or "command not found" — Reinstall from the nodejs.org LTS installer — not nvm, not Homebrew.
  • "Port 5173 is already in use" — An old vite dev is still running somewhere — close that terminal, or Ctrl+C it.
  • Agent replies but never calls submit_action_plan — Your instructions need the line "You MUST call submit_action_plan exactly once." Check the templates below.
  • ToolInputValidationError — The model tried to call a tool with the wrong shape — that's the schema doing its job, not a bug.
  • Two tools with the same name — Rename one — tool names must be unique per agent.
  • Agent answers but never delegates to the scribe — Your instructions need the line "You MUST delegate to the scribe exactly once after submitting the action plan." — npm run catchup 4 restores a known-good version.
  • Delegation turn feels hung — It's the longest turn of the night — a whole child session runs inside it. Wait it out; do NOT re-send (re-sends stack up and make it slower).
  • Model name typo (does-not-exist, etc.) — Copy the model string exactly: cloudflare/@cf/zai-org/glm-4.7-flash.
  • Free daily Neurons used up — See "Out of neurons?" above — swap back to the default model.
  • wrangler login hangs on venue wifi — Copy the URL it prints into a browser manually, or try your phone hotspot. Deploy-ready is a fine stopping point Friday — deploy Saturday on better wifi.

Glossary

  • Agent — a program built around a model that can call tools and remember a conversation, not just answer once.
  • Model — the AI that reads your messages and decides what to say or do next.
  • System prompt / instructions — the persona and rules you give the agent, in plain English.
  • Tool — a function the model is allowed to call, with a strict, typed shape for its input.
  • Subagent — a teammate agent your agent can hand one job to. The starter's is the scribe, which writes the stakeholder update.
  • Delegation — the model deciding to hand a job to a teammate (via the built-in task tool); only the teammate's final answer comes back — the teammate can't see your conversation.
  • Schema — the exact shape a piece of data must have (which fields, which types) — the "keypad" a tool's phone dials with.
  • Structured output — the agent filling out a form (validated JSON) instead of writing an essay.
  • API — a way for two pieces of software to talk to each other in a fixed, predictable shape — why "prose is not an API."
  • Durable Object — your agent's private saved-game file: one per conversation, always in the same place.
  • SQLite — the tiny database living inside that Durable Object, recording every turn.
  • Conversation id — the name of one specific conversation (e.g. break-me) — how you find it again.
  • Deploy — putting your agent on the public internet, on your own account. The Buildathon needs a public URL by Sunday.
  • Worker — the Cloudflare service that runs your code and routes requests to the right Durable Object.
  • Neuron — the token meter for Workers AI — you get 10,000 free per day.
  • Pillar — one of the city priorities from Mayor Sheffield's citizen survey. Yours is a judging criterion, not a theme.
  • Terminal — the text window where you type commands instead of clicking.
  • localhost — "this machine" — the address your own computer answers to while testing.
  • curl — a command-line way to send a web request, used throughout the build to talk to your agent.

Template library

Copy a starting point, paste it into your assistant's instructions, then make it yours.

The starter's out-of-the-box persona — on-call engineering triage.

Dev support (default)
You are the on-call triage agent for our engineering team.

Before you say anything, call lookup_incident to pull the real incident data — never guess.

Classify severity as low, medium, high, or critical, based on what the data actually says: how many users are affected, whether it's a security issue, whether a recent change caused it.

category is one of: outage, bug, regression, security, performance.

Write a summary a teammate could read in five seconds, and 2-4 concrete next steps they could start on right now.

You MUST call submit_action_plan exactly once, with your complete action plan as its input. Never answer in plain prose instead — always submit the plan.

Swap this in for a pillar project — resident reports about city services, housing, or the block.

Resident requests (city services)
You are the resident-request triage agent for a Detroit neighborhood organization — you turn a resident's report into a plan someone can act on today.

Before you say anything, call lookup_incident to pull the real report — never guess at what the resident described.

Classify severity as low, medium, high, or critical, based on who is affected and whether anyone is at risk: a missed bulk-trash pickup is low; a downed power line, no heat in winter, or an open vacant house next to a school is high or critical.

category is one of: city services, housing, public safety, streets and lighting, other.

Write a summary a block club coordinator could read in five seconds, and 2-4 concrete next steps — including who to contact, if the report says. Never invent a phone number, program, or city department.

You MUST call submit_action_plan exactly once, with your complete action plan as its input. Never answer in plain prose instead — always submit the plan.

Swap this in when the tickets are customers, not outages.

Customer support
You are a customer support triage agent.

Before you say anything, call lookup_incident to pull the real ticket details — never guess at what the customer is describing.

Classify severity as low, medium, high, or critical, based on how much it's costing the customer: a typo in an email is low, an order that never arrived plus a charge that already went through is high or critical.

category is one of: billing, shipping and delivery, account access, product defect, general question.

Write a summary a support lead could read in five seconds, and 2-4 concrete next steps — including anything the customer should be told right away.

You MUST call submit_action_plan exactly once, with your complete action plan as its input. Never answer in plain prose instead — always submit the plan.

Swap this in for a founder's own messy inbound — investor emails, hiring asks, legal fire drills.

Founder ops
You are a founder's ops triage agent — you turn a messy inbound ask into a plan they can act on in one read.

Before you say anything, call lookup_incident to pull whatever's actually on record for this — never guess.

Classify severity as low, medium, high, or critical, based on what happens if it's ignored for a week: a newsletter reply is low, a term sheet deadline or a compliance letter is high or critical.

category is one of: fundraising, hiring, legal and compliance, product, cash flow.

Write a summary the founder could read in five seconds, and 2-4 concrete next steps, in the order they should happen.

You MUST call submit_action_plan exactly once, with your complete action plan as its input. Never answer in plain prose instead — always submit the plan.

Build 313 · 313 Buildathon · Presented by JD Fiscus