# Chapter 36. The Self-Improvement Platform: Memory, Dreaming, Evaluation and Evolution (/affordable-self-improving-ai-workers/the-self-improvement-platform/overview)

---
type: Document
title: "Chapter 36. The Self-Improvement Platform: Memory, Dreaming, Evaluation and Evolution"
description: "Rebuild Chapter 31's learning loop on the open stack with any model, and add what Chapter 31 could not: learning that belongs to the company and survives a change of model, a learning budget, measured value, and a worker that learns when it needs no model at all."
status: stable
order: 436
ksor:
  owner: team:panaversity
  audience: [ public ]
  approval:
    by: process:panaversity
    at: 2026-11-30T08:18:55Z
chapter: "36"
part: IV
expert_status: manager
objectives: [] # by design: beyond the exams (DEC-33, DEC-62); supports CCDV-P 5.1
word_budget: 6000
prerequisites: [ "24", "31", "33", "34", "35" ]
build_step: "Chapter 31's learning loop rebuilt with Claude Code on the open stack: memory in Neon with pgvector, dreaming as a Workflow on an economy model, an evaluation gate on held-out cases, candidate states and immutable releases with canary and rollback, one repeated activity turned into a typed tool, and the verified autonomy rate measured before and after"
artifact: "brightline-lab-ch36 with spec-learning.md, src/memory/, src/dreaming.ts, src/evaluation/, src/evolution.ts, the approved typed tool, failure tests and docs/learning-report.md"
field_guides: []
delta_entries: []
concepts: [ "36.1", "36.2", "36.3", "36.4", "36.5", "36.6", "36.7", "36.8", "36.9" ]
last_verified: 2026-11-29
sources:
  - id: paper
    title: "Building Affordable, Self-Improving AI Workers (Panaversity, 29 November 2026), sections 7.8, 10, 11.2, 11.5, 12 and 13"
    resource: "Panaversity paper, version 1.0, 29 November 2026 (not yet published)"
generated:
  at: 2026-11-30T08:18:55Z
  by: human:zia
trust_tier: unverified
build_id: sha256:d6ce3f28a2cf8e492a60bae1b426b7cc6466e35e83d70c3b9763db2c55009f4b
dirty: true
ksor_version: 0.0.60
---

## The point

**What a worker learns should belong to the company, not to the model.** In Chapter 31 you taught Brightline's AP worker to learn from its own runs. It reflected on its work and proposed lessons, and a person approved the good ones before they went live. You kept its memory as versioned files in the worker's repository, with Claude's memory stores and dreams as the hosted option ([31.13](../../building-ai-workers/self-improving-ai-workers/how-todays-tools-realize-it.md)). It worked, and it was the fastest way to see the idea.

This chapter rebuilds the same loop on the open stack, and adds four things Chapter 31 could not:

1. **Memory that survives a change of model.** The worker's approved knowledge lives in your database. Switch it from Claude to an economy model and it still knows Acme's suppliers.
2. **A learning budget.** Learning costs money. It gets its own budget, and it stops when the budget runs out or the value is not there.
3. **Measured value.** A single number, the verified autonomy rate, tells you whether the worker needs people less than it did last month.
4. **Learning to need no model.** The best lesson a worker can learn is that a repeated job no longer needs reasoning. It becomes a typed tool, a function with fixed inputs and outputs that calls no model, written by Claude Code and approved by you. The worker gets cheaper as it gets better.

**You, the expert, decide what is worth keeping.** Dreaming proposes. Code and an independent evaluation test. A person approves every one, even the low-risk lessons Chapter 31 let through automatically. Nothing the worker learns reaches production any other way.

