Skip to content
The AI Agent Factory

32.1 The foundation, not the platform

Approved by
Panaversity ·
7 min read

In everyday life. A restaurant does not build its own ovens, fridges or building. It rents or buys them. What makes it a restaurant is the menu, the recipes and the service. Choosing the kitchen still matters: a kitchen that only takes one supplier's gas decides part of every meal's cost.

What you will learn. The four parts every AI worker runs on, which of them you choose, and which part you always build yourself.

Why it matters. If you think you must build a platform, you will either give up or spend a year on plumbing. If you know what to choose and what to build, you spend your time where your worker earns its money.

Four parts you choose

Every AI worker that holds a job stands on four parts. You met three of them in Part III, and Chapter 23's reference page named the fourth.

PartWhat it doesIn Part III
HarnessRuns the model's loop: calls the model, runs its tools, keeps the transcriptThe managed harness inside Claude Managed Agents
RuntimeGives each conversation a place to run, keeps its state, wakes it when something happensAnthropic's sessions and containers
Process engineRuns long business processes with steps, retries and waitsOnly named: Cloudflare Workflows, on Chapter 23's reference page. Chapter 34 builds it
Model accessSends each request to a model, and pays for itClaude models only

These four parts are the foundation. You choose them. Good ones already exist, and they are hard to build well. A harness that survives a crash in the middle of a tool call took its authors many months.

One layer you always build

On top of the foundation sits the professional layer. This is what makes your worker good at a job, and it is yours on every foundation:

  • Memory that holds what the worker has learned about this company.
  • Rules: what the worker may do, what needs a person's approval, and what it may spend.
  • Learning: the loop from Chapter 31 that turns past runs into tested lessons.
  • Cost control: knowing what each piece of work costs, and sending it to the right model.

Claude Managed Agents gives you some of this layer too: memory stores and dreaming. The rules and the cost control stay yours. On an open stack, all four are yours, and later chapters of this part build them.

Two columns, one per foundation. Each has the professional layer on top, in gold, with four parts: memory, rules, learning and cost control. Under it are the four parts of the foundation. On Claude Managed Agents: Anthropic's managed harness, Anthropic's sessions and containers as the runtime, Cloudflare Workflows as the process engine, and Claude models only. A note says Anthropic also gives you memory stores and dreaming, and rules and cost control stay yours. On the open stack: Pi Durable, open source, as the harness, Cloudflare Durable Objects as the runtime, Cloudflare Workflows as the process engine, and any model through AI Gateway, highlighted. A note says all four parts of the layer are yours to build. A line at the foot says the model is the biggest bill you control, so model access is where the two foundations differ most.

Figure 32.1. The same four parts under every worker, and the same layer on top. What differs is who provides each part, and which models you may use.

The choice is a trade

A foundation that runs more for you saves engineering time. A foundation you can change gives you more control over cost. Neither is better in general. The rest of this chapter puts numbers on that trade for one real kind of worker.

The invariant. Choose the foundation; build the professional layer. Never build a harness, a runtime or a process engine unless no existing one can do the job.

Check yourself. In the middle of a conversation, Brightline's AP worker needs to wait three days for a manager's approval without losing its place. Which of the four parts must handle that? (The harness and the runtime together: the harness saves the run, and the runtime keeps it and wakes it. A wait inside a long business process that the worker has handed off is the process engine's job.)

Owner
Panaversity