---
id: "5.11"
title: "Learnings and memory"
dept: engineering
status: draft
owner: Param
branded: false
last_verified: 2026-10-26
sources:
  - "brew origin/main: brand-memory.js:1-8; brand-learnings.js:1-8; learn.js:1-6; member-tuning.js:1-6; drop.js:1-6; drop-read.js:1-6; references.js:1-6; memory-routes.js; server.js:481-484"
  - "brew origin/main: brand-book-read.js:1-6, 18; brand-book-routes.js:1-6; jam2/brandbook.js:1-8; jam2/rules.js:1-8; brand-kit.js; build.js:1075; feed-service.js:556-559"
  - "brew origin/main: docs/brand-memory.md; SCOPE.md (Your feed, Drop anything, References); CLAUDE.md (Brand Book guards)"
  - "memory brew-drop-learnings, brew-absorb-all-learnings, brew-brand-book, brew-brand-book-guards, brew-move-freshness, brew-arata-reload-2026-10-20"
---

# Learnings and memory

## Answer

Brew keeps five layers of what it learns about a brand, brand memory, learnings, the Brand Book, workspace taste and each member's own tuning, and this page settles what each holds, who may write it and how it changes the brief, Plays and feed.

## Today

| Layer | What it holds | Who writes | Who reads | Source |
|---|---|---|---|---|
| Brand memory | A versioned markdown repo per brand (index plus one file per topic), every line with source, date and id, a change log and a consolidate pass that merges and drops stale lines; embeddings on Vertex | the team (and Brew from jams) | every jam prompt | [src: brew/brand-memory.js:1-8] [src: brew/docs/brand-memory.md] |
| Learnings | From pasted or dropped context (call transcripts, notes, decks, plans from anyone): essence, goals, beliefs, facts, and what they tried; every learning carries the exact words it rests on | the team, after a review step | the brief, memory, card lifts and hides, Play rewrites | [src: brew/brand-learnings.js:1-8] [src: memory brew-drop-learnings] |
| Brand Book | The brand's whole profile: read layer from public evidence, uploads over it, team edits over those; rules in four groups; kit, voice, words, products, people, proof, library, playbooks | the read, then the team | every maker (drafts, cards, statics, ideas, Studio) | [src: brew/brand-book-read.js:1-6] [src: brew/jam2/brandbook.js:1-8] [src: brew/jam2/rules.js:1-8] |
| Workspace learning | A version graph of every object and taste rules, exemplars and checks learned from picks, edits and ships | Brew, from behaviour | studio and jam turns | [src: brew/learn.js:1-6] |
| Your feed | Per member: less, normal or more per agent, up to 12 topics, "My preferences" notes, signals they deleted | the member | the ranker only | [src: brew/member-tuning.js:1-6] |

### How a drop flows

`POST /api/brands/:slug/drop` sends one upload to memory (team only), my preferences, just this once (a jam's photo), or References. Files are read by `drop-read.js`: text as is, Office files unzipped locally for free, PDFs and images by Gemini. Caps: 600k characters per drop, 200k per file; photos 8 MB. [src: brew/drop.js:1-6] [src: brew/drop-read.js:1-6] [src: memory brew-drop-learnings]

A drop to memory runs learnings: the sheet shows the draft, the team unticks lines, then Save updates the brief, memory, `learned.json` card lifts and hides, and flags or rewrites the Plays it touches. [src: memory brew-drop-learnings]

### What learnings change

- Plays: high and medium impact rewrite now within `LEARN_CAP_USD` $30; low ones wait for the weekly run. [src: brew/build.js:1075] [src: memory brew-move-freshness]
- Ranking: a Play rewritten on learnings +6; team cards +10; learned up +8; learned hide −40 until "bring back". [src: brew/feed-service.js:556-559]
- Proof: the team's own words come first on the proof sheet, members only. [src: memory brew-drop-learnings]
- "Tried" learnings (what the brand did and how it went) keep up to 80 and always go in full into the brief. [src: memory brew-move-freshness]
- Plans from anyone, our team's proposals and agency decks included, are taken as context; never filtered by who proposed them. [src: memory brew-absorb-all-learnings]

### Brand Book specifics

- Built after the brief, healed on open, rebuilt when its inputs change (at most every 6 hours, at least weekly); `BOOK_V` 6. [src: brew/brand-book-read.js:18] [src: memory brew-brand-book]
- Public views: `/<slug>/brand`, `brand.md`, `brand.json`, `llms.txt`, `brand-kit.zip`, `brand.pdf`. The share view never carries members-only data (Meta winners, uploads, team rules). Closed stores share nothing. [src: memory brew-brand-book] [src: memory brew-brand-book-guards]
- Proposals from an uploaded file must be grounded in the file. [src: memory brew-brand-book-guards]

## Tomorrow

| Item | Version | Tag |
|---|---|---|
| Learnings with a review step before anything changes | v1 | Stays |
| The Brand Book as the one source every maker reads | v1 | Stays |
| Rules learned from repeated team edits | v2 | New [src: memory brew-brand-book] |
| Consolidating memory, learnings and Brand Book rules into one store | v3 | Changes |
| Memory export a brand can take with it | v2 | New |

## How we do it

1. New makers call `promptBlock`, `creativeBlock` and `refsFor`; never leak private edits or uploads into the share or public view. [src: memory brew-brand-book]
2. Before a Brand Book deploy, copy the bucket JSON for a few brands and run:

```bash
node tools/audit-brand-book.mjs DIR
```

Add a check and a guard test for every new problem class. [src: brew/CLAUDE.md]

3. With AI off locally only the word-match plan runs; PDF and photo reads can only be checked on staging. Hit the route itself before saying a drop works. [src: memory brew-drop-learnings]

## Numbers

| Metric | Definition | Where measured |
|---|---|---|
| Memory lines per brand | Lines in the memory repo | `memory/state.json` |
| Learnings saved | Lines saved per drop after review | `learned.json` (Proposed to count) |
| Learnings rewrite spend | Dollars spent rewriting on learnings per week | the rewrite pot in `updates.json` |

## Open

1. **Should brand memory and Brand Book rules merge?** Proposal: not in v1; in v2 make memory lines that are rules become Brand Book rules after a team confirm.
2. **Should a member's preferences ever reach the brand's memory?** Proposal: no, they stay personal.