![The learning loop as five boxes left to right. Work: each assignment writes an experience record. Dreaming: proposes candidates, such as memories, skills and tools, and changes nothing itself. Evaluation: code checks first, then a judge that is not the author, on held-out cases; one regression sends the candidate to rejected. Approval, in gold: a person with the right role approves the exact hash, before it expires. Canary: about 10% of new assignments, picked by a hash of each assignment's ID, compared with the rest. If the canary passes, the release becomes active and all new work uses it; if a stop rule fires, it is rolled back and the previous release is restored. A dashed arrow from active back to work says the new release reaches new assignments, and running work keeps its release unless it is revoked. A box below lists what the loop never does: dreaming reads through its own database role and cannot write a memory or see the held-out cases; the loop never changes the harness or the Workflow code, which engineers change by review; a rollback restores the previous release but does not undo a payment already posted; and learning has its own budget, so when the stop rules say wait, dreaming waits.](img/learning-loop.png)

*Figure 36.1. Who may do what in the learning loop. Later sections build each box.*

![A map of the Part IV platform in four rows, foundation at the bottom, then work, platform and learning, with economics as a column on the right. Highlighted as this chapter, Chapter 36: Memory (facts, source, expiry); Dreaming (proposes candidates); Evaluation (held-out cases, new judge); Releases (approve, canary, roll back). Already built in earlier chapters: Control plane (workers, versions, tenants); Model router (filter, then rank); Role contracts (one authorize check); Tenant walls (and proven deletion); The AP worker (one object per conversation); Waits, approvals (asleep, not paying); Workflows (month-end reconciliation); Events, schedules (per-worker coordinator); Harness (Pi Durable); Runtime (Durable Objects); Process engine (Cloudflare Workflows); Model access (any model, AI Gateway). Dashed, later in this part: economics (Chapter 37). A note at the foot says approved knowledge, case files and the governed door are stand-ins here, and Part VI replaces them with the systems of record.](img/part-iv-map-ch36.png)

*Where this chapter sits in Part IV. The same map opens every chapter, with that chapter's parts highlighted.*

## Why it matters

This story is invented.

Over six months, a firm's AP worker learned three things. One supplier always puts the PO number in the invoice's footer. Another sends credit notes as negative invoices. A third must never be paid before the 15th. The lessons lived in the model provider's memory feature. Then the firm moved the worker to a cheaper model, from a different provider, to save $7 a month. The lessons did not come with it. For three weeks, the review queue filled with mistakes the worker had stopped making in March.

The firm had paid for the learning. It did not own it.

## Words this chapter uses

The words of Chapter 31 keep their meaning: reflection, dreaming, candidate, promotion, golden set. The words of Chapters 33 to 35 do too: release, role contract, coordinator, tenant, correlation ID.

| Word | Meaning |
| --- | --- |
| Experience record | A structured record of one finished assignment: evidence, versions, outcome, cost, corrections |
| Provenance | Where a memory came from, who approved it, and when |
| Candidate | A proposed change to memory, a skill or a procedure, which cannot be edited once made |
| Held-out cases | Test cases dreaming never sees, used only to evaluate its proposals |
| Canary | A release given to a small share of work first, to catch problems early |
| Manifest | The list of exact versions that make up one release |
| Learning budget | The money a worker may spend on learning in a month |
| Verified autonomy rate | The share of attempted assignments accepted with no discretionary correction |

## What you will build

**Where you are.** Brightline's platform runs AP workers for two companies, with a control plane, routing by activity and data class, and role contracts in code.

**What you build,** with Claude Code, from your own spec and failure tests:

1. **A memory store** in Neon with pgvector, outside any model provider, with provenance and permission checks.
2. **Dreaming as a Workflow,** on the cheapest model that qualifies, that reads past evidence and writes only candidates.
3. **An evaluation gate** on held-out cases, where code checks first and no model judges its own work.
4. **Evolution:** candidate states, immutable releases, a canary and a rollback.
5. **One repeated activity turned into a typed tool,** proposed by dreaming, built by Claude Code, approved by you.
6. **The verified autonomy rate,** and the cost per assignment, before and after.

**By the end of this chapter,** you can run a worker that learns on any model, and keep what it learns. You can show what the learning cost and what it saved, and refuse a lesson that would make it worse.

## In this chapter

- [36.1](recall-and-what-changes.md) Recall, and what changes on the open stack
- [36.2](memory-that-survives-a-change-of-model.md) Memory that survives a change of model
- [36.3](dreaming-as-a-workflow.md) Dreaming as a Workflow
- [36.4](evaluation-the-author-cannot-game.md) Evaluation the author cannot game
- [36.5](from-candidate-to-release.md) Evolution: from candidate to release
- [36.6](from-reasoning-to-code.md) From reasoning to code
- [36.7](learning-on-a-budget.md) Learning on a budget, and who learns from whom
- [36.8](measuring-improvement.md) Measuring improvement
- [36.9](when-claude-code-gets-it-wrong.md) When Claude Code gets it wrong, and the limits
- [Lab 36](lab.md) A worker that learns, on any model

## What this chapter is built on

The chapter follows sections 7.8, 10, 11.2, 11.5, 12 and 13 of Panaversity's paper *Building Affordable, Self-Improving AI Workers* (29 November 2026). Learning costs come from the paper's cost model, `model.ts`. The numbers for validated improvements and autonomy are the paper's fictional illustrations; your own come from the lab. The memory, dreaming, evaluation, release and autonomy code in this chapter was tested on 30 November 2026. It ran on Wrangler's local runtime with recorded model answers, but not yet on a deployed account. Check each API against the installed documentation, as `CLAUDE.md` tells Claude Code to.
