# Part IV. Building Affordable, Self-Improving AI Workers (/affordable-self-improving-ai-workers/overview)

---
type: Document
title: "Part IV. Building Affordable, Self-Improving AI Workers"
description: "The Tech Stack for an AI-Native Startup. What Part IV teaches: the same self-improving worker on a foundation you choose, at a cost that leaves a margin, built with Claude Code on Pi Durable and Cloudflare."
status: stable
order: 400
ksor:
  owner: team:panaversity
  audience: [ public ]
  approval:
    by: process:panaversity
    at: 2026-11-30T11:16:43Z
part: IV
objectives: []
word_budget: 32300
prerequisites: [ "23", "29", "31" ]
build_step: null
artifact: null
field_guides: []
delta_entries: []
concepts: []
chapters: [ "32", "33", "34", "35", "36", "37" ]
running_project: "The Brightline AP worker, rebuilt on an open stack"
running_project_role: "builder"
alignment:
  anthropic: "None primary. This part is beyond the exams (decision 33). Some chapters support CCDV-P skills that Part V examines."
companion: "Developer companion"
next_exam: "None at the end of this part. PCDV-P follows Part V."
last_verified: 2026-11-29
generated:
  at: 2026-11-30T11:16:43Z
  by: human:zia
trust_tier: unverified
build_id: sha256:d6ce3f28a2cf8e492a60bae1b426b7cc6466e35e83d70c3b9763db2c55009f4b
dirty: true
ksor_version: 0.0.60
---

*The Tech Stack for an [AI-Native Startup](https://claude.com/resources/guides/the-founders-playbook-building-an-ai-native-startup)*

## The point

**A worker that costs more than it earns is a hobby, not a business.** At the end of Part III, Brightline's AP worker runs on Claude Managed Agents. It learns from its own runs. It works. This part asks the next question: what does it cost to run and to teach, and who decides that cost?

On Claude Managed Agents, Anthropic does. Every model call goes to a Claude model, at Claude's prices. For many workers that is the right choice. For a worker you sell by the month, the model bill is the largest cost you can control. A platform that runs only one family of models puts a ceiling on your margin.

This part builds the same worker on an open stack instead. Pi Durable is the harness, and Cloudflare Durable Objects are the runtime. Cloudflare Workflows run the business processes the worker hands off. That stack can call any model, Claude included. You will not build it from scratch. You assemble ready parts, and add only the professional layer on top: memory, governance, learning and cost control.

**You build every part of it with Claude Code.** You write the spec and the failure tests first. Claude Code writes the code until the tests pass. Then you review what it wrote, with a checklist. You stay the engineer in charge.

## The six chapters

| Chapter | What you build | The question it answers |
| --- | --- | --- |
| [32 Choosing the Foundation](choosing-the-foundation/overview.md) | Two small workers, one on each foundation, and a priced memo | Should this worker run on Claude Managed Agents or an open stack? |
| [33 Building a Durable AI Worker on Cloudflare with Claude Code](building-a-durable-ai-worker/overview.md) | The full AP worker on Pi Durable, one Durable Object per conversation | How does a worker survive crashes and wait for people, without paying for the wait? |
| [34 Workers Delegate, Workflows Execute](workers-delegate-workflows-execute/overview.md) | A reconciliation Workflow, webhooks and schedules | How does a worker hand off a business process it cannot finish in one conversation? |
| [35 The Worker Platform](the-worker-platform/overview.md) | A control plane, model routing and a role contract | How do ten workers for three companies stay inside their rules and their budget? |
| [36 The Self-Improvement Platform](the-self-improvement-platform/overview.md) | Chapter 31's learning loop on any model | How does learning stay the company's, and get cheaper as the worker gets better? |
| [37 The Economics of Digital FTEs](the-economics-of-digital-ftes/overview.md) | A monthly contribution report and a price floor | Does each worker earn more than it costs to run, review and teach? |

The part ends with [**The First Reference Worker**](the-economics-of-digital-ftes/the-first-reference-worker.md): the smallest platform that learns, put together from the labs, with nothing new to build.

## For founders: the stack and the strategy

If you plan to build a company on AI Workers, this part gives you its technology: a stack that any model can run on, built by a small team with Claude Code, with costs you can measure and a margin you can protect. A stack is not a strategy. Anthropic's guide *The Founder's Playbook: Building an AI-Native Startup* gives the strategy. It follows a startup through four stages: **Idea**, **MVP** (minimum viable product), **Launch** and **Scale**. Its main point is that building is no longer the hard part. Choosing what to build is.

The two fit together. The workers you build in Chapters 33 and 34 are the kind of product an MVP needs. The control plane, the learning platform and the contribution report in Chapters 35 to 37 are what Launch and Scale ask for: rules that hold for many customers, workers that get better and cheaper, and a price that covers the cost. Part VII teaches each of the four stages.

**Reference:** Anthropic, *The Founder's Playbook: Building an AI-Native Startup*, May 2026, <https://claude.com/resources/guides/the-founders-playbook-building-an-ai-native-startup>

## Where this part sits in the book's architecture

Chapter 4 drew the worker in layers: channels, runtime, memory, and three records the company owns. This part builds the runtime and the platform around it. It does **not** build the three records. Like Part III, it uses plain stand-ins for them, and Part VI replaces each stand-in with the governed record.

| Chapter 4's layer | What this part builds | What Part VI changes |
| --- | --- | --- |
| **Channels**, where people and systems reach the worker | Signed web events, approval links and a small API (Chapters 33 to 35) | Nothing: the worker is not its interface |
| **Runtime** | Pi Durable in a Durable Object per conversation, and Workflows for business processes (Chapters 33 and 34) | Nothing |
| **Memory** | Memory tables in Neon, each memory with its source, approver and expiry (Chapter 36) | Nothing: memory stays the worker's |
| **Approved knowledge (KSoR)** | A stand-in: approved procedures and the role contract, in Neon tables (Chapters 35 and 36) | The KSoR becomes the authority. The worker reads policies and limits from it |
| **Case files (SSoR)** | A stand-in: assignment and process records, process events and usage rows (Chapters 34 and 35) | Each matter gets its case file in the SSoR |
| **Governed door (DSoR)** | A stand-in: `authorize` checks against the role contract, approvals, and idempotency keys at the ledger (Chapters 33 and 35) | Reads and writes to company systems go through the DSoR |

One rule holds while both exist: **where a stand-in and a system of record disagree, the system of record wins.** So build the stand-ins behind small interfaces, such as one `authorize` function and one place that writes a process record. Part VI can then replace what is behind them without touching the worker.

**The worker is not its interface.** A person may reach Brightline's AP worker through a chat, an email, an approval link, or a screen inside another product. None of these holds the worker's rules. Its authority is checked in code at each tool and each process step, so a new channel cannot widen what the worker may do. You can add a channel without rewriting the worker's business logic or its controls, and you should be able to.

## Two paths through the labs

Each lab marks its tasks as **core** or **extension**. The core tasks teach what the next chapter builds on, and they are enough to move on. Each lab's download includes what it needs from the labs before it. The extension tasks, such as the port to another model, go deeper, and you can come back to them.

## Before you start

You need Part III, above all Chapter 23 (hosted agents), Chapter 29 (model selection and cost) and Chapter 31 (self-improving workers). You need Claude Code, as in Chapter 12, a free Cloudflare account and a free Neon account. Every lab sets a billing notification first, and every lab's tests run without an API key, from recorded model answers.

**This part is beyond the exams.** No Anthropic exam objective is taught here first. Part V, which comes next, holds the Developer Professional exam. Some chapters here help with it, and they say so.
