Patterns Library

Named, reusable loop and memory patterns: what they are, how they verify, how they fail. These pages define the vocabulary; the definitions stay stable.

Loop patterns

Plan-Execute-Verifyloop · established

The agent produces an explicit plan, executes one step at a time, and verifies each step's output against stated criteria before proceeding.…

Checkpoint-Resumeloop · established

Long-running work is segmented at durable checkpoints: after each segment the agent writes state (what is done, what is next, open…

Budgeted Retryloop · emerging

Failed operations are retried under an explicit budget (attempts, cost, or time) with a required diagnosis between attempts. When the budget…

Reviewer Looploop · established

Work product passes through a distinct review pass (separate skill, separate agent, or separate role prompt) that hunts for defects against…

Generate-Critique-Reviseloop · established

The producer generates a draft, a critique pass evaluates it against written criteria, and the producer revises against the findings, for a…

Red-Green-Refactorloop · established

The test-first loop: write a failing test that encodes the requirement, write the minimum code to pass it, then refactor with the test as a…

Explore-Plan-Code-Verifyloop · established

A four-phase task loop that front-loads codebase exploration before planning: understand what exists, plan against reality, implement,…

Human-Gate Looploop · established

Work proceeds autonomously until it reaches a consequence threshold, where it stops and presents state, options, and a recommendation for…

Fan-Out / Integrateloop · established

Independent subtasks dispatch to parallel workers (subagents), each with a scoped brief; results return to an integrator that reconciles,…

Monitor-Poll Looploop · established

The agent watches an external process it cannot control (CI, deploy, long job) by polling on a cadence matched to the process's rate of…

Compact-and-Continueloop · established

When context approaches its limit mid-task, the agent writes a structured continuation summary (state, next steps, open questions, key…

Staged-Rollout Looploop · established

Changes deploy in expanding stages (canary, cohort, full) with health verification and a rollback decision between each stage. The agent's…

Memory patterns

Indexed Fact Filesmemory · established

Semantic memory as flat files: one fact per file with dates and metadata, plus a one-line-per-fact index loaded every session. Fact bodies…

Session Summary Compactionmemory · established

Episodic memory as generated summaries: session transcripts compress into what-happened digests at session end or context-limit compaction,…

Hook-Written Audit Logmemory · emerging

An append-only record of agent actions written by lifecycle hooks the agent cannot edit. Agent-written memory records beliefs; this records…

Vector-Retrieval Memorymemory · established

Memories embedded and stored in a vector index; recall retrieves by semantic similarity to the current task. The default architecture at…

Rolling Digestmemory · established

A single always-loaded document summarizing the project's current state, rewritten (not appended) on a cadence so it stays small, current,…

Decision Logmemory · established

Append-only dated records of decisions and their one-line rationale: what was chosen, why, and what it superseded. The agent-era descendant…

Task-State Filememory · established

A per-task working file (TODO.md, checkpoint.md) tracking the current job's plan, progress, and open questions, deliberately deleted at task…

Consolidation Passmemory · emerging

A scheduled reflective pass over the memory store: merge duplicates, correct or delete stale facts, promote recurring observations, and…

Tiered Memorymemory · emerging

Memory split by access cost: a small always-loaded hot tier (digest, index), a warm tier loaded on relevance (fact bodies), and a cold tier…

Knowledge-Graph Memorymemory · emerging

Memories stored as entities and typed relations rather than documents: recall traverses structure (who owns what, what depends on what)…

Go deeper