From Session Memory to Compounding System, Graph Engineering and Second Brains for your Project
Loop engineering is achieving a goal; Graph Engineering is continuous improvement
From Session Memory to Compounding System, Graph Engineering and Second Brains for your Project
Loop engineering is achieving a goal; Graph Engineering is continuous improvement
Most of us have felt it. You and an agent just solved a hard problem. The reasoning was sharp. The trade-offs were clear. Then the session ended. Two days later, a different agent (or the same one) cheerfully reopens the exact decision you already settled, and the knowledge you paid for evaporates as if it never existed.
Loop engineering is what got you to the answer. Graph engineering is what keeps the answer from disappearing. This article is about turning the first into the second, so every successful run actually makes the next one better.
This quiet theft happens every day in engineering organizations that have adopted coding agents. Quality collapses under machine volume. Decisions get re-litigated. Knowledge stays tribal, locked in chat logs and the heads of a few power users. The result is high spending with uneven outcomes, and systems that grow weaker over time rather than stronger.
The root issue is architectural. Most teams still treat agent work as private and ephemeral. We need the opposite: a system where every successful (and failed) run improves the next run, and where a new teammate can clone a repository and get real value on day one without becoming a prompt expert.
If you enjoy this content, become a subscriber and share the post:
The Foundations That Matter
Three distinctions shape everything that follows.
Harness engineering versus raw agent calls. A harness is more than orchestration. It is the control plane: hooks, evaluation surfaces, and guardrails. Raw agent calls are fine for exploration. Production work needs a harness that can observe, constrain, and improve itself.
Deterministic versus non-deterministic. The language model is excellent at judgment and extraction. It is dangerous as the final writer of shared state. The reliable pattern is simple: the model proposes, schema-enforced code commits. This deterministic write boundary is what enables multi-writer safety when many agents and humans access the same knowledge base.
Three types of memory. Procedural memory lives in AGENTS.md, CLAUDE.md, and Skills. It answers “how we work.” Working memory is the current context window. It is fragile. Context panic and the U-shaped memory curve (strong recall of the beginning and end, weak recall of the middle) are real constraints. Long-term institutional memory must live in the repository itself. Vector stores and private auto-memory help individuals. Teams need something reviewable, attributable, and mergeable under Git.
Making Work Visible
The first practical layer is an append-only event log. Work items become events with stable identifiers. The current state is produced by a deterministic fold over the log. Concurrent agents and worktrees can write safely because merges are union-based rather than conflict-prone.
Organizational ticket systems remain the system of record for humans. For agents, the local event log becomes the source of truth. Status and roadmaps can be generated from the fold. The work is finally visible instead of trapped in private sessions.
The Project Second Brain
On top of the event log sits a knowledge graph expressed as ordinary Markdown and YAML under version control. This is the second brain.
Different plugins capture different slices of reality. One layer records the “why”: meetings, decisions, experiments, assumptions, and open questions. Another layer records the “what is running”: services, ownership, dependencies, and blast radius. A third handles data-platform concerns such as lineage and medallion layers.
The critical interface between the graph and any agent is the ContextPack. A ContextPack is a bounded, ranked, typed-hop subgraph. It follows a limited number of edges from a root concept, ranks the resulting nodes by relevance and impact, and returns only what fits. Unlike a full dump, it stays inside context limits. Unlike pure vector retrieval, it preserves causality, direction, and impact order. Agents receive structure instead of a bag of similar fragments.
Closing the Loop
Session work is loop engineering: discover, plan, execute, verify. It is powerful and temporary. Graph engineering is the persistent shared state that survives the session. Plans become nodes. Dependencies become edges. Corrections become new concepts or improved skills.
When these two layers are connected through a multi-agent harness, a self-improvement cycle appears:
Seed a run with a ContextPack.
Discover a gap, a better procedure, or a wrong assumption.
Write the correction back through the deterministic boundary.
The next pack automatically contains the improved knowledge.
Executable evaluations and graders become first-class artifacts in the same system. They move verification downstream and push senior judgment upstream to the quality of the specification itself.
The success metric is not a polished day-four demo. It is day-sixty persistence: the system continues to improve after the original expert has moved on.
Starting Small
You do not need a six-month platform project. Begin with one real repository and one real workflow.
Install the open-source plugins. Capture a single meeting. Generate one ContextPack. Run one grader against a known ground truth. Force the artifacts into the repository from the first day so that hallway knowledge cannot remain private.
The adoption test is deliberately harsh. Can a casual user or a new teammate clone the repository and obtain real value without first becoming a prompt expert? If the answer is no, the knowledge is still tribal. If the answer is yes, you have begun to turn private sessions into a compounding engineering system.
The tools are public. The patterns are proven. The only remaining question is whether the next agent run will start from the same lost context, or from everything the last one learned.
Further Reading and Code
GitHub repositories (MIT, dual-host for Claude Code and Grok Build):
SpillwaveSolutions organization
wiki_ticket_sdd — local-first visible work tracking
okf-plugin — Open Knowledge Format graph engineering and progressive disclosure, second brain and LLM Wikis
project-knowledge-capture — PKC, the “why” second brain for your project. Captures designs, specs, PRDs, ADRs, decisions, meetings, epics, stories, tasks, subtasks and the relationship between these.
system-architecture-capture — SAC, the “what is running” second brain for your projects design. Cloud Infra, Database, Microservices, Packages, Framework, etc.
data-engineering-knowledge-capture — DEKC second brain for data engineering, data catalogs, schemas, lakes, ETL, ELT, etc.
okf-agent-graph — AGER multi-agent harness schema, captures agentic flows, doers, graders, rubrics, prompts, flows, facts, etc.
Articles on this subject:
When the Decision Already Happened (Substack)
Open Knowledge Format: Agents Don’t Need More Context. They Need Better Disclosure. (Medium)
Rick Hightower is a Claude Certified Architect, former Senior Distinguished Engineer, and author of Manning’s Harness Engineering book. Through Spillwave, he sits as a resident architect for production agents: harness engineering, loop engineering, 4–16 weeks, Austin and remote.
If the last session evaporated, read What Is Harness Engineering? (short) or the Spillwave guides. To talk through a stand-up: contact@spillwave.com or LinkedIn.
If you are a paid subscriber, thank you. Your support makes this work possible.
If you are a free subscriber and find these articles useful, please consider upgrading. A paid subscription is $80 per year or $8 per month.
Free subscribers typically receive access to the full versions of paid articles after one to two months.
If this helped you, please consider subscribing to my Substack newsletter.
Likes, comments, and shares really do make a difference. They help grow the channel, support the work, and get these ideas in front of more builders who are trying to understand AI agents, harness engineering, and production AI systems.
Thank you for reading and for helping the work reach more people.


