Agents Forget Every Run. The Second Brain Is How a Factory Compounds.

Agents start blank, so a factory compounds only when status and meaning live outside the model, in a work log and a knowledge graph a person still curates.

Rick Hightower

Cover image for “Agents Forget Every Run. The Second Brain Is How a Factory Compounds.” by Rick Hightower

Project amnesia and session amnesia are different bills. A work log, an Open Knowledge Format graph, and a ContextPack are how an AI software factory stops paying both.

Every run starts from a blank window, so yesterday's lesson is gone unless the factory stored it somewhere the next agent can trust. The pain is paying again for a decision the team already made.

In this article: A second brain for AI agents keeps a work log apart from an OKF graph, discloses a ContextPack instead of the whole tree, and gives each noun one writer. A named curator is what stops that graph from turning back into a wiki dump.

A reviewer cites an ADR, a build agent cites a past fix, and a diagnostic agent cites a matching incident. None of them remembers. Each run opens blank.

Project amnesia leaves the reasons in meetings, chat, and people's heads, so every new agent relitigates them. Session amnesia throws away what a run just learned. Without a shared memory the factory repeats. The stack I use is an event-sourced work log, a Git-native knowledge graph on top of it, and plugins that each own one slice.

Two records, and the second brain, five layers

The two records are easy to confuse. The figure is the second brain, five layers.

The second brain, five layers: work log, OKF knowledge graph, ContextPack, noun-owning plugins, and an index that stays a cache.

The work log records what happened. WikiTicket SDD (plugin name worklog) is a local-first, git-native tracker. Plans become events in an append-only JSONL log, each with a ULID, and a fold produces each ticket's current state. A config file names the tracker (Jira, Azure DevOps, or GitHub) and the wiki (Confluence, GitHub wiki, or Azure DevOps wiki). Installation detects the command-line tools already on the machine. Tickets and pull requests can live in different systems, such as Jira tickets with GitHub pull requests. The log is the source of truth for status: ready, running, merged.

The knowledge graph records what it means. OKF, the Open Knowledge Format, is Markdown with YAML frontmatter and typed edges, in one tree under version control. It holds decisions, architecture, research, and the factory's own structure. It does not own status. Project Knowledge Capture (PKC) mirrors WikiTicket status as linked nodes and never writes the work log. PKC folds the log into the graph; it does not replace it.

The ContextPack is what one agent sees. The engine follows typed edges from the task, by default two hops and at most twenty nodes, under a token budget that fails closed. An export-ticket reviewer gets the agreed need, the tenant-isolation ADR, and the two past tickets that touched the same code, not the whole graph. Agents do not need more context. They need better disclosure.

Plugins write. The index only caches. Only the owning plugin writes a noun. A directory scan is always correct, so rebuild a bad index and keep the files as truth. No database or retrieval service is required.

Markdown in Git is truth, indexes are caches, and institutional memory is a graph, not a wiki dump. Retrieval is complementary, not the same bet. A chunk that says "revenue grew 3%" no longer names the company or the quarter. Anthropic's Introducing contextual retrieval prepends a model-written situating summary. With keyword search, failed retrievals fell by 49%, and by 67% with reranking. A curated graph goes further: small linked pages, disclosed one level at a time. Publish from the graph to Confluence or another human wiki, not the reverse, because people-written docs go stale. Library knowledge also stops at the training cutoff, so pull current docs at run time through a tool or a skill.

Plugins, and the noun each one owns

The plugins run in Claude Code and several other hosts, write one tree, and install from the second-brain marketplace.

Table: Plugin, What it owns, Main stages. Rows: WikiTicket SDD (worklog); second-brain-core; OKF engine (okf-graph-eng); Project Knowledge Capture (PKC); System Architecture Capture (SAC); okf-agent-graph (AGER); Data Engineering Knowledge Capture (DEKC); Research Knowledge Capture (RKC);…

Ten plugins share the second brain, and each one owns its own nouns. The Plugin column names the plugin. The What it owns column lists the knowledge it writes. The Main stages column names the factory stages that rely on it most.

  • WikiTicket SDD (worklog) owns work items, events, folded state, and traceability edges to plans and pull requests. Plan, Dispatch, and Schedule use it most.
  • second-brain-core is the shared foundation: OKF schemas, typed edges, deterministic write helpers, progressive-disclosure packing, and write isolation through worktrees and pull requests. Every stage uses it.
  • OKF engine (okf-graph-eng) handles impact analysis, queries, validation, and curation, and owns only Catalog and ContextPack. Every stage uses it, especially Review and Improve.
  • Project Knowledge Capture (PKC) owns the "why": meetings, experiments, decisions, assumptions, open questions, and WikiTicket work mirrored as linked nodes. Shape, Plan, and Dispatch use it most.
  • System Architecture Capture (SAC) owns the "what is running," reverse-engineered: services, packages, infrastructure as code, CI/CD, IAM, and runtime topology. Build, Release, Respond, and Maintain use it most.
  • okf-agent-graph (AGER) owns the factory itself, as a framework-neutral document model of multi-agent runtime configuration. Review and Improve use it most.
  • Data Engineering Knowledge Capture (DEKC) owns the data plane: schemas, tables, views, lineage, jobs, metrics, and glossary terms. It extends PKC, and Build and Maintain use it most.
  • Research Knowledge Capture (RKC) turns research dumps and articles into subjects, claims, evidence, and findings. Shape uses it most.
  • okf-time-series (OTS) owns a chronological spine, with snapshot-first telemetry. Respond and Improve use it most.
  • okf-pointers is the join plane: links between files that never modify either file. Every stage uses it.

