{"id":1989,"date":"2026-11-03T05:18:00","date_gmt":"2026-11-03T13:18:00","guid":{"rendered":"https:\/\/www.kenwalger.com\/blog\/?p=1989"},"modified":"2026-10-26T08:50:30","modified_gmt":"2026-10-26T15:50:30","slug":"rack-before-you-remember","status":"publish","type":"post","link":"https:\/\/www.kenwalger.com\/blog\/software-engineering\/rack-before-you-remember\/","title":{"rendered":"Rack Before You Remember"},"content":{"rendered":"<p><em>What racking wine teaches about agent memory<\/em><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.kenwalger.com\/blog\/wp-content\/uploads\/2026\/10\/IMG_3463-scaled.jpeg\" alt=\"The bottom of a white fermenting bucket seen from above, holding a shallow pool of cloudy golden mead over a thick layer of tan sediment, with the tip of a clear siphon tube resting at the edge of the pool.\" \/><\/p>\n<p><em>The mead&#8217;s lees on October 21, with the racking cane at the edge. Everything the siphon left behind stays here.<\/em><\/p>\n<p>That layer at the bottom of my mead fermenter did most of the work of turning honey and water into something worth drinking. It&#8217;s spent yeast and the debris of a few weeks of vigorous fermentation. Without it, there&#8217;d be nothing to rack.<\/p>\n<p>I left all of it behind on purpose.<\/p>\n<h2>What lees are, and why they stay behind<\/h2>\n<p>When primary fermentation winds down, the yeast that did the work drops out of suspension along with whatever solids came along for the ride. That sediment is called the lees, and the first, heaviest layer is known as the gross lees.<\/p>\n<p>Racking is how you separate the wine from it. You siphon the wine off from above, carefully, into a clean vessel, and leave the sediment where it settled. I racked the pear wine on October 12, once the readings <a href=\"https:\/\/www.kenwalger.com\/blog\/software-engineering\/tuesday-isnt-a-valid-state-transition\/?utm_source=kenwalger&#038;utm_medium=blog&#038;utm_campaign=systems_under_fermentation&#038;utm_id=post_3\">had held steady long enough<\/a> to justify the move, and the mead on October 21, when its refractometer reading had settled at 3.2 Brix.<\/p>\n<p>The pear racking went smoothly, and it taught me something I didn&#8217;t expect. I&#8217;d added bentonite, a clay that binds proteins and helps haze drop out, and I assumed that by racking day the wine would be close to see-through. It wasn&#8217;t. It&#8217;s not murky, but it&#8217;s not clear either. Racking had separated the wine from the heavy sediment. It hadn&#8217;t made the wine clean. The finer material still in suspension will take weeks to settle, and there will be another racking after it does.<\/p>\n<p>Hold on to that distinction, because it comes back later.<\/p>\n<p>The reason to rack isn&#8217;t that the lees are bad. It&#8217;s that their job is done. Left in contact with the wine too long, the heavy lees start to break down, and the compounds they release can push the wine toward off flavors that range from dull to genuinely unpleasant. Material that was essential during fermentation becomes a liability during aging.<\/p>\n<p>That&#8217;s the whole article in one sentence: <strong>not everything useful during execution deserves to survive execution.<\/strong><\/p>\n<h2>Agents have lees too<\/h2>\n<p>Watch an AI agent work through a nontrivial task and you&#8217;ll see the equivalent of a primary fermentation. It retrieves documents, most of which turn out to be irrelevant. It calls tools and gets back large blobs of output. It tries an approach, hits an error, and backs out. It forms hypotheses that don&#8217;t survive. It reads text from untrusted sources, some of which might contain instructions it was never supposed to follow.<\/p>\n<p>All of that is essential while the task is running. The failed attempts are how it found the working one. The irrelevant documents are how it figured out which were relevant.<\/p>\n<p>And then the task ends, and a surprising number of memory designs do the equivalent of never racking the wine. The transcript gets saved. The tool outputs get embedded. The scratchpad gets summarized into long-term memory without anyone deciding which parts of it were conclusions and which were sediment.<\/p>\n<p>For a while, nothing seems wrong. Then the lees start to break down. A hypothesis the agent abandoned on Tuesday gets retrieved on Friday as if it were a fact. An error message from a transient outage becomes a durable belief that some service is broken. A snippet of injected text from a web page resurfaces, weeks later, in a context where it looks like a user preference. None of these were bad things to have <em>during<\/em> the task. They&#8217;re bad things to have in the cellar.<\/p>\n<h2>You can&#8217;t filter it out at the glass<\/h2>\n<p>The obvious objection is that you can sort it out later. Store everything, and let retrieval figure out what&#8217;s relevant.<\/p>\n<p>Winemaking has a pretty clear answer to that. If you leave the wine on the gross lees for months, you can&#8217;t fix it by pouring carefully. The problem isn&#8217;t that sediment ends up in the glass; you could decant that away. The problem is what the sediment did to the wine <em>while it was stored together<\/em>.<\/p>\n<p>Memory systems work the same way. Raw execution material doesn&#8217;t just sit inertly waiting to be filtered at read time. It gets summarized, and the summaries inherit its errors. It gets embedded, and it competes in similarity search with things that were actually true. It feeds derived facts, and those facts get cited by later tasks. By the time a read-side filter sees it, the contamination has already been folded into things that look clean.<\/p>\n<p>None of this means throwing the raw record away. Transcripts and tool outputs are genuinely valuable for debugging, forensics, and compliance, and a system that can&#8217;t reconstruct what an agent did is its own kind of problem. The distinction is between keeping evidence and promoting it into memory. A raw execution log in an archive the agent never retrieves from is evidence. The same log embedded into the store the agent reasons from is sediment in the wine. Winemakers make the same split: lees you want to keep go into a separate jar, for cooking or for starting the next batch. They don&#8217;t stay in the carboy.<\/p>\n<p>That&#8217;s why I&#8217;ve come to think the decision about what persists belongs at write time, as a deliberate boundary, rather than being deferred to whatever happens to read the store later. I&#8217;ve been calling this <a href=\"https:\/\/sovereignplatform.dev\/terms\/write-side-custody.html?utm_source=kenwalger&#038;utm_medium=blog&#038;utm_campaign=systems_under_fermentation&#038;utm_id=post_3\">Write-Side Custody<\/a>: the system that writes memory is responsible for what it lets in, and for being able to say why.<\/p>\n<h2>One boundary doesn&#8217;t make it clean<\/h2>\n<p>Remember the hazy pear. A write-time boundary works the same way the first racking does: it removes the gross sediment, the material that&#8217;s obviously done its job and is obviously going to cause trouble. It doesn&#8217;t guarantee that what passes through is perfectly clean.<\/p>\n<p>Some fine material always comes along. A conclusion that seemed confirmed turns out to rest on a shaky source. A summary carries a little of the noise it was built from. That isn&#8217;t a reason to skip the boundary. It&#8217;s a reason to expect more than one. Wine gets racked again after it has had time to settle, because time reveals what the first separation couldn&#8217;t. My blackberry wine got its second racking the same week as the mead&#8217;s first, and weeks after the heavy sediment was gone, it still left a layer of fine lees behind. Memory benefits from the same second pass: revisiting what was stored once it has been used, contradicted, or simply aged, and deciding again what still deserves to stay.<\/p>\n<p>The first racking makes the problem manageable. It doesn&#8217;t make it finished.<\/p>\n<h2>The racking cane leaves wine behind<\/h2>\n<p>Here&#8217;s the part nobody mentions in the metaphor-friendly version of racking: you lose wine.<\/p>\n<p>To avoid drawing up sediment, you stop siphoning a little before the bottom, which means leaving some perfectly good wine behind with the lees. In a five-gallon batch that loss barely registers. In a one-gallon batch, it&#8217;s noticeable.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.kenwalger.com\/blog\/wp-content\/uploads\/2026\/10\/IMG_3462-scaled.jpeg\" alt=\"A glass carboy of dark purple blackberry wine on a kitchen counter, with a red siphon tube arcing from it into a second carboy sitting lower in the sink.\" \/><\/p>\n<p><em>The blackberry&#8217;s second racking. The receiving carboy sits lower so gravity does the work.<\/em><\/p>\n<p>The pear got lucky. I&#8217;d made a little more than the carboy could hold, so the loss came out of the surplus, and the surplus was just enough for one hydrometer reading. The mead lost four ounces to its lees, about 3% of the batch. The blackberry&#8217;s second racking lost eight, about 6%, and not all of that was sediment: the auto-siphon simply couldn&#8217;t reach into the corners of the carboy. The shape of the vessel set part of the cost.<\/p>\n<p>A carboy that isn&#8217;t full has headspace, and headspace is air, and air is how wine oxidizes. So the gap has to be filled with something. For the mead, I topped it back up with four ounces of honey water, made from the same fireweed honey, at 18.4 Brix, which means the mead now has a little fresh sugar in it, on purpose, and the log says so. For the blackberry, I didn&#8217;t have anything worth adding, so I used an inert gas instead. It doesn&#8217;t replace the missing wine. The carboy holds less than it did, and nothing will change that. What the gas does is protect the wine that&#8217;s left, by keeping oxygen away from it.<\/p>\n<p>That&#8217;s an honest cost, and it&#8217;s the right trade. Chasing the last few ounces means stirring up the sediment you were trying to leave behind.<\/p>\n<p>Memory boundaries have the same cost. A write-side filter conservative enough to keep out the sediment will sometimes discard something that would have been useful: a detail from a failed attempt, a tool output that mattered after all. That&#8217;s not a flaw in the approach. It&#8217;s the price of the boundary, and it&#8217;s usually far cheaper than the alternative. A memory store that has lost a few useful details is annoying. One that has absorbed a few confidently wrong ones is dangerous, because it doesn&#8217;t know which ones they are.<\/p>\n<p>It&#8217;s worth separating the two kinds of loss, though, because the blackberry had both. Some of what stayed behind was sediment I chose to leave. The rest was wine the siphon physically couldn&#8217;t reach. Memory systems lose information the same two ways. Some is discarded by policy: a rule decided this didn&#8217;t deserve to persist. Some is lost to the equipment: a schema with no field for it, a fixed chunk size that splits it in half, a context limit that drops whatever came first. Nobody decided to lose that second kind, which is exactly why it goes unnoticed. The fixes are different, too. A bad policy gets a better rule. A bad vessel gets better equipment, and no amount of careful siphoning will reach a corner the tube can&#8217;t bend into.<\/p>\n<p>And when the boundary leaves a gap, those two top-offs are worth remembering. Adding something real is fine when it&#8217;s deliberate and recorded: the mead&#8217;s top-off is a known liquid at a known strength, written down the day it went in. The trouble is filling the space with something that only looks like the real thing: a plausible guess, a synthesized summary, a default. That&#8217;s topping up with water and not mentioning it. It dilutes the record, and nobody can tell afterward which part was the wine. When there&#8217;s nothing real to add, do what the inert gas does. A record that says plainly <em>this was discarded, and here&#8217;s why<\/em> doesn&#8217;t restore what was lost. It protects everything downstream from treating the gap as something known. That&#8217;s the job: not filling the hole, but making sure nothing mistakes the hole for knowledge.<\/p>\n<h2>Sur lie is a decision<\/h2>\n<p>To be fair to the lees, some winemakers deliberately keep wine on them. Aging on the fine lees, the lighter sediment that remains after the first racking, is a traditional technique for adding texture and complexity. It&#8217;s called <em>sur lie<\/em>, and Muscadet and Champagne are built partly on it.<\/p>\n<p>But notice how it&#8217;s done. It&#8217;s the fine lees, not the gross lees. It&#8217;s a specific choice made for a specific wine, often with regular stirring and attention. Nobody ends up with a sur lie wine because they forgot to rack.<\/p>\n<p>The same is true in memory. Sometimes execution detail genuinely deserves to persist. A failed approach might be exactly the thing you want an agent to remember next time: <em>we tried this, it doesn&#8217;t work, here&#8217;s why.<\/em> That&#8217;s valuable. But it&#8217;s valuable because someone decided to keep it, labeled it as what it is, and recorded where it came from. A lesson learned from a failure is a different thing from the failure&#8217;s raw transcript sitting in the store, waiting to be mistaken for advice.<\/p>\n<p>Keeping execution material can be the right call. Keeping it by default almost never is.<\/p>\n<h2>Rack at transitions, not constantly<\/h2>\n<p>One more practical lesson. Racking isn&#8217;t free for the wine either: every transfer exposes it to oxygen and handling. So you don&#8217;t rack constantly. You rack at transitions, when primary ends, after secondary, before bottling, at the points where the evidence says the wine has moved into a new state. The mead waited in primary until its readings held still, then moved once.<\/p>\n<p>That maps well onto memory design. Rather than continuously streaming everything an agent touches into durable storage, the natural points to decide what persists are the transitions: when a task completes, when a conclusion is confirmed, when a session ends. Those are the moments when you can tell the wine from the sediment, because the process has finished producing both.<\/p>\n<h2>Racking your memory<\/h2>\n<p><strong>Decide what persists at write time.<\/strong> Read-time filtering can&#8217;t undo what raw material did to summaries, embeddings, and derived facts while it sat in the store.<\/p>\n<p><strong>Archive evidence; don&#8217;t promote it.<\/strong> Keep raw transcripts for debugging and audit, somewhere the agent doesn&#8217;t retrieve from. Evidence and memory are different stores.<\/p>\n<p><strong>Assume execution produces sediment.<\/strong> Failed attempts, irrelevant retrievals, transient errors, and untrusted text are normal byproducts of useful work. Plan for them to exist; don&#8217;t plan for them to persist.<\/p>\n<p><strong>Expect more than one pass.<\/strong> The first boundary removes the obvious sediment. Time reveals the rest.<\/p>\n<p><strong>Accept the cost of the boundary.<\/strong> A good filter will occasionally discard something useful. That&#8217;s cheaper than keeping something wrong.<\/p>\n<p><strong>Know which losses are policy and which are equipment.<\/strong> Some information is dropped because a rule said so. Some is dropped because the schema, chunk size, or context limit couldn&#8217;t hold it. Only the first kind was a decision.<\/p>\n<p><strong>Fill gaps honestly.<\/strong> When the boundary leaves a hole, either add something real and record exactly what it was, or record that something was removed, so the gap is protected rather than mistaken for knowledge. Never top it up with plausible filler.<\/p>\n<p><strong>Make retention deliberate.<\/strong> When execution detail is worth keeping, keep it on purpose, label what it is, and record where it came from.<\/p>\n<p><strong>Rack at transitions.<\/strong> The best time to separate conclusions from sediment is when the process that produced them has finished.<\/p>\n<p>The pear is clearing now, a few shades brighter than it was in the fermenter, though still not as clear as I&#8217;d hoped. The lees did their job. They just don&#8217;t get to come along for the rest of it.<\/p>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F1989&amp;t=Rack%20Before%20You%20Remember&amp;s=100&amp;p[url]=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F1989&amp;p[images][0]=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-content%2Fuploads%2F2026%2F10%2F03_Feature.png&amp;p[title]=Rack%20Before%20You%20Remember\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/facebook.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F1989&amp;text=Hey%20check%20this%20out\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-reddit nolightbox\" data-provider=\"reddit\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Reddit\" href=\"https:\/\/www.reddit.com\/submit?url=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F1989&amp;title=Rack%20Before%20You%20Remember\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"reddit\" title=\"Share on Reddit\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/reddit.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&amp;url=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F1989&amp;title=Rack%20Before%20You%20Remember\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=Rack%20Before%20You%20Remember&amp;body=Hey%20check%20this%20out:%20https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F1989\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/mail.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>What racking wine teaches about agent memory The mead&#8217;s lees on October 21, with the racking cane at the edge. Everything the siphon left behind stays here. That layer at the bottom of my mead fermenter did most of the work of turning honey and water into something worth drinking. It&#8217;s spent yeast and the &hellip; <a href=\"https:\/\/www.kenwalger.com\/blog\/software-engineering\/rack-before-you-remember\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Rack Before You Remember&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":1994,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pmpro_default_level":"","_monsterinsights_skip_tracking":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1738],"tags":[1902,1681,1954,1805,1713,1970,1969],"class_list":["post-1989","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-engineering","tag-agent-memory","tag-ai-agents","tag-llm","tag-rag","tag-system-design","tag-systems-under-fermentation","tag-winemaking","pmpro-has-access"],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8lx70-w5","jetpack-related-posts":[],"jetpack_featured_media_url":"https:\/\/www.kenwalger.com\/blog\/wp-content\/uploads\/2026\/10\/03_Feature.png","_links":{"self":[{"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/posts\/1989","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/comments?post=1989"}],"version-history":[{"count":2,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/posts\/1989\/revisions"}],"predecessor-version":[{"id":1993,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/posts\/1989\/revisions\/1993"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/media\/1994"}],"wp:attachment":[{"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/media?parent=1989"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/categories?post=1989"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/tags?post=1989"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}