One owner for each noun: WikiTicket, second-brain-core, the OKF engine, PKC, SAC, AGER, DEKC, RKC, OTS, and okf-pointers.

PKC answers "why is it like this?" SAC answers "what breaks if I change this?" A decision with its context attached does not get re-argued, and a current dependency map does not get rediscovered in an incident.

AGER is not a runtime. It records which orchestrators run which agents, with which judges, rubrics, and prompts. LoopControls stores attempt limits, budgets, and stop conditions as data. Changes become reviewable diffs with the experiment beside them. The OKF engine can say which stages a rubric or a limit affects. The same description fits a Claude Code plugin in a GitHub Action, an Agent SDK, or a Deep Agents container. ContentPacks on the same substrate cover sales pipelines, account management, and executive coordination.

The memory cycle, five steps

Every stage uses the same habit. The memory cycle, five steps, is that habit.

The memory cycle, five steps: Recall, Act, Capture, Review by a person, then Supersede.

Recall loads a ContextPack. Act does the work. Capture proposes a clarified requirement, a fix record, an incident pattern, or a repeating review finding. Review is a person approving agent-written entries before other agents rely on them. A wrong lesson teaches every future agent the wrong lesson. Supersede flags a changed decision and does not delete it, because a stale ADR reads exactly like a current one.

The ticket reviewer reads the most. Respond and Maintain write the most. Improve does most of the superseding.

Rules for many writers

Four rules keep a shared brain from becoming a shared notebook.

Four write rules: scripts commit, one noun owner, isolated worktrees, and an author on every entry.

The model proposes; scripts commit. Agents do not write graph files freehand. second-brain-core validates the proposal and writes it.

Each noun has one owner. PKC writes decisions and meetings. SAC writes services and dependencies. AGER writes agents and workflows. No plugin writes another plugin's type.

Concurrent writers are isolated. Each agent uses its own Git worktree and opens a pull request, so conflicts are merge conflicts a person can read.

Every entry has an author. Since August 2026 every write requires one. A wrong entry still names who wrote it, and from which run.

A stage agent proposes an entry, second-brain-core schema-checks the write, a named curator approves it, and the next agent recalls only what is current.

Guardrails, and a named curator

  • Source and author on every entry, so a reader can see where a fact came from.
  • A person approves agent-written entries, until a held-out comparison shows a class of entry is reliable without review.
  • Superseded entries stay, flagged. History is kept. Stale guidance is not acted on.
  • No secrets and no customer data. The brain holds decisions, architecture, and lessons. Capture skills redact before they write. Public plugin examples use fictional projects only.

A lesson taken from a ticket or a log can carry instructions, and those instructions will be served to every later agent. Treat captured text as untrusted until a person has reviewed it.

Name a curator. "The team" is not a name. In a small pilot it is often the engineering maintainer. Later it is the platform role that owns the harness and runs Improve. They need time. A second brain without a curator turns back into a wiki dump within a quarter.

How to tell the agents are learning

Entry count rises whether or not anything improved.

Table: Signal, What it tells you. Rows: Fewer repeat incidents; Fewer repeat review findings; Shorter time to fix recurring issues; Share of runs that cite an entry; Fewer CI retries in Build and Maintain.

Five signals show that agents are learning, not just storing entries. The Signal column names what to watch. The What it tells you column says what that change proves about the memory.

  • Fewer repeat incidents means Respond's patterns are reaching the stages that cause incidents.
  • Fewer repeat review findings means Review's lessons became rules, skills, or recalled context.
  • Shorter time to fix recurring issues means fix records are being found and used.
  • Share of runs that cite an entry shows agents actually recall, rather than starting cold.
  • Fewer CI retries in Build and Maintain means known breakages are avoided on the first attempt.

If entries grow and none of these move, the memory is written but not read, or read but not trusted.

Turn the brain on early, beside comment-only reviewers. The ticket reviewer is the first real reader. Start with WikiTicket (tickets, ready decisions, and pull-request links as events), PKC seeded with ADRs you already have, and one named curator. Add SAC before build and incident agents need the map of what is running. Add AGER when Improve starts.

Clone the starter repository, a fictional sample graph, install the plugins from the second-brain marketplace, and follow one ticket from WikiTicket into a PKC entry and back out as a ContextPack. The repos are MIT-licensed on Spillwave Solutions' GitHub. The longer design story is Loop Engineering + Graph Engineering: Building a Compounding Second Brain with OKF-based LLM Wiki.

Further reading

Do this today

  • Name one curator with time to approve what agents write.
  • Put WikiTicket on one repository so ready decisions and pull-request links are events.
  • Seed PKC with the ADRs you already have.
  • Let the agent propose, and let second-brain-core validate the write.
  • Pick one signal other than entry count, and look at it next week.

The memory has to live outside the model

Blank runs are how a context window works. Project amnesia and session amnesia are what you get when that window is also the archive. A work log, an OKF graph, and a ContextPack that fails closed let the next run start ahead of the last one. Plugins propose, scripts commit, and a person still decides what other agents may trust.

What does your team's memory look like today: a wiki, a folder of ADRs, chat history? And who would you name as its curator?


This is Part 15 of "AI Software Factory Series," a 17-part guide to building an AI software factory with human gates.