<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[The System Design Newsletter]]></title><description><![CDATA[Download my system design playbook on newsletter signup for FREE]]></description><link>https://newsletter.systemdesign.one</link><image><url>https://substackcdn.com/image/fetch/$s_!W5r-!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1c8067a-95bb-416b-9114-e0b9fb8821d4_256x256.png</url><title>The System Design Newsletter</title><link>https://newsletter.systemdesign.one</link></image><generator>Substack</generator><lastBuildDate>Wed, 22 Jul 2026 18:53:31 GMT</lastBuildDate><atom:link href="https://newsletter.systemdesign.one/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Neo Kim]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[systemdesignone@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[systemdesignone@substack.com]]></itunes:email><itunes:name><![CDATA[Neo Kim]]></itunes:name></itunes:owner><itunes:author><![CDATA[Neo Kim]]></itunes:author><googleplay:owner><![CDATA[systemdesignone@substack.com]]></googleplay:owner><googleplay:email><![CDATA[systemdesignone@substack.com]]></googleplay:email><googleplay:author><![CDATA[Neo Kim]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[What Happens When Your Coding Agent Actually Knows Your Architecture?]]></title><description><![CDATA[#163: How I turned NotebookLM into a grounded knowledge layer for PR reviews, design reviews, debugging, and onboarding]]></description><link>https://newsletter.systemdesign.one/p/how-to-use-notebooklm</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/how-to-use-notebooklm</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Mon, 20 Jul 2026 11:31:27 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/9630507d-bfb1-41bc-a374-c706d8b73492_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"><span data-color="#3a7bf9" style="color: rgb(58, 123, 249);">Get my system design playbook for FREE on newsletter signup:</span></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><ul><li><p><em><a href="https://newsletter.systemdesign.one/p/how-to-use-notebooklm/?action=share">Share this letter</a> &amp; I&#8217;ll send you some rewards for the referrals.</em></p></li></ul><div><hr></div><p><span>Every task used to start the same way for me, and you know this feeling:</span></p><p><span>You sit down to ship something small, and before you write a line, you ask, &#8220;</span><em><span>Where is this documented?&#8221;</span></em></p><p><span>The context I needed was never in one place&#8230;</span></p><p><span>So I would dig through scattered READMEs, a stale runbook, an ADR<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>, and a lost Slack thread, then ask a team member. And when none of it worked, just guess.</span></p><p><span>None of it was the work itself, and over time, I realized it came down to three problems stacked on top of each other:</span></p><ul><li><p><span>First, the time. I burned hours hunting through docs and GitHub pages before I even started, just trying to find where this structure was explained.</span></p></li><li><p><span>Then comes trust. So let&#8217;s say my AI agent finds something. How do I trust it when AI can hallucinate</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a><span>?</span></p></li><li><p><span>And the last one is the scariest: the knowledge never written down anywhere, the kind that lives in one senior engineer&#8217;s head and leaves the day they do.</span></p></li></ul><p><span>These are real problems, and they cost real time and trust on every team.</span></p><p><span>The good news is you can solve all three with a single tool called </span><em><strong><span>NotebookLM</span></strong></em><span>.</span></p><p><span>So let me show you what it actually is&#8230;</span></p><div><hr></div><div class="callout-block" data-callout="true"><h3><strong><a href="https://watch.getcontrast.io/register/context-maturity-jul?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary">[Webinar] 8 levels of context maturity in AI-native engineering (Partner)</a></strong></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://watch.getcontrast.io/register/context-maturity-jul?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sxoE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0f67b58-6ac6-4420-bd79-7d4f74bf9acb_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!sxoE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0f67b58-6ac6-4420-bd79-7d4f74bf9acb_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!sxoE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0f67b58-6ac6-4420-bd79-7d4f74bf9acb_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!sxoE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0f67b58-6ac6-4420-bd79-7d4f74bf9acb_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sxoE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0f67b58-6ac6-4420-bd79-7d4f74bf9acb_1200x600.png" width="1200" height="600" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d0f67b58-6ac6-4420-bd79-7d4f74bf9acb_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:321476,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://watch.getcontrast.io/register/context-maturity-jul?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/180731784?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0f67b58-6ac6-4420-bd79-7d4f74bf9acb_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!sxoE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0f67b58-6ac6-4420-bd79-7d4f74bf9acb_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!sxoE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0f67b58-6ac6-4420-bd79-7d4f74bf9acb_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!sxoE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0f67b58-6ac6-4420-bd79-7d4f74bf9acb_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!sxoE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0f67b58-6ac6-4420-bd79-7d4f74bf9acb_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>AI is in your engineering workflow. While the token spend shows it, the throughput doesn&#8217;t. The human is very much still in the loop, and that&#8217;s a context problem.</p><p><a href="https://watch.getcontrast.io/register/context-maturity-jul?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary">Join live July 23 (FREE)</a><span> to learn:</span></p><ul><li><p>The 8 levels of context maturity: where most teams are stuck and what the ceiling looks like at each stage</p></li><li><p>Why more MCPs, rules, and skills provide agents access but not understanding</p></li><li><p>How leading engineering teams are using a context engine to make the most of their agents</p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://watch.getcontrast.io/register/context-maturity-jul?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary&quot;,&quot;text&quot;:&quot;Register now&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://watch.getcontrast.io/register/context-maturity-jul?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary"><span>Register now</span></a></p><p><span>(Thanks, </span><a href="https://watch.getcontrast.io/register/context-maturity-jul?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary">Unblocked</a><span>, for partnering on this newsletter.)</span></p></div><div><hr></div><p>I want to introduce <strong><a href="https://www.learnwithmeai.com/welcome">Gencay</a></strong> as the guest author.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://www.learnwithmeai.com/welcome" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!i2sU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79774ca3-8968-45f9-bb13-fb23bc404b4f_1442x668.png 424w, https://substackcdn.com/image/fetch/$s_!i2sU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79774ca3-8968-45f9-bb13-fb23bc404b4f_1442x668.png 848w, https://substackcdn.com/image/fetch/$s_!i2sU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79774ca3-8968-45f9-bb13-fb23bc404b4f_1442x668.png 1272w, https://substackcdn.com/image/fetch/$s_!i2sU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79774ca3-8968-45f9-bb13-fb23bc404b4f_1442x668.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!i2sU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79774ca3-8968-45f9-bb13-fb23bc404b4f_1442x668.png" width="1442" height="668" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/79774ca3-8968-45f9-bb13-fb23bc404b4f_1442x668.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:668,&quot;width&quot;:1442,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.learnwithmeai.com/welcome&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!i2sU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79774ca3-8968-45f9-bb13-fb23bc404b4f_1442x668.png 424w, https://substackcdn.com/image/fetch/$s_!i2sU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79774ca3-8968-45f9-bb13-fb23bc404b4f_1442x668.png 848w, https://substackcdn.com/image/fetch/$s_!i2sU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79774ca3-8968-45f9-bb13-fb23bc404b4f_1442x668.png 1272w, https://substackcdn.com/image/fetch/$s_!i2sU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79774ca3-8968-45f9-bb13-fb23bc404b4f_1442x668.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>He has been building with AI since ChatGPT first shipped in 2022.</p><p>For years, he built for clients on Upwork: 7,300+ hours of it.</p><p>Now he builds in the open and shares every piece of it on <strong><a href="https://www.learnwithmeai.com/welcome"><span data-color="#3a7bf9" style="color: rgb(58, 123, 249);">LearnAIWithMe</span></a></strong>, every Monday, Wednesday, and Friday.</p><p>Not just theory for its own sake. One real build at a time, from idea to running system.</p><div><hr></div><p><em><strong>Here&#8217;s what&#8217;s inside this newsletter:</strong></em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2vbr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0a89daa-64a1-4643-abda-3dba979d9064_1448x1086.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2vbr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0a89daa-64a1-4643-abda-3dba979d9064_1448x1086.png 424w, https://substackcdn.com/image/fetch/$s_!2vbr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0a89daa-64a1-4643-abda-3dba979d9064_1448x1086.png 848w, https://substackcdn.com/image/fetch/$s_!2vbr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0a89daa-64a1-4643-abda-3dba979d9064_1448x1086.png 1272w, https://substackcdn.com/image/fetch/$s_!2vbr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0a89daa-64a1-4643-abda-3dba979d9064_1448x1086.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2vbr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0a89daa-64a1-4643-abda-3dba979d9064_1448x1086.png" width="1448" height="1086" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a0a89daa-64a1-4643-abda-3dba979d9064_1448x1086.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1086,&quot;width&quot;:1448,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2vbr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0a89daa-64a1-4643-abda-3dba979d9064_1448x1086.png 424w, https://substackcdn.com/image/fetch/$s_!2vbr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0a89daa-64a1-4643-abda-3dba979d9064_1448x1086.png 848w, https://substackcdn.com/image/fetch/$s_!2vbr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0a89daa-64a1-4643-abda-3dba979d9064_1448x1086.png 1272w, https://substackcdn.com/image/fetch/$s_!2vbr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa0a89daa-64a1-4643-abda-3dba979d9064_1448x1086.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"><span data-color="#3a7bf9" style="color: rgb(58, 123, 249);">Golden members get all letters like these!&#8230;</span></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p><div><hr></div><h2><span>What NotebookLM Actually Is</span></h2><p><span>NotebookLM is a research tool from Google that answers your questions using a set of documents you provide.</span></p><p><span>The set you give it is called a </span><strong><span>notebook</span></strong><span>, just a workspace where you collect the files you want to read, like a folder you can ask questions to.</span></p><p><span>Picture a sharp new hire on their first day:</span></p><p><span>They are smart, and they want to help, but they do not know your system yet, so you hand them a stack of your real docs and tell them to work from those. This single constraint is the whole point.</span></p><p><span>They will not wing it from general knowledge, and when they tell you something, they can point to the page they got it from.</span></p><p><span>NotebookLM works differently from general chat models like ChatGPT/Claude. Those usually come from broad model knowledge.</span></p><p><em><span>Now you might ask, why not just bolt a RAG pipeline</span></em><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a><em><span> onto ChatGPT or Claude and be done with it?</span></em></p><p><span>Yes, you can, and sometimes it is the right call. But NotebookLM gives you grounding and citations out of the box with nothing to build or maintain.</span></p><p><span>(I&#8217;ll cover the real numbers on this later.)</span></p><p><span>Under the hood, the core mechanism behind NotebookLM is retrieval and grounding rather than open-ended model memory.</span></p><p><span>Here&#8217;s the workflow:</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SKg1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e4c29f-4e2f-4ed2-9215-54d3295d8d51_1992x1096.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SKg1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e4c29f-4e2f-4ed2-9215-54d3295d8d51_1992x1096.png 424w, https://substackcdn.com/image/fetch/$s_!SKg1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e4c29f-4e2f-4ed2-9215-54d3295d8d51_1992x1096.png 848w, https://substackcdn.com/image/fetch/$s_!SKg1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e4c29f-4e2f-4ed2-9215-54d3295d8d51_1992x1096.png 1272w, https://substackcdn.com/image/fetch/$s_!SKg1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e4c29f-4e2f-4ed2-9215-54d3295d8d51_1992x1096.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SKg1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e4c29f-4e2f-4ed2-9215-54d3295d8d51_1992x1096.png" width="1456" height="801" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c5e4c29f-4e2f-4ed2-9215-54d3295d8d51_1992x1096.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:801,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!SKg1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e4c29f-4e2f-4ed2-9215-54d3295d8d51_1992x1096.png 424w, https://substackcdn.com/image/fetch/$s_!SKg1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e4c29f-4e2f-4ed2-9215-54d3295d8d51_1992x1096.png 848w, https://substackcdn.com/image/fetch/$s_!SKg1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e4c29f-4e2f-4ed2-9215-54d3295d8d51_1992x1096.png 1272w, https://substackcdn.com/image/fetch/$s_!SKg1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc5e4c29f-4e2f-4ed2-9215-54d3295d8d51_1992x1096.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ol><li><p><span>You ask a question in plain language.</span></p></li><li><p><span>NotebookLM searches your sources and pulls only the passages that match it.</span></p></li><li><p><span>Those passages, and nothing from the open web, go to Gemini</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a><span> as the context.</span></p></li><li><p><span>Gemini writes the answer from those passages.</span></p></li><li><p><span>Each claim comes back with a citation to the exact line it came from.</span></p></li></ol><p><span>The technique has a name: retrieval-augmented generation (</span><strong><span>RAG</span></strong><span>).</span></p><p><span>It also leans on the notebook&#8217;s chat history while it answers, so a follow-up still makes sense without you repeating the setup.</span></p><p><span>Plus, it runs on Google&#8217;s Gemini models, which Google keeps upgrading, and it can hold a lot at once.</span></p><p><span>Each source can run up to about five hundred thousand words, and the chat works across a context window of a million tokens. So you can load real documentation instead of a handful of pages.</span></p><p><span>The one thing to keep in mind is scope.</span></p><p><span>Each notebook only knows what is inside it. It does not pull from your other notebooks. The boundary sounds like a limitation until you realize it is exactly what makes NotebookLM safe to put underneath an agent.</span></p><p><span>Enough about what it is&#8230; Let&#8217;s set one up.</span></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/how-to-use-notebooklm?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/how-to-use-notebooklm?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div><hr></div><h2><span>How to set up NotebookLM?</span></h2><ol><li><p><span>Visit </span><a href="https://notebooklm.google/"><span>here</span></a><span>,</span></p></li><li><p><span>Click on &#8220;Try NotebookLM&#8221;,</span></p></li><li><p><span>Then click &#8220;Create new notebook&#8221;.</span></p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7x3H!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dc4630f-7672-4293-9e9f-53f8c4f81446_2048x1152.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7x3H!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dc4630f-7672-4293-9e9f-53f8c4f81446_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!7x3H!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dc4630f-7672-4293-9e9f-53f8c4f81446_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!7x3H!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dc4630f-7672-4293-9e9f-53f8c4f81446_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!7x3H!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dc4630f-7672-4293-9e9f-53f8c4f81446_2048x1152.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7x3H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dc4630f-7672-4293-9e9f-53f8c4f81446_2048x1152.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7dc4630f-7672-4293-9e9f-53f8c4f81446_2048x1152.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!7x3H!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dc4630f-7672-4293-9e9f-53f8c4f81446_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!7x3H!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dc4630f-7672-4293-9e9f-53f8c4f81446_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!7x3H!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dc4630f-7672-4293-9e9f-53f8c4f81446_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!7x3H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dc4630f-7672-4293-9e9f-53f8c4f81446_2048x1152.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><span>You have a few ways to feed it.</span></p><p><span>A web search, file upload, websites, a Google Drive connection, or pasted text.</span></p><p><span>Pick whichever matches where your material already lives.</span></p><p><span>For this notebook, I used websites.</span></p><p><span>I clicked &#8220;Websites&#8221; and pasted the Backstage links I had pulled together. The architecture decision records, the core docs, and the pull requests.</span></p><p><span>Here are the exact links I added:</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;06666f2b-6154-471a-93ce-61bc6795358f&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">https://backstage.io/docs/architecture-decisions/adrs-adr001/

https://backstage.io/docs/architecture-decisions/adrs-adr002/

https://backstage.io/docs/architecture-decisions/adrs-adr003/

https://backstage.io/docs/architecture-decisions/adrs-adr004/

https://backstage.io/docs/architecture-decisions/adrs-adr005/

https://backstage.io/docs/architecture-decisions/adrs-adr006/

https://backstage.io/docs/architecture-decisions/adrs-adr007/

https://backstage.io/docs/architecture-decisions/adrs-adr008/

https://backstage.io/docs/architecture-decisions/adrs-adr009/

https://backstage.io/docs/architecture-decisions/

https://backstage.io/docs/overview/architecture-overview/

https://backstage.io/docs/backend-system/architecture/index/

https://backstage.io/docs/features/techdocs/architecture/

https://backstage.io/docs/deployment/

https://backstage.io/docs/getting-started/

https://backstage.io/docs/overview/what-is-backstage/

https://github.com/backstage/backstage/pulls

https://github.com/backstage/backstage/tree/master/docs/architecture-decisions</code></pre></div><p><span>A couple of minutes later, the notebook gets trained and is ready to answer.</span></p><p><span>From here, the notebook is ready, with every Studio output on the right waiting to build from your sources.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!umKm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3231c5f-5902-48a3-854a-6107f659758a_2048x1152.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!umKm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3231c5f-5902-48a3-854a-6107f659758a_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!umKm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3231c5f-5902-48a3-854a-6107f659758a_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!umKm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3231c5f-5902-48a3-854a-6107f659758a_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!umKm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3231c5f-5902-48a3-854a-6107f659758a_2048x1152.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!umKm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3231c5f-5902-48a3-854a-6107f659758a_2048x1152.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e3231c5f-5902-48a3-854a-6107f659758a_2048x1152.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!umKm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3231c5f-5902-48a3-854a-6107f659758a_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!umKm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3231c5f-5902-48a3-854a-6107f659758a_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!umKm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3231c5f-5902-48a3-854a-6107f659758a_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!umKm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3231c5f-5902-48a3-854a-6107f659758a_2048x1152.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><span>So the notebook is loaded.</span></p><p><span>But why trust a word it says? This comes down to one idea&#8230;</span></p><h3><span>Grounding, in plain language</span></h3><p><span>Here is what grounding looks like in practice:</span></p><p><span>I asked the notebook about the latest AI model Anthropic released, something nowhere in my sources, and here is its response:</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4Ilp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F778fa63d-2c6c-475e-a123-c3388fbeb2c4_2048x1152.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4Ilp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F778fa63d-2c6c-475e-a123-c3388fbeb2c4_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!4Ilp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F778fa63d-2c6c-475e-a123-c3388fbeb2c4_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!4Ilp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F778fa63d-2c6c-475e-a123-c3388fbeb2c4_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!4Ilp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F778fa63d-2c6c-475e-a123-c3388fbeb2c4_2048x1152.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4Ilp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F778fa63d-2c6c-475e-a123-c3388fbeb2c4_2048x1152.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/778fa63d-2c6c-475e-a123-c3388fbeb2c4_2048x1152.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4Ilp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F778fa63d-2c6c-475e-a123-c3388fbeb2c4_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!4Ilp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F778fa63d-2c6c-475e-a123-c3388fbeb2c4_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!4Ilp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F778fa63d-2c6c-475e-a123-c3388fbeb2c4_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!4Ilp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F778fa63d-2c6c-475e-a123-c3388fbeb2c4_2048x1152.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><span>To make the boundary clear, let&#8217;s customize the tone, using this prompt:</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;109dd896-0d56-4aee-9ba4-b71f1de258fd&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">If the answer is not explicitly supported by the provided sources, respond only with:

Not in source.</code></pre></div><p><span>I asked the same question after it, and here is the answer:</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mLv0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F991a1269-dbbe-4067-863d-cd608b50e8f0_2048x1152.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mLv0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F991a1269-dbbe-4067-863d-cd608b50e8f0_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!mLv0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F991a1269-dbbe-4067-863d-cd608b50e8f0_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!mLv0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F991a1269-dbbe-4067-863d-cd608b50e8f0_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!mLv0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F991a1269-dbbe-4067-863d-cd608b50e8f0_2048x1152.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mLv0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F991a1269-dbbe-4067-863d-cd608b50e8f0_2048x1152.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/991a1269-dbbe-4067-863d-cd608b50e8f0_2048x1152.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!mLv0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F991a1269-dbbe-4067-863d-cd608b50e8f0_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!mLv0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F991a1269-dbbe-4067-863d-cd608b50e8f0_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!mLv0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F991a1269-dbbe-4067-863d-cd608b50e8f0_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!mLv0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F991a1269-dbbe-4067-863d-cd608b50e8f0_2048x1152.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><span>So I asked the same question again, and this time it just said: &#8220;Not in source.&#8221; One line in the prompt forced it to stay inside what I had uploaded instead of reaching for what it already knew.</span></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/how-to-use-notebooklm?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/how-to-use-notebooklm?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><h3><span>How citations work</span></h3><p><span>If grounding</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a><span> is the promise, then citations are the receipt to prove it.</span></p><p><span>NotebookLM does hallucinate </span><em><span>less</span></em><span>, and there is a study to point at now:</span></p><p><span>Researchers ran ChatGPT, Gemini, and NotebookLM over the same 300-document reporting task. NotebookLM made something up in roughly 13% of its answers, against about 40% for the other two on the same sources.</span></p><p><span>Here is the </span><a href="https://arxiv.org/abs/2509.25498"><span>research report</span></a><span>.</span></p><p><span>Let me show you the notebook we will use for the rest of this newsletter.</span></p><p><span>It holds Backstage&#8217;s Architecture Decision Records. Backstage is Spotify&#8217;s open-source developer portal, and its decision log is public. So it makes a clean stand-in for a real team&#8217;s knowledge base.</span></p><p><span>Here is the prompt:</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;c3620195-f443-4d41-9289-9468272e2c39&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Summarize the key architecture decisions recorded in these sources.
For each decision, cite the specific Architecture Decision Record it comes from.</code></pre></div><p><span>Here is the answer it returned, and the part worth watching is the citations:</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!30jG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F763797a6-e0a4-4fd5-91bf-67e592a9c8eb_2048x1152.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!30jG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F763797a6-e0a4-4fd5-91bf-67e592a9c8eb_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!30jG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F763797a6-e0a4-4fd5-91bf-67e592a9c8eb_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!30jG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F763797a6-e0a4-4fd5-91bf-67e592a9c8eb_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!30jG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F763797a6-e0a4-4fd5-91bf-67e592a9c8eb_2048x1152.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!30jG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F763797a6-e0a4-4fd5-91bf-67e592a9c8eb_2048x1152.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/763797a6-e0a4-4fd5-91bf-67e592a9c8eb_2048x1152.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!30jG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F763797a6-e0a4-4fd5-91bf-67e592a9c8eb_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!30jG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F763797a6-e0a4-4fd5-91bf-67e592a9c8eb_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!30jG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F763797a6-e0a4-4fd5-91bf-67e592a9c8eb_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!30jG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F763797a6-e0a4-4fd5-91bf-67e592a9c8eb_2048x1152.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><span>Look at the numbers in the answer&#8230;</span></p><p><span>Each one is a citation. Click one, and NotebookLM opens the source and highlights the line the claim came from.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Dxv9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5efb821f-b328-4ad4-a64b-d3474708c16d_2048x1152.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Dxv9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5efb821f-b328-4ad4-a64b-d3474708c16d_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!Dxv9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5efb821f-b328-4ad4-a64b-d3474708c16d_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!Dxv9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5efb821f-b328-4ad4-a64b-d3474708c16d_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!Dxv9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5efb821f-b328-4ad4-a64b-d3474708c16d_2048x1152.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Dxv9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5efb821f-b328-4ad4-a64b-d3474708c16d_2048x1152.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5efb821f-b328-4ad4-a64b-d3474708c16d_2048x1152.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Dxv9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5efb821f-b328-4ad4-a64b-d3474708c16d_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!Dxv9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5efb821f-b328-4ad4-a64b-d3474708c16d_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!Dxv9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5efb821f-b328-4ad4-a64b-d3474708c16d_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!Dxv9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5efb821f-b328-4ad4-a64b-d3474708c16d_2048x1152.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><span>That is the difference between an answer you hope is right and an answer you can check in two seconds.</span></p><p><span>So that is what it does well. Just as important is what it does not.</span></p><h3><span>What NotebookLM is not?</span></h3><p><span>A PDF reader will happily open your PDF, but it just shows you the page and stops there.</span></p><p><span>NotebookLM reads across every source at once and tells you exactly where it looked, so it does much more than a plain reader would.</span></p><p><span>Also, it is not a full agent running your code. It reads your sources, grounds its answers in them, and cites them, but the actual building still happens in your own tools.</span></p><p><span>On its own, NotebookLM is a read layer, and a very good one at that. So keep this frame in mind, and you will reach for it at the right time.</span></p><p><span>You have seen what it is and what it is not, so the next question is how you actually set one up&#8230;</span></p><div><hr></div><div class="callout-block" data-callout="true"><p style="text-align: center;"><em><strong><span data-color="#3a7bf9" style="color: rgb(58, 123, 249);">Reminder: this is a teaser of the subscriber-only newsletter series, exclusive to my golden members.</span></strong></em></p><p>When you upgrade, you&#8217;ll get:</p><ul><li><p><strong>High-level architecture of real-world systems.</strong></p></li><li><p>Deep dive into how popular real-world systems actually work.</p></li><li><p><strong>How real-world systems handle scale, reliability, and performance.</strong></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe&quot;,&quot;text&quot;:&quot;Unlock Full Access&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://newsletter.systemdesign.one/subscribe"><span>Unlock Full Access</span></a></p><p><em>Ready for the best part?</em></p></div><div><hr></div><h2><span>Engineering Use Case: NotebookLM as a Knowledge Layer for Code</span></h2><p><span>This is the part I actually run&#8230;</span></p><p><span>The rest of the newsletter explains NotebookLM. This section puts it to work.</span></p><p><span>The setup is one notebook, loaded with a real engineering knowledge base, and a Claude Code agent querying it.</span></p><p><span>I am using the Backstage notebook from earlier, since its decision records, docs, and merged pull requests are all public. I loaded them into a single notebook and pointed my agent at it.</span></p><h3><span>How I connected NotebookLM and Claude Code in the first place</span></h3><p><span>We connect NotebookLM and Claude Code through a command-line interface. (It is not official.)</span></p><p><span>Here is the link: </span><a href="https://github.com/teng-lin/notebooklm-py"><span>https://github.com/teng-lin/notebooklm-py</span></a></p><p><span>You can follow the setup steps on GitHub, or you can just drop this prompt into Claude Code:</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;d1e5e2da-3034-4484-a3b0-ac2c9100c381&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Install the notebooklm-py command-line interface from
https://github.com/teng-lin/notebooklm-py
and ping me when I need to authenticate.</code></pre></div><p><span>It opens the browser. You authenticate once.</span></p><p><span>From then on, the agent can reach your notebooks.</span></p><p><span>Now, let me show you how it reaches the Backstage notebook&#8230;</span></p><p><span>Use this prompt:</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;5cc28446-9be8-4b55-9509-a3d0df6f90a4&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Using the notebooklm-py command-line interface, connect to my Backstage notebook
and ask it to summarize ADR003 through ADR007
so I can see the decisions at a glance.
Return the answer with the citation for each ADR.

Backstage notebook link: (paste link here)</code></pre></div><p><span>First, it authenticates, then it summarizes ADR003 through ADR007.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!np3p!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87f90351-1a6f-4ff2-80cd-4e3a447d4649_2048x1152.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!np3p!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87f90351-1a6f-4ff2-80cd-4e3a447d4649_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!np3p!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87f90351-1a6f-4ff2-80cd-4e3a447d4649_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!np3p!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87f90351-1a6f-4ff2-80cd-4e3a447d4649_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!np3p!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87f90351-1a6f-4ff2-80cd-4e3a447d4649_2048x1152.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!np3p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87f90351-1a6f-4ff2-80cd-4e3a447d4649_2048x1152.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/87f90351-1a6f-4ff2-80cd-4e3a447d4649_2048x1152.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!np3p!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87f90351-1a6f-4ff2-80cd-4e3a447d4649_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!np3p!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87f90351-1a6f-4ff2-80cd-4e3a447d4649_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!np3p!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87f90351-1a6f-4ff2-80cd-4e3a447d4649_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!np3p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F87f90351-1a6f-4ff2-80cd-4e3a447d4649_2048x1152.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><span>Here it is:</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!657s!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5201a359-cc52-401d-ae7a-4b05709c497a_2048x1152.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!657s!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5201a359-cc52-401d-ae7a-4b05709c497a_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!657s!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5201a359-cc52-401d-ae7a-4b05709c497a_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!657s!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5201a359-cc52-401d-ae7a-4b05709c497a_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!657s!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5201a359-cc52-401d-ae7a-4b05709c497a_2048x1152.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!657s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5201a359-cc52-401d-ae7a-4b05709c497a_2048x1152.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5201a359-cc52-401d-ae7a-4b05709c497a_2048x1152.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!657s!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5201a359-cc52-401d-ae7a-4b05709c497a_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!657s!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5201a359-cc52-401d-ae7a-4b05709c497a_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!657s!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5201a359-cc52-401d-ae7a-4b05709c497a_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!657s!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5201a359-cc52-401d-ae7a-4b05709c497a_2048x1152.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><em><span>Imagine if accessing the right document while building was this easy. How much time would you save?</span></em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/how-to-use-notebooklm?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/how-to-use-notebooklm?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><h3><span>How agent queries on every Pull Request</span></h3><p><span>The goal here is simple:</span></p><p><span>Just catch a change breaking a documented decision before a human spends time reviewing it.</span></p><p><span>So, on every pull request, the agent reads the diff and then asks the notebook one question via the command-line interface. &#8220;</span><em><span>Does this change follow our recorded decisions?&#8221;</span></em></p><p><span>The notebook answers from the architecture decision records, with a citation, and the agent flags or passes on the answer.</span></p><p><span>Here is the prompt the agent runs:</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;6e99f748-b139-45a1-a25e-3e73b2f5191f&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Using the notebooklm-py command-line interface, query my Backstage notebook.

A pull request adds a new catalog entity kind called &#8220;Datastore&#8221;.

Its YAML descriptor has no api Version field and no metadata.name.

Based on the architecture decision records and the default catalog file format,
does this change follow our documented conventions?

Answer only from the sources and cite the specific record.

Backstage notebook link: (paste link here)</code></pre></div><p><span>Now the agent has something concrete to check against, so here is what it flagged:</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Wuug!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d1010fa-5b03-416d-92f3-976c12da7020_2048x1152.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Wuug!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d1010fa-5b03-416d-92f3-976c12da7020_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!Wuug!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d1010fa-5b03-416d-92f3-976c12da7020_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!Wuug!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d1010fa-5b03-416d-92f3-976c12da7020_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!Wuug!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d1010fa-5b03-416d-92f3-976c12da7020_2048x1152.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Wuug!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d1010fa-5b03-416d-92f3-976c12da7020_2048x1152.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4d1010fa-5b03-416d-92f3-976c12da7020_2048x1152.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Wuug!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d1010fa-5b03-416d-92f3-976c12da7020_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!Wuug!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d1010fa-5b03-416d-92f3-976c12da7020_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!Wuug!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d1010fa-5b03-416d-92f3-976c12da7020_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!Wuug!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d1010fa-5b03-416d-92f3-976c12da7020_2048x1152.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><span>Look at what came back.</span></p><p><span>The agent did not just say &#8220;this looks wrong.&#8221; Instead, it flagged three separate problems and tied each one to a specific record.</span></p><p><span>It holds no opinion about your architecture. So it asked the notebook, and the notebook answered from Backstage&#8217;s real records.</span></p><p><span>That is what turns architecture review from tribal knowledge stuck in one person&#8217;s head into a check that the agent can run on every change.</span></p><p><span>A concrete example, answered with citations.</span></p><p><span>The PR check above is the whole idea in one shot. A change comes in, the agent asks the notebook, the notebook answers with the exact records the change breaks.</span></p><p><span>Take the strongest of the three flags, the Datastore kind. To see what the agent is checking against, ask the record directly:</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;71c7bb15-888a-4c1e-acc8-b98f7bc2de4b&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Using the notebooklm-py command-line interface, query my Backstage notebook.

What does ADR005 decide about catalog core entities,
and would a new &#8220;Datastore&#8221; entity kind fit those decisions?

Quote the relevant lines and cite the source.

Backstage notebook link: (paste link here)</code></pre></div><p><span>Here is what the record gave back:</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AKgF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf0ef913-7c04-46e2-acc4-376d285f46f9_2048x1152.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AKgF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf0ef913-7c04-46e2-acc4-376d285f46f9_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!AKgF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf0ef913-7c04-46e2-acc4-376d285f46f9_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!AKgF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf0ef913-7c04-46e2-acc4-376d285f46f9_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!AKgF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf0ef913-7c04-46e2-acc4-376d285f46f9_2048x1152.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AKgF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf0ef913-7c04-46e2-acc4-376d285f46f9_2048x1152.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bf0ef913-7c04-46e2-acc4-376d285f46f9_2048x1152.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!AKgF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf0ef913-7c04-46e2-acc4-376d285f46f9_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!AKgF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf0ef913-7c04-46e2-acc4-376d285f46f9_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!AKgF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf0ef913-7c04-46e2-acc4-376d285f46f9_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!AKgF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf0ef913-7c04-46e2-acc4-376d285f46f9_2048x1152.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><span>Look at what the record itself says. The agent pulled ADR005 straight from the source, hash and all, and quoted it verbatim.</span></p><p><span>The catalog stands on three core entities: Components, APIs, and Resources. A datastore is not a fourth kind. It is already a Resource, the same bucket Backstage uses for Bigtable databases and S3. So the proposed change was never going to fit, and the record said so in its own words.</span></p><p><span>Now the design-doc check. The same question works before a review meeting, when the change is still a proposal:</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;53fff9c2-ed2e-4e10-a6ef-90b14c3dc355&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Using the notebooklm-py command-line interface,
query my Backstage notebook:(paste the link here)

Here is a new design doc proposing a dedicated &#8220;Datastore&#8221; entity kind for databases.

Does this conflict with any existing architecture decision?

Cite the record it conflicts with.</code></pre></div><p><span>Here is what came back this time.</span></p><p><span>Same answer, different door. The first query asked what ADR005 decides.</span></p><p><span>This one asks whether a new design conflicts with it:</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hpqK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56a92886-6723-4b26-b1d4-2a74fd99eede_2048x1152.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hpqK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56a92886-6723-4b26-b1d4-2a74fd99eede_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!hpqK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56a92886-6723-4b26-b1d4-2a74fd99eede_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!hpqK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56a92886-6723-4b26-b1d4-2a74fd99eede_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!hpqK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56a92886-6723-4b26-b1d4-2a74fd99eede_2048x1152.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hpqK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56a92886-6723-4b26-b1d4-2a74fd99eede_2048x1152.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/56a92886-6723-4b26-b1d4-2a74fd99eede_2048x1152.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!hpqK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56a92886-6723-4b26-b1d4-2a74fd99eede_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!hpqK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56a92886-6723-4b26-b1d4-2a74fd99eede_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!hpqK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56a92886-6723-4b26-b1d4-2a74fd99eede_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!hpqK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F56a92886-6723-4b26-b1d4-2a74fd99eede_2048x1152.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><span>Both land on the same record, the same source hash, the same verbatim lines.</span></p><p><span>One reads it as a PR check, the other as a design review before the meeting. The notebook does not change its story between the two, because it is reading, not guessing.</span></p><h3><span>Detailed workflows</span></h3><p><span>The same loop ends up covering four different jobs, so it is one notebook and one query pattern paying off in four places:</span></p><ul><li><p><strong><span>PR review.</span></strong><span> The agent checks the diff against the records and tells you whether the change follows the decisions you already made. Say a new teammate opens a PR that quietly reintroduces a pattern the team dropped a year ago. A human reviewer might not remember the old decision, but the notebook does. So the agent flags it with the exact record, before anyone burns a review cycle on it. This is the Datastore case from earlier, running on autopilot.</span></p></li><li><p><strong><span>Architecture and design review.</span></strong><span> The agent runs the design doc against the decision log before the meeting, so a conflict surfaces while the design is still a proposal. You drop in a proposal for a new caching layer. The agent points out that it contradicts a trade-off the team settled on two quarters ago, and it provides the citation. The meeting then starts from there instead of relitigating it live, which is usually where the hour goes.</span></p></li><li><p><strong><span>New feature spec.</span></strong><span> The agent pulls the records touching the area you are working in, so the spec starts from what the team has already decided. Before you write a line of the spec for a new auth flow, the agent surfaces the history for you. Every past decision, constraint, and rejected approach in this corner of the system. You stop proposing things the team already ruled out, and the reviewers stop typing the same objections they typed last time.</span></p></li><li><p><strong><span>Debugging against past incidents.</span></strong><span> The agent queries old PRs and notes for the same symptom to determine whether the team has encountered this failure before. A service starts timing out under load, so you describe the symptom. The agent finds the same failure from eight months ago, along with the fix that actually worked. Instead of rediscovering it from scratch at 2 am, you are reading the answer someone already paid for once.</span></p></li></ul><p><span>Every one of them is really the same move: </span><em><span>you ask the notebook, you get a cited answer, and you act on it.</span></em></p><p><span>The code layer is where I live, but the same notebook quietly does more.</span></p><p><span>Let me show you&#8230;</span></p><div><hr></div><h2><span>Alternative Use Cases for Engineers</span></h2><p><span>Once you wrap it in a Claude routine</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a><span>, most of it runs without you.</span></p><p><span>Let me show one, then point at the rest&#8230;</span></p><h3><span>The one I run on a schedule: weekly PR reporting</span></h3><p><span>A Claude routine queries the notebook on a schedule.</span></p><p><span>Every Friday, it checks the week&#8217;s merged PRs against our recorded decisions and sends a short report. Which changes followed the records, which drifted, and the citation for each call.</span></p><p><span>Here is the prompt the routine runs:</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;876901d1-c060-469f-be10-330928d76457&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Build a routine that runs every Friday at 5pm.

Use the notebooklm-py command-line interface to query my Backstage notebook:
(paste the link here)

Review the merged pull requests in the sources against the architecture decision records.

For each PR, say whether it follows our recorded decisions or drifts from them,
and cite the specific ADR.

Send me a report with one line per PR
and a single summary line for the team lead at the end.</code></pre></div><p><span>Next, Claude Code built the routine.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!S43p!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc284db12-bfe5-4385-80a0-68794862345e_2048x1152.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!S43p!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc284db12-bfe5-4385-80a0-68794862345e_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!S43p!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc284db12-bfe5-4385-80a0-68794862345e_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!S43p!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc284db12-bfe5-4385-80a0-68794862345e_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!S43p!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc284db12-bfe5-4385-80a0-68794862345e_2048x1152.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!S43p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc284db12-bfe5-4385-80a0-68794862345e_2048x1152.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c284db12-bfe5-4385-80a0-68794862345e_2048x1152.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!S43p!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc284db12-bfe5-4385-80a0-68794862345e_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!S43p!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc284db12-bfe5-4385-80a0-68794862345e_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!S43p!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc284db12-bfe5-4385-80a0-68794862345e_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!S43p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc284db12-bfe5-4385-80a0-68794862345e_2048x1152.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><span>Now let&#8217;s head to the routine inside Claude Code.</span></p><p><span>Click on the one you just set up.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4Xvz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74dacd7e-c6ba-44ba-97c5-eefb2b12e79e_2048x1152.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4Xvz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74dacd7e-c6ba-44ba-97c5-eefb2b12e79e_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!4Xvz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74dacd7e-c6ba-44ba-97c5-eefb2b12e79e_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!4Xvz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74dacd7e-c6ba-44ba-97c5-eefb2b12e79e_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!4Xvz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74dacd7e-c6ba-44ba-97c5-eefb2b12e79e_2048x1152.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4Xvz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74dacd7e-c6ba-44ba-97c5-eefb2b12e79e_2048x1152.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/74dacd7e-c6ba-44ba-97c5-eefb2b12e79e_2048x1152.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4Xvz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74dacd7e-c6ba-44ba-97c5-eefb2b12e79e_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!4Xvz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74dacd7e-c6ba-44ba-97c5-eefb2b12e79e_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!4Xvz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74dacd7e-c6ba-44ba-97c5-eefb2b12e79e_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!4Xvz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74dacd7e-c6ba-44ba-97c5-eefb2b12e79e_2048x1152.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><span>Click on &#8220;Run now&#8221; to test it.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WbP7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf9599e-49a8-4000-84c3-0d63b21be0a0_2048x1152.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WbP7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf9599e-49a8-4000-84c3-0d63b21be0a0_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!WbP7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf9599e-49a8-4000-84c3-0d63b21be0a0_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!WbP7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf9599e-49a8-4000-84c3-0d63b21be0a0_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!WbP7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf9599e-49a8-4000-84c3-0d63b21be0a0_2048x1152.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WbP7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf9599e-49a8-4000-84c3-0d63b21be0a0_2048x1152.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4cf9599e-49a8-4000-84c3-0d63b21be0a0_2048x1152.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!WbP7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf9599e-49a8-4000-84c3-0d63b21be0a0_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!WbP7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf9599e-49a8-4000-84c3-0d63b21be0a0_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!WbP7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf9599e-49a8-4000-84c3-0d63b21be0a0_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!WbP7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cf9599e-49a8-4000-84c3-0d63b21be0a0_2048x1152.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><span>Here is what the first run produced.</span></p><p><span>The first run came back empty.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!4LIn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b94ecf3-1df7-4bfa-9367-410e953264ec_2048x1152.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4LIn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b94ecf3-1df7-4bfa-9367-410e953264ec_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!4LIn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b94ecf3-1df7-4bfa-9367-410e953264ec_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!4LIn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b94ecf3-1df7-4bfa-9367-410e953264ec_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!4LIn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b94ecf3-1df7-4bfa-9367-410e953264ec_2048x1152.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4LIn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b94ecf3-1df7-4bfa-9367-410e953264ec_2048x1152.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1b94ecf3-1df7-4bfa-9367-410e953264ec_2048x1152.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!4LIn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b94ecf3-1df7-4bfa-9367-410e953264ec_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!4LIn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b94ecf3-1df7-4bfa-9367-410e953264ec_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!4LIn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b94ecf3-1df7-4bfa-9367-410e953264ec_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!4LIn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b94ecf3-1df7-4bfa-9367-410e953264ec_2048x1152.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><span>The notebook had no merged PRs inside it, only open ones, so there was nothing to check against the records.</span></p><p><span>It did not invent a result. Instead, it told me the sources held no merged PRs and stopped.</span></p><p><span>This empty result is reassuring because it shows the workflow tells you when there is nothing to report, rather than inventing something to fill the gap.</span></p><p><span>So I added a real merged PR as a source and ran it again.</span></p><p><span>Here is the result:</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Kr4F!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcecaf2ad-b966-405c-b37a-6caf049400e4_2048x1152.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Kr4F!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcecaf2ad-b966-405c-b37a-6caf049400e4_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!Kr4F!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcecaf2ad-b966-405c-b37a-6caf049400e4_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!Kr4F!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcecaf2ad-b966-405c-b37a-6caf049400e4_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!Kr4F!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcecaf2ad-b966-405c-b37a-6caf049400e4_2048x1152.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Kr4F!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcecaf2ad-b966-405c-b37a-6caf049400e4_2048x1152.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cecaf2ad-b966-405c-b37a-6caf049400e4_2048x1152.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Kr4F!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcecaf2ad-b966-405c-b37a-6caf049400e4_2048x1152.png 424w, https://substackcdn.com/image/fetch/$s_!Kr4F!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcecaf2ad-b966-405c-b37a-6caf049400e4_2048x1152.png 848w, https://substackcdn.com/image/fetch/$s_!Kr4F!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcecaf2ad-b966-405c-b37a-6caf049400e4_2048x1152.png 1272w, https://substackcdn.com/image/fetch/$s_!Kr4F!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcecaf2ad-b966-405c-b37a-6caf049400e4_2048x1152.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><span>From here, you can have Claude send this report wherever you want. Slack, email, or any tool you already use.</span></p><p><span>You have seen what it does. Now here is where it wins and where it does not&#8230;</span></p><p><em>Let&#8217;s keep going!</em></p>
      <p>
          <a href="https://newsletter.systemdesign.one/p/how-to-use-notebooklm">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[How to Build a Domain Expert AI]]></title><description><![CDATA[#162: Part 4 - Generative AI Masterclass]]></description><link>https://newsletter.systemdesign.one/p/fine-tuning-ai-models</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/fine-tuning-ai-models</guid><dc:creator><![CDATA[Louis-François Bouchard]]></dc:creator><pubDate>Fri, 17 Jul 2026 11:00:54 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/1f98d5dc-8e78-4d1f-9704-1270026a09c4_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://newsletter.systemdesign.one/subscribe?yearly=true" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RKN7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 424w, https://substackcdn.com/image/fetch/$s_!RKN7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 848w, https://substackcdn.com/image/fetch/$s_!RKN7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 1272w, https://substackcdn.com/image/fetch/$s_!RKN7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RKN7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png" width="1280" height="300" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3689f342-2008-4ce6-b968-16461682508b_1280x300.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:300,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:24224,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://newsletter.systemdesign.one/subscribe?yearly=true&quot;,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/192435842?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!RKN7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 424w, https://substackcdn.com/image/fetch/$s_!RKN7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 848w, https://substackcdn.com/image/fetch/$s_!RKN7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 1272w, https://substackcdn.com/image/fetch/$s_!RKN7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><ul><li><p><em><a href="https://newsletter.systemdesign.one/p/fine-tuning-ai-models/?action=share">Share this letter</a> &amp; I&#8217;ll send you some rewards for the referrals.</em></p></li></ul><div><hr></div><p><span>A general-purpose AI model, even with access to clinical notes, still does not write like a clinician&#8230;</span></p><p><span>Give the model access to legal documents, and it still does not draft like a lawyer&#8230;</span></p><p><span>The vocabulary is familiar, but the format and conventions are NOT present by default.</span></p><p><span>Ask a foundation model to write up a patient visit, and you get: </span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;c1a2cdea-363e-4ff8-b5d0-29f1cdf90a87&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">&#8220;The patient is a 70-year-old man with a history of hypertension
and hyperlipidemia who presents to the emergency department
complaining of substernal chest pain, pressure-like,
radiating to the left arm and jaw, with nausea, diaphoresis,
and shortness of breath.&#8221;</code></pre></div><p><span>While a clinician writes: </span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;7bb35396-0bf5-4d64-bf2b-ef4d790eb8fa&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">&#8220;70 y/o M w/ h/o HTN, HLD presents to ED c/o substernal CP.
Pressure-like, radiates to L arm and jaw. + nausea, diaphoresis, SOB.&#8221;</code></pre></div><p><span>Same content&#8230;</span></p><p><span>One is a paragraph; the other is a chart entry. The general model knows the medicine; it doesn&#8217;t know how clinicians write it down.</span></p><p><span>Fine-tuning is how you get them there.</span></p><p><span>Rather than prompting the model into a style on every call, you train those patterns directly into the model&#8217;s weights so they become its defaults. Fine-tuning is how tools like Harvey write like junior associates at large law firms.</span></p><ul><li><p><span>Glass Health produces clinical notes in the format clinicians use.</span></p></li><li><p><span>BloombergGPT reasons over financial data the way analysts expect.</span></p></li><li><p><span>GitHub Copilot responds fast enough to feel like autocomplete.</span></p></li></ul><p><span>Each of these is a general-purpose model trained in a narrow domain.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!l5jT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a611ae-9d63-483d-bbdb-1be1046bc0cf_1565x908.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!l5jT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a611ae-9d63-483d-bbdb-1be1046bc0cf_1565x908.png 424w, https://substackcdn.com/image/fetch/$s_!l5jT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a611ae-9d63-483d-bbdb-1be1046bc0cf_1565x908.png 848w, https://substackcdn.com/image/fetch/$s_!l5jT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a611ae-9d63-483d-bbdb-1be1046bc0cf_1565x908.png 1272w, https://substackcdn.com/image/fetch/$s_!l5jT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a611ae-9d63-483d-bbdb-1be1046bc0cf_1565x908.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!l5jT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a611ae-9d63-483d-bbdb-1be1046bc0cf_1565x908.png" width="1456" height="845" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/59a611ae-9d63-483d-bbdb-1be1046bc0cf_1565x908.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:845,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!l5jT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a611ae-9d63-483d-bbdb-1be1046bc0cf_1565x908.png 424w, https://substackcdn.com/image/fetch/$s_!l5jT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a611ae-9d63-483d-bbdb-1be1046bc0cf_1565x908.png 848w, https://substackcdn.com/image/fetch/$s_!l5jT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a611ae-9d63-483d-bbdb-1be1046bc0cf_1565x908.png 1272w, https://substackcdn.com/image/fetch/$s_!l5jT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59a611ae-9d63-483d-bbdb-1be1046bc0cf_1565x908.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Dataset feeds fine-tune; base becomes domain expert; the evaluation harness gates the ship decision.</figcaption></figure></div><p>This newsletter covers how fine-tuning works, when it is the right choice over prompting or RAG, and how to build it.</p><p>Let&#8217;s dive in!</p><div><hr></div><div class="callout-block" data-callout="true"><h3><a href="https://watch.getcontrast.io/register/context-maturity-jul?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary">[Webinar] 8 levels of context maturity in AI-native engineering (Partner)</a></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://watch.getcontrast.io/register/context-maturity-jul?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sxoE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0f67b58-6ac6-4420-bd79-7d4f74bf9acb_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!sxoE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0f67b58-6ac6-4420-bd79-7d4f74bf9acb_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!sxoE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0f67b58-6ac6-4420-bd79-7d4f74bf9acb_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!sxoE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0f67b58-6ac6-4420-bd79-7d4f74bf9acb_1200x600.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sxoE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0f67b58-6ac6-4420-bd79-7d4f74bf9acb_1200x600.png" width="1200" height="600" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d0f67b58-6ac6-4420-bd79-7d4f74bf9acb_1200x600.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:321476,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://watch.getcontrast.io/register/context-maturity-jul?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/180731784?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0f67b58-6ac6-4420-bd79-7d4f74bf9acb_1200x600.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!sxoE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0f67b58-6ac6-4420-bd79-7d4f74bf9acb_1200x600.png 424w, https://substackcdn.com/image/fetch/$s_!sxoE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0f67b58-6ac6-4420-bd79-7d4f74bf9acb_1200x600.png 848w, https://substackcdn.com/image/fetch/$s_!sxoE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0f67b58-6ac6-4420-bd79-7d4f74bf9acb_1200x600.png 1272w, https://substackcdn.com/image/fetch/$s_!sxoE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0f67b58-6ac6-4420-bd79-7d4f74bf9acb_1200x600.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>AI is in your engineering workflow. While the token spend shows it, the throughput doesn&#8217;t. The human is very much still in the loop, and that&#8217;s a context problem.</p><p><a href="https://watch.getcontrast.io/register/context-maturity-jul?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary">Join live July 23 (FREE)</a> to learn:</p><ul><li><p>The 8 levels of context maturity: where most teams are stuck and what the ceiling looks like at each stage</p></li><li><p>Why more MCPs, rules, and skills provide agents access but not understanding</p></li><li><p>How leading engineering teams are using a context engine to make the most of their agents</p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://watch.getcontrast.io/register/context-maturity-jul?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary&quot;,&quot;text&quot;:&quot;Register now&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://watch.getcontrast.io/register/context-maturity-jul?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary"><span>Register now</span></a></p><p>(Thanks, <a href="https://watch.getcontrast.io/register/context-maturity-jul?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary">Unblocked</a>, for partnering on this newsletter.)</p></div><div><hr></div><p><span>I want to reintroduce </span><strong><a href="https://louisbouchard.substack.com/welcome">Louis-Fran&#231;ois Bouchard</a><span> </span></strong><span>as the author of this newsletter.</span></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://louisbouchard.substack.com/welcome" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8ezx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 424w, https://substackcdn.com/image/fetch/$s_!8ezx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 848w, https://substackcdn.com/image/fetch/$s_!8ezx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 1272w, https://substackcdn.com/image/fetch/$s_!8ezx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8ezx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png" width="1100" height="220" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:220,&quot;width&quot;:1100,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:null,&quot;href&quot;:&quot;https://louisbouchard.substack.com/welcome&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!8ezx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 424w, https://substackcdn.com/image/fetch/$s_!8ezx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 848w, https://substackcdn.com/image/fetch/$s_!8ezx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 1272w, https://substackcdn.com/image/fetch/$s_!8ezx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><span>He&#8217;s a best-selling author (</span><a href="https://amzn.to/4bqYU9b">Building LLMs for Production</a><span>), the co-founder of </span><a href="https://academy.towardsai.net/?ref=1f9b29">Towards AI</a><span>, and the creator of the YouTube Channel, </span><a href="https://www.youtube.com/@whatsai?sub_confirmation=1">What&#8217;s AI</a><span>, where he helps people understand AI and learn how to apply it in the real world.</span></p><p><span>Through his development work with clients and his content, teaching, and AI training programs on the </span><strong><a href="https://academy.towardsai.net/?ref=1f9b29">Towards AI Academy</a></strong><span>, Louis focuses on making AI practical for builders, engineers, and curious learners alike.</span></p><p>At Towards AI, he and his team train AI engineers through courses built for every stage, from beginner to advanced. That educational mission and the real-world experience building for his clients are exactly why I wanted him in this newsletter series.</p><div><hr></div><p><em><strong><span>Here&#8217;s what&#8217;s inside this newsletter:</span></strong></em></p><ul><li><p><strong><span>What fine-tuning change in a model?</span></strong><span> Behavior, style, and domain reasoning patterns.</span></p></li><li><p><strong><span>Low-Rank Adaptation (LoRA) and Quantized Low-Rank Adaptation (QLoRA).</span></strong><span> The methods that make fine-tuning practical by modifying less than 1% of a model&#8217;s weights.</span></p></li><li><p><strong><span>Data quality.</span></strong><span> Instruction-response pairs, dataset size, synthetic data, and the gap between training distribution and production.</span></p></li><li><p><strong><span>The decision framework.</span></strong><span> When prompting is enough, when RAG is the right addition, when fine-tuning is warranted, and when all three are needed together.</span></p></li><li><p><strong><span>Alignment beyond Supervised Fine-Tuning (SFT).</span></strong><span> Reinforcement Learning from Human Feedback (RLHF), Direct Preference Optimization (DPO), model merging, and distillation.</span></p></li><li><p><strong><span>A hands-on comparison.</span></strong><span> Three configurations for the same clinical SOAP note task: base model, fine-tuned model, and frontier model ceiling.</span></p></li></ul><p style="text-align: center;"><span data-color="#3a7bf9" style="color: rgb(58, 123, 249);">Golden members get all letters like these!&#8230;</span></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h2><span>Why Build Your Own Domain Expert AI?</span></h2><p><span>Models such as GPT-5.5, Claude Opus 4.7, and Gemini 2.5 Pro are foundation models: Large Language Models (LLMs) trained on broad, internet-scale text to perform many tasks reasonably well rather than one task very well.</span></p><p><span>Their defaults are calibrated for a wide audience, not a specific domain.</span></p><p><span>For a domain product, this means out-of-the-box quality is just the starting point, and specialist users typically expect more&#8230;</span></p><ul><li><p><strong><span>Domain vocabulary and reasoning.</span></strong><span> A foundation model recognizes terms such as &#8220;Transient Ischemic Attack&#8221; and &#8220;force majeure,&#8221; but recognition is not the same as application. It does not consistently apply the National Institutes of Health (</span><strong><span>NIH</span></strong><span>) Stroke Scale, the standard scoring system clinicians use to grade stroke severity. It does not draft a force majeure clause the way a specific law firm drafts it. Fine-tuning bakes those specialized patterns into the model&#8217;s weights so they appear by default, without requiring them to be prompted on every call.</span></p></li><li><p><strong><span>Tone and style consistency.</span></strong><span> Every domain has a house style. Brand voice for marketing, a formal style for legal memos, a structured format for clinical chart notes. Harvey reads like a junior associate at a large law firm because the underlying model has been customized for legal drafting work. Prompting can imitate a style for a turn or two, but the model usually drifts back to its default voice within a few turns.</span></p></li><li><p><strong><span>Latency and model size.</span></strong><span> A fine-tuned 7-billion-parameter (</span><strong><span>7B</span></strong><span>) model often beats a foundation model on a narrow task. On a single Graphics Processing Unit (</span><strong><span>GPU</span></strong><span>), a fine-tuned 7B model can produce its first output token in under 300 milliseconds. This metric is called Time-To-First-Token (</span><strong><span>TTFT</span></strong><span>). For a product like code autocomplete, where suggestions must appear before the user types the next keystroke, this latency is the difference between a usable and an unusable product. GitHub Copilot is fine-tuned for exactly this reason.</span></p></li><li><p><strong><span>Cost at scale.</span></strong><span> Above a few hundred thousand queries per month (lower against a flagship-plus-RAG configuration, higher against a mini-class API), a self-hosted fine-tuned model is cheaper than paying for foundation-model Application Programming Interface (</span><strong><span>API</span></strong><span>) calls. Below this volume, the work required to build the dataset and run training usually costs more than a year&#8217;s worth of foundation-model API bills.</span></p></li><li><p><strong><span>Data privacy.</span></strong><span> Some training data cannot leave your infrastructure. Patient charts are regulated under the Health Insurance Portability and Accountability Act (</span><strong><span>HIPAA</span></strong><span>), the attorney-client privilege protects legal documents, and customer records may be regulated under the General Data Protection Regulation (</span><strong><span>GDPR</span></strong><span>) or System and Organization Controls 2 (</span><strong><span>SOC 2</span></strong><span>). None of this data can be sent to a third-party API for processing. Open-weight fine-tuning addresses this constraint by keeping the model, training data, and inference traffic within your own Virtual Private Cloud (</span><strong><span>VPC</span></strong><span>), behind your own authentication, and with your own audit trail.</span></p></li></ul><p><span>Before deciding to fine-tune, you must confirm prompting and Retrieval-Augmented Generation (</span><strong><span>RAG</span></strong><span>) do NOT meet your quality bar.</span></p><p><span>Most people overestimate how much fine-tuning will buy them over a well-engineered prompt combined with retrieval. Fine-tuning is the right answer when one of the five reasons above applies. But it is the wrong answer when you are reaching for it because the prompting felt inconvenient.</span></p><p><span>Once you have decided to fine-tune, three design questions determine the system: </span><em><span>which base model to start with, which dataset to build on, and whether to pair fine-tuning with retrieval.</span></em></p><div><hr></div><h2><span>What We Are Building</span></h2><p><span>The system has four components:</span></p><ul><li><p><span>Base model is the pretrained Large Language Model (</span><strong><span>LLM</span></strong><span>) the fine-tuning pipeline starts from.</span></p></li><li><p><span>Dataset is a set of instruction-response pairs capturing the behavior the model should produce by default.</span></p></li><li><p><span>Fine-tuning pipeline uses that dataset to shift the base model&#8217;s behavior toward the target domain.</span></p></li><li><p><span>API endpoint serves the resulting model, paired with the retrieval layer from </span><a href="https://newsletter.systemdesign.one/p/ai-based-knowledge-management-system"><span>newsletter 3</span></a><span>, for use cases where the domain also requires fresh facts.</span></p></li></ul><h4><strong><span>Requirements</span></strong></h4><ul><li><p><span>System must produce outputs in the domain style and format without per-query examples, and apply domain reasoning without Chain-of-Thought prompting on every call.</span></p></li><li><p><span>It must refuse out-of-scope questions in a calibrated way rather than attempting an answer.</span></p></li><li><p><span>The entire training run must be reproducible, with a locked dataset, locked random seeds, and a versioned model card.</span></p></li><li><p><span>A production ship would also verify that general capability regresses by less than 5% on Massive Multi-task Language Understanding, Professional version (</span><strong><span>MMLU-Pro</span></strong><span>) or MT-Bench, and that inference cost is at least 50% below the foundation-model baseline. Both gates are described in Parts 3 and 4 but are not run in Part 5&#8217;s walkthrough.</span></p></li><li><p><span>One advanced feature covered later: preference tuning with </span>Direct Preference Optimization (<strong><span>DPO</span></strong><span>), used to correct behaviors that </span>Supervised Fine-Tuning (<strong><span>SFT</span></strong><span>) cannot reach reliably.</span></p></li></ul><h4><strong><span>What this system does not do</span></strong></h4><p><span>It does not call tools or take actions, which is the focus of a future newsletter.</span></p><p><span>Also, it does not guarantee factual freshness, because the model&#8217;s training data is fixed at the point of fine-tuning. For current facts, RAG is still the right layer to add.</span></p><h4><strong><span>Deployment</span></strong></h4><p><span>Part 5 builds the open-weight path and documents the OpenAI fine-tuning path as a hosted alternative.</span></p><p><span>The open-weight path uses a base model such as Llama, Qwen, or Mistral with LoRA adapters served on vLLM<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>. The hosted path uses the OpenAI fine-tuning API.</span></p><h4><strong><span>Model selection</span></strong></h4><p><span>The right starting point is the smallest base model that already understands the domain.</span></p><p><span>Here are three criteria to look for:</span></p><ol><li><p><span>Run a 20-question domain probe on the base model; if it cannot answer roughly half correctly, fine-tuning will not recover it, because fine-tuning shifts defaults and does not install knowledge the model never had.</span></p></li><li><p><span>Confirm fine-tuning support: on the open side, Llama, Qwen, and Mistral all support it; on the hosted side, OpenAI API currently exposes GPT-4.1 and GPT-4.1-mini for fine-tuning, since the GPT-5.x reasoning tier is not available for SFT at the time of writing.</span></p></li><li><p><span>Check license fit: Llama community license, Apache 2.0, and the OpenAI Terms of Service each impose different constraints on where the model can be hosted, which determines whether the model can run where your data lives.</span></p></li></ol><p><span>Start in the 7B-8B parameter range and scale up only if the domain probe requires it.</span></p><p><span>Model choice is the last decision you make before training begins.</span></p><p><span>The next part covers what training actually does to the model you picked&#8230;</span></p><div><hr></div><h2><span>Part 1: How Fine-Tuning Changes a Model</span></h2><p><strong><span>Pretraining</span></strong><span> runs next-token prediction over trillions of tokens of text scraped from the internet, books, and code repositories.</span></p><p><span>By the end of the process, the model has compressed a broad representation of human language and knowledge into its weights. This is the </span><strong><span>base model</span></strong><span>: capable across many tasks, specialized in none.</span></p><p><strong><span>Fine-tuning</span></strong><span> starts from that base and runs the same training process again, but on a much smaller dataset, typically a few thousand examples, chosen specifically to push the model&#8217;s behavior in one direction. The model is not learning language at this stage. Instead, it is learning which of its existing patterns to apply by default.</span></p><p><span>i.e., fine-tune for behavior, retrieve for knowledge.</span></p><p><span>Fine-tuning works by reinforcing patterns across many examples until they override the base model&#8217;s defaults. A reasoning pattern or output format repeated across thousands of training examples will stick.</span></p><p><span>A fact that appears once or twice will not, because the model has no reason to weigh it more than the vast body of knowledge it acquired during pretraining.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lPje!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4207428-6315-455d-8fc5-44c1517dcf5d_2048x920.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lPje!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4207428-6315-455d-8fc5-44c1517dcf5d_2048x920.png 424w, https://substackcdn.com/image/fetch/$s_!lPje!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4207428-6315-455d-8fc5-44c1517dcf5d_2048x920.png 848w, https://substackcdn.com/image/fetch/$s_!lPje!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4207428-6315-455d-8fc5-44c1517dcf5d_2048x920.png 1272w, https://substackcdn.com/image/fetch/$s_!lPje!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4207428-6315-455d-8fc5-44c1517dcf5d_2048x920.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lPje!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4207428-6315-455d-8fc5-44c1517dcf5d_2048x920.png" width="1456" height="654" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e4207428-6315-455d-8fc5-44c1517dcf5d_2048x920.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:654,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!lPje!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4207428-6315-455d-8fc5-44c1517dcf5d_2048x920.png 424w, https://substackcdn.com/image/fetch/$s_!lPje!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4207428-6315-455d-8fc5-44c1517dcf5d_2048x920.png 848w, https://substackcdn.com/image/fetch/$s_!lPje!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4207428-6315-455d-8fc5-44c1517dcf5d_2048x920.png 1272w, https://substackcdn.com/image/fetch/$s_!lPje!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4207428-6315-455d-8fc5-44c1517dcf5d_2048x920.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Same loss function, different scale, different purpose.</figcaption></figure></div><h3><span>What Gets Updated During Training</span></h3><p><span>Fine-tuning adjusts every parameter in the model slightly, one example at a time, until its behavior shifts toward what the dataset shows.</span></p><p><span>The primary cost here is </span><em><span>memory</span></em><span>:</span></p><p><span>A 7B model has 7 billion numbers stored on the GPU. Training requires storing a second number alongside each parameter to track how it should change, roughly doubling memory usage to 28 GB.</span></p><p><span>The optimizer adds a few more bookkeeping values per parameter on top of that, pushing the total GPU memory to 60-80 GB.</span></p><p><span>Consumer GPUs have 16 to 24 GB of memory, which is why a full fine-tune of a 7B model used to require a cluster and cost tens of thousands of dollars. Parameter-efficient methods (covered later) reduce the requirement to a single 16 GB GPU and bring the cost down to around $10 per run.</span></p><p><span>The size of the GPU bill forces the choice of training regime; the next decision a team has to make&#8230;</span></p><h3><span>Three Training Regimes</span></h3><p><span>There are three ways to fine-tune a model, each using a different kind of dataset:</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gafc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac34b42f-b57c-4cd2-9f19-634cc45a6e6d_2048x944.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gafc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac34b42f-b57c-4cd2-9f19-634cc45a6e6d_2048x944.png 424w, https://substackcdn.com/image/fetch/$s_!gafc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac34b42f-b57c-4cd2-9f19-634cc45a6e6d_2048x944.png 848w, https://substackcdn.com/image/fetch/$s_!gafc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac34b42f-b57c-4cd2-9f19-634cc45a6e6d_2048x944.png 1272w, https://substackcdn.com/image/fetch/$s_!gafc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac34b42f-b57c-4cd2-9f19-634cc45a6e6d_2048x944.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gafc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac34b42f-b57c-4cd2-9f19-634cc45a6e6d_2048x944.png" width="1456" height="671" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ac34b42f-b57c-4cd2-9f19-634cc45a6e6d_2048x944.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:671,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!gafc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac34b42f-b57c-4cd2-9f19-634cc45a6e6d_2048x944.png 424w, https://substackcdn.com/image/fetch/$s_!gafc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac34b42f-b57c-4cd2-9f19-634cc45a6e6d_2048x944.png 848w, https://substackcdn.com/image/fetch/$s_!gafc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac34b42f-b57c-4cd2-9f19-634cc45a6e6d_2048x944.png 1272w, https://substackcdn.com/image/fetch/$s_!gafc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fac34b42f-b57c-4cd2-9f19-634cc45a6e6d_2048x944.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Each regime takes a different shape of data and changes a different thing</figcaption></figure></div><ul><li><p><strong>Continued pretraining</strong> runs the same kind of training the base model already underwent, but on raw text from a single domain rather than the open internet. There are no labels; the model just reads a lot of domain text and gets better at predicting the next word in the domain. The dataset is large, ranging from hundreds of millions to billions of words, and the point of the exercise is to teach the model the field&#8217;s vocabulary. BloombergGPT started this way with financial text, and Med-PaLM (a medical fine-tuning of Google&#8217;s PaLM, Pathways Language Model) started this way with medical text. You should reach for continued pretraining only when the base model barely understands your domain.</p></li><li><p><strong>Supervised Fine-Tuning (SFT)</strong>, introduced in <a href="https://newsletter.systemdesign.one/p/generative-ai-system-design">newsletter 1</a>, trains on a list of questions paired with the answers the model must produce. The model learns to imitate those answers. Typically, the datasets contain 1,000 to 50,000 of these question-answer pairs. SFT is the right starting point for almost every fine-tuning project, because most domain problems are about style, format, and reasoning patterns rather than missing knowledge.</p></li><li><p><strong>Preference tuning</strong>, which includes both Reinforcement Learning from Human Feedback (<strong>RLHF</strong>) and DPO, trains on comparisons. For each question, the dataset contains two possible answers and a label indicating which is better. The model learns to produce answers closer to the preferred one. Datasets are smaller, typically 500 to 5,000 pairs. Preference tuning is used to correct behaviors that SFT cannot reliably teach: calibrated refusals, a consistent tone, and output formats that hold up even when users push back.</p></li></ul><p>The practical order is to start with SFT, ship it, identify the specific behaviors that still need work, and then add DPO to address those cases.</p><p>Continued pretraining enters the picture &#8220;only&#8221; if SFT stops improving and the base model clearly does not understand the domain vocabulary.</p><p>SFT handles the bulk of the work in a typical project, and the question it raises immediately is how to run it without an 80 GB GPU. The answer is a class of methods called Parameter-Efficient Fine-Tuning (<strong>PEFT</strong>), which trains only a small fraction of the model&#8217;s parameters rather than all of them.</p><p>LoRA is the most widely used method in this class&#8230;</p><h3><span>Low-Rank Adaptation (LoRA)</span></h3><p><span>LoRA leaves the base model&#8217;s weights completely frozen and instead trains a small side network alongside it.</span></p><p><span>The side network is built from two small matrices, conventionally labeled A and B. At inference time, the output of the side network is added on top of the frozen base model&#8217;s output.</span></p><p><span>Only the side network is trained; the base model never changes.</span></p><p><span>This works because the change required to turn a general model into a domain expert is mathematically small.</span></p><p><span>You do not need to adjust every parameter in the model; you only need to apply a targeted correction to the parameters that matter. The side network learns the correction. Its capacity is controlled by a setting called the </span><em><strong><span>rank</span></strong></em><span>, typically 8 or 16, which determines how much the side network can express.</span></p><p><span>In those settings, LoRA trains fewer than 1% of the parameters full fine-tuning would touch and recovers 90-95% of the quality on most tasks. GPU memory drops by an order of magnitude because the optimizer only tracks the small side network, and the risk of degrading the base model remains low because its weights never change.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pJu3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa72a8c52-7515-45c1-bf25-75f930cabe87_1751x834.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pJu3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa72a8c52-7515-45c1-bf25-75f930cabe87_1751x834.png 424w, https://substackcdn.com/image/fetch/$s_!pJu3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa72a8c52-7515-45c1-bf25-75f930cabe87_1751x834.png 848w, https://substackcdn.com/image/fetch/$s_!pJu3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa72a8c52-7515-45c1-bf25-75f930cabe87_1751x834.png 1272w, https://substackcdn.com/image/fetch/$s_!pJu3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa72a8c52-7515-45c1-bf25-75f930cabe87_1751x834.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pJu3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa72a8c52-7515-45c1-bf25-75f930cabe87_1751x834.png" width="1456" height="693" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a72a8c52-7515-45c1-bf25-75f930cabe87_1751x834.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:693,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!pJu3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa72a8c52-7515-45c1-bf25-75f930cabe87_1751x834.png 424w, https://substackcdn.com/image/fetch/$s_!pJu3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa72a8c52-7515-45c1-bf25-75f930cabe87_1751x834.png 848w, https://substackcdn.com/image/fetch/$s_!pJu3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa72a8c52-7515-45c1-bf25-75f930cabe87_1751x834.png 1272w, https://substackcdn.com/image/fetch/$s_!pJu3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa72a8c52-7515-45c1-bf25-75f930cabe87_1751x834.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><em><span>Yet LoRA has two trade-offs against full fine-tuning:</span></em></p><ul><li><p><span>First, on most tasks, it matches full fine-tuning in quality, but not always at parity. On hard tasks, full fine-tuning is, on average, a few percentage points stronger.</span></p></li><li><p><span>Second, the side network has a fixed capacity ceiling set by the rank: a rank-16 adapter can only encode so much change to the base model. For large domain shifts, such as moving a general model toward dense medical or legal reasoning, LoRA hits this ceiling and stops improving with more data.</span></p></li></ul><p><span>Full fine-tuning has no such ceiling, but it incurs the highest GPU cost and carries the greatest risk of the model forgetting its general capabilities.</span></p><p><span>It is worth considering only when LoRA has plateaued, and the GPU budget allows it.</span></p><div class="callout-block" data-callout="true"><p style="text-align: center;"><em><strong><span data-color="#3a7bf9" style="color: rgb(58, 123, 249);">Reminder: this is a teaser of the subscriber-only newsletter series, exclusive to my golden members.</span></strong></em></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://newsletter.systemdesign.one/subscribe?yearly=true" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3mfm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 424w, https://substackcdn.com/image/fetch/$s_!3mfm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 848w, https://substackcdn.com/image/fetch/$s_!3mfm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 1272w, https://substackcdn.com/image/fetch/$s_!3mfm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3mfm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png" width="1280" height="300" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:300,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:24224,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://newsletter.systemdesign.one/subscribe?yearly=true&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/192435842?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!3mfm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 424w, https://substackcdn.com/image/fetch/$s_!3mfm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 848w, https://substackcdn.com/image/fetch/$s_!3mfm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 1272w, https://substackcdn.com/image/fetch/$s_!3mfm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>When you upgrade, you&#8217;ll get:</p><ul><li><p><strong>Simple breakdown of real-world architectures</strong></p></li><li><p>Frameworks you can plug into your work or business</p></li><li><p><strong>Proven systems behind ChatGPT, Perplexity, and Copilot</strong></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe&quot;,&quot;text&quot;:&quot;Unlock Full Access&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://newsletter.systemdesign.one/subscribe"><span>Unlock Full Access</span></a></p><p><em>Ready for the best part?</em></p></div><h3>Quantized Low-Rank Adaptation (QLoRA)</h3>
      <p>
          <a href="https://newsletter.systemdesign.one/p/fine-tuning-ai-models">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Kubernetes - A Deep Dive]]></title><description><![CDATA[#161: Part 3 - DevOps Mastermind]]></description><link>https://newsletter.systemdesign.one/p/kubernetes-architecture</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/kubernetes-architecture</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Mon, 13 Jul 2026 11:05:40 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/2b8130d7-13b6-44c7-bffd-f58c6c612def_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"><span data-color="#3a7bf9" style="color: rgb(58, 123, 249);">Get my system design playbook for FREE on newsletter signup:</span></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><ul><li><p><em><a href="https://newsletter.systemdesign.one/p/kubernetes-architecture/?action=share">Share this letter</a><strong> </strong>&amp; I&#8217;ll send you some rewards for the referrals.</em></p></li></ul><div><hr></div><p>In the early days, running apps was simple.</p><p>Most applications ran on a single server, and managing them was quite easy. Then microservices became popular. Instead of a single app on a single server, companies were running hundreds of apps across hundreds of servers.</p><p>But managing this became extremely difficult.</p><p>Engineers had to decide where apps should run, what to do when apps crash, how to handle more traffic, and how to update apps without downtime. Most people handled this with scripts and manual work. It worked for a while, but as systems grew, system started breaking more often, and downtime became more common.</p><p>Google faced this problem on a massive scale.</p><p>So they built an internal system called <strong>Borg</strong>. Borg was used to manage apps across thousands of servers. It automates scheduling, scaling, and self-healing across many servers. Years later, Kubernetes (<strong>k8s</strong>) was built based on many of the same ideas as Borg and got released as an open-source system. Since then, it has become the standard platform for running distributed systems and microservices.</p><p>Kubernetes could look simple from the outside, but within the cluster, many components constantly work to keep your apps running.</p><p>Let&#8217;s look at what is happening behind the scenes&#8230;</p><div><hr></div><div class="callout-block" data-callout="true"><h3><a href="https://superblocks.com/?utm_source=newsletter&amp;utm_medium=influencer&amp;utm_content=neo_kim">The most dangerous app in your company was built by someone in finance last Tuesday (Partner)</a></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://superblocks.com/?utm_source=newsletter&amp;utm_medium=influencer&amp;utm_content=neo_kim" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!KcTa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0379d98-e4bf-4a0a-9e31-6cea6c74b21f_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!KcTa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0379d98-e4bf-4a0a-9e31-6cea6c74b21f_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!KcTa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0379d98-e4bf-4a0a-9e31-6cea6c74b21f_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!KcTa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0379d98-e4bf-4a0a-9e31-6cea6c74b21f_1920x1080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!KcTa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0379d98-e4bf-4a0a-9e31-6cea6c74b21f_1920x1080.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f0379d98-e4bf-4a0a-9e31-6cea6c74b21f_1920x1080.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:905147,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://superblocks.com/?utm_source=newsletter&amp;utm_medium=influencer&amp;utm_content=neo_kim&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/206324415?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0379d98-e4bf-4a0a-9e31-6cea6c74b21f_1920x1080.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!KcTa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0379d98-e4bf-4a0a-9e31-6cea6c74b21f_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!KcTa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0379d98-e4bf-4a0a-9e31-6cea6c74b21f_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!KcTa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0379d98-e4bf-4a0a-9e31-6cea6c74b21f_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!KcTa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff0379d98-e4bf-4a0a-9e31-6cea6c74b21f_1920x1080.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The number of vibe-coded apps in <em>enterprise environments </em>has skyrocketed.</p><p>Yet most vibe-coded apps cannot handle customer data securely, comply with your internal workflows, or pass production processes.</p><p>i.e., they &#8220;break&#8221; your company standards.</p><p>So your apps become an IT problem when you ask yourself these questions:</p><ul><li><p>Where does the data live &amp; who can access the app?</p></li><li><p>Where are the audit logs &amp; how to enforce company security policies?</p></li><li><p>Can this safely reach production?</p></li></ul><p><strong>INTRODUCING <a href="https://superblocks.com/?utm_source=newsletter&amp;utm_medium=influencer&amp;utm_content=neo_kim">SUPERBLOCKS</a>&#8230;</strong></p><p>(Instead of cleaning up later, it makes IT the foundation from day one.)</p><ul><li><p>Apps deploy inside your own AWS account and VPC, so sensitive data stays under your control.</p></li><li><p>Company login, role-based permissions, audit logs, and governance get enforced automatically across all apps.</p></li><li><p>Every deployment gets scanned for vulnerabilities before it reaches production.</p></li></ul><p>So you build production-ready apps instead of demos that need to be rebuilt later&#8230;and your business moves faster.</p><p>If you&#8217;re serious about enterprise AI app development, try Superblocks right now:</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://superblocks.com/?utm_source=newsletter&amp;utm_medium=influencer&amp;utm_content=neo_kim&quot;,&quot;text&quot;:&quot;TRY SUPERBLOCKS NOW&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://superblocks.com/?utm_source=newsletter&amp;utm_medium=influencer&amp;utm_content=neo_kim"><span>TRY SUPERBLOCKS NOW</span></a></p><p>(Thanks to <a href="https://superblocks.com/?utm_source=newsletter&amp;utm_medium=influencer&amp;utm_content=neo_kim">Superblocks</a> for partnering on this post.)</p></div><div><hr></div><p>I want to introduce <strong><a href="https://x.com/twtayaan">Ayaan</a></strong> as a guest author.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://x.com/twtayaan" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GCV8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d442f35-0ac7-4552-bd87-66962939694d_2048x1024.png 424w, https://substackcdn.com/image/fetch/$s_!GCV8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d442f35-0ac7-4552-bd87-66962939694d_2048x1024.png 848w, https://substackcdn.com/image/fetch/$s_!GCV8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d442f35-0ac7-4552-bd87-66962939694d_2048x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!GCV8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d442f35-0ac7-4552-bd87-66962939694d_2048x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GCV8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d442f35-0ac7-4552-bd87-66962939694d_2048x1024.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5d442f35-0ac7-4552-bd87-66962939694d_2048x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://x.com/twtayaan&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!GCV8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d442f35-0ac7-4552-bd87-66962939694d_2048x1024.png 424w, https://substackcdn.com/image/fetch/$s_!GCV8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d442f35-0ac7-4552-bd87-66962939694d_2048x1024.png 848w, https://substackcdn.com/image/fetch/$s_!GCV8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d442f35-0ac7-4552-bd87-66962939694d_2048x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!GCV8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5d442f35-0ac7-4552-bd87-66962939694d_2048x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>He&#8217;s a <strong>Certified Kubernetes Administrator (CKA)</strong> who writes about Kubernetes, cloud infrastructure, and cloud-native systems. He builds in public and shares practical tips, projects, and lessons learned along the way.</p><p>Check out his work &amp; socials:</p><ul><li><p><a href="https://x.com/twtayaan">Twitter</a></p></li><li><p><a href="https://github.com/Ayaan49">Github</a></p></li></ul><div><hr></div><p><em><strong>Here&#8217;s what you&#8217;ll find inside this newsletter:</strong></em></p><ul><li><p><strong>The mental model that makes Kubernetes click</strong>. The reconciliation loop, what it is, why it matters, and why most Kubernetes confusion comes from not understanding it early enough.</p></li><li><p><strong>A complete breakdown of the Kubernetes architecture.</strong> Every component in the control plane and worker nodes, what each one does, how they talk to each other, and what breaks when any one of them goes wrong.</p></li><li><p><strong>From </strong><code>kubectl apply</code><strong> to a running pod, step by step</strong>. The exact sequence of events inside the cluster from the moment you hit enter to the moment your app is live.</p></li><li><p><strong>Every core Kubernetes object explained</strong>. Pods, deployments, daemonsets, statefulsets, services, ingress, secrets, what each one does, when to use it, and when people reach for the wrong one.</p></li><li><p><strong>What Kubernetes genuinely gets right and where it gets complicated</strong>. An honest look at the trade-offs most explainers skip over, including etcd as a single point of failure, the complexity floor, and the hidden cost nobody talks about.</p></li><li><p><strong>When NOT to use Kubernetes.</strong> The answer most posts won&#8217;t give you.</p></li></ul><p>Most Kubernetes posts teach you how to use it&#8230;</p><p>This newsletter is about how it actually works, because that&#8217;s the part that makes everything else make sense.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"><span data-color="#3a7bf9" style="color: rgb(58, 123, 249);">Golden members get all letters like these!&#8230;</span></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p><div><hr></div><h2>Kubernetes Architecture Overview</h2><p>To understand Kubernetes, we first need to look at its architecture.</p><p>Then we can dive into the individual components&#8230;</p><p>Kubernetes architecture is a distributed system:</p><p>It doesn&#8217;t run on just one server. Instead, it operates on a group of servers that work together, known as a <strong>Kubernetes Cluster</strong>. These servers could be virtual machines or bare metal servers. The components of Kubernetes are distributed across these servers over a single network.</p><p>At the highest level, the Kubernetes cluster consists of two key components:<em> control plane and worker nodes.</em></p><p>We will go through each of these components in detail later...</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yhWK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafdec232-c4d8-424e-9816-fe2008a7a99d_1280x698.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yhWK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafdec232-c4d8-424e-9816-fe2008a7a99d_1280x698.jpeg 424w, https://substackcdn.com/image/fetch/$s_!yhWK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafdec232-c4d8-424e-9816-fe2008a7a99d_1280x698.jpeg 848w, https://substackcdn.com/image/fetch/$s_!yhWK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafdec232-c4d8-424e-9816-fe2008a7a99d_1280x698.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!yhWK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafdec232-c4d8-424e-9816-fe2008a7a99d_1280x698.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yhWK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafdec232-c4d8-424e-9816-fe2008a7a99d_1280x698.jpeg" width="1280" height="698" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/afdec232-c4d8-424e-9816-fe2008a7a99d_1280x698.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:698,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!yhWK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafdec232-c4d8-424e-9816-fe2008a7a99d_1280x698.jpeg 424w, https://substackcdn.com/image/fetch/$s_!yhWK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafdec232-c4d8-424e-9816-fe2008a7a99d_1280x698.jpeg 848w, https://substackcdn.com/image/fetch/$s_!yhWK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafdec232-c4d8-424e-9816-fe2008a7a99d_1280x698.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!yhWK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fafdec232-c4d8-424e-9816-fe2008a7a99d_1280x698.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Control Plane Node</h3><p>Think of the control plane as the <em>brain</em> of the Kubernetes cluster.</p><p>It manages global decisions for the cluster. Plus, it schedules apps, checks system health, and ensures the cluster remains in the desired state.</p><p>The control plane contains these components:</p><ul><li><p>kube-apiserver</p></li><li><p>etcd</p></li><li><p>kube-scheduler</p></li><li><p>kube-controller-manager</p></li><li><p>Cloud-controller-manager</p></li></ul><h3>Worker Node</h3><p>Imagine the worker node as the <em>muscle</em> of the Kubernetes cluster.</p><p>It&#8217;s responsible for running workloads (containerized applications) in the cluster. And it contains these components:</p><ul><li><p>kubelet</p></li><li><p>kube-proxy</p></li><li><p>Container runtime</p></li></ul><p>i.e., control plane decides what runs where; worker nodes run the containers.</p><p>Kubernetes continuously checks and fixes the system. This ensures everything runs as expected&#8230;</p><p>A cluster can have many control plane nodes and worker nodes; this usually depends on the number of workloads to be deployed.</p><p>In production systems, it&#8217;s typical to have many control plane and worker nodes. This setup keeps the system stable. It also ensures applications run smoothly, even if some machines fail or are unavailable.</p><p>Plus, Kubernetes has a strong, decentralized structure. It automatically moves workloads to healthy nodes upon node failure. This keeps your system running smoothly.</p><p>This makes Kubernetes the foundation of a reliable and self-healing distributed system.</p><h3>Desired State and Actual State</h3><p>One of the most important ideas in Kubernetes architecture is the concept of <em>desired state</em> and <em>actual state</em>.</p><p>When we deploy an application to Kubernetes, we don&#8217;t start it in the cluster ourselves. Instead, we tell Kubernetes what we want the system to look like; for example, we could say we want three replicas of an application running.</p><p>This description of what we want is called the <em><strong>desired state</strong></em>.</p><p>The <em><strong>actual state</strong></em> is what is currently running in the cluster.</p><p>Kubernetes always checks the desired state against the actual state. If it finds a difference, it automatically tries to fix it.</p><p>For example, if one app crashes or a node fails, the actual state no longer matches the desired state. Kubernetes detects this and automatically creates a new app on healthy nodes to bring the system back to the desired state. The ongoing task of checking and fixing the system is called the <em><strong>reconciliation loop</strong></em>.</p><p>This is a key concept in how Kubernetes operates. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!E7GQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d4ac799-4eb3-4c17-8998-1518ebb0ccf2_1280x698.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!E7GQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d4ac799-4eb3-4c17-8998-1518ebb0ccf2_1280x698.jpeg 424w, https://substackcdn.com/image/fetch/$s_!E7GQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d4ac799-4eb3-4c17-8998-1518ebb0ccf2_1280x698.jpeg 848w, https://substackcdn.com/image/fetch/$s_!E7GQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d4ac799-4eb3-4c17-8998-1518ebb0ccf2_1280x698.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!E7GQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d4ac799-4eb3-4c17-8998-1518ebb0ccf2_1280x698.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!E7GQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d4ac799-4eb3-4c17-8998-1518ebb0ccf2_1280x698.jpeg" width="1280" height="698" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2d4ac799-4eb3-4c17-8998-1518ebb0ccf2_1280x698.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:698,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!E7GQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d4ac799-4eb3-4c17-8998-1518ebb0ccf2_1280x698.jpeg 424w, https://substackcdn.com/image/fetch/$s_!E7GQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d4ac799-4eb3-4c17-8998-1518ebb0ccf2_1280x698.jpeg 848w, https://substackcdn.com/image/fetch/$s_!E7GQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d4ac799-4eb3-4c17-8998-1518ebb0ccf2_1280x698.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!E7GQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2d4ac799-4eb3-4c17-8998-1518ebb0ccf2_1280x698.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Now we understand Kubernetes architecture, let&#8217;s learn the control plane and worker nodes&#8230;</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/kubernetes-architecture?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/kubernetes-architecture?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div><hr></div><h2>Kubernetes Control Plane Core Components</h2><p>We already saw how the control plane makes global decisions for the cluster, but it does NOT do that as a single component.</p><p>Instead, control plane is divided into <em>five components</em> that work together to manage the entire cluster state.</p><p>These components have their own specific roles:</p><ul><li><p>One component is the central hub for all cluster communication.</p></li><li><p>Another stores the cluster data.</p></li><li><p>One makes scheduling decisions.</p></li><li><p>Another continuously monitors cluster health and keeps it in the desired state.</p></li><li><p>And the last one integrates Kubernetes with your cloud provider to manage resources such as load balancers, routes, and storage volumes.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2RWQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1da966aa-f3d5-411d-b303-5ac64f0c8da5_1280x698.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2RWQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1da966aa-f3d5-411d-b303-5ac64f0c8da5_1280x698.jpeg 424w, https://substackcdn.com/image/fetch/$s_!2RWQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1da966aa-f3d5-411d-b303-5ac64f0c8da5_1280x698.jpeg 848w, https://substackcdn.com/image/fetch/$s_!2RWQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1da966aa-f3d5-411d-b303-5ac64f0c8da5_1280x698.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!2RWQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1da966aa-f3d5-411d-b303-5ac64f0c8da5_1280x698.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2RWQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1da966aa-f3d5-411d-b303-5ac64f0c8da5_1280x698.jpeg" width="1280" height="698" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1da966aa-f3d5-411d-b303-5ac64f0c8da5_1280x698.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:698,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2RWQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1da966aa-f3d5-411d-b303-5ac64f0c8da5_1280x698.jpeg 424w, https://substackcdn.com/image/fetch/$s_!2RWQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1da966aa-f3d5-411d-b303-5ac64f0c8da5_1280x698.jpeg 848w, https://substackcdn.com/image/fetch/$s_!2RWQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1da966aa-f3d5-411d-b303-5ac64f0c8da5_1280x698.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!2RWQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1da966aa-f3d5-411d-b303-5ac64f0c8da5_1280x698.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Let&#8217;s look at each of the control plane components and the concepts behind each:</p><h3>1. Kube-Apiserver</h3><p>The kube-apiserver is central to the Kubernetes control plane.</p><p>It serves as the key hub of the cluster, exposing the Kubernetes API. Almost every operation in the Kubernetes cluster goes through the API server. The other cluster components don&#8217;t talk directly with each other. Instead, they use the kube-apiserver to read and update the cluster state. This lets the parts work independently but still connect through a central system. Also, when you interact with Kubernetes, you do not interact with the Kubernetes nodes and their components directly.</p><p>Instead, you interact with it via kube-apiserver.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!MMi5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62eccd41-506f-4b72-9960-306f597d4366_1280x699.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MMi5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62eccd41-506f-4b72-9960-306f597d4366_1280x699.jpeg 424w, https://substackcdn.com/image/fetch/$s_!MMi5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62eccd41-506f-4b72-9960-306f597d4366_1280x699.jpeg 848w, https://substackcdn.com/image/fetch/$s_!MMi5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62eccd41-506f-4b72-9960-306f597d4366_1280x699.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!MMi5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62eccd41-506f-4b72-9960-306f597d4366_1280x699.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MMi5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62eccd41-506f-4b72-9960-306f597d4366_1280x699.jpeg" width="1280" height="699" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/62eccd41-506f-4b72-9960-306f597d4366_1280x699.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:699,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!MMi5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62eccd41-506f-4b72-9960-306f597d4366_1280x699.jpeg 424w, https://substackcdn.com/image/fetch/$s_!MMi5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62eccd41-506f-4b72-9960-306f597d4366_1280x699.jpeg 848w, https://substackcdn.com/image/fetch/$s_!MMi5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62eccd41-506f-4b72-9960-306f597d4366_1280x699.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!MMi5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62eccd41-506f-4b72-9960-306f597d4366_1280x699.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>It handles your requests and updates the cluster state.</p><p>All messages between the API server and other components are encrypted using TLS<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>. This keeps unauthorized users out and protects communication within the cluster.</p><p>i.e., API server is central communication hub of Kubernetes; without it, the cluster cannot function.</p><h4><strong>Key Responsibilities of Kube-Apiserver</strong></h4><ol><li><p><strong>Exposes cluster API endpoint: </strong>It&#8217;s the only component in the control plane that the outside world can talk to. When you run a <code>kubectl</code> command (<code>kubectl</code> is the command-line tool to interact with Kubernetes), it sends a request to the API server over HTTPS. When your app gets deployed in the cluster, it&#8217;s talking to the API server.</p></li><li><p><strong>Single entry point for all operations: </strong>All requests to the cluster go through the API server. This includes requests from you and from internal Kubernetes components. Components do NOT communicate directly with each other. They talk only to the API server. Because of this, API server always has a complete picture of what is happening in the cluster.</p></li></ol><ol start="3"><li><p><strong>Authentication and Authorization:</strong> It checks who is making the request. Then, it confirms if they have permission to take the action. If either check fails, the request stops right there.</p></li></ol><ol start="4"><li><p><strong>Notifies the rest of the system when something changes</strong>: Once a change is saved, API server notifies every interested component.</p></li></ol><ol start="5"><li><p><strong>Stores cluster state in etcd: </strong>Kubernetes keeps all cluster details in etcd. This is a fast, lightweight database made for storing cluster state. Nothing reads or writes to it directly except the API server. Every change has to go through it first, this keeps the data clean and consistent.</p></li></ol><p>Since the API server stores all cluster state in etcd, etcd becomes the source of truth for the entire Kubernetes cluster.</p><p>Let&#8217;s now look at etcd and understand its role in the control plane&#8230;</p><h3>2. <strong>Etcd</strong></h3><p>etcd is a distributed key-value store (distributed database) that Kubernetes uses to store the entire cluster data.</p><p>It keeps track of what is running, what should run, and how each Kubernetes component is set up. Since it stores all data about the cluster, it is also called the <em>single source of truth</em> for the Kubernetes cluster.</p><p>Kubernetes API server stores all information ever received in etcd.</p><p>The scheduler and controller manager monitor the API server for changes. They help keep the cluster in its desired state. The API server reads data from etcd. This makes etcd the central storage system for the entire cluster.</p><p>etcd is a key part of the Kubernetes control plane.</p><p>It&#8217;s crucial to back it up regularly in production settings. If etcd data is lost, the cluster loses its state. So Kubernetes won&#8217;t know what applications are running, what nodes exist, or what the system&#8217;s desired state is.</p><p>i.e., etcd is the database that stores everything about the cluster.</p><h4><strong>Key Responsibilities of Etcd</strong></h4><ul><li><p><strong>Stores cluster state: </strong>All Kubernetes objects are stored in etcd. This includes Pods, Deployments, Services, Nodes, ConfigMaps, and Secrets.</p></li><li><p><strong>Acts as the source of truth: </strong>The entire cluster state is stored in etcd, and all the components in the cluster rely on this data to make decisions.</p></li><li><p><strong>Enables cluster recovery: </strong>Backups of etcd can be used to restore the entire cluster state in case of failure.</p></li></ul><p>Also, etcd is the only StatefulSet component in the control plane.</p><p>i.e., etcd must be carefully managed and backed up, as it contains the entire cluster state.</p><p>Now we know how Kubernetes stores its cluster state; let&#8217;s explore how it decides where to run applications&#8230;</p><h3>3. Kube-Scheduler</h3><p>The kube-scheduler decides which node will run a pod.</p><p>A <em>pod</em> is the smallest unit you can deploy in Kubernetes. It acts as a wrapper for one or more containers. Whenever a pod is created, it remains in the cluster without a node being assigned to it.</p><p>The scheduler always checks for these pods.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Bm_Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c1d8f97-3092-4f22-9b27-340e0aba064b_1280x699.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Bm_Z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c1d8f97-3092-4f22-9b27-340e0aba064b_1280x699.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Bm_Z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c1d8f97-3092-4f22-9b27-340e0aba064b_1280x699.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Bm_Z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c1d8f97-3092-4f22-9b27-340e0aba064b_1280x699.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Bm_Z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c1d8f97-3092-4f22-9b27-340e0aba064b_1280x699.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Bm_Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c1d8f97-3092-4f22-9b27-340e0aba064b_1280x699.jpeg" width="1280" height="699" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5c1d8f97-3092-4f22-9b27-340e0aba064b_1280x699.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:699,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Bm_Z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c1d8f97-3092-4f22-9b27-340e0aba064b_1280x699.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Bm_Z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c1d8f97-3092-4f22-9b27-340e0aba064b_1280x699.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Bm_Z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c1d8f97-3092-4f22-9b27-340e0aba064b_1280x699.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Bm_Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c1d8f97-3092-4f22-9b27-340e0aba064b_1280x699.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>It assigns them to the right node based on available resources and pod setup.</p><p><em><strong>Let&#8217;s learn how the scheduler works:</strong></em></p><ol><li><p><strong>Watches for unassigned Pods:</strong> The kube-scheduler monitors the API server. It checks for pods that haven&#8217;t been assigned to any node after creation.</p></li><li><p><strong>Gets the list of available nodes: </strong>It gets the information about all worker nodes and their available resources.</p></li><li><p><strong>Filters Nodes:</strong> The scheduler removes nodes that don&#8217;t meet the pod's requirements. This includes:</p><ul><li><p>Not enough CPU or memory</p></li><li><p>Not enough GPU</p></li><li><p>Node is under maintenance</p></li><li><p>Pod needs a GPU, but the node lacks one</p></li></ul></li><li><p><strong>Scores for remaining nodes:</strong> After removing some nodes, it scores each remaining node. It considers resource availability, scheduling policies, load balancing, and so on. Then, it selects the node with the highest score from the filtered list.</p></li><li><p><strong>Updates the Pod information: </strong>The scheduler updates the Pod object via the API server and assigns the selected node.</p></li></ol><p>i.e., scheduler does not run the pod itself; it only decides which node the pod should run on.</p><p>Once the scheduler assigns a Pod to a node, kubelet on that node is responsible for actually running the container.</p><h3>4. Kube-Controller-Manager</h3><p>The kube-controller-manager is part of the control plane.</p><p>It monitors the cluster and ensures the actual state matches the desired state. It runs multiple controllers, each handling a specific task in the cluster. These controllers monitor the cluster&#8217;s state using the Kubernetes API.</p><p>If they find a mismatch between the desired and actual state, they work to correct it.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!phWC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a6b2425-bd06-4fae-b14b-3895c4b3c50a_1280x692.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!phWC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a6b2425-bd06-4fae-b14b-3895c4b3c50a_1280x692.jpeg 424w, https://substackcdn.com/image/fetch/$s_!phWC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a6b2425-bd06-4fae-b14b-3895c4b3c50a_1280x692.jpeg 848w, https://substackcdn.com/image/fetch/$s_!phWC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a6b2425-bd06-4fae-b14b-3895c4b3c50a_1280x692.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!phWC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a6b2425-bd06-4fae-b14b-3895c4b3c50a_1280x692.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!phWC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a6b2425-bd06-4fae-b14b-3895c4b3c50a_1280x692.jpeg" width="1280" height="692" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3a6b2425-bd06-4fae-b14b-3895c4b3c50a_1280x692.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:692,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!phWC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a6b2425-bd06-4fae-b14b-3895c4b3c50a_1280x692.jpeg 424w, https://substackcdn.com/image/fetch/$s_!phWC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a6b2425-bd06-4fae-b14b-3895c4b3c50a_1280x692.jpeg 848w, https://substackcdn.com/image/fetch/$s_!phWC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a6b2425-bd06-4fae-b14b-3895c4b3c50a_1280x692.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!phWC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a6b2425-bd06-4fae-b14b-3895c4b3c50a_1280x692.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>To understand this better, let&#8217;s look at an example:</p><p>Imagine an application on Kubernetes set to run three replicas. This is the cluster&#8217;s desired state. But one of the replicas crashes, and the actual state becomes 2 instead of 3. The controller will detect this difference and will automatically create a new replica of the application to make it three again. This is how the controller continuously monitors the cluster state and matches it with the desired state.</p><p>Kubernetes is self-healing and highly automated because it continuously monitors the cluster. It resolves differences between the desired and actual states.</p><p>Here is a list of important built-in Kubernetes controllers:</p><ul><li><p><strong>Node Controller: </strong>Detects node failures and responds when nodes become unavailable.</p></li><li><p><strong>Replication Controller: </strong>Ensures the correct number of Pod replicas are running.</p></li><li><p><strong>Deployment Controller: </strong>Handles rolling updates and ensures Deployments maintain the desired state.</p></li><li><p><strong>Endpoint Controller: </strong>Updates endpoints for Services when Pods change.</p></li><li><p><strong>Namespace Controller: </strong>Manages namespace lifecycle and resource cleanup.</p></li><li><p><strong>Service Account Controller: </strong>Creates and manages service accounts and tokens.</p></li><li><p><strong>Job Controller: </strong>Ensures jobs are completed successfully.</p></li></ul><p>All the controllers in Kubernetes work as a control loop.</p><p>i.e., it continuously monitors the cluster state via the API server and compares the actual state with the desired state. Kubernetes has a control loop feature that&#8217;s key to its design.</p><p>This allows for self-healing, auto-scaling, and rolling updates.</p><h3>5. Cloud Controller Manager (CCM)</h3><p>The kube-controller-manager manages internal cluster tasks.</p><p>But Kubernetes must also connect to cloud providers for resources.</p><p>This includes:</p><ul><li><p>Load balancers for services</p></li><li><p>Storage volumes for persistent data</p></li><li><p>Virtual machines for nodes</p></li></ul><p>The cloud controller manager handles this.</p><p>The cloud controller manager helps Kubernetes stay cloud-agnostic. It does this by keeping cloud-specific logic separate from the main Kubernetes components. Kubernetes can run on various cloud providers, such as AWS, Google Cloud, and Azure. It can also work in on-premises environments. Best of all, there&#8217;s no need to change the core Kubernetes code.</p><p>The cloud controller manager connects Kubernetes to the cloud provider&#8217;s infrastructure.</p><p>We have looked at the control plane components that manage the cluster and make decisions. But the control plane does not run applications itself. The actual applications run on the worker nodes.</p><p>So let&#8217;s look at the worker node components and see how they work&#8230;</p><div><hr></div><div class="callout-block" data-callout="true"><p style="text-align: center;"><em><strong><span data-color="#3a7bf9" style="color: rgb(58, 123, 249);">Reminder: this is a teaser of the subscriber-only newsletter, exclusive to my golden members.</span></strong></em></p><p>When you upgrade, you&#8217;ll get:</p><ul><li><p><strong>Architecture breakdown of core DevOps systems.</strong></p></li><li><p>Deep dives into Docker, Kubernetes, Terraform, and so on.</p></li><li><p><strong>Practical insights into how real-world systems achieve scalability, automation, and reliability.</strong></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe&quot;,&quot;text&quot;:&quot;Unlock Full Access&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://newsletter.systemdesign.one/subscribe"><span>Unlock Full Access</span></a></p><p>Let&#8217;s keep going!</p></div>
      <p>
          <a href="https://newsletter.systemdesign.one/p/kubernetes-architecture">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[How to use AI agents better than 99% of people]]></title><description><![CDATA[#160: A full guide to graph shaped memory for AI agents]]></description><link>https://newsletter.systemdesign.one/p/graph-based-agent-memory</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/graph-based-agent-memory</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Tue, 07 Jul 2026 11:32:10 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/ba999b5e-9727-4e39-bfd0-9529343a9d59_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption"><span data-color="#3a7bf9" style="color: rgb(58, 123, 249);">Get my system design playbook for FREE on newsletter signup:</span></p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><ul><li><p><em><a href="https://newsletter.systemdesign.one/p/graph-based-agent-memory/?action=share">Share this post</a> &amp; I&#8217;ll send you some rewards for the referrals.</em></p></li></ul><div><hr></div><p><span>You have more than one AI agent working on the same project:</span></p><p><em>A few coding agents in your terminal, a chatbot in your browser, an agent deployed on AWS.</em></p><p>Each keeps its &#8220;own&#8221; memory.</p><p>i.e., your terminal agent doesn&#8217;t know what you told the browser chatbot 10 minutes ago. And the browser chatbot doesn&#8217;t know what&#8217;s happening in your editor.</p><p>And you copy decisions between chats and carry context<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a> by hand&#8230;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OfHF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b78fae3-9ea2-4ea1-99e6-788d60320c88_1376x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OfHF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b78fae3-9ea2-4ea1-99e6-788d60320c88_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!OfHF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b78fae3-9ea2-4ea1-99e6-788d60320c88_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!OfHF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b78fae3-9ea2-4ea1-99e6-788d60320c88_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!OfHF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b78fae3-9ea2-4ea1-99e6-788d60320c88_1376x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OfHF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b78fae3-9ea2-4ea1-99e6-788d60320c88_1376x768.jpeg" width="1376" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6b78fae3-9ea2-4ea1-99e6-788d60320c88_1376x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1376,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Three separate agents each with its own walled-off memory, a tired person hand-carrying notes between them&quot;,&quot;title&quot;:&quot;Three separate agents each with its own walled-off memory, a tired person hand-carrying notes between them&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Three separate agents each with its own walled-off memory, a tired person hand-carrying notes between them" title="Three separate agents each with its own walled-off memory, a tired person hand-carrying notes between them" srcset="https://substackcdn.com/image/fetch/$s_!OfHF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b78fae3-9ea2-4ea1-99e6-788d60320c88_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!OfHF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b78fae3-9ea2-4ea1-99e6-788d60320c88_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!OfHF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b78fae3-9ea2-4ea1-99e6-788d60320c88_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!OfHF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6b78fae3-9ea2-4ea1-99e6-788d60320c88_1376x768.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>So a single &#8220;shared memory&#8221; every agent can read from &amp; write to is missing&#8230;</p><p>I&#8217;ll use <strong><a href="https://github.com/ModernRelay/omnigraph">Omnigraph</a></strong> as the case study for this newsletter.</p><p>(It&#8217;s an open-source graph engine built for solving this exact same problem.)</p><div><hr></div><p><em><strong>Here&#8217;s what&#8217;s inside this newsletter:</strong></em></p><ul><li><p><strong>Why shared folders and vector databases fail.</strong> The hidden problem that appears the moment many AI agents write to the same memory.</p></li><li><p><strong>Why graph-shaped memory wins.</strong> How nodes, edges, and schemas let agents build knowledge instead of disconnected text.</p></li><li><p><strong>Object storage without database transactions.</strong> How Omnigraph achieves atomic writes on Amazon S3.</p></li><li><p><strong>Git for AI memory.</strong> Why branches, commits, merges, and policy checks stop agents from overwriting each other or turning mistakes into shared truth.</p></li><li><p><strong>One query, three retrieval methods.</strong> How graph traversal, keyword search, and semantic search combine to assemble better context for every AI agent.</p></li><li><p><strong>When graph memory is the wrong tool.</strong> The workloads where a traditional database, a graph database, or a vector database is still the better choice.</p></li></ul><p><span>Onward.</span></p><div><hr></div><h2><span>Why traditional memory breaks</span></h2><p>One &#8220;shared&#8221; memory every AI agent can read from and write to sounds simple.</p><p>Yet the obvious ways to build it don&#8217;t work well&#8230;</p><p><em>Let&#8217;s start with two simple approaches:</em></p><h4>1. Shared document folder</h4><p>Every agent stores text in notion, google drive, confluence, or a wiki.</p><p>Yet the folder has NO structure an agent can reason over&#8230;it&#8217;s just a pile of text.</p><p>If you ask, <em>&#8220;Which deploy touched this service, or who shipped it?&#8221;</em>, the agent can answer it off a single file just fine. But it becomes extremely difficult when the answer is spread across 200+ files&#8230;</p><p>Then agent doesn&#8217;t know deploy, service, and person are different concepts. Plus, it has to read everything to be sure it didn&#8217;t <em>miss</em> the one file that mattered... or fall back to the classic habit of <em>hallucination</em><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a>. </p><p>A folder stores text,,, NOT knowledge.</p><h4>2. Vector database</h4><p>Ask the vector database<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a> a question using retrieval-augmented generation<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a> (<strong>RAG</strong>).</p><p>It returns the chunks of text that most closely match your question&#8230;This is useful for <em>&#8220;find me the passage about X.&#8221;</em></p><p>But a vector database holds NO relationships or types.</p><p>It can&#8217;t start at the customer; find their open tickets, connect them to the engineer on call, and then to the commit that probably caused it. Instead, you get only a bag of similar-sounding snippets, and you need to connect the dots yourself.</p><p>So neither one allows an agent to start with one fact and <em>follow</em> it to another related fact&#8230;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BZTq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fbcc1a9-de91-4c3a-9528-1660b8ed6163_1376x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BZTq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fbcc1a9-de91-4c3a-9528-1660b8ed6163_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!BZTq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fbcc1a9-de91-4c3a-9528-1660b8ed6163_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!BZTq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fbcc1a9-de91-4c3a-9528-1660b8ed6163_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!BZTq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fbcc1a9-de91-4c3a-9528-1660b8ed6163_1376x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BZTq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fbcc1a9-de91-4c3a-9528-1660b8ed6163_1376x768.jpeg" width="1376" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6fbcc1a9-de91-4c3a-9528-1660b8ed6163_1376x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1376,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;A folder shown as an untyped pile of identical pages, a vector database shown as look-alike cards with no threads between them, neither has a path to follow&quot;,&quot;title&quot;:&quot;A folder shown as an untyped pile of identical pages, a vector database shown as look-alike cards with no threads between them, neither has a path to follow&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A folder shown as an untyped pile of identical pages, a vector database shown as look-alike cards with no threads between them, neither has a path to follow" title="A folder shown as an untyped pile of identical pages, a vector database shown as look-alike cards with no threads between them, neither has a path to follow" srcset="https://substackcdn.com/image/fetch/$s_!BZTq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fbcc1a9-de91-4c3a-9528-1660b8ed6163_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!BZTq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fbcc1a9-de91-4c3a-9528-1660b8ed6163_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!BZTq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fbcc1a9-de91-4c3a-9528-1660b8ed6163_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!BZTq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6fbcc1a9-de91-4c3a-9528-1660b8ed6163_1376x768.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Even if you ignore these issues, everything falls apart the moment a <em>second</em> agent writes to the same place&#8230;</p><p>A <em><strong>shared folder</strong></em> has no way to coordinate concurrent writes. If two agents save the same document, the last write wins and the other disappears.</p><p>A <em><strong>vector database</strong></em> does NOT distinguish between a proposed change and an accepted one. Once an agent writes new information, every other agent can retrieve it immediately.</p><p>i.e., one agent&#8217;s mistake becomes every agent&#8217;s input (shared context). And agents often get things wrong, so letting one write straight to the shared memory is extremely dangerous.</p><p>A &#8220;shared&#8221; memory for AI agents must do three jobs:</p><ul><li><p><strong>Read:</strong> Assemble context across connected facts. Start from one fact, follow its relationships, and build the context an agent needs.</p></li><li><p><strong>Write:</strong> Persist new knowledge so it survives after the task ends.</p></li><li><p><strong>Coordinate:</strong> Allow many agents to read &amp; write simultaneously without overwriting each other or exposing incomplete changes.</p></li></ul><p>Reads and writes aren&#8217;t new&#8230;but coordination is&#8230;</p><p>Traditional memory systems assume a few deterministic writers making short, careful, and predictable updates.</p><p>But AI agents behave differently:</p><p>They reason for minutes, revise earlier conclusions, make &#8216;mistakes&#8217;, and run alongside many other agents touching the same knowledge.</p><p>Shared folders &amp; vector databases are NOT designed for this type of workload&#8230;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!a5ia!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F446eef9b-b43f-4c08-866f-27eaddbd6f49_1376x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!a5ia!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F446eef9b-b43f-4c08-866f-27eaddbd6f49_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!a5ia!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F446eef9b-b43f-4c08-866f-27eaddbd6f49_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!a5ia!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F446eef9b-b43f-4c08-866f-27eaddbd6f49_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!a5ia!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F446eef9b-b43f-4c08-866f-27eaddbd6f49_1376x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!a5ia!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F446eef9b-b43f-4c08-866f-27eaddbd6f49_1376x768.jpeg" width="1376" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/446eef9b-b43f-4c08-866f-27eaddbd6f49_1376x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1376,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;One calm careful writer making a single quick mark, beside a swarm of agents all reaching for the same memory at once, some of them wrong&quot;,&quot;title&quot;:&quot;One calm careful writer making a single quick mark, beside a swarm of agents all reaching for the same memory at once, some of them wrong&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="One calm careful writer making a single quick mark, beside a swarm of agents all reaching for the same memory at once, some of them wrong" title="One calm careful writer making a single quick mark, beside a swarm of agents all reaching for the same memory at once, some of them wrong" srcset="https://substackcdn.com/image/fetch/$s_!a5ia!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F446eef9b-b43f-4c08-866f-27eaddbd6f49_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!a5ia!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F446eef9b-b43f-4c08-866f-27eaddbd6f49_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!a5ia!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F446eef9b-b43f-4c08-866f-27eaddbd6f49_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!a5ia!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F446eef9b-b43f-4c08-866f-27eaddbd6f49_1376x768.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><blockquote><p>Omnigraph&#8217;s core idea is simple:</p><p>AI agents don&#8217;t need a better folder or a vector database. Instead, a <em><strong>memory</strong></em> <em><strong>system</strong></em> designed for the way they read, write, and coordinate.</p></blockquote><div><hr></div><div class="callout-block" data-callout="true"><p>I&#8217;m happy to partner with <strong><a href="https://github.com/ModernRelay/omnigraph">Omnigraph</a></strong> on this newsletter.</p><p>When dozens of agents share one graph, things get chaotic fast: updates collide, bad writes land immediately, and context drifts.</p><p>Omnigraph gives every agent an isolated branch of the same typed graph, so agents can enrich data in parallel while humans deliberately review, approve, and merge changes. Built on Lance, Arrow, DataFusion.</p><p>Graph state stored in object storage. MIT.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://github.com/ModernRelay/omnigraph" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YfC1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 424w, https://substackcdn.com/image/fetch/$s_!YfC1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 848w, https://substackcdn.com/image/fetch/$s_!YfC1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 1272w, https://substackcdn.com/image/fetch/$s_!YfC1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YfC1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png" width="1456" height="1751" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1751,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:973437,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://github.com/ModernRelay/omnigraph&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/204901045?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!YfC1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 424w, https://substackcdn.com/image/fetch/$s_!YfC1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 848w, https://substackcdn.com/image/fetch/$s_!YfC1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 1272w, https://substackcdn.com/image/fetch/$s_!YfC1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://github.com/ModernRelay/omnigraph&quot;,&quot;text&quot;:&quot;Check out the repo&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://github.com/ModernRelay/omnigraph"><span>Check out the repo</span></a></p></div><div><hr></div><h2><span>Graph based memory</span></h2><p><em>So what should this memory look like? </em></p><p>Imagine facts as dots and relationships as lines connecting them.</p><ul><li><p>A customer is a dot.</p></li><li><p>Each of their tickets is a dot.</p></li><li><p>Lines connect the customer to each ticket.</p></li><li><p>The engineer who owns a ticket is a dot with a line to it.</p></li><li><p>The commit that probably caused the bug is another dot, with a line to the ticket it broke.</p></li></ul><p>This is a <strong>graph</strong>: dots are&nbsp;<em><strong>nodes</strong></em> &amp; lines are <em><strong>edges</strong></em>.</p><p>To answer a question, the system doesn&#8217;t search thousands of documents for clues. Instead, it follows the existing edges:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;c41630b8-1fea-4383-bd18-f2c424722aa0&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Customer &#8594; Ticket &#8594; Engineer &#8594; Commit </code></pre></div><p>i.e., four direct hops through connected data.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-AlS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff025017f-047a-48bb-80bb-aa17c52d7e83_1376x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-AlS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff025017f-047a-48bb-80bb-aa17c52d7e83_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!-AlS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff025017f-047a-48bb-80bb-aa17c52d7e83_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!-AlS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff025017f-047a-48bb-80bb-aa17c52d7e83_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!-AlS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff025017f-047a-48bb-80bb-aa17c52d7e83_1376x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-AlS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff025017f-047a-48bb-80bb-aa17c52d7e83_1376x768.jpeg" width="1376" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f025017f-047a-48bb-80bb-aa17c52d7e83_1376x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1376,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;A small typed graph where a customer, ticket, engineer and commit are nodes joined by solid labeled edges, with one path walked along real connections&quot;,&quot;title&quot;:&quot;A small typed graph where a customer, ticket, engineer and commit are nodes joined by solid labeled edges, with one path walked along real connections&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A small typed graph where a customer, ticket, engineer and commit are nodes joined by solid labeled edges, with one path walked along real connections" title="A small typed graph where a customer, ticket, engineer and commit are nodes joined by solid labeled edges, with one path walked along real connections" srcset="https://substackcdn.com/image/fetch/$s_!-AlS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff025017f-047a-48bb-80bb-aa17c52d7e83_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!-AlS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff025017f-047a-48bb-80bb-aa17c52d7e83_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!-AlS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff025017f-047a-48bb-80bb-aa17c52d7e83_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!-AlS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff025017f-047a-48bb-80bb-aa17c52d7e83_1376x768.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The graph stores relationships alongside the facts themselves.</p><p>This is exactly what shared agent memory has been missing&#8230;</p><div><hr></div><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/graph-based-agent-memory?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption"><em><span data-color="#3a7bf9" style="color: rgb(58, 123, 249);">Get 1+ referral &amp; I&#8217;ll send you my Leetcode Master Template!</span></em></p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/graph-based-agent-memory?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/graph-based-agent-memory?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><div><hr></div><h3><span>Graph schema</span></h3><p>A graph alone is NOT enough.</p><p>Once <em>many</em> AI agents start writing to the same graph, a new problem appears&#8230;</p><p>Imagine three agents recording the same production event:</p><ul><li><p>One writes <code>&#8220;deploy&#8221;</code>,</p></li><li><p>Another writes <code>&#8220;deployment&#8221;</code>,</p></li><li><p>And the third writes <code>&#8220;release&#8221;</code>.</p></li></ul><p>To you, those are different words with the same meaning&#8230;but to the graph, they&#8217;re three <em>different</em> nodes.</p><p>(Nothing tells the graph they represent the same concept&#8230;)</p><p>Now when an agent asks, <em>&#8220;Show me every deploy this week and who shipped it.&#8221;</em></p><p>It follows the <code>deploy</code> nodes and returns only part of the answer. Every <code>deployment</code> and <code>release</code> sits elsewhere on the graph, so the query &#8220;silently&#8221; never reaches them.</p><p>The result looks complete&#8230; but it&#8217;s WRONG!</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JJM0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a1e1f56-3ae5-4abf-babb-d093d953b05f_1376x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JJM0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a1e1f56-3ae5-4abf-babb-d093d953b05f_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!JJM0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a1e1f56-3ae5-4abf-babb-d093d953b05f_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!JJM0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a1e1f56-3ae5-4abf-babb-d093d953b05f_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!JJM0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a1e1f56-3ae5-4abf-babb-d093d953b05f_1376x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JJM0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a1e1f56-3ae5-4abf-babb-d093d953b05f_1376x768.jpeg" width="1376" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3a1e1f56-3ae5-4abf-babb-d093d953b05f_1376x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1376,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;One event recorded under three different words splits into three disconnected islands, and a single read reaches only one of them&quot;,&quot;title&quot;:&quot;One event recorded under three different words splits into three disconnected islands, and a single read reaches only one of them&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="One event recorded under three different words splits into three disconnected islands, and a single read reaches only one of them" title="One event recorded under three different words splits into three disconnected islands, and a single read reaches only one of them" srcset="https://substackcdn.com/image/fetch/$s_!JJM0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a1e1f56-3ae5-4abf-babb-d093d953b05f_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!JJM0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a1e1f56-3ae5-4abf-babb-d093d953b05f_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!JJM0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a1e1f56-3ae5-4abf-babb-d093d953b05f_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!JJM0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a1e1f56-3ae5-4abf-babb-d093d953b05f_1376x768.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The graph didn&#8217;t fail,,, but the schema did.</p><p>Without a &#8220;shared&#8221; schema, each agent creates its own vocabulary. The graph stores exactly what each agent writes, even when different terms describe the same concept.</p><p>The solution is to <em>define</em> the graph before anyone writes to it.</p><p>A <strong>schema</strong> specifies:</p><ul><li><p>Which node types are allowed to exist,</p></li><li><p>Which relationships connect them,</p></li><li><p>How each node is identified.</p></li></ul><p>Every agent writes against the <em>same</em> schema, so they all describe the world in the same way.</p><p>So the graph stays consistent, even when hundreds of agents write to it.</p><h3><span>Omnigraph </span>schema</h3><p><span>In Omnigraph, a schema is a plain text file:</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ku6U!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b7ae94c-6768-470b-9c3c-e14c73faf824_1408x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ku6U!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b7ae94c-6768-470b-9c3c-e14c73faf824_1408x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Ku6U!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b7ae94c-6768-470b-9c3c-e14c73faf824_1408x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Ku6U!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b7ae94c-6768-470b-9c3c-e14c73faf824_1408x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Ku6U!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b7ae94c-6768-470b-9c3c-e14c73faf824_1408x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ku6U!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b7ae94c-6768-470b-9c3c-e14c73faf824_1408x768.jpeg" width="1408" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8b7ae94c-6768-470b-9c3c-e14c73faf824_1408x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1408,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;The Omnigraph schema, three node types Person Service and Deploy, and two edges TriggeredBy and Targets, each Deploy pointing to a Person and a Service&quot;,&quot;title&quot;:&quot;The Omnigraph schema, three node types Person Service and Deploy, and two edges TriggeredBy and Targets, each Deploy pointing to a Person and a Service&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Omnigraph schema, three node types Person Service and Deploy, and two edges TriggeredBy and Targets, each Deploy pointing to a Person and a Service" title="The Omnigraph schema, three node types Person Service and Deploy, and two edges TriggeredBy and Targets, each Deploy pointing to a Person and a Service" srcset="https://substackcdn.com/image/fetch/$s_!Ku6U!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b7ae94c-6768-470b-9c3c-e14c73faf824_1408x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Ku6U!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b7ae94c-6768-470b-9c3c-e14c73faf824_1408x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Ku6U!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b7ae94c-6768-470b-9c3c-e14c73faf824_1408x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Ku6U!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b7ae94c-6768-470b-9c3c-e14c73faf824_1408x768.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>You do NOT write it from scratch.</p><p>Instead, the agent generates it from your graph and updates it as your knowledge evolves. And the file describes the graph itself.</p><p>Each <code>node</code> defines a type of entity, such as <code>Person</code>, <code>Service</code>, or <code>Deploy</code>. The <code>@key</code> specifies how each node is uniquely identified; for example, a person&#8217;s name, a deploy ID, and so on.</p><p>Each <code>edge</code> defines a relationship between two node types and the direction an agent can traverse it.</p><p><code>Deploy -&gt; Service</code> literally means <em>&#8220;from the deploy to the service it touched.&#8221;</em></p><p>Every agent reads the same schema before it writes. This keeps the graph consistent even when many agents update it simultaneously.</p><p>So the memory isn&#8217;t just a graph&#8230;it&#8217;s a &#8220;typed&#8221; graph with a shared schema.</p><p>The next question is where this graph lives&#8230;</p><div><hr></div><h2><span>Where memory lives</span></h2><p>The graph lives in <strong>object storage</strong>.</p><p>Think of it as a data bucket in the cloud. Some popular examples are Amazon S3<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a>, Google Cloud Storage (GCS), and Cloudflare R2.</p><p>Modern web apps use object storage for backups, logs, images, videos, and data lakes.</p><h3><span>Why Omnigraph chose S3</span></h3><p><span>Omnigraph uses AWS S3 for storage.</span></p><p><span>Here&#8217;s why:</span></p><p><strong>1. Low cost</strong></p><p>Amazon S3 storage costs only a few cents per gigabyte each month.</p><p>AI agents accumulate knowledge over time. And object storage lets memory grow <em>without</em> the cost of running a large database cluster.</p><p><strong>2. High durability</strong></p><p>Once data is stored, Amazon S3 replicates it across many availability zones (<strong>AZ</strong>) within a region to provide very high durability.</p><p>This is crucial because the graph becomes your agents&#8217; shared memory and system of record.</p><p><strong>3. Shared access</strong></p><p>An object storage bucket is NOT tied to one machine.</p><p>Every agent with the right credentials can read from and write back to the same bucket. Your coding agent, browser chatbot, and background agents all share &#8220;one&#8221; memory instead of maintaining separate copies.</p><p>i.e., there&#8217;s no need to copy state between separate agent data stores.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!f6IU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c73fe9b-0ccc-4b9c-ae66-f2cd0a53b629_1376x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!f6IU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c73fe9b-0ccc-4b9c-ae66-f2cd0a53b629_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!f6IU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c73fe9b-0ccc-4b9c-ae66-f2cd0a53b629_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!f6IU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c73fe9b-0ccc-4b9c-ae66-f2cd0a53b629_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!f6IU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c73fe9b-0ccc-4b9c-ae66-f2cd0a53b629_1376x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!f6IU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c73fe9b-0ccc-4b9c-ae66-f2cd0a53b629_1376x768.jpeg" width="1376" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9c73fe9b-0ccc-4b9c-ae66-f2cd0a53b629_1376x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1376,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Many different agents all pointing at a single shared bucket in the cloud, with no private copies between them&quot;,&quot;title&quot;:&quot;Many different agents all pointing at a single shared bucket in the cloud, with no private copies between them&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Many different agents all pointing at a single shared bucket in the cloud, with no private copies between them" title="Many different agents all pointing at a single shared bucket in the cloud, with no private copies between them" srcset="https://substackcdn.com/image/fetch/$s_!f6IU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c73fe9b-0ccc-4b9c-ae66-f2cd0a53b629_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!f6IU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c73fe9b-0ccc-4b9c-ae66-f2cd0a53b629_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!f6IU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c73fe9b-0ccc-4b9c-ae66-f2cd0a53b629_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!f6IU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c73fe9b-0ccc-4b9c-ae66-f2cd0a53b629_1376x768.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Yet an object storage has one key limitation:</p><p>It stores one object safely at a time, but it can&#8217;t commit several objects as a single all-or-nothing operation. A database calls this an <strong>atomic write</strong>.</p><p>Write object A, then B, then C, and the bucket treats them as three independent writes. There&#8217;s NO built-in way to say, <em>&#8220;Commit all three or none.&#8221;</em></p><p>And a graph update almost always touches &#8220;many&#8221; objects&#8230;</p><p><em>So how do you get atomic writes from storage that doesn&#8217;t support them?</em></p><div><hr></div><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/graph-based-agent-memory?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption"><em><span data-color="#3a7bf9" style="color: rgb(58, 123, 249);">Get 2+ referrals &amp; I&#8217;ll send you my Interview Mistakes to Avoid PDF!</span></em></p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/graph-based-agent-memory?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/graph-based-agent-memory?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><div><hr></div><h2><span>How atomic writes work</span></h2><p><span>To understand this, you first need to see how Omnigraph stores the graph in the S3 bucket&#8230;</span></p><h4><span>How Omnigraph stores the graph</span></h4><p>The graph is NOT stored as a single file.</p><p>Instead, Omnigraph splits it into many separate stores. This design is what makes atomic writes (all-or-nothing writes) possible.</p><p>Take the schema from before:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ku6U!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b7ae94c-6768-470b-9c3c-e14c73faf824_1408x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ku6U!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b7ae94c-6768-470b-9c3c-e14c73faf824_1408x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Ku6U!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b7ae94c-6768-470b-9c3c-e14c73faf824_1408x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Ku6U!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b7ae94c-6768-470b-9c3c-e14c73faf824_1408x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Ku6U!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b7ae94c-6768-470b-9c3c-e14c73faf824_1408x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ku6U!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b7ae94c-6768-470b-9c3c-e14c73faf824_1408x768.jpeg" width="1408" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8b7ae94c-6768-470b-9c3c-e14c73faf824_1408x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1408,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;The Omnigraph schema, three node types Person Service and Deploy, and two edges TriggeredBy and Targets, each Deploy pointing to a Person and a Service&quot;,&quot;title&quot;:&quot;The Omnigraph schema, three node types Person Service and Deploy, and two edges TriggeredBy and Targets, each Deploy pointing to a Person and a Service&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Omnigraph schema, three node types Person Service and Deploy, and two edges TriggeredBy and Targets, each Deploy pointing to a Person and a Service" title="The Omnigraph schema, three node types Person Service and Deploy, and two edges TriggeredBy and Targets, each Deploy pointing to a Person and a Service" srcset="https://substackcdn.com/image/fetch/$s_!Ku6U!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b7ae94c-6768-470b-9c3c-e14c73faf824_1408x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Ku6U!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b7ae94c-6768-470b-9c3c-e14c73faf824_1408x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Ku6U!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b7ae94c-6768-470b-9c3c-e14c73faf824_1408x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Ku6U!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8b7ae94c-6768-470b-9c3c-e14c73faf824_1408x768.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Each node type &amp; edge type has its own <strong>store</strong>.</p><p>And each store contains every record of that type in <em>versioned</em> <em>files</em>. Under the hood, Omnigraph uses an open columnar file format<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a> called <strong>Lance</strong>, yet you never interact with it directly.</p><p>So schema above becomes five stores, plus a smaller store called the <strong>manifest</strong>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_bvv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae7f6fbd-25c1-496a-80e6-223aad02554f_1408x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_bvv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae7f6fbd-25c1-496a-80e6-223aad02554f_1408x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!_bvv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae7f6fbd-25c1-496a-80e6-223aad02554f_1408x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!_bvv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae7f6fbd-25c1-496a-80e6-223aad02554f_1408x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!_bvv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae7f6fbd-25c1-496a-80e6-223aad02554f_1408x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_bvv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae7f6fbd-25c1-496a-80e6-223aad02554f_1408x768.jpeg" width="1408" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ae7f6fbd-25c1-496a-80e6-223aad02554f_1408x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1408,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;The six stores on the bucket as paths, three node stores, two edge stores, and the manifest&quot;,&quot;title&quot;:&quot;The six stores on the bucket as paths, three node stores, two edge stores, and the manifest&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The six stores on the bucket as paths, three node stores, two edge stores, and the manifest" title="The six stores on the bucket as paths, three node stores, two edge stores, and the manifest" srcset="https://substackcdn.com/image/fetch/$s_!_bvv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae7f6fbd-25c1-496a-80e6-223aad02554f_1408x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!_bvv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae7f6fbd-25c1-496a-80e6-223aad02554f_1408x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!_bvv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae7f6fbd-25c1-496a-80e6-223aad02554f_1408x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!_bvv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae7f6fbd-25c1-496a-80e6-223aad02554f_1408x768.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Also, a store is NOT a single file.</p><p>Think of <code>nodes/Deploy/</code> as a folder that keeps growing as new deploys arrive&#8230;</p><p>(This detail becomes important in a second&#8230;)</p><h4><span>One update touches many stores</span></h4><p>An update to a graph almost always writes to several stores.</p><p>This is where object storage turns into a limitation&#8230;</p><p>Record a single deploy: <em>Alice pushes deploy </em><code>d-913</code><em> to the </em><code>checkout</code><em> service.</em></p><p>Omnigraph has to write:</p><ul><li><p>a new row in <code>nodes/Deploy/</code> for deploy <code>d-913</code></p></li><li><p>a new row in <code>nodes/Person/</code> for Alice, if she doesn&#8217;t already exist</p></li><li><p>a new row in <code>edges/TriggeredBy/</code> linking <code>d-913</code> to Alice</p></li></ul><p>i.e., write to <em>three</em> separate stores for <em>one</em> logical update.</p><p>And to the bucket, those are just three <em>independent</em> writes&#8230;</p><p>If the process crashes after writing the <code>Deploy</code> and <code>Person</code> stores but before writing the <code>TriggeredBy</code> edge, the graph becomes <em>inconsistent</em>. Then deploy exists, but nothing says who triggered it&#8230;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!M6W6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1018502-95af-479c-9138-b8f1f0904e7c_1376x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!M6W6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1018502-95af-479c-9138-b8f1f0904e7c_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!M6W6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1018502-95af-479c-9138-b8f1f0904e7c_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!M6W6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1018502-95af-479c-9138-b8f1f0904e7c_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!M6W6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1018502-95af-479c-9138-b8f1f0904e7c_1376x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!M6W6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1018502-95af-479c-9138-b8f1f0904e7c_1376x768.jpeg" width="1376" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b1018502-95af-479c-9138-b8f1f0904e7c_1376x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1376,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;A single recorded action splitting into three separate store-writes, where a crash mid-way leaves a deploy node with its connecting edge missing, pointing at nothing&quot;,&quot;title&quot;:&quot;A single recorded action splitting into three separate store-writes, where a crash mid-way leaves a deploy node with its connecting edge missing, pointing at nothing&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A single recorded action splitting into three separate store-writes, where a crash mid-way leaves a deploy node with its connecting edge missing, pointing at nothing" title="A single recorded action splitting into three separate store-writes, where a crash mid-way leaves a deploy node with its connecting edge missing, pointing at nothing" srcset="https://substackcdn.com/image/fetch/$s_!M6W6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1018502-95af-479c-9138-b8f1f0904e7c_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!M6W6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1018502-95af-479c-9138-b8f1f0904e7c_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!M6W6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1018502-95af-479c-9138-b8f1f0904e7c_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!M6W6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1018502-95af-479c-9138-b8f1f0904e7c_1376x768.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Besides, object storage can&#8217;t roll those writes back because it never knew they belonged to the same logical update.</p><h4><span>Manifest tracks live versions</span></h4><p>The manifest is the smaller store&#8230;It does NOT contain graph data.</p><p>Instead, it&#8217;s a small table whose only job is to record, for every other store, which version of it is live right now.</p><p>It follows these two simple rules:</p><p><em><strong>Rule #1 Stores are immutable</strong></em></p><p>A write &#8220;never&#8221; modifies a store in place.</p><p>A write to <code>nodes/Deploy/</code> creates a new version alongside the old one. Both versions exist in object storage simultaneously. And the old version remains live (agents keep seeing it) until the manifest says otherwise.</p><p><em><strong>Rule #2 Every store has exactly one live version</strong></em></p><p>The manifest stores a pointer to the current version of each store.</p><p>It looks like this:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6CCb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e9e605-d7c7-417f-96e5-3955d3e26138_1376x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6CCb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e9e605-d7c7-417f-96e5-3955d3e26138_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!6CCb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e9e605-d7c7-417f-96e5-3955d3e26138_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!6CCb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e9e605-d7c7-417f-96e5-3955d3e26138_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!6CCb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e9e605-d7c7-417f-96e5-3955d3e26138_1376x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6CCb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e9e605-d7c7-417f-96e5-3955d3e26138_1376x768.jpeg" width="1376" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/75e9e605-d7c7-417f-96e5-3955d3e26138_1376x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1376,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;The manifest before and after a write, three stores whose live versions all advance one step, Deploy v7 to v8, Person v11 to v12, TriggeredBy v3 to v4&quot;,&quot;title&quot;:&quot;The manifest before and after a write, three stores whose live versions all advance one step, Deploy v7 to v8, Person v11 to v12, TriggeredBy v3 to v4&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The manifest before and after a write, three stores whose live versions all advance one step, Deploy v7 to v8, Person v11 to v12, TriggeredBy v3 to v4" title="The manifest before and after a write, three stores whose live versions all advance one step, Deploy v7 to v8, Person v11 to v12, TriggeredBy v3 to v4" srcset="https://substackcdn.com/image/fetch/$s_!6CCb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e9e605-d7c7-417f-96e5-3955d3e26138_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!6CCb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e9e605-d7c7-417f-96e5-3955d3e26138_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!6CCb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e9e605-d7c7-417f-96e5-3955d3e26138_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!6CCb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75e9e605-d7c7-417f-96e5-3955d3e26138_1376x768.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Now check the deploy from earlier&#8230;</p><p>The update touches three stores,,, so the manifest has to move three pointers to their new versions.</p><h4><span>Publishing a graph update</span></h4><p>Here&#8217;s the complete (all-or-nothing) write sequence:</p><ol><li><p>Omnigraph writes the new store versions without touching the manifest.</p></li><li><p>It creates <code>Deploy v8</code>, <code>Person v12</code>, and <code>TriggeredBy v4</code> in the bucket.</p></li><li><p>Those versions already exist in object storage, but they&#8217;re invisible to agents. Every agent still reads <code>Deploy v7</code>, <code>Person v11</code>, and <code>TriggeredBy v3</code> because the manifest hasn&#8217;t been updated.</p></li><li><p>The <em>final step</em> is to update the &#8220;manifest&#8221; file.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Rllk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64421547-3a67-4da5-bd1f-ca16d3c5d2d3_1376x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Rllk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64421547-3a67-4da5-bd1f-ca16d3c5d2d3_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Rllk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64421547-3a67-4da5-bd1f-ca16d3c5d2d3_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Rllk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64421547-3a67-4da5-bd1f-ca16d3c5d2d3_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Rllk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64421547-3a67-4da5-bd1f-ca16d3c5d2d3_1376x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Rllk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64421547-3a67-4da5-bd1f-ca16d3c5d2d3_1376x768.jpeg" width="1376" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/64421547-3a67-4da5-bd1f-ca16d3c5d2d3_1376x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1376,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;New versions of three stores built in darkness where no agent can see them, while a single manifest switch still lights only the old versions, ready to flip all three live at once&quot;,&quot;title&quot;:&quot;New versions of three stores built in darkness where no agent can see them, while a single manifest switch still lights only the old versions, ready to flip all three live at once&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="New versions of three stores built in darkness where no agent can see them, while a single manifest switch still lights only the old versions, ready to flip all three live at once" title="New versions of three stores built in darkness where no agent can see them, while a single manifest switch still lights only the old versions, ready to flip all three live at once" srcset="https://substackcdn.com/image/fetch/$s_!Rllk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64421547-3a67-4da5-bd1f-ca16d3c5d2d3_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Rllk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64421547-3a67-4da5-bd1f-ca16d3c5d2d3_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Rllk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64421547-3a67-4da5-bd1f-ca16d3c5d2d3_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Rllk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F64421547-3a67-4da5-bd1f-ca16d3c5d2d3_1376x768.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A single manifest write moves all three pointers at once:</p><ul><li><p><code>Deploy &#8594; v8</code></p></li><li><p><code>Person &#8594; v12</code></p></li><li><p><code>TriggeredBy &#8594; v4</code></p></li></ul><p>Thus from an <em>agent&#8217;s</em> perspective:</p><ul><li><p><strong>Before commit:</strong> entire old graph is visible (consistent)</p></li><li><p><strong>After commit:</strong> entire new graph is visible (consistent)</p></li><li><p><strong>During commit:</strong> there is no partial state (consistent)</p></li></ul><p>The only <em>atomic</em> operation is the update to the manifest file.</p><p>If the process crashes before the manifest changes,,, nothing becomes visible. The new store versions remain orphaned files in object storage, while every agent continues reading the previous graph version.</p><h4><span>Preventing conflicting updates</span></h4><p><em>What happens if another agent updates the graph before your commit becomes visible?</em></p><p>Omnigraph solves this problem using <strong>compare-and-swap</strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-7" href="#footnote-7" target="_self">7</a><strong> (CAS)</strong>.</p><p>Before updating the manifest, it checks whether every store is still on the version the writer originally read.</p><p>Suppose a writer starts from <code>Deploy v7</code> and creates <code>Deploy v8</code>.</p><p>Before publishing the update, Omnigraph asks one question:</p><p>Is <code>Deploy</code> still on version <code>v7</code>?</p><ul><li><p><strong>Yes.</strong> Nothing changed, so the manifest update succeeds.</p></li><li><p><strong>No.</strong> Another writer already published a newer version. The commit then gets rejected, nothing becomes visible, and the writer retries from the latest state.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cBzV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3108708-bc0d-4943-967e-ca5a083af690_1376x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cBzV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3108708-bc0d-4943-967e-ca5a083af690_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!cBzV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3108708-bc0d-4943-967e-ca5a083af690_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!cBzV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3108708-bc0d-4943-967e-ca5a083af690_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!cBzV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3108708-bc0d-4943-967e-ca5a083af690_1376x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cBzV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3108708-bc0d-4943-967e-ca5a083af690_1376x768.jpeg" width="1376" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e3108708-bc0d-4943-967e-ca5a083af690_1376x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1376,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;A writer built on top of v7, but the live pointer has already moved to v8 underneath it, so its swap is refused and bounces back to retry&quot;,&quot;title&quot;:&quot;A writer built on top of v7, but the live pointer has already moved to v8 underneath it, so its swap is refused and bounces back to retry&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A writer built on top of v7, but the live pointer has already moved to v8 underneath it, so its swap is refused and bounces back to retry" title="A writer built on top of v7, but the live pointer has already moved to v8 underneath it, so its swap is refused and bounces back to retry" srcset="https://substackcdn.com/image/fetch/$s_!cBzV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3108708-bc0d-4943-967e-ca5a083af690_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!cBzV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3108708-bc0d-4943-967e-ca5a083af690_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!cBzV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3108708-bc0d-4943-967e-ca5a083af690_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!cBzV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3108708-bc0d-4943-967e-ca5a083af690_1376x768.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Compare-and-Swap simply compares the expected version with the current version before swapping the manifest pointer.</p><p>The manifest file is <em>append-only</em>.</p><p>i.e., it never modifies older entries. Instead, each successful commit simply adds a new set of live pointers.</p><p>CAS prevents one writer from accidentally overwriting changes it never saw.</p><h4><span>Proven approach</span></h4><p>Omnigraph isn&#8217;t the first system to solve this problem&#8230;</p><p>Apache Iceberg and Delta Lake<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-8" href="#footnote-8" target="_self">8</a> (open table formats) use the same pattern to achieve atomic commits on object storage.</p><p>They write new data files first, keep them invisible, then publish them with a single metadata update. It&#8217;s a proven design to power production data platforms.</p><blockquote><p>Atomic commits solve one problem:</p><p><em>They guarantee every graph update is complete or NOT visible at all.</em></p></blockquote><p>But another challenge remains&#8230;</p><p><em>What happens when many AI agents want to change the graph at the same time? And how do you stop one bad write from becoming shared memory?</em></p><div><hr></div><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/graph-based-agent-memory?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption"><em><span data-color="#3a7bf9" style="color: rgb(58, 123, 249);">Get 3+ referrals &amp; I&#8217;ll send you Popular Interview Questions PDF!</span></em></p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/graph-based-agent-memory?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/graph-based-agent-memory?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><div><hr></div><h2><span>How agents write safely</span></h2><p>Compare-and-Swap (<strong>CAS</strong>) prevents &#8220;conflicting&#8221; writes:</p><p>If two AI agents update the same store at once, one commit succeeds, and the other retries. So the graph remains consistent.</p><p>But CAS doesn&#8217;t decide whether the write is correct&#8230;</p><p>AI agents can hallucinate, misread context, or make wrong inferences. If a bad write wins the CAS check, it immediately becomes part of the shared graph.</p><p>And then every other agent reads it as fact.</p><p>Omnigraph solves this problem using a workflow similar to the <strong>Git</strong> <strong>version control system</strong>:</p><p>You don&#8217;t edit the shared repository. Instead, you create a branch, make your changes, review those, and then merge them. (Omnigraph applies the same idea to graph memory.)</p><p>i.e., AI agents don&#8217;t write directly to the shared graph, but to branches first.</p><p>Let&#8217;s dive in!</p><h3><span>Every agent gets its own branch</span></h3><p>Agents &#8220;never&#8221; write directly<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-9" href="#footnote-9" target="_self">9</a> to <code>main</code> branch (shared truth).</p><p>Instead, each agent creates its own branch from the latest graph and writes there. This branch is private. And the agent can add, modify, or delete data without affecting anyone else&#8217;s view. So<code> main</code> branch remains unchanged.</p><p>Imagine two agents working on the same graph; each creates their own branch:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Vquh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d963696-adc2-48a9-9ce8-637325e67a3e_1408x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Vquh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d963696-adc2-48a9-9ce8-637325e67a3e_1408x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Vquh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d963696-adc2-48a9-9ce8-637325e67a3e_1408x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Vquh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d963696-adc2-48a9-9ce8-637325e67a3e_1408x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Vquh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d963696-adc2-48a9-9ce8-637325e67a3e_1408x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Vquh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d963696-adc2-48a9-9ce8-637325e67a3e_1408x768.jpeg" width="1408" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9d963696-adc2-48a9-9ce8-637325e67a3e_1408x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1408,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Three branch names, main as the live shared graph, and two agent branches agent-A/fix and agent-B/refactor each forked from main&quot;,&quot;title&quot;:&quot;Three branch names, main as the live shared graph, and two agent branches agent-A/fix and agent-B/refactor each forked from main&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Three branch names, main as the live shared graph, and two agent branches agent-A/fix and agent-B/refactor each forked from main" title="Three branch names, main as the live shared graph, and two agent branches agent-A/fix and agent-B/refactor each forked from main" srcset="https://substackcdn.com/image/fetch/$s_!Vquh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d963696-adc2-48a9-9ce8-637325e67a3e_1408x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Vquh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d963696-adc2-48a9-9ce8-637325e67a3e_1408x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Vquh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d963696-adc2-48a9-9ce8-637325e67a3e_1408x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Vquh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9d963696-adc2-48a9-9ce8-637325e67a3e_1408x768.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>They work in PARALLEL without blocking each other, while the <code>main</code> branch remains unchanged&#8230;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QjPP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcd64303-80aa-474e-ad6f-f8be1f1d9a79_1376x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QjPP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcd64303-80aa-474e-ad6f-f8be1f1d9a79_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!QjPP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcd64303-80aa-474e-ad6f-f8be1f1d9a79_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!QjPP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcd64303-80aa-474e-ad6f-f8be1f1d9a79_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!QjPP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcd64303-80aa-474e-ad6f-f8be1f1d9a79_1376x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QjPP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcd64303-80aa-474e-ad6f-f8be1f1d9a79_1376x768.jpeg" width="1376" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bcd64303-80aa-474e-ad6f-f8be1f1d9a79_1376x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1376,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;A clean main line with two agent branches forking off to work in parallel, each rejoining only through a single review gate&quot;,&quot;title&quot;:&quot;A clean main line with two agent branches forking off to work in parallel, each rejoining only through a single review gate&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A clean main line with two agent branches forking off to work in parallel, each rejoining only through a single review gate" title="A clean main line with two agent branches forking off to work in parallel, each rejoining only through a single review gate" srcset="https://substackcdn.com/image/fetch/$s_!QjPP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcd64303-80aa-474e-ad6f-f8be1f1d9a79_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!QjPP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcd64303-80aa-474e-ad6f-f8be1f1d9a79_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!QjPP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcd64303-80aa-474e-ad6f-f8be1f1d9a79_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!QjPP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbcd64303-80aa-474e-ad6f-f8be1f1d9a79_1376x768.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Branching does NOT copy the entire graph:</p><p>A store gets copied only when an agent writes to it for the <em>first</em> time. Until then, the branch shares the same underlying storage as <code>main </code>branch.</p><p>Branching is therefore &#8220;inexpensive&#8221;.</p><h3><span>Every merge needs approval</span></h3><p>A branch is ONLY a proposal.</p><p>It doesn&#8217;t become part of <code>main</code> until it&#8217;s merged<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-10" href="#footnote-10" target="_self">10</a>.</p><p>But every merge must be &#8220;approved&#8221;. You can approve it yourself, or define policy rules that automatically approve routine, low-risk changes from a trusted AI agent (into a scratch branch). Yet larger/riskier changes go through human review.</p><p>The key idea is simple:</p><p>An AI agent never approves its own changes.</p><p>(Let&#8217;s return to policy rules later.)</p><p><em>Now, let&#8217;s understand what occurs on merge conflicts&#8230;</em></p><h3><span>Merge conflicts</span></h3><p>Most branches merge automatically.</p><p>If two agents change &#8220;different&#8221; parts of the graph, Omnigraph keeps both changes.</p><p>Imagine Agent A updates one deploy, while Agent B adds a new person. Those changes don&#8217;t overlap, so the merge <em>succeeds</em>&#8230;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rQov!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F946b574a-b604-4bf2-a337-fe2c8a449d52_1376x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rQov!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F946b574a-b604-4bf2-a337-fe2c8a449d52_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!rQov!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F946b574a-b604-4bf2-a337-fe2c8a449d52_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!rQov!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F946b574a-b604-4bf2-a337-fe2c8a449d52_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!rQov!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F946b574a-b604-4bf2-a337-fe2c8a449d52_1376x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rQov!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F946b574a-b604-4bf2-a337-fe2c8a449d52_1376x768.jpeg" width="1376" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/946b574a-b604-4bf2-a337-fe2c8a449d52_1376x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1376,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;A common starting version splitting into two branches, where changes to different fields merge automatically but the same field changed two ways is halted as a conflict&quot;,&quot;title&quot;:&quot;A common starting version splitting into two branches, where changes to different fields merge automatically but the same field changed two ways is halted as a conflict&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A common starting version splitting into two branches, where changes to different fields merge automatically but the same field changed two ways is halted as a conflict" title="A common starting version splitting into two branches, where changes to different fields merge automatically but the same field changed two ways is halted as a conflict" srcset="https://substackcdn.com/image/fetch/$s_!rQov!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F946b574a-b604-4bf2-a337-fe2c8a449d52_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!rQov!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F946b574a-b604-4bf2-a337-fe2c8a449d52_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!rQov!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F946b574a-b604-4bf2-a337-fe2c8a449d52_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!rQov!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F946b574a-b604-4bf2-a337-fe2c8a449d52_1376x768.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Conflicts occur only when two branches modify the &#8220;same&#8221; field differently:</p><p>Suppose Agent A changes deploy <code>d-913</code> to <code>rolled-back</code>, while Agent B changes the same field to <code>succeeded</code>.</p><p>Omnigraph won&#8217;t guess which value is correct<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-11" href="#footnote-11" target="_self">11</a>. Instead, it reports the exact conflict: <em>node, field, and both competing values.</em> Then a human or a policy rule decides which one wins.</p><p>Also graphs introduce another kind of conflict:</p><p>One branch can delete a node while another adds an edge pointing to it. And merging both would leave a dangling edge.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-NAS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffff3ea39-9d96-4782-861f-3aab6f764c3c_1376x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-NAS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffff3ea39-9d96-4782-861f-3aab6f764c3c_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!-NAS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffff3ea39-9d96-4782-861f-3aab6f764c3c_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!-NAS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffff3ea39-9d96-4782-861f-3aab6f764c3c_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!-NAS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffff3ea39-9d96-4782-861f-3aab6f764c3c_1376x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-NAS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffff3ea39-9d96-4782-861f-3aab6f764c3c_1376x768.jpeg" width="1376" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fff3ea39-9d96-4782-861f-3aab6f764c3c_1376x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1376,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;One branch adds an edge to a node that the other branch deleted, leaving a connection pointing into empty space, caught at the merge&quot;,&quot;title&quot;:&quot;One branch adds an edge to a node that the other branch deleted, leaving a connection pointing into empty space, caught at the merge&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="One branch adds an edge to a node that the other branch deleted, leaving a connection pointing into empty space, caught at the merge" title="One branch adds an edge to a node that the other branch deleted, leaving a connection pointing into empty space, caught at the merge" srcset="https://substackcdn.com/image/fetch/$s_!-NAS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffff3ea39-9d96-4782-861f-3aab6f764c3c_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!-NAS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffff3ea39-9d96-4782-861f-3aab6f764c3c_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!-NAS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffff3ea39-9d96-4782-861f-3aab6f764c3c_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!-NAS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffff3ea39-9d96-4782-861f-3aab6f764c3c_1376x768.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Omnigraph <em>detects</em> this conflict before the merge completes, preventing the graph from becoming inconsistent.</p><p>i.e., every disagreement becomes an explicit conflict and NOT a silent overwrite of data.</p><h3><span>Proven pattern</span></h3><p>Omnigraph is NOT the first system to use branches &amp; merges for data.</p><p>Dolt brings Git-style branching and merging to SQL databases. lakeFS applies the same idea to data lakes.</p><p>Omnigraph extends this pattern to typed graphs, giving AI agents a safe way to propose, review, and merge changes into shared memory.</p><div><hr></div><div class="callout-block" data-callout="true"><p>When many AI agents share the same graph, updates can conflict, incorrect writes can spread instantly, and shared context can drift over time.</p><p><strong><a href="https://github.com/ModernRelay/omnigraph">Omnigraph</a></strong> gives each agent an isolated branch of a typed graph, allowing agents to work in parallel while humans review, approve, and merge changes before they become shared truth.</p><p>Built on Apache Arrow, Lance, and DataFusion. Stores graph state in object storage. Open source under the MIT License.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://github.com/ModernRelay/omnigraph" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YfC1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 424w, https://substackcdn.com/image/fetch/$s_!YfC1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 848w, https://substackcdn.com/image/fetch/$s_!YfC1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 1272w, https://substackcdn.com/image/fetch/$s_!YfC1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YfC1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png" width="1456" height="1751" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1751,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:973437,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://github.com/ModernRelay/omnigraph&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/204901045?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!YfC1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 424w, https://substackcdn.com/image/fetch/$s_!YfC1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 848w, https://substackcdn.com/image/fetch/$s_!YfC1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 1272w, https://substackcdn.com/image/fetch/$s_!YfC1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://github.com/ModernRelay/omnigraph&quot;,&quot;text&quot;:&quot;Check out the repo&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://github.com/ModernRelay/omnigraph"><span>Check out the repo</span></a></p></div><div><hr></div><h2><span>Managing graph updates</span></h2><p><span>A safe write still leaves three questions open:</span></p><ul><li><p><em>Who is allowed to make this change?</em></p></li><li><p><em>Who actually made the change?</em></p></li><li><p><em>How do you undo the change later?</em></p></li></ul><p>Omnigraph answers all three with one object: <code>commit</code>.</p><p>Every accepted change becomes a commit on <code>main</code>. This commit records who made the change, governs how it entered the graph, and preserves the history to reverse it later if needed.</p><h3><span>Authorization layer</span></h3><p>Omnigraph itself is the engine&#8212;the core that stores the graph, merges branches, executes queries, and manages commits.</p><p>You can reach it in three ways:</p><ul><li><p>over <code>HTTP</code> through the server,</p></li><li><p>through <code>omnigraph</code> command-line tool,</p></li><li><p>through an SDK embedded in your own app.</p></li></ul><p>AI agents usually connect through a Model Context Protocol<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-12" href="#footnote-12" target="_self">12</a> (<strong>MCP</strong>) server, which talks to the HTTP server.</p><p>It might seem natural to enforce permissions at the HTTP layer. But it protects only one entry point. Plus, the command-line tool and SDK bypass the HTTP server completely.</p><p>So Omnigraph enforces permissions inside the engine.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-PK_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbb0e9ef-a114-400b-8b13-5b2cbc4bb4e5_1376x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-PK_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbb0e9ef-a114-400b-8b13-5b2cbc4bb4e5_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!-PK_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbb0e9ef-a114-400b-8b13-5b2cbc4bb4e5_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!-PK_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbb0e9ef-a114-400b-8b13-5b2cbc4bb4e5_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!-PK_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbb0e9ef-a114-400b-8b13-5b2cbc4bb4e5_1376x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-PK_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbb0e9ef-a114-400b-8b13-5b2cbc4bb4e5_1376x768.jpeg" width="1376" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cbb0e9ef-a114-400b-8b13-5b2cbc4bb4e5_1376x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1376,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Three different doors into one engine, with a single guard placed at the engine itself so every path is checked, instead of guarding only one door&quot;,&quot;title&quot;:&quot;Three different doors into one engine, with a single guard placed at the engine itself so every path is checked, instead of guarding only one door&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Three different doors into one engine, with a single guard placed at the engine itself so every path is checked, instead of guarding only one door" title="Three different doors into one engine, with a single guard placed at the engine itself so every path is checked, instead of guarding only one door" srcset="https://substackcdn.com/image/fetch/$s_!-PK_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbb0e9ef-a114-400b-8b13-5b2cbc4bb4e5_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!-PK_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbb0e9ef-a114-400b-8b13-5b2cbc4bb4e5_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!-PK_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbb0e9ef-a114-400b-8b13-5b2cbc4bb4e5_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!-PK_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbb0e9ef-a114-400b-8b13-5b2cbc4bb4e5_1376x768.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Every write passes through the same authorization check, regardless of whether it came from HTTP, the command line, or an SDK.</p><p>There&#8217;s NO path to the graph that bypasses the permission system.</p><h3><span>What the policy controls</span></h3><p>Every authorization check runs against a policy&#8230;</p><p>Imagine <em><strong>policy</strong></em> as a set of rules that defines who can perform which actions. These are the same policy rules that decide whether a branch can be merged.</p><p>The actions are specific:</p><ul><li><p>read the graph,</p></li><li><p>make a change,</p></li><li><p>create a branch,</p></li><li><p>modify a branch,</p></li><li><p>merge into <code>main</code>,</p></li><li><p>change the schema.</p></li></ul><p>A policy could allow one actor to merge into <code>main</code> while allowing another to read the graph but never modify it.</p><p>Omnigraph writes these rules in <strong>Cedar</strong>, an open policy language from AWS.</p><h3><span>How Omnigraph verifies identity</span></h3><p>Every policy rule applies to an actor.</p><p>So the first step is identifying who the actor really is. Each actor receives a <strong>token</strong> when it&#8217;s created (similar to a service API key). And every request from the actor includes that token.</p><p>The engine then identifies the actor from the token, NOT from information in the request itself.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gMvR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9857dd6c-c86b-4e3f-8e63-8c0146a009f8_1376x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gMvR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9857dd6c-c86b-4e3f-8e63-8c0146a009f8_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!gMvR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9857dd6c-c86b-4e3f-8e63-8c0146a009f8_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!gMvR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9857dd6c-c86b-4e3f-8e63-8c0146a009f8_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!gMvR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9857dd6c-c86b-4e3f-8e63-8c0146a009f8_1376x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gMvR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9857dd6c-c86b-4e3f-8e63-8c0146a009f8_1376x768.jpeg" width="1376" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9857dd6c-c86b-4e3f-8e63-8c0146a009f8_1376x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1376,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;A request loudly claiming to be admin while the engine ignores the claim and reads identity only from the sealed token it actually carries&quot;,&quot;title&quot;:&quot;A request loudly claiming to be admin while the engine ignores the claim and reads identity only from the sealed token it actually carries&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A request loudly claiming to be admin while the engine ignores the claim and reads identity only from the sealed token it actually carries" title="A request loudly claiming to be admin while the engine ignores the claim and reads identity only from the sealed token it actually carries" srcset="https://substackcdn.com/image/fetch/$s_!gMvR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9857dd6c-c86b-4e3f-8e63-8c0146a009f8_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!gMvR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9857dd6c-c86b-4e3f-8e63-8c0146a009f8_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!gMvR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9857dd6c-c86b-4e3f-8e63-8c0146a009f8_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!gMvR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9857dd6c-c86b-4e3f-8e63-8c0146a009f8_1376x768.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A request can claim, <em>&#8220;I&#8217;m an admin.&#8221;</em> Yet the token decides whether that&#8217;s true&#8230;</p><p>If the token belongs to a <em>regular</em> actor, the request gets treated as a <em>regular</em> actor every time. Trusting the request rather than the token would allow anyone to claim any identity.</p><h3><span>What permissions can control</span></h3><p>Omnigraph enforces permissions at the branch level&#8230;</p><p>A policy can answer questions such as:</p><ul><li><p><em>Can this actor</em><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-13" href="#footnote-13" target="_self">13</a><em> create a branch?</em></p></li><li><p><em>Can this actor write to this branch?</em></p></li><li><p><em>Can this actor merge into </em><code>main</code><em>?</em></p></li></ul><p>Yet it can&#8217;t answer more granular questions, such as whether an actor can update one field of a node while leaving every other field untouched. For example, <em>&#8220;can this actor edit a deploy&#8217;s status without touching its owner?&#8221;</em></p><p>(Field-level permissions are on Omnigraph&#8217;s roadmap&#8230;)</p><p>So today the permission system controls access to branches, NOT individual fields.</p><h3><span>Commit history</span></h3><p>Authorization answers one question:</p><p><em>&#8220;Who is allowed to make a change?&#8221;</em></p><p>So the next logical question is:</p><p><em>&#8220;Who actually made it?&#8221;</em><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-14" href="#footnote-14" target="_self">14</a></p><p>Every accepted change becomes a commit on <code>main</code>.</p><p>The good news is that commit records:</p><ul><li><p>who (actor<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-15" href="#footnote-15" target="_self">15</a>) made the change,</p></li><li><p>when it was committed,</p></li><li><p>its parent commit.</p></li></ul><p>Chain those commits together, and you get the history of the entire graph&#8230;</p><p>Every change has an author, a timestamp, and a place in the commit history.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oCpT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7dab73f-7476-4a8c-bdcc-f5b7b0d63a67_1376x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oCpT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7dab73f-7476-4a8c-bdcc-f5b7b0d63a67_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!oCpT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7dab73f-7476-4a8c-bdcc-f5b7b0d63a67_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!oCpT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7dab73f-7476-4a8c-bdcc-f5b7b0d63a67_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!oCpT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7dab73f-7476-4a8c-bdcc-f5b7b0d63a67_1376x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oCpT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7dab73f-7476-4a8c-bdcc-f5b7b0d63a67_1376x768.jpeg" width="1376" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b7dab73f-7476-4a8c-bdcc-f5b7b0d63a67_1376x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1376,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;A chain of commits linked in order, each link tagged with who made it and when, forming the audit trail with no separate logging system&quot;,&quot;title&quot;:&quot;A chain of commits linked in order, each link tagged with who made it and when, forming the audit trail with no separate logging system&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A chain of commits linked in order, each link tagged with who made it and when, forming the audit trail with no separate logging system" title="A chain of commits linked in order, each link tagged with who made it and when, forming the audit trail with no separate logging system" srcset="https://substackcdn.com/image/fetch/$s_!oCpT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7dab73f-7476-4a8c-bdcc-f5b7b0d63a67_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!oCpT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7dab73f-7476-4a8c-bdcc-f5b7b0d63a67_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!oCpT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7dab73f-7476-4a8c-bdcc-f5b7b0d63a67_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!oCpT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb7dab73f-7476-4a8c-bdcc-f5b7b0d63a67_1376x768.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This chain is the &#8220;audit&#8221; trail.</p><p>Omnigraph does NOT need a separate audit log because the commit history already records every accepted change in order.</p><h3><span>Reverting graph updates</span></h3><p>Omnigraph never updates data in place.</p><p>Every change creates a <em>new</em> version alongside the old one. The manifest simply points to the new version, while the old version remains in object storage.</p><p>This is what makes every change REVERSIBLE&#8230;</p><p>Every historical version of the graph still exists.</p><p>You can read the graph exactly as it looked before the merge, inspect what the system knew at that point in time, or compare it with the current state.</p><p>Nothing needs to be &#8220;reconstructed&#8221; because nothing got overwritten&#8230;</p><p>Rolling back works the same way.</p><p>A branch can be discarded, and a merged change can be reverted by creating a new commit that restores an earlier state. The previous versions are still there, ready to be read.</p><h3><strong><span>Crash recovery</span></strong></h3><p>A write can FAIL halfway through&#8230;</p><p>New store versions could already exist, while the manifest still points to the previous graph.</p><p>The next time Omnigraph opens the graph for writing, it automatically recovers the interrupted operation. It either completes the pending commit or rolls it back.</p><p>This recovery gets recorded as its own commit&#8230; Yet this commit uses a reserved system identity instead of a human or AI agent, making automatic recovery easy to distinguish in the commit history.</p><p>You can immediately tell whether a change came from a human, an AI agent, or the system itself from the audit trail.</p><div><hr></div><h2><span>How one query searches structure, keyword, and meaning</span></h2><p>Every write in Omnigraph gets saved atomically, gets checked before it is shared, and gets protected against crashes &amp; conflicting updates&#8230;</p><p>Yet an AI agent is only as <em>good</em> as the context it receives.</p><p>And the context almost &#8220;never&#8221; comes from a single lookup:</p><p>To answer a question, an agent usually has to assemble related information. Some of it comes from relationships, some from exact keywords, and some from semantic meaning.</p><p>The engine has to search all three&#8230;</p><p><strong>1. Relationships</strong></p><p>Start at the <code>LoginService</code> node and follow its edges. Which services depend on it? Which incident involved it? Who owns it?</p><p>That&#8217;s graph traversal&#8230;The engine walks relationships which already exist.</p><p><strong>2. Exact keywords</strong></p><p>Sometimes you know exactly what you&#8217;re looking for:</p><ul><li><p>the error string <code>ERR_AUTH_443,</code></p></li><li><p>a service name,</p></li><li><p>a ticket ID.</p></li></ul><p>That&#8217;s full-text search,,, similar to searching a log file with <code>grep</code>.</p><p>A graph traversal can&#8217;t answer those queries efficiently.</p><p><strong>3. Semantic meaning</strong></p><p>The agent searches for <em>&#8220;can&#8217;t log in,&#8221;</em> but the relevant incident is titled <em>&#8220;authentication failure.&#8221;</em></p><p>The words are different&#8230; but the meaning is the same&#8230;</p><p>And that&#8217;s what vector search is designed for.</p><p>A straightforward solution is to build three separate systems:</p><ul><li><p>Graph database for relationships,</p></li><li><p>Search index for keywords,</p></li><li><p>And a vector database for semantic search.</p></li></ul><p>But this approach creates a synchronization problem.</p><p>Each system keeps its own copy of the data&#8230;</p><p>If one index falls behind, they stop agreeing. The graph knows about a node that hasn&#8217;t been indexed yet, or the vector database still returns an outdated version of it. Your application now has to query all three systems and combine the results itself.</p><p>So Omnigraph takes a different approach&#8230;</p><p>It stores ONE copy of the graph in object storage and builds three indexes on top of it:</p><ul><li><p>graph relationships,</p></li><li><p>full-text index,</p></li><li><p>vector index.</p></li></ul><p>Every index gets built from the same underlying data, so they stay in <em>sync</em>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hs6p!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3529bac0-ee15-4f1a-9f60-749213fa7e76_1376x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hs6p!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3529bac0-ee15-4f1a-9f60-749213fa7e76_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!hs6p!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3529bac0-ee15-4f1a-9f60-749213fa7e76_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!hs6p!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3529bac0-ee15-4f1a-9f60-749213fa7e76_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!hs6p!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3529bac0-ee15-4f1a-9f60-749213fa7e76_1376x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hs6p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3529bac0-ee15-4f1a-9f60-749213fa7e76_1376x768.jpeg" width="1376" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3529bac0-ee15-4f1a-9f60-749213fa7e76_1376x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1376,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Three separate systems each holding its own copy of the data and drifting out of sync, beside a single stored copy with three lenses reading it, nothing to sync&quot;,&quot;title&quot;:&quot;Three separate systems each holding its own copy of the data and drifting out of sync, beside a single stored copy with three lenses reading it, nothing to sync&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Three separate systems each holding its own copy of the data and drifting out of sync, beside a single stored copy with three lenses reading it, nothing to sync" title="Three separate systems each holding its own copy of the data and drifting out of sync, beside a single stored copy with three lenses reading it, nothing to sync" srcset="https://substackcdn.com/image/fetch/$s_!hs6p!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3529bac0-ee15-4f1a-9f60-749213fa7e76_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!hs6p!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3529bac0-ee15-4f1a-9f60-749213fa7e76_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!hs6p!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3529bac0-ee15-4f1a-9f60-749213fa7e76_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!hs6p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3529bac0-ee15-4f1a-9f60-749213fa7e76_1376x768.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Here&#8217;s what happens when an AI agent sends a query:</p><ul><li><p>Omnigraph searches graph, full-text index, and vector index.</p></li><li><p>Each search returns its own ranked list of results.</p></li><li><p>The engine then combines those lists into one final ranking.</p></li></ul><p>It doesn&#8217;t <em>average</em> the scores because each search method uses a different scoring system.</p><p>Instead, Omnigraph ranks the results from each search independently, then merges those rankings using Reciprocal Rank Fusion (<strong>RRF</strong>).</p><p>i.e., results that appear near top across many searches rise to the top of final list.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zZWB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86919d3a-bc4d-46e3-99d3-758a2a3150fd_1376x768.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zZWB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86919d3a-bc4d-46e3-99d3-758a2a3150fd_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!zZWB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86919d3a-bc4d-46e3-99d3-758a2a3150fd_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!zZWB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86919d3a-bc4d-46e3-99d3-758a2a3150fd_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!zZWB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86919d3a-bc4d-46e3-99d3-758a2a3150fd_1376x768.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zZWB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86919d3a-bc4d-46e3-99d3-758a2a3150fd_1376x768.jpeg" width="1376" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/86919d3a-bc4d-46e3-99d3-758a2a3150fd_1376x768.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1376,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Three separate ranked lists merged not by averaging their scores but by rank position, so an item near the top of two lists rises in the combined ranking&quot;,&quot;title&quot;:&quot;Three separate ranked lists merged not by averaging their scores but by rank position, so an item near the top of two lists rises in the combined ranking&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Three separate ranked lists merged not by averaging their scores but by rank position, so an item near the top of two lists rises in the combined ranking" title="Three separate ranked lists merged not by averaging their scores but by rank position, so an item near the top of two lists rises in the combined ranking" srcset="https://substackcdn.com/image/fetch/$s_!zZWB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86919d3a-bc4d-46e3-99d3-758a2a3150fd_1376x768.jpeg 424w, https://substackcdn.com/image/fetch/$s_!zZWB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86919d3a-bc4d-46e3-99d3-758a2a3150fd_1376x768.jpeg 848w, https://substackcdn.com/image/fetch/$s_!zZWB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86919d3a-bc4d-46e3-99d3-758a2a3150fd_1376x768.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!zZWB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86919d3a-bc4d-46e3-99d3-758a2a3150fd_1376x768.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Under the hood, Omnigraph combines several retrieval techniques:</p><ul><li><p>BM25<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-16" href="#footnote-16" target="_self">16</a> for keyword search,</p></li><li><p>Vector k-nearest neighbors<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-17" href="#footnote-17" target="_self">17</a> (<strong>k-NN</strong>) with cosine similarity for semantic search,</p></li><li><p>Fuzzy matching for approximate matches,</p></li><li><p>Reciprocal Rank Fusion<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-18" href="#footnote-18" target="_self">18</a> (<strong>RRF</strong>) for combining results.</p></li></ul><p>You don&#8217;t have to know any of these techniques yourself or how to even use them, because the agent using Omnigraph is going to handle it for you&#8230;</p><div><hr></div><h2>When to use graph memory</h2><p>Graph memory solves a specific problem.</p><p>Multiple AI agents need to read shared context, write new knowledge, and coordinate those changes without corrupting the shared graph.</p><p>Here are some use cases:</p><ul><li><p><strong>Company knowledge graph </strong>where agents read and update decisions, ownership, and relationships.</p></li><li><p><strong>Long-term agent memory</strong> that survives after each task ends.</p></li><li><p><strong>Codebase graph</strong> that coding agents continuously read and update.</p></li><li><p><strong>Personal knowledge graph</strong> managed by one or more AI agents.</p></li></ul><p>The common pattern isn&#8217;t the domain&#8230;</p><p>But multiple agents working on the same knowledge over time.</p><div><hr></div><h2>When NOT to use graph memory</h2><p>Graph memory is NOT the right tool for every workload&#8230;</p><p>The biggest limitation is &#8220;write&#8221; latency.</p><p>Omnigraph stores data in object storage. Small writes typically take tens to hundreds of milliseconds, while an in-memory database can respond in well under a millisecond.</p><p>It&#8217;s a fair tradeoff for AI agents that already spend seconds reasoning&#8230;</p><p>But it&#8217;s NOT a good fit for workloads that require <em><strong>thousands of low-latency writes per second</strong></em>, such as payment processing, click counters, or real-time session state.</p><p>Those belong in a transactional database&#8230;</p><p>You also don&#8217;t need graph memory if you only need one retrieval method&#8230;</p><ul><li><p>Need semantic search? Use a vector database to keep it simple.</p></li><li><p>Need graph traversal for a single application with one writer? A traditional graph database such as Neo4j is a better fit.</p></li><li><p>Need high-throughput transactions? Use a transactional database.</p></li></ul><div><hr></div><h2><span>Final thoughts</span></h2><p>AI agents turned out to be a new kind of memory user.</p><p>They need a memory system built for how they actually read, write &amp; coordinate.</p><p>Omnigraph is a typed graph on shared object storage, where every change is proposed, reviewed, and merged before it reaches shared memory.</p><p>The agents are already here&#8230;And the memory is finally catching up.</p><div><hr></div><div class="callout-block" data-callout="true"><p>Thanks to <strong><a href="https://github.com/ModernRelay/omnigraph">Omnigraph</a></strong> for partnering on this newsletter.</p><p>When dozens of agents share one graph, things get chaotic fast: updates collide, bad writes land immediately, and context drifts.</p><p>Omnigraph gives every agent an isolated branch of the same typed graph, so agents can enrich data in parallel while humans deliberately review, approve, and merge changes. Built on Lance, Arrow, DataFusion.</p><p>Graph state stored in object storage. MIT.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://github.com/ModernRelay/omnigraph" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YfC1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 424w, https://substackcdn.com/image/fetch/$s_!YfC1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 848w, https://substackcdn.com/image/fetch/$s_!YfC1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 1272w, https://substackcdn.com/image/fetch/$s_!YfC1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YfC1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png" width="1456" height="1751" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1751,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:973437,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://github.com/ModernRelay/omnigraph&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/204901045?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!YfC1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 424w, https://substackcdn.com/image/fetch/$s_!YfC1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 848w, https://substackcdn.com/image/fetch/$s_!YfC1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 1272w, https://substackcdn.com/image/fetch/$s_!YfC1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcc8cc0d7-607e-4fab-bc57-35a774ce1d25_2200x2646.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://github.com/ModernRelay/omnigraph&quot;,&quot;text&quot;:&quot;Check out the repo&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://github.com/ModernRelay/omnigraph"><span>Check out the repo</span></a></p></div><div><hr></div><p>Louis &amp; I launched the <strong><a href="https://newsletter.systemdesign.one/subscribe?yearly=true">GENERATIVE AI MASTERCLASS</a></strong> (newsletter series exclusive to PAID subscribers).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://newsletter.systemdesign.one/subscribe?yearly=true" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Lz0V!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 424w, https://substackcdn.com/image/fetch/$s_!Lz0V!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 848w, https://substackcdn.com/image/fetch/$s_!Lz0V!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 1272w, https://substackcdn.com/image/fetch/$s_!Lz0V!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Lz0V!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png" width="1200" height="630" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:630,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:614623,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://newsletter.systemdesign.one/subscribe?yearly=true&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/199185364?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!Lz0V!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 424w, https://substackcdn.com/image/fetch/$s_!Lz0V!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 848w, https://substackcdn.com/image/fetch/$s_!Lz0V!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 1272w, https://substackcdn.com/image/fetch/$s_!Lz0V!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>When you upgrade, you&#8217;ll get:</p><ul><li><p><strong>Simple breakdown of real-world architectures</strong></p></li><li><p>Frameworks you can plug into your work or business</p></li><li><p><strong>Proven systems behind ChatGPT, Perplexity, and Copilot</strong></p></li></ul><p><strong>&#128073; <a href="https://newsletter.systemdesign.one/subscribe?yearly=true">CLICK HERE TO JOIN THE GENERATIVE AI MASTERCLASS</a></strong></p><div><hr></div><p>If you find this newsletter valuable, share it with a friend and subscribe if you haven&#8217;t already. There are <a href="http://newsletter.systemdesign.one/subscribe?group=true">group discounts</a>, <a href="http://newsletter.systemdesign.one/subscribe?gift=true">gift options</a>, and <a href="https://newsletter.systemdesign.one/leaderboard">referral rewards</a> available.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.linkedin.com/in/nk-systemdesign-one/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bEFk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 424w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 848w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 1272w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bEFk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png" width="152" height="152" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:320,&quot;width&quot;:320,&quot;resizeWidth&quot;:152,&quot;bytes&quot;:74009,&quot;alt&quot;:&quot;Author Neo Kim; System design case studies&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://www.linkedin.com/in/nk-systemdesign-one/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Author Neo Kim; System design case studies" title="Author Neo Kim; System design case studies" srcset="https://substackcdn.com/image/fetch/$s_!bEFk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 424w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 848w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 1272w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption"><strong>&#128075; Find me on <a href="https://www.linkedin.com/in/nk-systemdesign-one/">LinkedIn</a> | <a href="https://x.com/intent/follow?screen_name=systemdesignone">Twitter</a> | <a href="https://www.threads.net/@systemdesignone">Threads</a> | <a href="https://www.instagram.com/systemdesignone/">Instagram</a></strong></figcaption></figure></div><div><hr></div><p><strong>Want to reach 210K+ tech professionals at scale? </strong>&#128240;</p><p>If your company wants to reach 210K+ tech professionals, <a href="https://newsletter.systemdesign.one/p/sponsorship">advertise with me</a>.</p><div><hr></div><p>Thank you for supporting this newsletter.</p><p>You are now 210,001+ readers strong, very close to 210k. Let&#8217;s try to get 211k readers by 10 July. Consider sharing this post with your friends and get rewards.</p><p>Y&#8217;all are the best.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6oWl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6oWl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 424w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 848w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 1272w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6oWl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png" width="590" height="368.75" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2e739087-a910-4643-be36-997b6dd5b4af_800x500.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:500,&quot;width&quot;:800,&quot;resizeWidth&quot;:590,&quot;bytes&quot;:87878,&quot;alt&quot;:&quot;system design newsletter&quot;,&quot;title&quot;:&quot;system design newsletter&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/163380418?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="system design newsletter" title="system design newsletter" srcset="https://substackcdn.com/image/fetch/$s_!6oWl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 424w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 848w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 1272w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/graph-based-agent-memory?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/graph-based-agent-memory?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div><hr></div><h3>References</h3><ul><li><p>ModernRelay, <a href="https://github.com/ModernRelay/omnigraph">Omnigraph</a></p></li><li><p>ModernRelay, <a href="https://github.com/ModernRelay/omnigraph-cookbooks">Omnigraph Cookbooks</a></p></li><li><p>Apache Iceberg, <a href="https://iceberg.apache.org/spec/">Table Spec</a></p></li><li><p>Delta Lake, <a href="https://github.com/delta-io/delta/blob/master/PROTOCOL.md">Protocol</a></p></li><li><p>DoltHub, <a href="https://github.com/dolthub/dolt">Dolt: Git for Data</a></p></li><li><p>lakeFS, <a href="https://github.com/treeverse/lakeFS">Data Version Control for Object Storage</a></p></li><li><p>Cedar, <a href="https://www.cedarpolicy.com/">Cedar Policy Language</a></p></li><li><p>Lance, <a href="https://github.com/lance-format/lance">Columnar Data Format</a></p></li></ul><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p><strong>Context</strong> is all the information an AI uses to answer a request or make a decision.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-2" href="#footnote-anchor-2" class="footnote-number" contenteditable="false" target="_self">2</a><div class="footnote-content"><p><strong>Hallucination:</strong> When an AI generates information that sounds correct but is false or unsupported by the available data.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-3" href="#footnote-anchor-3" class="footnote-number" contenteditable="false" target="_self">3</a><div class="footnote-content"><p><strong>Vector database:</strong> A database that stores data as mathematical vectors so AI can find information by meaning, not just exact keywords.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-4" href="#footnote-anchor-4" class="footnote-number" contenteditable="false" target="_self">4</a><div class="footnote-content"><p><strong>RAG (Retrieval-Augmented Generation).</strong> A method where an agent searches a store of text for passages that match a question, then feeds those passages to the model as context before it answers. The store is usually a vector database that matches by meaning rather than by exact words.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-5" href="#footnote-anchor-5" class="footnote-number" contenteditable="false" target="_self">5</a><div class="footnote-content"><p><strong>Amazon Simple Storage Service (Amazon S3):</strong> AWS object storage service for storing and retrieving files and other unstructured data at virtually any scale.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-6" href="#footnote-anchor-6" class="footnote-number" contenteditable="false" target="_self">6</a><div class="footnote-content"><p><strong>Columnar file format:</strong> A file format that stores data by columns instead of rows, making analytics and scans over large datasets much faster.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-7" href="#footnote-anchor-7" class="footnote-number" contenteditable="false" target="_self">7</a><div class="footnote-content"><p><strong>Compare-and-Swap (CAS):</strong> A concurrency control technique that updates data only if it hasn&#8217;t changed since it was last read, preventing conflicting writes from overwriting each other.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-8" href="#footnote-anchor-8" class="footnote-number" contenteditable="false" target="_self">8</a><div class="footnote-content"><p>Open table formats that adds transactions, versioning, and schema evolution to data stored in object storage.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-9" href="#footnote-anchor-9" class="footnote-number" contenteditable="false" target="_self">9</a><div class="footnote-content"><p><strong>NOTE</strong>: Agents can write to <code>main</code>. You can configure it so that no agent writes directly to <code>main</code>.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-10" href="#footnote-anchor-10" class="footnote-number" contenteditable="false" target="_self">10</a><div class="footnote-content"><p><strong>NOTE</strong>: An agent can write to the main and merge branches; it depends on the policy.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-11" href="#footnote-anchor-11" class="footnote-number" contenteditable="false" target="_self">11</a><div class="footnote-content"><p><strong>NOTE:</strong> Merge is three-way at the record level, not the field level.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-12" href="#footnote-anchor-12" class="footnote-number" contenteditable="false" target="_self">12</a><div class="footnote-content"><p><strong>MCP (Model Context Protocol).</strong> An open standard that lets an agent connect to outside tools and data sources through a common interface, so the same agent can reach many systems without custom code for each one.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-13" href="#footnote-anchor-13" class="footnote-number" contenteditable="false" target="_self">13</a><div class="footnote-content"><p><strong>Actor:</strong> An authenticated identity that performs actions on the graph.</p><p>An actor can be:</p><ul><li><p>AI agent</p></li><li><p>human user</p></li><li><p>application</p></li><li><p>service</p></li><li><p>automated job or background process</p></li></ul><p>Each actor authenticates with a bearer token. Omnigraph identifies the actor from that token and evaluates authorization policies for that identity before allowing the requested action.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-14" href="#footnote-anchor-14" class="footnote-number" contenteditable="false" target="_self">14</a><div class="footnote-content"><p>You need this answer before you can undo anything: to revert a bad change, you first have to know which change was bad and who made it.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-15" href="#footnote-anchor-15" class="footnote-number" contenteditable="false" target="_self">15</a><div class="footnote-content"><p>Resolved from that same trusted token.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-16" href="#footnote-anchor-16" class="footnote-number" contenteditable="false" target="_self">16</a><div class="footnote-content"><p><strong>BM25 (Best Matching 25):</strong> A keyword search algorithm that ranks documents by how well their words match a search query, while considering word frequency and document length.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-17" href="#footnote-anchor-17" class="footnote-number" contenteditable="false" target="_self">17</a><div class="footnote-content"><p><strong>Vector k-nearest neighbors (k-NN):</strong> A search algorithm that finds the stored vectors closest to a query vector, returning results with the most similar meaning.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-18" href="#footnote-anchor-18" class="footnote-number" contenteditable="false" target="_self">18</a><div class="footnote-content"><p><strong>Reciprocal Rank Fusion (RRF):</strong> A ranking algorithm that combines results from multiple search methods, giving higher priority to items that rank highly across several search results.</p><p></p></div></div>]]></content:encoded></item><item><title><![CDATA[Content Delivery Network (CDN) - A Deep Dive]]></title><description><![CDATA[#159: A clear introduction to CDNs and their core concepts]]></description><link>https://newsletter.systemdesign.one/p/how-does-cdn-work</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/how-does-cdn-work</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Thu, 02 Jul 2026 20:18:06 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/54663069-eae4-4bf1-b868-4965bbababa3_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Get my system design playbook for FREE on newsletter signup:</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><ul><li><p><em><a href="https://newsletter.systemdesign.one/p/how-does-cdn-work/?action=share">Share this post</a> &amp; I&#8217;ll send you some rewards for the referrals.</em></p></li></ul><div><hr></div><p>How does Netflix stream videos worldwide in milliseconds,,, while some sites take &#8220;seconds&#8221; to load a basic HTML page?</p><p>The answer is <em>proximity</em>&#8230;</p><p>i.e., closeness between the servers and end-users.</p><p>Imagine a <em>single</em> server to handle global traffic:</p><ul><li><p>International users wait 300ms+ just for the first byte from the &#8220;distant&#8221; server</p></li><li><p>Origin server<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a> handles all requests from every continent</p></li><li><p>One traffic spike could take down the entire site</p></li></ul><p>Onward.</p><div><hr></div><div class="callout-block" data-callout="true"><h2 style="text-align: center;"><strong><span data-color="#3a7bf9" style="color: rgb(58, 123, 249);">Get your company in front of 240,000+ tech readers &amp; earn up to $100 for the intro</span></strong></h2><p>Think your startup/company should feature its product in this newsletter via sponsorship?</p><p>Then introduce me to your marketing manager. Just <strong><a href="mailto:hello@systemdesign.one?subject=Reach%20240%2C000%20tech%20readers%20through%20system%20design%20newsletter&amp;body=Hi%20Neo%2C%0A%0AI%27m%20introducing%20you%20to%20%5BMarketing%20Manager%20Name%5D%2C%20who%20makes%20marketing%20decisions%20at%20%5BYour%20Company%5D%20%28CC%27d%29.%0A%0A%5BMarketing%20Manager%20Name%5D%2C%20this%20newsletter%20reaches%20240%2C000%2B%20tech%20readers%20on%20Substack.%0AI%20think%20it%20could%20be%20a%20strong%20fit%20for%20our%20brand.%0A%0ASponsorship%20details%3A%20https%3A%2F%2Fnewsletter.systemdesign.one%2Fp%2Fsponsorship%0A%0ABest%2C%0A%5BYour%20Name%5D">reply</a></strong> to this email and CC them.</p><p>What you&#8217;ll get:</p><ul><li><p><strong>1-month free newsletter subscription</strong> if they reply to your intro. First 10 intros ONLY.</p></li><li><p><strong>1-year free newsletter subscription, PLUS $100 cash</strong> if it turns into a sponsorship.</p></li></ul><p>(The only requirement is that the marketing manager of your company should reply to your intro email.)</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;mailto:hello@systemdesign.one?subject=Reach%20240%2C000%20tech%20readers%20through%20system%20design%20newsletter&amp;body=Hi%20Neo%2C%0A%0AI%27m%20introducing%20you%20to%20%5BMarketing%20Manager%20Name%5D%2C%20who%20makes%20marketing%20decisions%20at%20%5BYour%20Company%5D%20%28CC%27d%29.%0A%0A%5BMarketing%20Manager%20Name%5D%2C%20this%20newsletter%20reaches%20240%2C000%2B%20tech%20readers%20on%20Substack.%0AI%20think%20it%20could%20be%20a%20strong%20fit%20for%20our%20brand.%0A%0ASponsorship%20details%3A%20https%3A%2F%2Fnewsletter.systemdesign.one%2Fp%2Fsponsorship%0A%0ABest%2C%0A%5BYour%20Name%5D&quot;,&quot;text&quot;:&quot;Introduce now &#8594;&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="mailto:hello@systemdesign.one?subject=Reach%20240%2C000%20tech%20readers%20through%20system%20design%20newsletter&amp;body=Hi%20Neo%2C%0A%0AI%27m%20introducing%20you%20to%20%5BMarketing%20Manager%20Name%5D%2C%20who%20makes%20marketing%20decisions%20at%20%5BYour%20Company%5D%20%28CC%27d%29.%0A%0A%5BMarketing%20Manager%20Name%5D%2C%20this%20newsletter%20reaches%20240%2C000%2B%20tech%20readers%20on%20Substack.%0AI%20think%20it%20could%20be%20a%20strong%20fit%20for%20our%20brand.%0A%0ASponsorship%20details%3A%20https%3A%2F%2Fnewsletter.systemdesign.one%2Fp%2Fsponsorship%0A%0ABest%2C%0A%5BYour%20Name%5D"><span>Introduce now &#8594;</span></a></p><p>You can also see the sponsorship details <a href="https://newsletter.systemdesign.one/p/sponsorship">here</a>.</p></div><div><hr></div><p><em><strong>Here&#8217;s what you&#8217;ll find inside this newsletter:</strong></em></p><ul><li><p><strong>Why websites slow down. </strong>The hidden costs of distance, overloaded servers, and bandwidth limits.</p></li><li><p><strong>Why CDNs became essential.</strong> How they evolved from a niche scaling solution into core internet infrastructure.</p></li><li><p><strong>What happens when you visit a site.</strong> The journey your request takes before content reaches your browser.</p></li><li><p><strong>The building blocks of a CDN.</strong> Edge servers, origin servers, DNS, Anycast, GSLB, and the components behind global content delivery.</p></li><li><p><strong>Where CDNs make the massive impact.</strong> The industries and applications that depend on them every day.</p></li><li><p><strong>Why CDNs aren&#8217;t a silver bullet.</strong> The trade-offs, limitations, and operational challenges every engineer should understand.</p></li></ul><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Golden members get all posts like these!&#8230;</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>
      <p>
          <a href="https://newsletter.systemdesign.one/p/how-does-cdn-work">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[A2A Protocol - Deep Dive]]></title><description><![CDATA[#158: How AI agents collaborate to solve complex tasks]]></description><link>https://newsletter.systemdesign.one/p/agent-to-agent-protocol</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/agent-to-agent-protocol</guid><dc:creator><![CDATA[Eric Roby]]></dc:creator><pubDate>Fri, 26 Jun 2026 13:43:17 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/08a95ff4-e02b-4c21-9850-17b36455b7ff_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Get my system design playbook for FREE on newsletter signup:</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><ul><li><p><em><a href="https://newsletter.systemdesign.one/p/agent-to-agent-protocol/?action=share">Share this post</a> &amp; I&#8217;ll send you some rewards for the referrals.</em></p></li></ul><div><hr></div><p>AI agents can use tools<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a> today.</p><p>Model Context Protocol (<strong>MCP</strong>) provides an agent with a standard way to communicate with databases, APIs, files, and external services.</p><p>But there&#8217;s a problem MCP doesn&#8217;t solve:</p><blockquote><p><em>What happens when you need many agents to work together?</em></p></blockquote><p>Onward.</p><div><hr></div><div class="callout-block" data-callout="true"><h2><a href="https://pages.awscloud.com/awsmp-gim-guf2-webinar-aim-enterprise-ai-and-data-leader-panel-lt-panel-2.html?trk=b69c9e72-00ee-4bb9-90d5-6e794118ec29&amp;sc_channel=el">Build stronger data foundations for &#8220;agentic AI&#8221; at scale</a></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://pages.awscloud.com/awsmp-gim-guf2-webinar-aim-enterprise-ai-and-data-leader-panel-lt-panel-2.html?trk=b69c9e72-00ee-4bb9-90d5-6e794118ec29&amp;sc_channel=el" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DVIn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe64e118-f294-4635-a505-bb85e0b1cef7_1280x720.png 424w, https://substackcdn.com/image/fetch/$s_!DVIn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe64e118-f294-4635-a505-bb85e0b1cef7_1280x720.png 848w, https://substackcdn.com/image/fetch/$s_!DVIn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe64e118-f294-4635-a505-bb85e0b1cef7_1280x720.png 1272w, https://substackcdn.com/image/fetch/$s_!DVIn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe64e118-f294-4635-a505-bb85e0b1cef7_1280x720.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DVIn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe64e118-f294-4635-a505-bb85e0b1cef7_1280x720.png" width="1280" height="720" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fe64e118-f294-4635-a505-bb85e0b1cef7_1280x720.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1343073,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://pages.awscloud.com/awsmp-gim-guf2-webinar-aim-enterprise-ai-and-data-leader-panel-lt-panel-2.html?trk=b69c9e72-00ee-4bb9-90d5-6e794118ec29&amp;sc_channel=el&quot;,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/193554859?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe64e118-f294-4635-a505-bb85e0b1cef7_1280x720.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!DVIn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe64e118-f294-4635-a505-bb85e0b1cef7_1280x720.png 424w, https://substackcdn.com/image/fetch/$s_!DVIn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe64e118-f294-4635-a505-bb85e0b1cef7_1280x720.png 848w, https://substackcdn.com/image/fetch/$s_!DVIn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe64e118-f294-4635-a505-bb85e0b1cef7_1280x720.png 1272w, https://substackcdn.com/image/fetch/$s_!DVIn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe64e118-f294-4635-a505-bb85e0b1cef7_1280x720.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Building an AI demo is EASY.</p><p>Building production-ready agentic AI systems that scale across an enterprise is extremely &#8220;difficult&#8221;.</p><p>That&#8217;s exactly what senior enterprise leaders from AWS, Prudential Insurance, Siemens, GAF, and HF Sinclair discuss in this virtual panel: <em>how to build resilient, scalable data foundations and production-ready AI agents.</em></p><p><em><strong>Here&#8217;s what you&#8217;ll learn:</strong></em></p><ul><li><p><strong>Scale AI beyond the proof of concept.</strong> Build industrial-scale systems with classical and generative AI.</p></li><li><p><strong>Fix the data problem.</strong> Power AI with governed, high-quality data.</p></li><li><p><strong>Make better architecture decisions.</strong> Choose the right databases for AI applications.</p></li><li><p><strong>Streamline deployment.</strong> Discover, procure, and deploy AI solutions with AWS Marketplace.</p></li></ul><p>Watch the <strong><a href="https://pages.awscloud.com/awsmp-gim-guf2-webinar-aim-enterprise-ai-and-data-leader-panel-lt-panel-2.html?trk=b69c9e72-00ee-4bb9-90d5-6e794118ec29&amp;sc_channel=el">AWS panel</a></strong> for free right now and see how enterprise leaders are building AI systems with speed, governance, and control.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://pages.awscloud.com/awsmp-gim-guf2-webinar-aim-enterprise-ai-and-data-leader-panel-lt-panel-2.html?trk=b69c9e72-00ee-4bb9-90d5-6e794118ec29&amp;sc_channel=el&quot;,&quot;text&quot;:&quot;Watch AWS Virtual Panel for FREE&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://pages.awscloud.com/awsmp-gim-guf2-webinar-aim-enterprise-ai-and-data-leader-panel-lt-panel-2.html?trk=b69c9e72-00ee-4bb9-90d5-6e794118ec29&amp;sc_channel=el"><span>Watch AWS Virtual Panel for FREE</span></a></p><p>(Thanks to <a href="https://pages.awscloud.com/awsmp-gim-guf2-webinar-aim-enterprise-ai-and-data-leader-panel-lt-panel-2.html?trk=b69c9e72-00ee-4bb9-90d5-6e794118ec29&amp;sc_channel=el">AWS</a> for partnering on this post.)</p></div><div><hr></div><p><span>I want to introduce </span><a href="https://www.linkedin.com/in/codingwithroby/">Eric Roby</a><span> as a guest author.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://www.linkedin.com/in/codingwithroby/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!T637!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62ac556a-3c71-48ad-ad80-794b441ba8b9_1600x801.png 424w, https://substackcdn.com/image/fetch/$s_!T637!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62ac556a-3c71-48ad-ad80-794b441ba8b9_1600x801.png 848w, https://substackcdn.com/image/fetch/$s_!T637!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62ac556a-3c71-48ad-ad80-794b441ba8b9_1600x801.png 1272w, https://substackcdn.com/image/fetch/$s_!T637!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62ac556a-3c71-48ad-ad80-794b441ba8b9_1600x801.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!T637!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62ac556a-3c71-48ad-ad80-794b441ba8b9_1600x801.png" width="1456" height="729" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/62ac556a-3c71-48ad-ad80-794b441ba8b9_1600x801.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:729,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.linkedin.com/in/codingwithroby/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!T637!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62ac556a-3c71-48ad-ad80-794b441ba8b9_1600x801.png 424w, https://substackcdn.com/image/fetch/$s_!T637!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62ac556a-3c71-48ad-ad80-794b441ba8b9_1600x801.png 848w, https://substackcdn.com/image/fetch/$s_!T637!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62ac556a-3c71-48ad-ad80-794b441ba8b9_1600x801.png 1272w, https://substackcdn.com/image/fetch/$s_!T637!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F62ac556a-3c71-48ad-ad80-794b441ba8b9_1600x801.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><span>He&#8217;s a senior backend and AI engineer focused on building real-world systems and teaching developers how to do the same. He runs the YouTube channel </span><a href="https://www.youtube.com/@codingwithroby">codingwithroby</a><span>, where he focuses on scalable backend architecture and integrating AI into production applications.</span></p><p>Through his content and courses, he helps engineers go beyond tutorials, think in systems, and develop the skills that actually matter for senior-level roles.</p><p>Find him on:</p><ul><li><p><a href="https://www.linkedin.com/in/codingwithroby/">LinkedIn</a></p></li><li><p><a href="https://codingwithroby.substack.com/">Substack</a></p></li></ul><div><hr></div><p><em><strong>Here&#8217;s what&#8217;s inside this newsletter:</strong></em></p><ul><li><p><strong>Why MCP wasn&#8217;t enough. </strong>The missing coordination layer that prevents AI agents built by different vendors and frameworks from working together.</p></li><li><p><strong>How AI agents actually collaborate.</strong> Agent Cards, task lifecycles, delegation, streaming, discovery, and the protocol that standardizes agent-to-agent communication.</p></li><li><p><strong>The emerging AI interoperability stack.</strong> How A2A, MCP, RAG, AGNTCY, ACP, and AP2 fit together, and why the industry is converging around open standards.</p></li><li><p><strong>Where A2A breaks down in production.</strong> Latency, trust, authorization, debugging, observability, and the engineering tradeoffs you&#8217;ll face when building multi-agent systems.</p></li><li><p><strong>A practical guide to building with A2A.</strong> Security, Agent Card design, interoperability, production architecture, and the patterns that make agent ecosystems reliable at scale.</p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;http://newsletter.systemdesign.one/subscribe&quot;,&quot;text&quot;:&quot;Get Instant Full Access Now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="http://newsletter.systemdesign.one/subscribe"><span>Get Instant Full Access Now</span></a></p><p><em>(Golden members get all letters like these!&#8230;)</em></p><div><hr></div><blockquote><p>&#128161; Quick refresher</p><p><strong>AI agent</strong> is a system that uses a large language model<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a> (<strong>LLM</strong>) to reason, plan, and take actions on your behalf. It&#8217;s not just answering questions. But also calling tools, checking results, and deciding what to do next. Think of it as an LLM with hands.</p></blockquote><p>A single agent can be brilliant at one job&#8230;</p><p>They can write code, analyze data, and schedule meetings. But real work crosses domains. And you need one agent to code, one to test, and one to ship. If you stack all of this into one mega-agent, it becomes slow, expensive, and brittle.</p><p>i.e., specialization wins, just as it does on a real team&#8230;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nE6k!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8bb330-005b-4d3e-a4ba-45a0743088bb_1280x720.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nE6k!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8bb330-005b-4d3e-a4ba-45a0743088bb_1280x720.png 424w, https://substackcdn.com/image/fetch/$s_!nE6k!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8bb330-005b-4d3e-a4ba-45a0743088bb_1280x720.png 848w, https://substackcdn.com/image/fetch/$s_!nE6k!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8bb330-005b-4d3e-a4ba-45a0743088bb_1280x720.png 1272w, https://substackcdn.com/image/fetch/$s_!nE6k!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8bb330-005b-4d3e-a4ba-45a0743088bb_1280x720.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nE6k!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8bb330-005b-4d3e-a4ba-45a0743088bb_1280x720.png" width="1280" height="720" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4e8bb330-005b-4d3e-a4ba-45a0743088bb_1280x720.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nE6k!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8bb330-005b-4d3e-a4ba-45a0743088bb_1280x720.png 424w, https://substackcdn.com/image/fetch/$s_!nE6k!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8bb330-005b-4d3e-a4ba-45a0743088bb_1280x720.png 848w, https://substackcdn.com/image/fetch/$s_!nE6k!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8bb330-005b-4d3e-a4ba-45a0743088bb_1280x720.png 1272w, https://substackcdn.com/image/fetch/$s_!nE6k!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4e8bb330-005b-4d3e-a4ba-45a0743088bb_1280x720.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>But then, what is Agent-to-Agent (<strong>A2A</strong>) protocol?</p><blockquote><p><em>Can&#8217;t agents already communicate through normal API calls?</em></p></blockquote><p>The problem is every agent-to-agent integration becomes custom: one agent needs to know what another agent can do, what inputs it expects, how to authenticate, how to hand off a task, how to track status, how to pass context, and how to receive the final result.</p><p>A2A is an emerging open standard for the coordination layer&#8230;</p><p>It gives agents a shared way to advertise their capabilities, accept tasks, exchange messages, report progress, and return outputs.</p><p>i.e., A2A standardizes the workflow in which one agent delegates work to another.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xNpv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51febb89-5869-4d67-bacd-6a074ca3aa89_1280x720.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xNpv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51febb89-5869-4d67-bacd-6a074ca3aa89_1280x720.png 424w, https://substackcdn.com/image/fetch/$s_!xNpv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51febb89-5869-4d67-bacd-6a074ca3aa89_1280x720.png 848w, https://substackcdn.com/image/fetch/$s_!xNpv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51febb89-5869-4d67-bacd-6a074ca3aa89_1280x720.png 1272w, https://substackcdn.com/image/fetch/$s_!xNpv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51febb89-5869-4d67-bacd-6a074ca3aa89_1280x720.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xNpv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51febb89-5869-4d67-bacd-6a074ca3aa89_1280x720.png" width="1280" height="720" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/51febb89-5869-4d67-bacd-6a074ca3aa89_1280x720.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!xNpv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51febb89-5869-4d67-bacd-6a074ca3aa89_1280x720.png 424w, https://substackcdn.com/image/fetch/$s_!xNpv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51febb89-5869-4d67-bacd-6a074ca3aa89_1280x720.png 848w, https://substackcdn.com/image/fetch/$s_!xNpv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51febb89-5869-4d67-bacd-6a074ca3aa89_1280x720.png 1272w, https://substackcdn.com/image/fetch/$s_!xNpv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51febb89-5869-4d67-bacd-6a074ca3aa89_1280x720.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Imagine A2A as the next connection layer:</p><ul><li><p>TCP/IP<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a> lets machines talk to each other</p></li><li><p>HTTP lets documents link to each other</p></li><li><p>APIs let services compose into systems</p></li><li><p>MCP lets agents connect to tools</p></li><li><p>A2A does the same thing for agents</p></li></ul><p>Google launched A2A in April 2025.</p><p>(They partnered with 50+ tech companies and service providers. 150+ organizations joined them later.)</p><p><em>To understand why A2A matters, you need to understand the pain it solves&#8230;</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/agent-to-agent-protocol?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/agent-to-agent-protocol?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div><hr></div><h2><strong>AI Agent Collaboration Problem</strong></h2><p>AI agents are exponentially growing&#8230;</p><p>Every team, every vendor, every platform is shipping them&#8230;but each one is a SILO.</p><p>Your customer relationship management (<strong>CRM</strong>) agent can&#8217;t coordinate with your internal data agent. Your coding agent can&#8217;t delegate to a testing agent built by a different team. They might all live in the same company, in the same building, on the same network&#8230;</p><p>Yet they still can&#8217;t work together.</p><p>Framework<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a> lock-in is part of the problem.</p><p>An agent built with LangGraph can&#8217;t directly communicate with one built with CrewAI, Google&#8217;s ADK, or AutoGen. Each framework has its own internal orchestration model. While cross-framework collaboration requires custom glue code, written and maintained by you.</p><p>That's where A2A comes in.</p><p><em>Now let&#8217;s look at what it is&#8230;</em></p><div><hr></div><h2><strong>What A2A Actually Is</strong></h2><p><em>Here&#8217;s a simple analogy for you:</em></p><p>Think of A2A like hiring a contractor. You don&#8217;t need to know what tools are in their truck or how they manage their schedule. You hand them a job; they confirm what they can do, and then hand back the finished work. A2A is the standard contract format. This lets any contractor work with any client. They don&#8217;t need to renegotiate from scratch each time.</p><p>The Agent2Agent (<strong>A2A</strong>) protocol is an open standard.</p><p>It helps AI agents find each other&#8217;s skills<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a>. They can send messages, delegate tasks, and work together safely. This all happens NO matter their framework, vendor, or platform.</p><p>Here are five design principles on which the A2A v1.0 specification is built:</p><ul><li><p><strong>Simple.</strong> Reuse existing, well-understood standards. HTTP, JSON-RPC 2.0, Server-Sent Events. No new transport layer to learn.</p></li><li><p><strong>Enterprise Ready.</strong> Address authentication, authorization, security, privacy, tracing, and monitoring by aligning with established enterprise practices.</p></li><li><p><strong>Async First.</strong> Designed for long-running tasks and human-in-the-loop interactions. Quick queries to deep research that takes hours or days.</p></li><li><p><strong>Modality Agnostic.</strong> Support text, audio, and video via file references, structured data, and forms, and embedded UI components.</p></li><li><p><strong>Opaque Execution.</strong> Agents work together by sharing their skills and information. They don&#8217;t need to reveal their internal thoughts, plans, or how their tools work.</p></li></ul><p>The last one is the most important.</p><p>A2A treats agents as autonomous, opaque entities. You don&#8217;t need to share your agent&#8217;s internals to participate in the ecosystem.</p><p><em>Now let&#8217;s open the hood&#8230;</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/agent-to-agent-protocol?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/agent-to-agent-protocol?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div><hr></div><h2><strong>How A2A Works Under the Hood</strong></h2><p>Here are the key points you should understand:</p><ul><li><p>How agents connect,</p></li><li><p>What they share,</p></li><li><p>And how they communicate.</p></li></ul><p>Let&#8217;s dive in!</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!A8GQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2097386f-a522-4c6d-b37d-7f8172129206_1280x720.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!A8GQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2097386f-a522-4c6d-b37d-7f8172129206_1280x720.png 424w, https://substackcdn.com/image/fetch/$s_!A8GQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2097386f-a522-4c6d-b37d-7f8172129206_1280x720.png 848w, https://substackcdn.com/image/fetch/$s_!A8GQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2097386f-a522-4c6d-b37d-7f8172129206_1280x720.png 1272w, https://substackcdn.com/image/fetch/$s_!A8GQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2097386f-a522-4c6d-b37d-7f8172129206_1280x720.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!A8GQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2097386f-a522-4c6d-b37d-7f8172129206_1280x720.png" width="1280" height="720" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2097386f-a522-4c6d-b37d-7f8172129206_1280x720.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!A8GQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2097386f-a522-4c6d-b37d-7f8172129206_1280x720.png 424w, https://substackcdn.com/image/fetch/$s_!A8GQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2097386f-a522-4c6d-b37d-7f8172129206_1280x720.png 848w, https://substackcdn.com/image/fetch/$s_!A8GQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2097386f-a522-4c6d-b37d-7f8172129206_1280x720.png 1272w, https://substackcdn.com/image/fetch/$s_!A8GQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2097386f-a522-4c6d-b37d-7f8172129206_1280x720.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3><strong>Client-Server Model and Agent Discovery</strong></h3><p>Every A2A interaction has two roles:</p><ul><li><p><strong>Client agent</strong> is the requester. It discovers remote agents, sends tasks, and coordinates the workflow.</p></li><li><p><strong>Remote agent</strong> is the executor. It receives and processes tasks, does the work, and returns results.</p></li></ul><p>Any agent can play both roles, depending on the workflow.</p><p>A coding agent is a <em>client</em> when it delegates testing to a QA agent. The same coding agent becomes a <em>remote</em> agent when a project manager agent asks it to write code.</p><p>Agents discover each other through an <strong>Agent Card</strong>.</p><p>This JSON metadata document is published by every A2A server<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a>. It describes the agent&#8217;s identity, capabilities, skills, endpoint URL, supported data formats, and authentication needs.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6n0M!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08b7ca17-99a5-4b3e-8d39-12ef099a8cba_1280x720.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6n0M!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08b7ca17-99a5-4b3e-8d39-12ef099a8cba_1280x720.png 424w, https://substackcdn.com/image/fetch/$s_!6n0M!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08b7ca17-99a5-4b3e-8d39-12ef099a8cba_1280x720.png 848w, https://substackcdn.com/image/fetch/$s_!6n0M!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08b7ca17-99a5-4b3e-8d39-12ef099a8cba_1280x720.png 1272w, https://substackcdn.com/image/fetch/$s_!6n0M!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08b7ca17-99a5-4b3e-8d39-12ef099a8cba_1280x720.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6n0M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08b7ca17-99a5-4b3e-8d39-12ef099a8cba_1280x720.png" width="1280" height="720" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/08b7ca17-99a5-4b3e-8d39-12ef099a8cba_1280x720.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!6n0M!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08b7ca17-99a5-4b3e-8d39-12ef099a8cba_1280x720.png 424w, https://substackcdn.com/image/fetch/$s_!6n0M!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08b7ca17-99a5-4b3e-8d39-12ef099a8cba_1280x720.png 848w, https://substackcdn.com/image/fetch/$s_!6n0M!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08b7ca17-99a5-4b3e-8d39-12ef099a8cba_1280x720.png 1272w, https://substackcdn.com/image/fetch/$s_!6n0M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08b7ca17-99a5-4b3e-8d39-12ef099a8cba_1280x720.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Agent Cards live at a standard, well-known URI:<code> /.well-known/agent-card.json</code>.</p><p>The path follows RFC 8615<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-7" href="#footnote-7" target="_self">7</a>. This is the same way browsers find SSL verification files. A client agent checks another agent&#8217;s card. It does this to see what the agent can do before sending requests.</p><p>This is like MCP&#8217;s capability negotiation<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-8" href="#footnote-8" target="_self">8</a>, but for agents instead of tools.</p><p>Here&#8217;s what an Agent Card includes:</p><ul><li><p>Name, description, version</p></li><li><p>Service endpoint URL</p></li><li><p>Supported input and output modalities, as MIME types</p></li><li><p>Skills, with IDs, descriptions, tags, and examples</p></li><li><p>Authentication requirements, aligned with OpenAPI security schemes</p></li><li><p>Supported A2A features like streaming, push notifications, and extended cards</p></li></ul><p>Agents can also serve an <strong>Extended Agent Card</strong> behind authentication.</p><p>This lets you hide sensitive skills or internal capabilities from unauthenticated discovery. i.e., public-facing summary first, full details after you prove who you are.</p><h3><strong>Tasks, Messages, and Artifacts</strong></h3><p>Communication in A2A is task-oriented.</p><p>When a client agent sends a message, the remote agent creates a <strong>Task</strong>. This is the fundamental unit of work in A2A. Plus, every task has a unique ID and progresses through a defined <em>lifecycle</em>.</p><p>Here are 9 possible lifecycle states:</p><ul><li><p><strong>submitted</strong>: task received by the remote agent</p></li><li><p><strong>working</strong>: agent is actively processing</p></li><li><p><strong>input-required</strong>: agent needs more information from the client</p></li><li><p><strong>auth-required</strong>: agent needs credentials or authorization to proceed</p></li><li><p><strong>completed</strong>: task finished successfully (terminal)</p></li><li><p><strong>failed</strong>: task could not be completed (terminal)</p></li><li><p><strong>canceled</strong>: task was canceled by the client (terminal)</p></li><li><p><strong>rejected</strong>: agent decided not to perform the task (terminal)</p></li><li><p><strong>unknown</strong>: state recovery scenario</p></li></ul><p>This is fundamentally different from a simple function call.</p><p>Tasks are stateful and can involve many message exchanges. They can also pause to ask the client for more information&#8230;Or pause to request authorization before doing anything destructive.</p><p>This is the kind of back-and-forth a real collaboration requires&#8230;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!BMAh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02638597-a7b3-4e2d-b242-492d85b18463_1280x720.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!BMAh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02638597-a7b3-4e2d-b242-492d85b18463_1280x720.png 424w, https://substackcdn.com/image/fetch/$s_!BMAh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02638597-a7b3-4e2d-b242-492d85b18463_1280x720.png 848w, https://substackcdn.com/image/fetch/$s_!BMAh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02638597-a7b3-4e2d-b242-492d85b18463_1280x720.png 1272w, https://substackcdn.com/image/fetch/$s_!BMAh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02638597-a7b3-4e2d-b242-492d85b18463_1280x720.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!BMAh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02638597-a7b3-4e2d-b242-492d85b18463_1280x720.png" width="1280" height="720" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/02638597-a7b3-4e2d-b242-492d85b18463_1280x720.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!BMAh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02638597-a7b3-4e2d-b242-492d85b18463_1280x720.png 424w, https://substackcdn.com/image/fetch/$s_!BMAh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02638597-a7b3-4e2d-b242-492d85b18463_1280x720.png 848w, https://substackcdn.com/image/fetch/$s_!BMAh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02638597-a7b3-4e2d-b242-492d85b18463_1280x720.png 1272w, https://substackcdn.com/image/fetch/$s_!BMAh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F02638597-a7b3-4e2d-b242-492d85b18463_1280x720.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p><strong>Messages</strong> are the units of communication between agents. Each message has a role (user or agent) and contains one or more Parts.</p></li><li><p><strong>Parts</strong> are the smallest content units. Text parts hold plain text. While File parts hold files or images via URI or inline bytes. And Data parts hold structured JSON. This supports rich, multimodal communication without forcing everything into text.</p></li><li><p><strong>Artifacts</strong> are the outputs of a task. Documents, images, structured data, or any other deliverable remote agent produces. Artifacts, like messages, consist of Parts. They can be streamed as they are created.</p></li><li><p><strong>Contexts</strong> group related tasks together via a <code>contextId</code>. This provides continuity across a series of interactions, similar to a conversation thread.</p></li></ul><h3><strong>Communication Patterns and Protocol Bindings</strong></h3><p>Before we get into transport details, there are two <a href="https://newsletter.systemdesign.one/p/multi-agent-system">orchestration patterns</a> to understand:</p><ul><li><p><strong>Centralized orchestrator</strong>. One lead agent owns the plan. It discovers specialist agents, delegates tasks, and stitches the results back together. This makes it easier to reason about and debug. The default pattern for most enterprise workflows today. This is the &#8220;tech lead delegates to ICs&#8221; model.</p></li><li><p><strong>Decentralized swarm</strong>. No single orchestrator. Agents find each other directly and share tasks. Each agent chooses whom to contact next based on its own judgment. More flexible. More resilient. Harder to trace. Closer to a marketplace or a team of peers.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5qpQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd32558c0-b817-4c74-a0e9-042e96873f81_1280x720.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5qpQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd32558c0-b817-4c74-a0e9-042e96873f81_1280x720.png 424w, https://substackcdn.com/image/fetch/$s_!5qpQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd32558c0-b817-4c74-a0e9-042e96873f81_1280x720.png 848w, https://substackcdn.com/image/fetch/$s_!5qpQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd32558c0-b817-4c74-a0e9-042e96873f81_1280x720.png 1272w, https://substackcdn.com/image/fetch/$s_!5qpQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd32558c0-b817-4c74-a0e9-042e96873f81_1280x720.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5qpQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd32558c0-b817-4c74-a0e9-042e96873f81_1280x720.png" width="1280" height="720" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d32558c0-b817-4c74-a0e9-042e96873f81_1280x720.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!5qpQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd32558c0-b817-4c74-a0e9-042e96873f81_1280x720.png 424w, https://substackcdn.com/image/fetch/$s_!5qpQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd32558c0-b817-4c74-a0e9-042e96873f81_1280x720.png 848w, https://substackcdn.com/image/fetch/$s_!5qpQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd32558c0-b817-4c74-a0e9-042e96873f81_1280x720.png 1272w, https://substackcdn.com/image/fetch/$s_!5qpQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd32558c0-b817-4c74-a0e9-042e96873f81_1280x720.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A2A supports both.</p><p>It&#8217;s a protocol, not an orchestration model. The protocol just defines how any two agents talk. The topology is your choice. Most real systems begin centralized. They switch to swarm patterns<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-9" href="#footnote-9" target="_self">9</a> when they can see well and have trust systems to handle complexity.</p><p>Plus A2A supports three interaction patterns at the network level:</p><ul><li><p><strong>Synchronous request-response.</strong> Client sends a message and waits for a complete response. Good for quick tasks.</p></li><li><p><strong>Streaming via Server-Sent Events.</strong> Server streams incremental updates in real-time. Good for tasks where you want to show progress.</p></li><li><p><strong>Push notifications.</strong> Server sends async updates to a client webhook<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-10" href="#footnote-10" target="_self">10</a>. Good for long-running tasks where the client doesn&#8217;t want to hold a connection open.</p></li></ul><p>And for the actual wire protocol, A2A v1.0 supports three bindings:</p><ul><li><p><strong>JSON-RPC 2.0</strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-11" href="#footnote-11" target="_self">11</a>: original and most commonly used binding. Methods include message/send, message/stream, tasks/get, tasks/cancel, and others.</p></li><li><p><strong>gRPC</strong>: added for high-performance scenarios. Uses Protocol Buffers for message serialization.</p></li><li><p><strong>HTTP REST</strong>: uses standard HTTP verbs and URL patterns like <code>/v1/message:send and /v1/tasks/{id}</code>. Lowers the barrier for teams that prefer REST over JSON-RPC.</p></li></ul><p>All three bindings share the same semantic model and abstract operations.</p><p>The choice of binding is a deployment decision, not a design one. As of v1.0, the protocol&#8217;s main data model is in Protocol Buffers<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-12" href="#footnote-12" target="_self">12</a> (<code>a2a.proto</code>). This file is the single source of truth. All bindings derive from this definition.</p><p>This familiarity with existing web standards is intentional.</p><p>A2A works with your current enterprise setup. It connects easily to load balancers, API gateways, and observability tools. No new tools are needed!</p><p>Now that you understand how A2A works, the obvious question: <em>how does it relate to MCP?</em></p><div><hr></div><div class="callout-block" data-callout="true"><p><em><strong>Reminder: this is a teaser of the subscriber-only newsletter series, exclusive to my golden members.</strong></em></p><p>When you upgrade, you&#8217;ll get:</p><ul><li><p><strong>High-level architecture of real-world systems.</strong></p></li><li><p>Deep dive into how popular real-world systems actually work.</p></li><li><p><strong>How real-world systems handle scale, reliability, and performance.</strong></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe&quot;,&quot;text&quot;:&quot;Unlock Full Access Now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/subscribe"><span>Unlock Full Access Now</span></a></p><p>Ready for the best part?</p></div><div><hr></div><h2><strong>A2A vs MCP: Complementary, Not Competing</strong></h2>
      <p>
          <a href="https://newsletter.systemdesign.one/p/agent-to-agent-protocol">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[You Won’t Use Claude The Same Way After Understanding This Folder]]></title><description><![CDATA[#157: A map of every file inside, and why it controls what Claude does before you type a word]]></description><link>https://newsletter.systemdesign.one/p/claude-folder</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/claude-folder</guid><dc:creator><![CDATA[Ilia Karelin]]></dc:creator><pubDate>Wed, 24 Jun 2026 14:23:50 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/b1a07dd1-5e17-43fa-ae7a-231fffe88cbe_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Get my system design playbook for FREE on newsletter signup:</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><ul><li><p><em><a href="https://newsletter.systemdesign.one/p/claude-folder/?action=share">Share this post</a> &amp; I&#8217;ll send you some rewards for the referrals.</em></p></li></ul><div><hr></div><p>I&#8217;ve been using Claude Code for more than half a year now&#8230;daily, for actual work.</p><p>For most of the time, I ignored a hidden folder that controlled everything Claude did.</p><p>Every session, I copied the same instructions: <em>setup, preferences, and what to avoid<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a></em>. And Claude kept asking permission for things I&#8217;d already approved. So when I opened a new project, it knew nothing.</p><p>None of it was necessary&#8230;</p><p><em>Claude Code</em><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a> is Anthropic&#8217;s AI in your terminal.</p><p>It reads code, writes files, and runs commands. When you install it, a hidden folder appears: <code>.claude</code>. This folder controls everything: <em>Claude&#8217;s instructions, permissions, reusable commands, and session memory</em><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a>. Configure it right, and Claude walks into every project already knowing the rules.</p><p>With the launch of Cowork<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a>, there&#8217;s another folder on your machine doing similar work. Same idea, but a different surface. Claude keeps your routines, outputs, and memory<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a> outside your conversations.</p><p>This newsletter gives you a complete map: <em>what&#8217;s inside both systems, what each file does, and how it all fits together&#8230;</em></p><p>Onward.</p><div><hr></div><div class="callout-block" data-callout="true"><h3><a href="https://coderabbit.link/neo-jan">Review the actual change, not the file list (Partner)</a></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://coderabbit.link/neo-jan" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!97LS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91514842-3f85-41df-a215-cc1fe44b4a38_2048x1163.png 424w, https://substackcdn.com/image/fetch/$s_!97LS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91514842-3f85-41df-a215-cc1fe44b4a38_2048x1163.png 848w, https://substackcdn.com/image/fetch/$s_!97LS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91514842-3f85-41df-a215-cc1fe44b4a38_2048x1163.png 1272w, https://substackcdn.com/image/fetch/$s_!97LS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91514842-3f85-41df-a215-cc1fe44b4a38_2048x1163.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!97LS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91514842-3f85-41df-a215-cc1fe44b4a38_2048x1163.png" width="1456" height="827" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/91514842-3f85-41df-a215-cc1fe44b4a38_2048x1163.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:827,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:null,&quot;href&quot;:&quot;https://coderabbit.link/neo-jan&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!97LS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91514842-3f85-41df-a215-cc1fe44b4a38_2048x1163.png 424w, https://substackcdn.com/image/fetch/$s_!97LS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91514842-3f85-41df-a215-cc1fe44b4a38_2048x1163.png 848w, https://substackcdn.com/image/fetch/$s_!97LS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91514842-3f85-41df-a215-cc1fe44b4a38_2048x1163.png 1272w, https://substackcdn.com/image/fetch/$s_!97LS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91514842-3f85-41df-a215-cc1fe44b4a38_2048x1163.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong><a href="https://coderabbit.link/neo-jan">AI writes more code than ever. Reviewing it shouldn&#8217;t mean scrolling forty files in alphabetical order.</a></strong></p><p><a href="https://coderabbit.link/neo-jan">CodeRabbit Review</a> reorganizes any pull request from a flat file list into a structured, layer-by-layer walkthrough - the logical reading order of the change, not the order your platform happens to sort it. Every range gets its own plain-language summary, with sequence diagrams, state machines, and ERDs generated inline wherever a visual earns its place.</p><p><strong>Cohorts</strong> group related files, and chunks so you review one idea at a time. <strong>Layers</strong> order them so foundational changes - data shapes, contracts - come before the code that depends on them. <strong>Code Peek</strong> lets you click any variable, function, class, or type to see its definition and usages without leaving the tab, while <strong>Semantic Diff</strong> view cuts past formatting noise to show what actually changed.</p><p>Open it straight from the Review Change Stack button in the PR Walkthrough. Navigate cohorts and layers from the keyboard, comment against exact line ranges, and submit native reviews, comments, and approvals post back to GitHub or GitLab right where your team expects them.</p><p><em>In the early access, available for free to everyone.</em></p><p>From the team that pioneered AI code reviews. 2M reviews every week. 6M repos. 15K customers. The review interface built for the way modern PRs are actually written.</p><p>&gt;&gt;&gt; <strong><a href="https://coderabbit.link/neo-jan"><mark data-color="rgb(255, 255, 0)" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Review your next PR with CodeRabbit Review Today</mark></a></strong></p><p>(Thanks to <a href="https://coderabbit.link/neo-jan">CodeRabbit</a> for partnering on this post.)</p></div><div><hr></div><p>I want to introduce <strong><a href="https://prosperinai.substack.com/subscribe">Ilia Karelin</a></strong> as the guest author.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://prosperinai.substack.com/subscribe" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!LMPo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faee51029-73f9-4327-b913-39bb88656d8f_2048x379.png 424w, https://substackcdn.com/image/fetch/$s_!LMPo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faee51029-73f9-4327-b913-39bb88656d8f_2048x379.png 848w, https://substackcdn.com/image/fetch/$s_!LMPo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faee51029-73f9-4327-b913-39bb88656d8f_2048x379.png 1272w, https://substackcdn.com/image/fetch/$s_!LMPo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faee51029-73f9-4327-b913-39bb88656d8f_2048x379.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!LMPo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faee51029-73f9-4327-b913-39bb88656d8f_2048x379.png" width="1456" height="269" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aee51029-73f9-4327-b913-39bb88656d8f_2048x379.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:269,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://prosperinai.substack.com/subscribe&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!LMPo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faee51029-73f9-4327-b913-39bb88656d8f_2048x379.png 424w, https://substackcdn.com/image/fetch/$s_!LMPo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faee51029-73f9-4327-b913-39bb88656d8f_2048x379.png 848w, https://substackcdn.com/image/fetch/$s_!LMPo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faee51029-73f9-4327-b913-39bb88656d8f_2048x379.png 1272w, https://substackcdn.com/image/fetch/$s_!LMPo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faee51029-73f9-4327-b913-39bb88656d8f_2048x379.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><span>He comes from a data background, data science, analytics, and BI, and brings that analytical mindset to </span><strong><a href="https://prosperinai.substack.com/subscribe">Prosper In AI</a></strong><span>, his newsletter, where he constantly experiments with AI tools and workflows to help professionals adopt AI in ways that actually improve their work and lives.</span></p><p>Follow him on <strong><a href="https://www.linkedin.com/in/iliakarelin">LinkedIn</a></strong> as well.</p><div><hr></div><p><em><strong>Here&#8217;s what you&#8217;ll find inside this newsletter:</strong></em></p><ul><li><p><strong>The hidden operating system behind Claude Code. </strong>What every file in <code>.claude/</code> actually does, why <code>CLAUDE.md</code> is only one piece of the puzzle, and how Claude decides what to load before you type a word.</p></li><li><p><strong>Configuration layer nobody explains.</strong> Instructions, permissions, commands, hooks, memory, and MCP servers--what each one controls and where they fit in the stack.</p></li><li><p><strong>How Claude really works under the hood.</strong> The startup sequence, memory system, permission checks, tool pipeline, and why understanding this flow makes debugging dramatically easier.</p></li><li><p><strong>Claude Code vs Claude Desktop vs Cowork.</strong> Where configuration lives, what carries across sessions, what stays local, and why the same workflow behaves differently on each platform.</p></li><li><p><strong>The mistakes that quietly break Claude.</strong> Bloated <code>CLAUDE.md</code> files, stale memory, overpowered permissions, weak commands, broken hooks, and the patterns that make Claude ignore your rules.</p></li></ul><p></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;http://newsletter.systemdesign.one/subscribe&quot;,&quot;text&quot;:&quot;Get Instant Access&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="http://newsletter.systemdesign.one/subscribe"><span>Get Instant Access</span></a></p><div><hr></div><h2>What lives inside</h2><p>Every file inside the folder falls into one of three categories: <em>instructions, permissions, or reusable commands.</em></p><p>Open a Claude Code session, and this folder is what it reads first. Only then does it act&#8230;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9SF1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab5533e6-13f1-4fbb-9403-f5f92be8cfff_1400x800.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9SF1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab5533e6-13f1-4fbb-9403-f5f92be8cfff_1400x800.png 424w, https://substackcdn.com/image/fetch/$s_!9SF1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab5533e6-13f1-4fbb-9403-f5f92be8cfff_1400x800.png 848w, https://substackcdn.com/image/fetch/$s_!9SF1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab5533e6-13f1-4fbb-9403-f5f92be8cfff_1400x800.png 1272w, https://substackcdn.com/image/fetch/$s_!9SF1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab5533e6-13f1-4fbb-9403-f5f92be8cfff_1400x800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9SF1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab5533e6-13f1-4fbb-9403-f5f92be8cfff_1400x800.png" width="1400" height="800" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ab5533e6-13f1-4fbb-9403-f5f92be8cfff_1400x800.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:800,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9SF1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab5533e6-13f1-4fbb-9403-f5f92be8cfff_1400x800.png 424w, https://substackcdn.com/image/fetch/$s_!9SF1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab5533e6-13f1-4fbb-9403-f5f92be8cfff_1400x800.png 848w, https://substackcdn.com/image/fetch/$s_!9SF1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab5533e6-13f1-4fbb-9403-f5f92be8cfff_1400x800.png 1272w, https://substackcdn.com/image/fetch/$s_!9SF1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab5533e6-13f1-4fbb-9403-f5f92be8cfff_1400x800.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The <code>.claude</code> folder in your home<em> </em>directory &#8212; <code>(/Users/yourname/.claude)</code></figcaption></figure></div><p>&#128161; Quick note for context:</p><ul><li><p>Claude Desktop is the native app: conversational, no file access.</p></li><li><p>Cowork<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a> is the visual workspace: live artifacts, local folders, and autonomous runs.</p></li></ul><p>Yet neither uses the <code>.claude/</code> folder the way Claude Code does.</p><p>They follow the same philosophy: <em>persistent context, reusable actions, and behavior controls.</em> But files live in different places and are managed differently.</p><p>(I&#8217;ll cover this later.)</p><p>Now we know what&#8217;s inside, let&#8217;s look at exactly where everything lives&#8230;</p><div><hr></div><h2>The folder map: what lives where</h2><p>Here&#8217;s the first thing that trips people up&#8230;there are two <code>.claude </code>folders:</p><ul><li><p><strong>~/.claude/</strong><em><strong> </strong></em>lives in your home directory (<code>/Users/yourname/.claude</code>). This is your &#8220;global&#8221; Claude configuration. It applies to every Claude Code session you run, across all projects.</p></li><li><p><strong>.claude/</strong> lives at the root of a specific repository or working directory (inside a project). Everything here applies only when you&#8217;re working inside the project.</p></li></ul><p>Think of these 2 folders as layers&#8230;</p><p>Claude loads the global config first, then the project config on top of it. i.e., project settings &#8220;override&#8221; global ones where they conflict.</p><p>Here&#8217;s what&#8217;s in the global folder:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!a-vk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38698751-2ca2-4b8f-b557-2b288b06e656_1025x902.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!a-vk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38698751-2ca2-4b8f-b557-2b288b06e656_1025x902.png 424w, https://substackcdn.com/image/fetch/$s_!a-vk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38698751-2ca2-4b8f-b557-2b288b06e656_1025x902.png 848w, https://substackcdn.com/image/fetch/$s_!a-vk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38698751-2ca2-4b8f-b557-2b288b06e656_1025x902.png 1272w, https://substackcdn.com/image/fetch/$s_!a-vk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38698751-2ca2-4b8f-b557-2b288b06e656_1025x902.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!a-vk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38698751-2ca2-4b8f-b557-2b288b06e656_1025x902.png" width="1025" height="902" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/38698751-2ca2-4b8f-b557-2b288b06e656_1025x902.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:902,&quot;width&quot;:1025,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!a-vk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38698751-2ca2-4b8f-b557-2b288b06e656_1025x902.png 424w, https://substackcdn.com/image/fetch/$s_!a-vk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38698751-2ca2-4b8f-b557-2b288b06e656_1025x902.png 848w, https://substackcdn.com/image/fetch/$s_!a-vk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38698751-2ca2-4b8f-b557-2b288b06e656_1025x902.png 1272w, https://substackcdn.com/image/fetch/$s_!a-vk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F38698751-2ca2-4b8f-b557-2b288b06e656_1025x902.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>And here&#8217;s what you&#8217;ll find inside the project folder:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rqMG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce6ec459-0527-405c-b0a6-cde1c4539b1e_1425x863.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rqMG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce6ec459-0527-405c-b0a6-cde1c4539b1e_1425x863.png 424w, https://substackcdn.com/image/fetch/$s_!rqMG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce6ec459-0527-405c-b0a6-cde1c4539b1e_1425x863.png 848w, https://substackcdn.com/image/fetch/$s_!rqMG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce6ec459-0527-405c-b0a6-cde1c4539b1e_1425x863.png 1272w, https://substackcdn.com/image/fetch/$s_!rqMG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce6ec459-0527-405c-b0a6-cde1c4539b1e_1425x863.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rqMG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce6ec459-0527-405c-b0a6-cde1c4539b1e_1425x863.png" width="1425" height="863" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ce6ec459-0527-405c-b0a6-cde1c4539b1e_1425x863.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:863,&quot;width&quot;:1425,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rqMG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce6ec459-0527-405c-b0a6-cde1c4539b1e_1425x863.png 424w, https://substackcdn.com/image/fetch/$s_!rqMG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce6ec459-0527-405c-b0a6-cde1c4539b1e_1425x863.png 848w, https://substackcdn.com/image/fetch/$s_!rqMG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce6ec459-0527-405c-b0a6-cde1c4539b1e_1425x863.png 1272w, https://substackcdn.com/image/fetch/$s_!rqMG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce6ec459-0527-405c-b0a6-cde1c4539b1e_1425x863.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>NOTE:<code> CLAUDE.md</code> does <em>NOT</em> live inside <code>.claude/</code> folder. Instead, it sits at the root of your project.</p><p><em>Think of it this way:</em></p><ul><li><p><code>.claude/</code> stores Claude&#8217;s settings and behavior rules<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-7" href="#footnote-7" target="_self">7</a></p></li><li><p><code>CLAUDE.md</code> stores instructions and project context</p></li></ul><p>They work together, but they are separate files&#8230;</p><p>Plus,<code> .mcp.json</code> lives at the project root.</p><p>Model context protocol (<strong>MCP</strong>)<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-8" href="#footnote-8" target="_self">8</a> servers allow Claude to connect to external tools such as databases, APIs, and services.</p><ul><li><p>If you want MCP tools available everywhere, configure them globally in <code>~/.claude/settings.json</code>.</p></li><li><p>But if you want MCP tools for just one project, use <code>.mcp.json</code> inside the project instead.</p></li></ul><p>This matters because different MCP setups can make Claude behave differently across projects.</p><p>You can commit the project <code>.claude/</code> folder to git. i.e., everyone on your team gets the same Claude setup when they clone your repository.</p><p>You should commit files like:</p><ul><li><p><code>settings.json</code></p></li><li><p><code>commands/</code></p></li></ul><p>But do NOT commit <code>settings.local.json</code>. It stores machine-specific paths and personal settings that usually break on other machines.</p><p>Claude used to support <code>CLAUDE.local.md</code> for personal instruction overrides&#8230; But it&#8217;s now deprecated. Today, the recommended approach is to use <code>@ </code>imports inside your main <code>CLAUDE.md</code>.</p><p>Also,<code> rules/</code> helps you split a large <code>CLAUDE.md</code> into smaller files by topic.</p><p>For example:</p><ul><li><p><code>architecture.md</code></p></li><li><p><code>mistakes.md</code></p></li><li><p><code>conventions.md</code></p></li></ul><p>Claude automatically reads every <code>.md</code> file inside <code>rules/</code> when a session starts. No imports or extra setup needed. You just add the file, and Claude uses it.</p><p>You can also make rules apply only to certain folders.</p><p>For example, <code>rules/api-conventions.md</code> can load only when Claude works inside <code>src/api/</code>.</p><p>This helps when different parts of the project follow different rules&#8230;</p><p><strong>TAKEAWAY</strong></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tdD2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22760819-d4fb-44a8-95a6-338514d049aa_1200x1038.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tdD2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22760819-d4fb-44a8-95a6-338514d049aa_1200x1038.jpeg 424w, https://substackcdn.com/image/fetch/$s_!tdD2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22760819-d4fb-44a8-95a6-338514d049aa_1200x1038.jpeg 848w, https://substackcdn.com/image/fetch/$s_!tdD2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22760819-d4fb-44a8-95a6-338514d049aa_1200x1038.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!tdD2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22760819-d4fb-44a8-95a6-338514d049aa_1200x1038.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tdD2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22760819-d4fb-44a8-95a6-338514d049aa_1200x1038.jpeg" width="1200" height="1038" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/22760819-d4fb-44a8-95a6-338514d049aa_1200x1038.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1038,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!tdD2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22760819-d4fb-44a8-95a6-338514d049aa_1200x1038.jpeg 424w, https://substackcdn.com/image/fetch/$s_!tdD2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22760819-d4fb-44a8-95a6-338514d049aa_1200x1038.jpeg 848w, https://substackcdn.com/image/fetch/$s_!tdD2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22760819-d4fb-44a8-95a6-338514d049aa_1200x1038.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!tdD2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22760819-d4fb-44a8-95a6-338514d049aa_1200x1038.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Commit these files:</p><ul><li><p><code>CLAUDE.md</code></p></li><li><p><code>.claude/settings.json</code></p></li><li><p><code>.claude/commands/</code></p></li><li><p><code>.claude/rules/</code></p></li></ul><p>So when a new engineer clones the repo, Claude already knows the project rules, restricted files, and available commands.</p><p>But do NOT commit <code>.claude/settings.local.json</code>. Instead, add it to <code>.gitignore</code> because it stores personal settings. It works only on one machine.</p><p>With the folder structure mapped out, let&#8217;s dig into the most important file: <code>CLAUDE.md</code>.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/claude-folder?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/claude-folder?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div><hr></div><h2>CLAUDE.md: instructions layer</h2><p><code>CLAUDE.md</code> is not documentation for humans, but instructions for Claude.</p><p>Regular docs explain the project to developers: <em>what the app does, how to install it, and how the API works</em>. While <code>CLAUDE.md</code> tells Claude how to behave on a project: <em>what rules to follow, what conventions matter, and what files to avoid.</em></p><p>When you start a session, Claude loads every <code>CLAUDE.md</code> file it can see, in this exact same order:</p><ol><li><p><code>~/.claude/CLAUDE.md</code> - your global instructions</p></li><li><p><code>./CLAUDE.md</code> - instructions for the current project</p></li><li><p>Any <code>CLAUDE.md</code> files inside subfolders you are working in</p></li></ol><p>They stack together. i.e., each file adds more instructions without replacing the earlier ones.</p><p>You can also split large instructions into separate files using <code>@</code> imports. For example, <code>@docs/architecture.md</code>.<code> </code>Claude will automatically load the file at the start of the session.</p><p>This keeps your main <code>CLAUDE.md</code> short while still giving Claude access to deeper project details.</p><p>IMPORTANT: imported files still count toward Claude&#8217;s context limit. Splitting files improves organization, but it does not reduce the amount of context Claude carries into the session.</p><p>Here&#8217;s what belongs in <code>CLAUDE.md</code>:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!uUgB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F603072ea-71df-46ee-b3c4-86bf01101291_1535x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uUgB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F603072ea-71df-46ee-b3c4-86bf01101291_1535x1024.png 424w, https://substackcdn.com/image/fetch/$s_!uUgB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F603072ea-71df-46ee-b3c4-86bf01101291_1535x1024.png 848w, https://substackcdn.com/image/fetch/$s_!uUgB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F603072ea-71df-46ee-b3c4-86bf01101291_1535x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!uUgB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F603072ea-71df-46ee-b3c4-86bf01101291_1535x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uUgB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F603072ea-71df-46ee-b3c4-86bf01101291_1535x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/603072ea-71df-46ee-b3c4-86bf01101291_1535x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!uUgB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F603072ea-71df-46ee-b3c4-86bf01101291_1535x1024.png 424w, https://substackcdn.com/image/fetch/$s_!uUgB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F603072ea-71df-46ee-b3c4-86bf01101291_1535x1024.png 848w, https://substackcdn.com/image/fetch/$s_!uUgB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F603072ea-71df-46ee-b3c4-86bf01101291_1535x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!uUgB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F603072ea-71df-46ee-b3c4-86bf01101291_1535x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>1. Architecture rules Claude cannot infer</h4><p>Some rules are invisible in the code itself.</p><p>For example:</p><ul><li><p><em>&#8220;Never import directly from </em><code>utils.ts</code><em>.&#8221;</em></p></li><li><p><em>&#8220;Always use the shared API client.&#8221;</em></p></li><li><p><em>&#8220;Do not edit generated files.&#8221;</em></p></li></ul><p>Claude will NOT reliably discover these patterns on its own... So write them down.</p><h4>2. Environment and workflow context</h4><p>Include the information a new engineer would spend days piecing together:</p><ul><li><p>which test runner you use</p></li><li><p>how deployments work</p></li><li><p>where database configs live</p></li><li><p>what setup steps usually fail</p></li><li><p>which scripts matter</p></li></ul><h4>3. Hard boundaries</h4><p>Tell Claude what it should never touch without permission.</p><p>Use strong markers like:</p><ul><li><p><code>IMPORTANT</code></p></li><li><p><code>YOU MUST</code></p></li></ul><p>Anthropic has confirmed emphasis markers improve adherence to instructions.</p><h4>What does not belong</h4><p>Do not fill <code>CLAUDE.md</code> with:</p><ul><li><p>long essays</p></li><li><p>duplicated documentation</p></li><li><p>theory</p></li><li><p>things already obvious from the code</p></li></ul><blockquote><p>Here&#8217;s a simple rule:</p><p><em>If removing a line would not change Claude&#8217;s behavior, delete it.</em></p></blockquote><p><code>CLAUDE.md</code> has no hard length limit. Yet longer files weaken instruction reliability. As the file grows, instructions compete for attention<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-9" href="#footnote-9" target="_self">9</a>. And rules near the bottom become easier to ignore than rules near the top&#8230;</p><p>A 200-line <code>CLAUDE.md</code> is usually not thorough and noisy.</p><p>Here&#8217;s a tiny but effective <code>CLAUDE.md</code>:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;markdown&quot;,&quot;nodeId&quot;:&quot;6c04cec7-8e43-4327-b3ad-05b0809383b4&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-markdown"># Project Context

This is a personal finance tracker.
Users log expenses; the app categorizes them.
Run locally with: `npm start`. Tests: `npm test`.

## Rules

- IMPORTANT: never store real financial data in test files
- All database queries go in /db - not scattered across other files
- Don&#8217;t touch the /legacy folder - it&#8217;s kept for reference only

## Common tasks

- Adding a new feature: check /docs/architecture.md first
- Running into a bug: look in /logs before changing any code</code></pre></div><p>Claude already knows what the project does, what files to avoid, and where to look before changing anything.</p><p>Here&#8217;s the fastest way to start: run <code>/init</code> inside a Claude Code session. Claude scans your project, detects things like the build system and test framework, then generates a starter <code>CLAUDE.md</code> for you.</p><p>That is usually much better than starting from a blank file.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!mIQC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb39f6f01-542c-4a68-8ac3-ae2400ab1339_665x123.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mIQC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb39f6f01-542c-4a68-8ac3-ae2400ab1339_665x123.png 424w, https://substackcdn.com/image/fetch/$s_!mIQC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb39f6f01-542c-4a68-8ac3-ae2400ab1339_665x123.png 848w, https://substackcdn.com/image/fetch/$s_!mIQC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb39f6f01-542c-4a68-8ac3-ae2400ab1339_665x123.png 1272w, https://substackcdn.com/image/fetch/$s_!mIQC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb39f6f01-542c-4a68-8ac3-ae2400ab1339_665x123.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mIQC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb39f6f01-542c-4a68-8ac3-ae2400ab1339_665x123.png" width="728" height="134.65263157894736" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b39f6f01-542c-4a68-8ac3-ae2400ab1339_665x123.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:123,&quot;width&quot;:665,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!mIQC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb39f6f01-542c-4a68-8ac3-ae2400ab1339_665x123.png 424w, https://substackcdn.com/image/fetch/$s_!mIQC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb39f6f01-542c-4a68-8ac3-ae2400ab1339_665x123.png 848w, https://substackcdn.com/image/fetch/$s_!mIQC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb39f6f01-542c-4a68-8ac3-ae2400ab1339_665x123.png 1272w, https://substackcdn.com/image/fetch/$s_!mIQC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb39f6f01-542c-4a68-8ac3-ae2400ab1339_665x123.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">The command in the terminal</figcaption></figure></div><p>One distinction matters here: <em>prompts and configuration are not the same thing.</em></p><p>Use prompts for one-time requests:</p><ul><li><p><em>&#8220;Explain this simply.&#8221;</em></p></li><li><p><em>&#8220;Summarize this as bullet points.&#8221;</em></p></li></ul><p>You can use <code>CLAUDE.md</code> for rules that should apply every session:</p><ul><li><p>coding conventions</p></li><li><p>hard boundaries</p></li><li><p>project context</p></li><li><p>workflow rules</p></li></ul><p>Here&#8217;s a simple test to help you: If you repeat an instruction in every new session, then put it in <code>CLAUDE.md</code>.</p><p>Instructions are only half the picture. Now let&#8217;s look at the skills and commands that make Claude reusable&#8230;</p><div><hr></div><div class="callout-block" data-callout="true"><p><em><strong>Reminder: this is a teaser of the subscriber-only newsletter, exclusive to my golden members.</strong></em></p><p>When you upgrade, you&#8217;ll get:</p><ul><li><p><strong>High-level architecture of real-world systems.</strong></p></li><li><p>Deep dive into how popular real-world systems work.</p></li><li><p><strong>How real-world systems handle scale, reliability, and performance.</strong></p></li></ul><p>And much more!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe&quot;,&quot;text&quot;:&quot;Unlock Full Access&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://newsletter.systemdesign.one/subscribe"><span>Unlock Full Access</span></a></p><p>Ready for the best part?</p></div><div><hr></div><h2>Skills and commands: reusable workflows</h2>
      <p>
          <a href="https://newsletter.systemdesign.one/p/claude-folder">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[mobile system design was HARD until I learned these 53 concepts]]></title><description><![CDATA[#156: Part 3 - Modular Architecture, Feature Flags, Staged Rollouts, and 11 others.]]></description><link>https://newsletter.systemdesign.one/p/system-design-mobile</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/system-design-mobile</guid><dc:creator><![CDATA[Shefali Jangid]]></dc:creator><pubDate>Mon, 22 Jun 2026 11:04:05 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/393c9baf-1aee-4f35-a076-eedba4854049_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Get my system design playbook for FREE on newsletter signup:</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><ul><li><p><em><a href="https://newsletter.systemdesign.one/p/system-design-mobile/?action=share">Share this post</a> &amp; I&#8217;ll send you some rewards for the referrals.</em></p></li></ul><div><hr></div><p><span>The following is the third of a premium 3-part<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a> newsletter series&#8230; where everything comes together for mobile system design:&nbsp;</span><em><span>architecture, how the&nbsp;platform behaves, and what happens after you ship.</span></em></p><p><span>On with part 3 of the newsletter:</span></p><p><span>===</span></p><p><span>In this newsletter, we&#8217;ll learn 14 concepts that shape how production apps are built and operated:</span></p><ol start="40"><li><p>Modular Architecture/Feature-Based Modules,</p></li><li><p>Backend for Frontend (BFF) for Mobile,</p></li><li><p>App Versioning &amp; Backward Compatibility,</p></li><li><p>Feature Flags &amp; Remote Configuration,</p></li><li><p>Deep Linking for Navigation &amp; Growth,</p></li><li><p>Navigation &amp; Screen Flow Architecture,</p></li><li><p>Permissions Model,</p></li><li><p>Accessibility (a11y),</p></li><li><p>Localisation &amp; Internationalisation (i18n),</p></li><li><p>Graceful Degradation,</p></li><li><p>Geo Location Usage,</p></li><li><p>Crash Reporting &amp; Performance Monitoring,</p></li><li><p>Crash-Free Rate as an SLI,</p></li><li><p>Staged Rollouts &amp; Safe Releases.</p></li></ol><p><span>For each concept, you&#8217;ll learn:</span></p><ul><li><p><span>What it is and how it works</span></p></li><li><p><span>Real-world example</span></p></li><li><p><span>Tradeoffs</span></p></li><li><p><span>Why it matters for mobile</span></p></li></ul><p><span>Onward.</span></p><div><hr></div><div class="callout-block" data-callout="true"><h3><strong><a href="https://www.sarasai.org/masteraidev?utm_source=Linkedin&amp;utm_medium=Neo&amp;utm_campaign=Aidev">Do you want to become an AI Engineer in 2026?</a></strong></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://www.sarasai.org/masteraidev?utm_source=Linkedin&amp;utm_medium=Neo&amp;utm_campaign=Aidev" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8wN2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84cc8c1a-2485-42af-bf17-1286f7be45b6_1600x900.jpeg 424w, https://substackcdn.com/image/fetch/$s_!8wN2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84cc8c1a-2485-42af-bf17-1286f7be45b6_1600x900.jpeg 848w, https://substackcdn.com/image/fetch/$s_!8wN2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84cc8c1a-2485-42af-bf17-1286f7be45b6_1600x900.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!8wN2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84cc8c1a-2485-42af-bf17-1286f7be45b6_1600x900.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8wN2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84cc8c1a-2485-42af-bf17-1286f7be45b6_1600x900.jpeg" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/84cc8c1a-2485-42af-bf17-1286f7be45b6_1600x900.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:156666,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:&quot;https://www.sarasai.org/masteraidev?utm_source=Linkedin&amp;utm_medium=Neo&amp;utm_campaign=Aidev&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/202750555?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84cc8c1a-2485-42af-bf17-1286f7be45b6_1600x900.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!8wN2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84cc8c1a-2485-42af-bf17-1286f7be45b6_1600x900.jpeg 424w, https://substackcdn.com/image/fetch/$s_!8wN2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84cc8c1a-2485-42af-bf17-1286f7be45b6_1600x900.jpeg 848w, https://substackcdn.com/image/fetch/$s_!8wN2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84cc8c1a-2485-42af-bf17-1286f7be45b6_1600x900.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!8wN2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84cc8c1a-2485-42af-bf17-1286f7be45b6_1600x900.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>AI Engineer is LinkedIn&#8217;s #1 fastest-growing job, with many roles paying $180K&#8211;$350K.</p><p>The challenge isn&#8217;t learning AI tools.</p><p>It&#8217;s learning how to design, build, and deploy AI systems that work in production.</p><p>That&#8217;s why <strong>Saras AI Institute</strong> created the <strong><a href="https://www.sarasai.org/masteraidev?utm_source=Linkedin&amp;utm_medium=Neo&amp;utm_campaign=Aidev">Advanced AI Engineer Certificate</a>.</strong></p><p>Co-designed with AI leaders from Microsoft (Eduardo Kassner, Chief Data &amp; AI Officer) and Google (Tomas Pfister, Head of AI Research @ Google Cloud).</p><p>In 5 months, you&#8217;ll build a portfolio of 4 real-world AI projects, including agentic workflows, RAG systems, LLM applications, and production-ready AI solutions.</p><ul><li><p>Turn your AI product idea into a production-ready solution with hands-on mentorship from industry experts.</p></li><li><p>Weekly live masterclasses with AI practitioners</p></li><li><p>100% online, designed for working engineers</p></li></ul><p>Engineers from Microsoft, Apple, AWS, and other leading technology companies have already joined.</p><p>By graduation, you&#8217;ll have a GitHub portfolio that demonstrates your ability to design, build, and lead AI initiatives&#8212;not just talk about them.</p><p>Cohort starts August 1.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.sarasai.org/masteraidev?utm_source=Linkedin&amp;utm_medium=Neo&amp;utm_campaign=Aidev&quot;,&quot;text&quot;:&quot;Reserve your seat today for just $99&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://www.sarasai.org/masteraidev?utm_source=Linkedin&amp;utm_medium=Neo&amp;utm_campaign=Aidev"><span>Reserve your seat today for just $99</span></a></p><p>(Thanks to <a href="https://www.sarasai.org/masteraidev?utm_source=Linkedin&amp;utm_medium=Neo&amp;utm_campaign=Aidev">Saras AI Institute</a> for partnering on this post.)</p></div><div><hr></div><p><span>I want to reintroduce </span><strong><a href="https://x.com/Shefali__J">Shefali Jangid</a></strong><span> as a guest author.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://x.com/Shefali__J" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!grPx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe7703d2-7046-46fc-b7cb-4b0c2caac2e6_900x480.png 424w, https://substackcdn.com/image/fetch/$s_!grPx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe7703d2-7046-46fc-b7cb-4b0c2caac2e6_900x480.png 848w, https://substackcdn.com/image/fetch/$s_!grPx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe7703d2-7046-46fc-b7cb-4b0c2caac2e6_900x480.png 1272w, https://substackcdn.com/image/fetch/$s_!grPx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe7703d2-7046-46fc-b7cb-4b0c2caac2e6_900x480.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!grPx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe7703d2-7046-46fc-b7cb-4b0c2caac2e6_900x480.png" width="900" height="480" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/be7703d2-7046-46fc-b7cb-4b0c2caac2e6_900x480.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:480,&quot;width&quot;:900,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://x.com/Shefali__J&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!grPx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe7703d2-7046-46fc-b7cb-4b0c2caac2e6_900x480.png 424w, https://substackcdn.com/image/fetch/$s_!grPx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe7703d2-7046-46fc-b7cb-4b0c2caac2e6_900x480.png 848w, https://substackcdn.com/image/fetch/$s_!grPx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe7703d2-7046-46fc-b7cb-4b0c2caac2e6_900x480.png 1272w, https://substackcdn.com/image/fetch/$s_!grPx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe7703d2-7046-46fc-b7cb-4b0c2caac2e6_900x480.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>She&#8217;s a web developer, technical writer, and content creator with a love for frontend architecture and building things that scale.</p><p>Check out her work and socials:</p><ul><li><p><a href="https://shefali.dev/">Shefali.dev</a></p></li><li><p><a href="https://github.com/WebdevShefali">GitHub</a></p></li><li><p><a href="https://x.com/Shefali__J">Twitter</a></p></li></ul><p>You&#8217;ll often find her writing about web development, sharing UI tips, and building tools that make developers&#8217; lives easier.</p><div><hr></div><h1><strong><span>Architecture</span></strong></h1><p><span>This section explains different architectural patterns and design approaches that help build apps that are modular, easier to maintain, and can grow without becoming difficult to update.</span></p><p><span>Let&#8217;s dive in!</span></p><h3><strong><span>40. Modular Architecture/Feature-Based Modules</span></strong></h3><p><span>As mobile apps grow, the codebase can become very large and difficult to manage.</span></p><p><span>If everything is written in one BIG project, it becomes harder to understand the code, make changes, and test new features.</span></p><p><span>To solve this problem, you can use </span><em><span>modular architecture</span></em><span>.</span></p><p><span>In modular architecture, app is divided into separate modules, where each module represents a specific feature of the app.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yZta!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa73c7f04-e48d-4252-a9a7-91d844d847da_1467x653.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yZta!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa73c7f04-e48d-4252-a9a7-91d844d847da_1467x653.png 424w, https://substackcdn.com/image/fetch/$s_!yZta!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa73c7f04-e48d-4252-a9a7-91d844d847da_1467x653.png 848w, https://substackcdn.com/image/fetch/$s_!yZta!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa73c7f04-e48d-4252-a9a7-91d844d847da_1467x653.png 1272w, https://substackcdn.com/image/fetch/$s_!yZta!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa73c7f04-e48d-4252-a9a7-91d844d847da_1467x653.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yZta!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa73c7f04-e48d-4252-a9a7-91d844d847da_1467x653.png" width="1456" height="648" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a73c7f04-e48d-4252-a9a7-91d844d847da_1467x653.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:648,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!yZta!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa73c7f04-e48d-4252-a9a7-91d844d847da_1467x653.png 424w, https://substackcdn.com/image/fetch/$s_!yZta!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa73c7f04-e48d-4252-a9a7-91d844d847da_1467x653.png 848w, https://substackcdn.com/image/fetch/$s_!yZta!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa73c7f04-e48d-4252-a9a7-91d844d847da_1467x653.png 1272w, https://substackcdn.com/image/fetch/$s_!yZta!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa73c7f04-e48d-4252-a9a7-91d844d847da_1467x653.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><span>An app could have modules like:</span></p><ul><li><p><strong><span>Auth module:</span></strong><span> Handles login and signup.</span></p></li><li><p><strong><span>Feed module:</span></strong><span> Shows posts or content.</span></p></li><li><p><strong><span>Checkout module:</span></strong><span> Handles payments and orders.</span></p></li></ul><p><span>Each module contains its own code and exposes only the parts other modules need.</span></p><p><span>This keeps features separate and prevents different parts of the app from interfering with each other.</span></p><p><span>This structure makes the app easier to understand and maintain.</span></p><h4><strong><span>Why It Matters</span></strong></h4><p><span>In a very large app, building the entire project can take a long time&#8230;</span></p><p><span>If a single codebase contains hundreds of thousands of lines of code, compiling the app could take several minutes.</span></p><p><span>With modular architecture, only the module that changed needs to be rebuilt. This makes builds much faster and helps you work more efficiently.</span></p><h4><strong><span>Real-World Example</span></strong></h4><p><span>Airbnb, Uber, and Spotify use modular architecture in their mobile apps.</span></p><p><span>They adopted this approach to accelerate development, improve code organization, and allow different teams to work on separate features simultaneously.</span></p><h4><strong><span>Trade-offs</span></strong></h4><p><span>Modular architecture also introduces some challenges.</span></p><p><span>You need to carefully design the boundaries between modules and define clear interfaces for how modules communicate with each other. Some shared functionality, such as analytics, navigation, or design systems, may need to live in a common core module that all features can use.</span></p><p><span>It can also be difficult to convert an existing large app into a modular structure after it has already grown.</span></p><h4><strong><span>Practical Tip</span></strong></h4><p><span>It&#8217;s useful to visualize how modules depend on each other.</span></p><p><span>Tools like dependency graph visualizers can help teams see how modules are connected and identify problems such as circular dependencies, where two modules depend on each other. This usually means the architecture needs improvement.</span></p><p><span>While modular architecture improves how the app code is organized, mobile apps also depend heavily on backend systems designed specifically for them.</span></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/system-design-mobile?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/system-design-mobile?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><h3><strong><span>41. Backend for Frontend (BFF) for Mobile</span></strong></h3><p><span>Mobile apps often need data from &#8220;many&#8221; different backend services.</span></p><p><span>A single screen requires data from a user service, a recommendation service, and a content service.</span></p><p><span>If the mobile app directly calls all these services, it would need to make several network requests and combine the results on the device. This can SLOW down the app and increase battery usage.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!USrZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68adb76c-3e11-4558-9f19-357a0e43f803_1509x715.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!USrZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68adb76c-3e11-4558-9f19-357a0e43f803_1509x715.png 424w, https://substackcdn.com/image/fetch/$s_!USrZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68adb76c-3e11-4558-9f19-357a0e43f803_1509x715.png 848w, https://substackcdn.com/image/fetch/$s_!USrZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68adb76c-3e11-4558-9f19-357a0e43f803_1509x715.png 1272w, https://substackcdn.com/image/fetch/$s_!USrZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68adb76c-3e11-4558-9f19-357a0e43f803_1509x715.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!USrZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68adb76c-3e11-4558-9f19-357a0e43f803_1509x715.png" width="1456" height="690" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/68adb76c-3e11-4558-9f19-357a0e43f803_1509x715.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:690,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!USrZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68adb76c-3e11-4558-9f19-357a0e43f803_1509x715.png 424w, https://substackcdn.com/image/fetch/$s_!USrZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68adb76c-3e11-4558-9f19-357a0e43f803_1509x715.png 848w, https://substackcdn.com/image/fetch/$s_!USrZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68adb76c-3e11-4558-9f19-357a0e43f803_1509x715.png 1272w, https://substackcdn.com/image/fetch/$s_!USrZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F68adb76c-3e11-4558-9f19-357a0e43f803_1509x715.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><span>To solve this, use a technique called Backend for Frontend (</span><strong><span>BFF</span></strong><span>).</span></p><p><span>A BFF</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a><span> is a special backend layer designed specifically for a specific type of client, such as a mobile app.</span></p><p><span>Instead of the mobile app calling many services, it sends one request to the BFF. The BFF then communicates with the required services, gathers the data, combines it, and sends back a single optimized response.</span></p><p><span>This makes the mobile app simpler and reduces the number of network requests.</span></p><h4><strong><span>Why It Matters</span></strong></h4><p><span>Every network request adds delay &amp; consumes battery.</span></p><p><span>If a mobile screen requires data from five services, the app will make five separate API calls. This increases latency and slows down the user experience.</span></p><p><span>With a BFF, the mobile app only makes one request, and the server handles the rest. This improves performance and keeps the app more efficient.</span></p><h4><strong><span>Real-World Example</span></strong></h4><p><span>Netflix uses the BFF approach to serve different types of clients.</span></p><p><span>They maintain separate backend layers for iOS apps, Android apps, TVs, and web browsers.</span></p><p><span>Each BFF returns data formatted specifically for that device.</span></p><p><span>A mobile BFF sends smaller responses optimized for mobile screens, while the TV version may include higher-resolution metadata.</span></p><h4><strong><span>Trade-offs</span></strong></h4><p><span>Using a BFF also introduces an additional service that needs to be maintained.</span></p><p><span>It is important BFF does not become overly complex. Its main responsibility should be to aggregate and transform data for the client. Core business logic should remain in the backend services that actually own the data.</span></p><p><span>As backend APIs evolve, another challenge appears: </span><em><span>users often run older versions of the app...</span></em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/system-design-mobile?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/system-design-mobile?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><h3><strong><span>42. App Versioning &amp; Backward Compatibility</span></strong></h3><p><span>When mobile apps are released, users do NOT always update them immediately.</span></p><p><span>Some people update right away, but others may continue using an older version of the app for weeks or even months.</span></p><p><span>So the backend system must support many versions of the app simultaneously.</span></p><p><span>i.e., server should continue to work with older app versions while also supporting the latest version.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xxmJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05d3cc59-4712-4826-99d6-0e1a435701e4_1616x682.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xxmJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05d3cc59-4712-4826-99d6-0e1a435701e4_1616x682.png 424w, https://substackcdn.com/image/fetch/$s_!xxmJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05d3cc59-4712-4826-99d6-0e1a435701e4_1616x682.png 848w, https://substackcdn.com/image/fetch/$s_!xxmJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05d3cc59-4712-4826-99d6-0e1a435701e4_1616x682.png 1272w, https://substackcdn.com/image/fetch/$s_!xxmJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05d3cc59-4712-4826-99d6-0e1a435701e4_1616x682.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xxmJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05d3cc59-4712-4826-99d6-0e1a435701e4_1616x682.png" width="1456" height="614" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/05d3cc59-4712-4826-99d6-0e1a435701e4_1616x682.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:614,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!xxmJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05d3cc59-4712-4826-99d6-0e1a435701e4_1616x682.png 424w, https://substackcdn.com/image/fetch/$s_!xxmJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05d3cc59-4712-4826-99d6-0e1a435701e4_1616x682.png 848w, https://substackcdn.com/image/fetch/$s_!xxmJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05d3cc59-4712-4826-99d6-0e1a435701e4_1616x682.png 1272w, https://substackcdn.com/image/fetch/$s_!xxmJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F05d3cc59-4712-4826-99d6-0e1a435701e4_1616x682.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><span>To manage this, use </span><em><span>versioning</span></em><span>:</span></p><p><span>Versioning assigns each API, or app release, a version number so the server knows how to communicate with different app versions.</span></p><p><span>Check these API endpoints:</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;8f5caecd-b6d3-4b2d-b713-60c4ba78f096&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">/v1/users
/v2/users</code></pre></div><p><span>Each version can return data in a format that matches what that specific app version expects.</span></p><h4><strong><span>Why It Matters</span></strong></h4><p><span>If the backend changes something in the API without considering older app versions, older apps will suddenly stop working&#8230;</span></p><p><span>If the server removes a field that an older app depends on, the app could crash or show broken screens.</span></p><p><span>Unlike websites, mobile apps cannot be updated instantly for every user. This is why systems must remain backward compatible.</span></p><h4><strong><span>Real-World Example</span></strong></h4><p><span>Stripe uses API versioning to maintain compatibility.</span></p><p><span>When a client makes an API request, it specifies which API version it expects. Even if Stripe changes the API later, older clients still receive responses in the format they were built for.</span></p><p><span>This allows the platform to evolve without breaking existing apps.</span></p><h4><strong><span>Trade-offs</span></strong></h4><p><span>Supporting many versions of an API requires extra maintenance.</span></p><p><span>You need to keep older fields or response formats in the system for some time.</span></p><p><span>A common strategy used to manage this safely is called the </span><strong><span>Expand&#8211;Contract pattern</span></strong><span>:</span></p><ol><li><p><span>First, add new fields or features without removing the old ones.</span></p></li><li><p><span>Gradually update apps to use the new fields.</span></p></li><li><p><span>Once all users have updated, remove the old fields.</span></p></li></ol><p><span>This approach prevents breaking older versions while still allowing the system to evolve.</span></p><p><span>Even when APIs remain backward compatible, you still need safe ways to release new features&#8230;</span></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/system-design-mobile?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/system-design-mobile?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><h3><strong><span>43. Feature Flags &amp; Remote Configuration</span></strong></h3><p><span>When you add a new feature to a mobile app, you must release a new version of the app and wait for users to update it.</span></p><p><span>This process can take time because apps must go through the app store review, and not all users update their apps immediately.</span></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_hPn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51924f04-95ec-4529-a8b5-9fbf9bb47037_1412x593.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_hPn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51924f04-95ec-4529-a8b5-9fbf9bb47037_1412x593.png 424w, https://substackcdn.com/image/fetch/$s_!_hPn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51924f04-95ec-4529-a8b5-9fbf9bb47037_1412x593.png 848w, https://substackcdn.com/image/fetch/$s_!_hPn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51924f04-95ec-4529-a8b5-9fbf9bb47037_1412x593.png 1272w, https://substackcdn.com/image/fetch/$s_!_hPn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51924f04-95ec-4529-a8b5-9fbf9bb47037_1412x593.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_hPn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51924f04-95ec-4529-a8b5-9fbf9bb47037_1412x593.png" width="1412" height="593" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/51924f04-95ec-4529-a8b5-9fbf9bb47037_1412x593.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:593,&quot;width&quot;:1412,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!_hPn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51924f04-95ec-4529-a8b5-9fbf9bb47037_1412x593.png 424w, https://substackcdn.com/image/fetch/$s_!_hPn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51924f04-95ec-4529-a8b5-9fbf9bb47037_1412x593.png 848w, https://substackcdn.com/image/fetch/$s_!_hPn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51924f04-95ec-4529-a8b5-9fbf9bb47037_1412x593.png 1272w, https://substackcdn.com/image/fetch/$s_!_hPn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51924f04-95ec-4529-a8b5-9fbf9bb47037_1412x593.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><span>Feature flags solve this problem:</span></p><p><span>A </span><strong><span>feature flag</span></strong><span> is a switch that lets you remotely enable or disable a feature without releasing a new version of the app.</span></p><p><span>The feature&#8217;s code is already included in the app, but it stays disabled by default. You can later enable it from a dashboard for specific users or for everyone.</span></p><p><span>This allows you to control when features are released.</span></p><p><span>Remote configuration extends this idea even further. It allows you to change certain app behaviors remotely, such as:</span></p><ul><li><p><span>UI text or labels</span></p></li><li><p><span>Feature limits</span></p></li><li><p><span>Layouts or design elements</span></p></li><li><p><span>Experiment settings</span></p></li></ul><p><span>Tools such as </span><a href="https://firebase.google.com/docs/remote-config"><span>Firebase Remote Config</span></a><span> are commonly used for this.</span></p><h4><strong><span>Why It Matters</span></strong></h4><p><span>Submitting an app update to the app store can take up to 3 days for approval.</span></p><p><span>If a new feature has a bug and has already been released to millions of users, fixing it through another app update can take time.</span></p><p><span>With feature flags, you can disable the feature instantly from a dashboard without waiting for another release.</span></p><p><span>This makes apps safer and easier to manage in production.</span></p><h4><strong><span>Real-World Example</span></strong></h4><p><span>Many companies use feature flags to run A/B testing</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a><span> experiments.</span></p><p><span>Airbnb tests two different versions of a feature:</span></p><ul><li><p><span>One group of users sees the original version.</span></p></li><li><p><span>Another group sees a new version.</span></p></li></ul><p><span>Feature flags control which users see which version, allowing the company to measure which design performs better.</span></p><h4><strong><span>Trade-offs</span></strong></h4><p><span>While feature flags are powerful, they can also create complexity.</span></p><p><span>If too many flags are added and never removed, the codebase can become cluttered with outdated flags. To avoid this, you should define a lifecycle policy where every feature flag has a purpose and an expiry date. Once the feature becomes permanent, the flag should be removed from the code.</span></p><p><span>Feature flags help control when features are released, but navigation systems determine how users actually reach those features inside the app.</span></p><div class="callout-block" data-callout="true"><p><em><strong>Reminder: this is a teaser of the subscriber-only newsletter, exclusive to my golden members.</strong></em></p><p>When you upgrade, you&#8217;ll get:</p><ul><li><p><strong>High-level architecture of real-world systems.</strong></p></li><li><p>Deep dive into how popular real-world systems work.</p></li><li><p><strong>How real-world systems handle scale, reliability, and performance.</strong></p></li></ul><p>And much more!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe&quot;,&quot;text&quot;:&quot;Unlock Full Access&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://newsletter.systemdesign.one/subscribe"><span>Unlock Full Access</span></a></p><p>Ready for the next technique?</p></div><h3><strong><span>44. Deep Linking for Navigation &amp; Growth</span></strong></h3>
      <p>
          <a href="https://newsletter.systemdesign.one/p/system-design-mobile">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[The Secret Architecture Behind AI Data Centers]]></title><description><![CDATA[#155: Why AI breakthroughs are really infrastructure breakthroughs]]></description><link>https://newsletter.systemdesign.one/p/what-is-ai-infrastructure</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/what-is-ai-infrastructure</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Fri, 19 Jun 2026 09:11:26 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/2d3a5cbd-b7ab-4d69-95c4-68eb8e588f09_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Get my system design playbook for FREE on newsletter signup:</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><ul><li><p><em><a href="https://newsletter.systemdesign.one/p/what-is-ai-infrastructure/?action=share">Share this post</a> &amp; I&#8217;ll send you some rewards for the referrals.</em></p></li></ul><div><hr></div><p>When people talk about Artificial Intelligence (<strong>AI</strong>), they often refer to models such as Generative Pre-trained Transformers (<strong>GPTs</strong>), Large Language Models (<strong>LLMs</strong>), and neural networks.</p><p>It sounds like magic, software that <em>thinks</em>&#8230;</p><p>But here&#8217;s the uncomfortable truth:</p><blockquote><p>The biggest breakthroughs in AI are not coming from better models; they&#8217;re coming from better infrastructure.</p></blockquote><p>If AI were only about the models, there would be no need for huge, warehouse-sized data centers packed with specialized hardware and powered by massive amounts of electricity.</p><p>So what&#8217;s actually going on inside those buildings?</p><p>To make sense of everything that follows, we need a simple mental model.</p><p>Let&#8217;s find out one layer at a time&#8230;</p><p>Onward.</p><div><hr></div><div class="callout-block" data-callout="true"><h2><strong><a href="https://coderabbit.link/neo-jan">Review the actual change, not the file list (Partner)</a></strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://coderabbit.link/neo-jan" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!97LS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91514842-3f85-41df-a215-cc1fe44b4a38_2048x1163.png 424w, https://substackcdn.com/image/fetch/$s_!97LS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91514842-3f85-41df-a215-cc1fe44b4a38_2048x1163.png 848w, https://substackcdn.com/image/fetch/$s_!97LS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91514842-3f85-41df-a215-cc1fe44b4a38_2048x1163.png 1272w, https://substackcdn.com/image/fetch/$s_!97LS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91514842-3f85-41df-a215-cc1fe44b4a38_2048x1163.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!97LS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91514842-3f85-41df-a215-cc1fe44b4a38_2048x1163.png" width="1456" height="827" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/91514842-3f85-41df-a215-cc1fe44b4a38_2048x1163.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:827,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://coderabbit.link/neo-jan&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!97LS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91514842-3f85-41df-a215-cc1fe44b4a38_2048x1163.png 424w, https://substackcdn.com/image/fetch/$s_!97LS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91514842-3f85-41df-a215-cc1fe44b4a38_2048x1163.png 848w, https://substackcdn.com/image/fetch/$s_!97LS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91514842-3f85-41df-a215-cc1fe44b4a38_2048x1163.png 1272w, https://substackcdn.com/image/fetch/$s_!97LS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91514842-3f85-41df-a215-cc1fe44b4a38_2048x1163.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong><a href="https://coderabbit.link/neo-jan">AI writes more code than ever. Reviewing it shouldn&#8217;t mean scrolling forty files in alphabetical order.</a></strong></p><p><a href="https://coderabbit.link/neo-jan">CodeRabbit Review</a> reorganizes any pull request from a flat file list into a structured, layer-by-layer walkthrough - the logical reading order of the change, not the order your platform happens to sort it. Every range gets its own plain-language summary, with sequence diagrams, state machines, and ERDs generated inline wherever a visual earns its place.</p><p><strong>Cohorts</strong> group related files and chunks so you review one idea at a time. <strong>Layers</strong> order them so foundational changes - data shapes, contracts - come before the code that depends on them. <strong>Code Peek</strong> lets you click any variable, function, class, or type to see its definition and usages without leaving the tab, while <strong>Semantic Diff</strong> view cuts past formatting noise to show what actually changed.</p><p>Open it straight from the Review Change Stack button in the PR Walkthrough. Navigate cohorts and layers from the keyboard, comment against exact line ranges, and submit native reviews, comments, and approvals post back to GitHub or GitLab right where your team expects them.</p><p><em>In the early access, available for free to everyone.</em></p><p>From the team that pioneered AI code reviews. 2M reviews every week. 6M repos. 15K customers.The review interface built for the way modern PRs are actually written.</p><p>&gt;&gt;&gt; <strong><a href="https://coderabbit.link/neo-jan"><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">Review your next PR with CodeRabbit Review Today</mark></a></strong></p><p>(Thanks to <a href="https://coderabbit.link/neo-jan">CodeRabbit</a> for partnering on this post.)</p></div><div><hr></div><p>I&#8217;d like to introduce <strong><a href="https://maven.com/nvidia-cert/ai-infra?promoCode=SYSTEM-DESIGN">Ashish Prajapati</a></strong>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://maven.com/nvidia-cert/ai-infra?promoCode=SYSTEM-DESIGN" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nNx0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd03ff4f7-14dc-49eb-8ea2-0a0f19931553_851x315.png 424w, https://substackcdn.com/image/fetch/$s_!nNx0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd03ff4f7-14dc-49eb-8ea2-0a0f19931553_851x315.png 848w, https://substackcdn.com/image/fetch/$s_!nNx0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd03ff4f7-14dc-49eb-8ea2-0a0f19931553_851x315.png 1272w, https://substackcdn.com/image/fetch/$s_!nNx0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd03ff4f7-14dc-49eb-8ea2-0a0f19931553_851x315.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nNx0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd03ff4f7-14dc-49eb-8ea2-0a0f19931553_851x315.png" width="851" height="315" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d03ff4f7-14dc-49eb-8ea2-0a0f19931553_851x315.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:315,&quot;width&quot;:851,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://maven.com/nvidia-cert/ai-infra?promoCode=SYSTEM-DESIGN&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nNx0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd03ff4f7-14dc-49eb-8ea2-0a0f19931553_851x315.png 424w, https://substackcdn.com/image/fetch/$s_!nNx0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd03ff4f7-14dc-49eb-8ea2-0a0f19931553_851x315.png 848w, https://substackcdn.com/image/fetch/$s_!nNx0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd03ff4f7-14dc-49eb-8ea2-0a0f19931553_851x315.png 1272w, https://substackcdn.com/image/fetch/$s_!nNx0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd03ff4f7-14dc-49eb-8ea2-0a0f19931553_851x315.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>He is an AI infrastructure specialist and technology educator who helps engineers understand the technologies powering modern AI.</p><p>With expertise spanning data centers, cloud computing, GPU infrastructure, Generative AI, and Agentic AI, he focuses on turning complex concepts into practical, real-world knowledge.</p><p>His training programs have reached over 39,000 learners worldwide, and through his free mentoring initiative, <a href="https://besaprogram.com/">Become a Solutions Architect (BeSA)</a>, he has helped over 23,000 professionals accelerate their careers.</p><p>As AI adoption continues to grow, understanding the infrastructure behind AI systems is becoming a valuable skill for architects, engineers, and IT professionals.</p><p>For a limited time, this newsletter's readers can use code <strong><a href="https://maven.com/nvidia-cert/ai-infra?promoCode=SYSTEM-DESIGN">SYSTEM-DESIGN to get 25% off Ashish&#8217;s live NCA-AIIO bootcamp</a></strong>.</p><p>This intensive one-day workshop covers the fundamentals of NVIDIA AI infrastructure, GPU networking, accelerated computing, and AI operations, and prepares you for the NVIDIA-Certified Associate: AI Infrastructure and Operations (NCA-AIIO) certification.</p><p><strong><a href="https://maven.com/nvidia-cert/ai-infra?promoCode=SYSTEM-DESIGN">Learn, Prepare, and Pass NCA-AIIO in a Day</a></strong>. </p><div><hr></div><p><em><strong>Here&#8217;s what you&#8217;ll find inside this newsletter:</strong></em></p><ul><li><p><strong>The hidden architecture behind AI.</strong> Why models are only the visible tip of a much larger infrastructure stack.</p></li><li><p><strong>The physics that limit AI growth.</strong> How power, cooling, and space shape every AI data center.</p></li><li><p><strong>Why GPUs became the backbone of AI.</strong> The architectural advantages that made modern AI training possible.</p></li><li><p><strong>The real bottlenecks in modern AI.</strong> Why memory, networking, and coordination determine performance at scale.</p></li><li><p><strong>How thousands of GPUs work together as one system. </strong>The software, networking, and orchestration layers that enable large-scale AI.</p></li></ul><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Golden members get all posts like these!&#8230;</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h2>Think of an AI Data Center as a Factory</h2><p>Before we go deep, build this mental model; it will explain almost everything that follows:</p><ul><li><p>AI Data Center = Factory</p></li><li><p>Data = Raw material</p></li><li><p>Graphics Processing Units (<strong>GPUs</strong>) = Machines on the factory floor</p></li><li><p>Network = Internal transport system</p></li><li><p>Storage = Warehouse holding raw materials</p></li><li><p>Software = Assembly line logic</p></li><li><p>Output = Trained intelligence</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Dv0q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5af17e2a-b970-4c7d-9e5c-09dbcbaf333d_752x266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Dv0q!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5af17e2a-b970-4c7d-9e5c-09dbcbaf333d_752x266.png 424w, https://substackcdn.com/image/fetch/$s_!Dv0q!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5af17e2a-b970-4c7d-9e5c-09dbcbaf333d_752x266.png 848w, https://substackcdn.com/image/fetch/$s_!Dv0q!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5af17e2a-b970-4c7d-9e5c-09dbcbaf333d_752x266.png 1272w, https://substackcdn.com/image/fetch/$s_!Dv0q!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5af17e2a-b970-4c7d-9e5c-09dbcbaf333d_752x266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Dv0q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5af17e2a-b970-4c7d-9e5c-09dbcbaf333d_752x266.png" width="752" height="266" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5af17e2a-b970-4c7d-9e5c-09dbcbaf333d_752x266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:266,&quot;width&quot;:752,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Dv0q!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5af17e2a-b970-4c7d-9e5c-09dbcbaf333d_752x266.png 424w, https://substackcdn.com/image/fetch/$s_!Dv0q!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5af17e2a-b970-4c7d-9e5c-09dbcbaf333d_752x266.png 848w, https://substackcdn.com/image/fetch/$s_!Dv0q!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5af17e2a-b970-4c7d-9e5c-09dbcbaf333d_752x266.png 1272w, https://substackcdn.com/image/fetch/$s_!Dv0q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5af17e2a-b970-4c7d-9e5c-09dbcbaf333d_752x266.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Now imagine a car factory.</p><p>It doesn&#8217;t just need skilled workers; instead, it needs conveyors, warehouses, and power. Remove any of those, and production stops.</p><p>An AI data center works the same way&#8230;</p><p>AI infrastructure processes vast amounts of data using mathematical operations, similar to how a factory transforms raw materials into finished goods.</p><p>Remove any one ingredient, and the entire system stalls&#8230;</p><p>Once you see AI as a factory, the next question becomes obvious: <em>what limits how fast this factory can run?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/what-is-ai-infrastructure?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/what-is-ai-infrastructure?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div><hr></div><h2>First Problem: Physics</h2><p><em>Before AI is a software problem, it&#8217;s a physics problem&#8230;</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!u0wV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29912406-5182-430f-8786-0c3cf2d8603e_752x299.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!u0wV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29912406-5182-430f-8786-0c3cf2d8603e_752x299.png 424w, https://substackcdn.com/image/fetch/$s_!u0wV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29912406-5182-430f-8786-0c3cf2d8603e_752x299.png 848w, https://substackcdn.com/image/fetch/$s_!u0wV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29912406-5182-430f-8786-0c3cf2d8603e_752x299.png 1272w, https://substackcdn.com/image/fetch/$s_!u0wV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29912406-5182-430f-8786-0c3cf2d8603e_752x299.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!u0wV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29912406-5182-430f-8786-0c3cf2d8603e_752x299.png" width="752" height="299" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/29912406-5182-430f-8786-0c3cf2d8603e_752x299.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:299,&quot;width&quot;:752,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!u0wV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29912406-5182-430f-8786-0c3cf2d8603e_752x299.png 424w, https://substackcdn.com/image/fetch/$s_!u0wV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29912406-5182-430f-8786-0c3cf2d8603e_752x299.png 848w, https://substackcdn.com/image/fetch/$s_!u0wV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29912406-5182-430f-8786-0c3cf2d8603e_752x299.png 1272w, https://substackcdn.com/image/fetch/$s_!u0wV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29912406-5182-430f-8786-0c3cf2d8603e_752x299.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Here are three hard physical constraints that shape every design decision in an AI data center:</p><h4>1. Power</h4><p>Modern AI workloads rely on high-density GPUs that consume enormous amounts of electricity.</p><p>A single server rack of GPUs can draw 80-120 kilowatts. i.e., roughly equivalent to 40 homes running at full load simultaneously. Yet you can&#8217;t just add more GPUs forever.</p><p>You&#8217;re limited by how much electricity your facility can physically receive and distribute.</p><h4>2. Cooling</h4><p>More power means more heat, and heat is the enemy&#8230;</p><p>Here&#8217;s what happens if you don&#8217;t remove it fast enough:</p><ul><li><p>Hardware fails prematurely,</p></li><li><p>Performance throttles back to avoid damage,</p></li><li><p>In extreme cases, systems shut down entirely.</p></li></ul><p>To manage the intense heat generated by AI workloads, modern data centers are increasingly adopting <em>liquid cooling</em>, which is far more effective than conventional air cooling.</p><p>Coolant is circulated through cold plates attached directly to GPUs and CPUs, absorbing heat much more efficiently than air. The warmed liquid is then pumped to heat exchangers, where the heat is removed before the coolant is recirculated.</p><p>This approach enables higher rack densities, lower cooling power consumption, and more consistent performance for large-scale AI training and inference<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a> workloads.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cAHv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf2be83b-5804-4e79-aa70-b8a689157c39_2048x955.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cAHv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf2be83b-5804-4e79-aa70-b8a689157c39_2048x955.png 424w, https://substackcdn.com/image/fetch/$s_!cAHv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf2be83b-5804-4e79-aa70-b8a689157c39_2048x955.png 848w, https://substackcdn.com/image/fetch/$s_!cAHv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf2be83b-5804-4e79-aa70-b8a689157c39_2048x955.png 1272w, https://substackcdn.com/image/fetch/$s_!cAHv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf2be83b-5804-4e79-aa70-b8a689157c39_2048x955.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cAHv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf2be83b-5804-4e79-aa70-b8a689157c39_2048x955.png" width="1456" height="679" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/df2be83b-5804-4e79-aa70-b8a689157c39_2048x955.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:679,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!cAHv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf2be83b-5804-4e79-aa70-b8a689157c39_2048x955.png 424w, https://substackcdn.com/image/fetch/$s_!cAHv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf2be83b-5804-4e79-aa70-b8a689157c39_2048x955.png 848w, https://substackcdn.com/image/fetch/$s_!cAHv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf2be83b-5804-4e79-aa70-b8a689157c39_2048x955.png 1272w, https://substackcdn.com/image/fetch/$s_!cAHv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf2be83b-5804-4e79-aa70-b8a689157c39_2048x955.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>3. Space</h4><p>Even if you had unlimited chips and unlimited power, you still need racks to mount them and floor space to put those racks.</p><p>Scaling AI is not just software--it&#8217;s real estate, energy infrastructure, and thermodynamics combined.</p><h4>Takeaway</h4><p>A data center is, at its core, a power plant combined with a massive, precisely controlled air-conditioning system. Every engineering decision flows from managing this reality.</p><p>After dealing with the physical challenges, the next question is: <em>how we perform the computation?</em></p><div><hr></div><h2>Compute: Why GPUs Took Over</h2><p>To understand why GPUs dominate AI, picture a very simple task&#8230;</p><p>Imagine you have 1,000 fence posts to paint:</p><ul><li><p>Option A: One expert painter, working post by post. Slow, but the painter can handle any unexpected situation--a broken post, a curved section.</p></li><li><p>Option B: 1,000 workers, each painting exactly one post simultaneously. Extremely fast, but each worker knows only one simple task.</p></li></ul><p>That&#8217;s the difference between a CPU and a GPU.</p><h4>CPU (Central Processing Unit)</h4><ul><li><p>A few very powerful cores</p></li><li><p>Handles complex, varied, sequential tasks</p></li><li><p>Acts as the &#8220;manager&#8221; making decisions and coordinating work</p></li></ul><h4>GPU (Graphics Processing Unit)</h4><ul><li><p>Thousands of smaller, simpler cores</p></li><li><p>Handles same simple operation repeated millions of times, all at once</p></li><li><p>Acts as the &#8220;factory workers&#8221; doing mass production</p></li></ul><p>AI training repeatedly performs matrix multiplications billions of times, making minor adjustments after each step. GPUs are specifically designed for this type of work.</p><h4>DPU (Data Processing Unit)</h4><ul><li><p>As AI systems grow, a third processor becomes important.</p></li><li><p>DPU handles networking, storage I/O, and security operations--tasks that would otherwise steal cycles from the GPU and CPU.</p></li></ul><p><em>Here&#8217;s the system view:</em></p><ul><li><p>CPU = manager (decision-making)</p></li><li><p>GPU = factory workers (mass production)</p></li><li><p>DPU = logistics and operations (keeping materials moving and systems secure)</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!YjyT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F206518df-1f9a-410f-95ed-11871707fd8d_752x384.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YjyT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F206518df-1f9a-410f-95ed-11871707fd8d_752x384.png 424w, https://substackcdn.com/image/fetch/$s_!YjyT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F206518df-1f9a-410f-95ed-11871707fd8d_752x384.png 848w, https://substackcdn.com/image/fetch/$s_!YjyT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F206518df-1f9a-410f-95ed-11871707fd8d_752x384.png 1272w, https://substackcdn.com/image/fetch/$s_!YjyT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F206518df-1f9a-410f-95ed-11871707fd8d_752x384.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YjyT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F206518df-1f9a-410f-95ed-11871707fd8d_752x384.png" width="752" height="384" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/206518df-1f9a-410f-95ed-11871707fd8d_752x384.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:384,&quot;width&quot;:752,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!YjyT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F206518df-1f9a-410f-95ed-11871707fd8d_752x384.png 424w, https://substackcdn.com/image/fetch/$s_!YjyT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F206518df-1f9a-410f-95ed-11871707fd8d_752x384.png 848w, https://substackcdn.com/image/fetch/$s_!YjyT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F206518df-1f9a-410f-95ed-11871707fd8d_752x384.png 1272w, https://substackcdn.com/image/fetch/$s_!YjyT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F206518df-1f9a-410f-95ed-11871707fd8d_752x384.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>But even with powerful GPUs, computation alone isn&#8217;t the limiting factor; the real challenge is keeping them fed with data&#8230;</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/what-is-ai-infrastructure?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/what-is-ai-infrastructure?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div><hr></div><h2>Hidden Bottleneck: Memory and Storage</h2><p>Here&#8217;s something that surprises most people:</p><blockquote><p>GPUs don&#8217;t fail because they&#8217;re slow. They fail because they&#8217;re hungry&#8212;constantly starved for data.</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xZF7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6728dea-ba70-4e77-9830-100ec4bc5d36_752x384.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xZF7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6728dea-ba70-4e77-9830-100ec4bc5d36_752x384.png 424w, https://substackcdn.com/image/fetch/$s_!xZF7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6728dea-ba70-4e77-9830-100ec4bc5d36_752x384.png 848w, https://substackcdn.com/image/fetch/$s_!xZF7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6728dea-ba70-4e77-9830-100ec4bc5d36_752x384.png 1272w, https://substackcdn.com/image/fetch/$s_!xZF7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6728dea-ba70-4e77-9830-100ec4bc5d36_752x384.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xZF7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6728dea-ba70-4e77-9830-100ec4bc5d36_752x384.png" width="752" height="384" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e6728dea-ba70-4e77-9830-100ec4bc5d36_752x384.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:384,&quot;width&quot;:752,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!xZF7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6728dea-ba70-4e77-9830-100ec4bc5d36_752x384.png 424w, https://substackcdn.com/image/fetch/$s_!xZF7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6728dea-ba70-4e77-9830-100ec4bc5d36_752x384.png 848w, https://substackcdn.com/image/fetch/$s_!xZF7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6728dea-ba70-4e77-9830-100ec4bc5d36_752x384.png 1272w, https://substackcdn.com/image/fetch/$s_!xZF7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe6728dea-ba70-4e77-9830-100ec4bc5d36_752x384.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Memory Hierarchy</h4><p>Data doesn&#8217;t live in one place. It moves through a layered system, trading speed for capacity:</p><ul><li><p>GPU Memory (HBM<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a>): Blazingly fast but tiny; usually tens of gigabytes. This is the GPU&#8217;s working memory.</p></li><li><p>CPU RAM: Larger (hundreds of gigabytes), but slower than HBM.</p></li><li><p>SSD/NVMe<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a> Storage: Enormous capacity at a lower cost, but still slower.</p></li><li><p>Network/Object Storage: Nearly unlimited, but the slowest link in the chain.</p></li></ul><p>Every time the GPU needs data that isn&#8217;t already in its fast local memory, it must wait... And a GPU sitting idle costs just as much money as one doing useful work.</p><p><strong>Takeaway</strong></p><p>AI performance is not determined solely by how fast the GPU computes. Instead, by how fast data can be fed into the GPU.</p><p>A faster chip with a slow data pipeline is like a faster car stuck in traffic.</p><h4>Tiered storage in practice</h4><p>In real AI data centers, storage is organized into tiers that roughly map to hot, warm, and cold data:</p><ul><li><p><strong>Hot</strong>: NVMe SSDs holding active training datasets and model checkpoints.</p></li><li><p><strong>Warm</strong>: Parallel file systems<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a>, such as Lustre, General Parallel File System (<strong>GPFS</strong>), provide high-speed shared access across many GPUs.</p></li><li><p><strong>Cold</strong>: Object storage, such as Amazon Simple Storage Service (Amazon S3), for storing raw datasets and older checkpoints.</p></li></ul><p>As models grow larger, a single GPU is no longer enough&#8230;</p><p>Techniques such as model sharding<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a> and distributed training<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a> distribute the model across multiple GPUs and memory layers.</p><p>And once data starts moving across machines, a new bottleneck appears: <em>how those machines communicate with each other.</em></p><div class="callout-block" data-callout="true"><p><em><strong>Reminder: this is a teaser of the subscriber-only newsletter series, exclusive to my golden members.</strong></em></p><p>When you upgrade, you&#8217;ll get:</p><ul><li><p><strong>High-level architecture of real-world systems.</strong></p></li><li><p>Deep dive into how popular real-world systems actually work.</p></li><li><p><strong>How real-world systems handle scale, reliability, and performance.</strong></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?yearly=true&quot;,&quot;text&quot;:&quot;Unlock Full Access&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://newsletter.systemdesign.one/subscribe?yearly=true"><span>Unlock Full Access</span></a></p></div><div><hr></div><h2>Networking: Bottleneck Nobody Talks About</h2><p>When training a large AI model, you typically use thousands of GPUs working together rather than a single GPU&#8230;</p><p>And those thousands of GPUs must constantly communicate with each other, sharing what they&#8217;ve learned at every step&#8230;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!87HU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd90bf47f-a16f-4146-b7e6-dad78481fa7f_2048x1045.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!87HU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd90bf47f-a16f-4146-b7e6-dad78481fa7f_2048x1045.png 424w, https://substackcdn.com/image/fetch/$s_!87HU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd90bf47f-a16f-4146-b7e6-dad78481fa7f_2048x1045.png 848w, https://substackcdn.com/image/fetch/$s_!87HU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd90bf47f-a16f-4146-b7e6-dad78481fa7f_2048x1045.png 1272w, https://substackcdn.com/image/fetch/$s_!87HU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd90bf47f-a16f-4146-b7e6-dad78481fa7f_2048x1045.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!87HU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd90bf47f-a16f-4146-b7e6-dad78481fa7f_2048x1045.png" width="1456" height="743" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d90bf47f-a16f-4146-b7e6-dad78481fa7f_2048x1045.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:743,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!87HU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd90bf47f-a16f-4146-b7e6-dad78481fa7f_2048x1045.png 424w, https://substackcdn.com/image/fetch/$s_!87HU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd90bf47f-a16f-4146-b7e6-dad78481fa7f_2048x1045.png 848w, https://substackcdn.com/image/fetch/$s_!87HU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd90bf47f-a16f-4146-b7e6-dad78481fa7f_2048x1045.png 1272w, https://substackcdn.com/image/fetch/$s_!87HU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd90bf47f-a16f-4146-b7e6-dad78481fa7f_2048x1045.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Every second a GPU waits for data or synchronization is a second of lost productivity and wasted investment.</p><h4>Cluster topology and fabrics</h4><p>Modern AI clusters typically use leaf-spine network architectures<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-7" href="#footnote-7" target="_self">7</a>: <em>a design built for high throughput and low latency at scale</em>.</p><p>Every GPU server can reach every other GPU server in <em>at most &#8216;two&#8217; hops</em>.</p><p>Within a node, GPUs talk over NVLink (intra-node fabric). Between nodes, traffic flows over InfiniBand or RDMA over Converged Ethernet (<strong>RoCE</strong>), the inter-node fabric<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-8" href="#footnote-8" target="_self">8</a>.</p><p>There&#8217;s also a clear speed hierarchy:</p><ul><li><p>NVLink<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-9" href="#footnote-9" target="_self">9</a>: fastest path, a direct, private highway connecting GPUs within the same server.</p></li><li><p>InfiniBand/RoCE<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-10" href="#footnote-10" target="_self">10</a>: very high-speed interconnect between separate servers. Imagine it as the &#8220;bullet train&#8221; of the data center.</p></li><li><p>Ethernet: general-purpose, flexible, and ubiquitous, but not designed for AI&#8217;s most extreme bandwidth and latency demands.</p></li></ul><h4>Amdahl&#8217;s Law: Why More GPUs Aren&#8217;t Always Better</h4><p>There&#8217;s a fundamental principle in distributed computing called <em>Amdahl&#8217;s Law</em>.</p><blockquote><p>In plain English: if parts of your system must wait for other parts, adding more workers eventually stops helping.</p></blockquote><p>In AI workloads, adding more GPUs increases computing power but also increases communication overhead. As GPUs spend more time sharing and synchronizing data, the bottleneck gradually shifts from computation to communication.</p><h4>Smarter data movement</h4><p>Modern AI systems address this with several techniques:</p><ul><li><p>Remote Direct Memory Access (<strong>RDMA</strong>): Provides low-latency, high-throughput communication by enabling direct memory-to-memory data transfers between servers.</p></li><li><p>RDMA kernel<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-11" href="#footnote-11" target="_self">11</a> bypass: Lets the network adapter access application memory directly from user space<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-12" href="#footnote-12" target="_self">12</a>, eliminating unnecessary operating system overhead.</p></li><li><p>GPUDirect: GPUs can read from and write to storage or network cards directly, bypassing the CPU entirely.</p></li><li><p>Zero-copy pipelines: Data takes the shortest path from source to GPU, with no redundant copying along the way.</p></li></ul><p>The goal of AI networking is to make thousands of GPUs behave like one giant, unified processor, as if the data never had to travel at all.</p><p><em>Once communication is in place, the next challenge is dividing the work efficiently across all those GPUs&#8230;</em></p>
      <p>
          <a href="https://newsletter.systemdesign.one/p/what-is-ai-infrastructure">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[30 Core Agentic Engineering Concepts, Explained Simply]]></title><description><![CDATA[#154: What an agent is, how to configure one, when to use multiple, and how to keep them from doing damage.]]></description><link>https://newsletter.systemdesign.one/p/agentic-engineering</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/agentic-engineering</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Wed, 17 Jun 2026 09:35:54 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/1e4758b7-163b-4aee-b880-3c3fcb29909f_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Get my system design playbook for FREE on newsletter signup:</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><ul><li><p><em><a href="https://newsletter.systemdesign.one/p/agentic-engineering/?action=share">Share this post</a> &amp; I'll send you some rewards for the referrals.</em></p></li></ul><div><hr></div><p>How do you keep up with agentic engineering when a new tool ships every week?</p><p>You do not&#8230;</p><p>You learn the ideas behind the tools, and let the tools come and go.</p><p>The pace will not slow down. New models, new frameworks, a new <em>&#8220;this changes everything</em>&#8221; launch every few days. Chase all of it, and you spend more time switching tools than using them.</p><p>But underneath the noise, it is the same few ideas every time.</p><p>One calls it a skill, the next calls it a rule; it's the same job underneath.</p><p>Learn the idea, and it stops mattering which tool you pick.</p><p>By the end of this newsletter, you can read any agent post or news drop and see which of these ideas it actually covers, instead of feeling behind every time something new ships.</p><p>Onward.</p><div><hr></div><div class="callout-block" data-callout="true"><h2><a href="https://solutions.cerbos.dev/how-to-adopt-externalized-authorization?utm_campaign=system_design_june_2026&amp;utm_source=newsletter&amp;utm_medium=email&amp;utm_content=&amp;utm_term=">&#8221;How to adopt externalized authorization: step-by-step roadmap&#8221; eBook by Cerbos (Sponsor)</a></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://solutions.cerbos.dev/how-to-adopt-externalized-authorization?utm_campaign=system_design_june_2026&amp;utm_source=newsletter&amp;utm_medium=email&amp;utm_content=&amp;utm_term=" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7YsV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dc78d8b-e765-47b1-8796-f5a99f5bbd74_1800x1013.png 424w, https://substackcdn.com/image/fetch/$s_!7YsV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dc78d8b-e765-47b1-8796-f5a99f5bbd74_1800x1013.png 848w, https://substackcdn.com/image/fetch/$s_!7YsV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dc78d8b-e765-47b1-8796-f5a99f5bbd74_1800x1013.png 1272w, https://substackcdn.com/image/fetch/$s_!7YsV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dc78d8b-e765-47b1-8796-f5a99f5bbd74_1800x1013.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7YsV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dc78d8b-e765-47b1-8796-f5a99f5bbd74_1800x1013.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5dc78d8b-e765-47b1-8796-f5a99f5bbd74_1800x1013.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:809658,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://solutions.cerbos.dev/how-to-adopt-externalized-authorization?utm_campaign=system_design_june_2026&amp;utm_source=newsletter&amp;utm_medium=email&amp;utm_content=&amp;utm_term=&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/201500103?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dc78d8b-e765-47b1-8796-f5a99f5bbd74_1800x1013.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!7YsV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dc78d8b-e765-47b1-8796-f5a99f5bbd74_1800x1013.png 424w, https://substackcdn.com/image/fetch/$s_!7YsV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dc78d8b-e765-47b1-8796-f5a99f5bbd74_1800x1013.png 848w, https://substackcdn.com/image/fetch/$s_!7YsV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dc78d8b-e765-47b1-8796-f5a99f5bbd74_1800x1013.png 1272w, https://substackcdn.com/image/fetch/$s_!7YsV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5dc78d8b-e765-47b1-8796-f5a99f5bbd74_1800x1013.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Hardcoded authorization logic doesn&#8217;t scale. As systems grow and requirements change, those tightly coupled permissions end up slowing down development, creating security risks, and making compliance a nightmare.</p><p>This <strong><a href="https://solutions.cerbos.dev/how-to-adopt-externalized-authorization?utm_campaign=system_design_june_2026&amp;utm_source=newsletter&amp;utm_medium=email&amp;utm_content=&amp;utm_term=">80-page eBook</a></strong> breaks down how hundreds of engineering teams have tackled this problem. It walks through the practical steps for moving from hardcoded permissions to externalized authorization.</p><p>What&#8217;s in it:</p><ul><li><p>Step-by-step adoption strategy from planning to PoC rollout</p></li><li><p>Frameworks, policy examples, code samples</p></li><li><p>Lessons from teams who&#8217;ve made the transition</p></li></ul><p>If you&#8217;re dealing with authorization complexity, this might save you some of the trial and error.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://solutions.cerbos.dev/how-to-adopt-externalized-authorization?utm_campaign=system_design_june_2026&amp;utm_source=newsletter&amp;utm_medium=email&amp;utm_content=&amp;utm_term=&quot;,&quot;text&quot;:&quot;Download free eBook&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://solutions.cerbos.dev/how-to-adopt-externalized-authorization?utm_campaign=system_design_june_2026&amp;utm_source=newsletter&amp;utm_medium=email&amp;utm_content=&amp;utm_term="><span>Download free eBook</span></a></p><p>(Thanks to <a href="https://solutions.cerbos.dev/how-to-adopt-externalized-authorization?utm_campaign=system_design_june_2026&amp;utm_source=newsletter&amp;utm_medium=email&amp;utm_content=&amp;utm_term=">Cerbos</a> for partnering on this post.)</p></div><div><hr></div><p>I want to introduce <strong><a href="https://paulhoekstra.substack.com/subscribe">Paul Hoekstra</a></strong> as the guest author.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://paulhoekstra.substack.com/subscribe" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!x-R_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70536c2e-7c91-4f9e-bd75-9a924d933d88_1179x563.png 424w, https://substackcdn.com/image/fetch/$s_!x-R_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70536c2e-7c91-4f9e-bd75-9a924d933d88_1179x563.png 848w, https://substackcdn.com/image/fetch/$s_!x-R_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70536c2e-7c91-4f9e-bd75-9a924d933d88_1179x563.png 1272w, https://substackcdn.com/image/fetch/$s_!x-R_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70536c2e-7c91-4f9e-bd75-9a924d933d88_1179x563.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!x-R_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70536c2e-7c91-4f9e-bd75-9a924d933d88_1179x563.png" width="1179" height="563" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/70536c2e-7c91-4f9e-bd75-9a924d933d88_1179x563.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:563,&quot;width&quot;:1179,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:390579,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://paulhoekstra.substack.com/subscribe&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70536c2e-7c91-4f9e-bd75-9a924d933d88_1179x563.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!x-R_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70536c2e-7c91-4f9e-bd75-9a924d933d88_1179x563.png 424w, https://substackcdn.com/image/fetch/$s_!x-R_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70536c2e-7c91-4f9e-bd75-9a924d933d88_1179x563.png 848w, https://substackcdn.com/image/fetch/$s_!x-R_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70536c2e-7c91-4f9e-bd75-9a924d933d88_1179x563.png 1272w, https://substackcdn.com/image/fetch/$s_!x-R_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70536c2e-7c91-4f9e-bd75-9a924d933d88_1179x563.png 1456w" sizes="100vw" loading="lazy" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Paul is a data engineer at Digital Power, a data and AI consultancy, and writes <strong><a href="https://paulhoekstra.substack.com/subscribe">Paul&#8217;s Pipeline</a></strong>, a free newsletter on AI, data, and side projects.</p><p>This newsletter pulls out the ideas that keep mattering, whichever tool you pick. If it leaves you wanting more, he has a four-part series on the layers covered in this newsletter: configuration, capability, orchestration, and guardrails.</p><div><hr></div><p><em><strong>Here&#8217;s what you&#8217;ll find inside this newsletter:</strong></em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!M9gA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F982a6e25-adc8-41af-aec6-7412231fc2cf_1456x1050.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!M9gA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F982a6e25-adc8-41af-aec6-7412231fc2cf_1456x1050.png 424w, https://substackcdn.com/image/fetch/$s_!M9gA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F982a6e25-adc8-41af-aec6-7412231fc2cf_1456x1050.png 848w, https://substackcdn.com/image/fetch/$s_!M9gA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F982a6e25-adc8-41af-aec6-7412231fc2cf_1456x1050.png 1272w, https://substackcdn.com/image/fetch/$s_!M9gA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F982a6e25-adc8-41af-aec6-7412231fc2cf_1456x1050.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!M9gA!,w_2400,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F982a6e25-adc8-41af-aec6-7412231fc2cf_1456x1050.png" width="778" height="561.0576923076923" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/982a6e25-adc8-41af-aec6-7412231fc2cf_1456x1050.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;large&quot;,&quot;height&quot;:1050,&quot;width&quot;:1456,&quot;resizeWidth&quot;:778,&quot;bytes&quot;:170345,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F982a6e25-adc8-41af-aec6-7412231fc2cf_1456x1050.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-large" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!M9gA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F982a6e25-adc8-41af-aec6-7412231fc2cf_1456x1050.png 424w, https://substackcdn.com/image/fetch/$s_!M9gA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F982a6e25-adc8-41af-aec6-7412231fc2cf_1456x1050.png 848w, https://substackcdn.com/image/fetch/$s_!M9gA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F982a6e25-adc8-41af-aec6-7412231fc2cf_1456x1050.png 1272w, https://substackcdn.com/image/fetch/$s_!M9gA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F982a6e25-adc8-41af-aec6-7412231fc2cf_1456x1050.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p><strong>Foundations.</strong> What an agent is, how it runs, where its state lives, and the patterns you build once you have more than one.</p></li><li><p><strong>Configuration.</strong> How you shape the agent&#8217;s behavior before it writes a line of code: config files, reusable workflows, prompt caching, and the context rot that limits all of it.</p></li><li><p><strong>Capability.</strong> What the agent can reach for once it is running: live documentation, AI-native search, long-term memory, and knowledge it queries but never owns.</p></li><li><p><strong>Orchestration.</strong> How you coordinate multiple agents without letting them step on each other.</p></li><li><p><strong>Guardrails.</strong> What stops the agents from doing damage: sandboxing, permissions, hooks, and the commit gates that catch the rest.</p></li><li><p><strong>Observability.</strong> How you see what an agent actually did after it stopped typing: tracing, logging, replay, and metrics.</p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><h1><strong>Foundations</strong></h1><p>Let&#8217;s dive in!</p><h2><strong>1. What is an agent?</strong></h2><p>&#8220;Agent&#8221; gets used for almost anything these days.</p><p>Let us pin it down:</p><p>An agent is a large language model (<strong>LLM</strong>) that runs in a loop, has access to tools<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>, and decides what to do next. Instead of a single answer to a prompt, the model produces a chain of actions. And each action builds on the result of the last.</p><p>Coding is the most obvious use case so far.</p><p>The loop fits naturally there. Small building blocks. Fast feedback from tests and errors. Files the agent can edit directly. The same shape works for research agents, ops automation, customer support, and content workflows.</p><p>Use an agent when:</p><ul><li><p>Task is open-ended (&#8221;debug this failing test&#8221;, not &#8220;format this date&#8221;)</p></li><li><p>The next step depends on the result of the last one</p></li><li><p>You cannot script the path in advance</p></li></ul><p>But skip the agent when a single prompt or a plain script will do.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jZ8a!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeaaa4ed-cb9b-47ca-89e8-6ccff483f3ca_1456x819.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jZ8a!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeaaa4ed-cb9b-47ca-89e8-6ccff483f3ca_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!jZ8a!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeaaa4ed-cb9b-47ca-89e8-6ccff483f3ca_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!jZ8a!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeaaa4ed-cb9b-47ca-89e8-6ccff483f3ca_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!jZ8a!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeaaa4ed-cb9b-47ca-89e8-6ccff483f3ca_1456x819.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jZ8a!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeaaa4ed-cb9b-47ca-89e8-6ccff483f3ca_1456x819.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/feaaa4ed-cb9b-47ca-89e8-6ccff483f3ca_1456x819.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:59547,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeaaa4ed-cb9b-47ca-89e8-6ccff483f3ca_1456x819.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!jZ8a!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeaaa4ed-cb9b-47ca-89e8-6ccff483f3ca_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!jZ8a!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeaaa4ed-cb9b-47ca-89e8-6ccff483f3ca_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!jZ8a!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeaaa4ed-cb9b-47ca-89e8-6ccff483f3ca_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!jZ8a!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffeaaa4ed-cb9b-47ca-89e8-6ccff483f3ca_1456x819.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Loops are not free.</p><p>Every time round the loop costs time and money, and they add up fast. The agent gets less predictable. And it gets harder to debug: the runs are longer, and the agent does not always make the same choices twice.</p><p>You do not have to pick one mode for everything.</p><p>Use a single prompt or a plain script for easy problems. Reserve the agent for tasks where its flexibility earns the cost.</p><div><hr></div><h2><strong>2. Execution model</strong></h2><p>An agent loop has a recognizable shape.</p><p>Three steps, repeated until something says we are done:</p><ul><li><p>First, the model <strong>thinks</strong>. It reads the current state of the conversation and decides what to do next.</p></li><li><p>The model then <strong>acts</strong>. It emits a tool call. The harness<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a> around the model receives the call, validates it, and runs it: file read, shell command, MCP request, whatever fits.</p></li><li><p>Finally, the model <strong>observes</strong>. The tool result joins the conversation as new context. The next iteration starts with that result in scope.</p></li></ul><p>This pattern goes by a few names.</p><p>ReAct (from <a href="https://arxiv.org/abs/2210.03629">the original paper</a>), Think-act-observe, agent loop.</p><p>The name changes, but the loop does not.</p><p>A single model call has to predict the entire path up front and commit to it. The loop replaces that prediction with feedback. The model takes one step, observes what actually happened, and decides the next step based on the actual result rather than a guess.</p><p>This is why an agent can recover from its own mistakes.</p><p>A failing test returns a stack trace. A blocked command returns an error. Each one is just the next observation, and the next iteration plans against it. The loop catches a wrong first step on the next pass, instead of letting it poison everything after it.</p><p>Two variations sit on top of this basic loop:</p><ul><li><p><strong>Parallelism</strong>. Modern agents can fire several tool calls inside a single act step. That cuts wall-clock time on read-heavy work. It also causes conflicts when two parallel calls try to edit the same thing. We will come back to ways of handling that when we get to subagents (concept 17).</p></li></ul><ul><li><p><strong>Blocking vs non-blocking</strong>. Most agents run synchronously: conversation waits while a tool runs, then the result comes back as the observation. Some run asynchronously and fire off long-running jobs in the background. Async unlocks fan-out, at the cost of more complexity.</p></li></ul><div><hr></div><h2><strong>3. Agent state</strong></h2><p>&#8220;State&#8221; gets used in two senses.</p><p>One is <em>workflow progress</em>: which step the agent is on and what is left. <em>Agent loops</em> carry that sense across iterations (concept 17). This concept is the other sense: everything the agent knows at any moment.</p><p>It breaks into two halves with very different properties:</p><ul><li><p><strong>Context window</strong>: everything the model can see right now. Your latest message, the system prompt, the agent&#8217;s previous tool calls, and the results of those calls. It has a hard ceiling (the token cap) and a soft one (concept 9, context rot). When a session ends, the context window is gone.</p></li></ul><ul><li><p><strong>Everything outside it</strong>: what the model cannot see until it fetches it. Files on disk, database entries. Memory that survives across sessions (concept 14). Knowledge the agent only queries and never owns (concept 15). The model cannot reason over any of it directly, but the agent can pull pieces into context on demand.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CCPD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51b338b7-597e-47ea-9d60-14a83c24f615_1456x819.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CCPD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51b338b7-597e-47ea-9d60-14a83c24f615_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!CCPD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51b338b7-597e-47ea-9d60-14a83c24f615_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!CCPD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51b338b7-597e-47ea-9d60-14a83c24f615_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!CCPD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51b338b7-597e-47ea-9d60-14a83c24f615_1456x819.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CCPD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51b338b7-597e-47ea-9d60-14a83c24f615_1456x819.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/51b338b7-597e-47ea-9d60-14a83c24f615_1456x819.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:90304,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51b338b7-597e-47ea-9d60-14a83c24f615_1456x819.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!CCPD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51b338b7-597e-47ea-9d60-14a83c24f615_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!CCPD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51b338b7-597e-47ea-9d60-14a83c24f615_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!CCPD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51b338b7-597e-47ea-9d60-14a83c24f615_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!CCPD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F51b338b7-597e-47ea-9d60-14a83c24f615_1456x819.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>So, where should your state actually live?</p><p>Files are usually the right default. They are diffable, versionable, and easy for both you and the agent to edit. Memory works well for facts that survive across sessions but do not need git history. Databases earn their place when the state needs to be queried by structure or shared across processes.</p><p>Multiple agents make the state harder.</p><p>Two agents reading the same file is fine. Two agents writing to it is the canonical race condition. Git worktrees (concept 16) give each agent its own working copy.</p><p>Subagents are friendlier: each starts with a fresh context window, and the parent passes in only what it needs. If the parent has to pass more than a few paragraphs, the split between the two is probably wrong.</p><div><hr></div><h2><strong>4. Common agent patterns</strong></h2><p>Once you have multiple agents to work with, the question is how to compose them.</p><p>There are a handful of useful patterns to know:</p><p>The simplest is <strong>planner/executor</strong>.</p><p>One agent plans, another executes. The split keeps each agent in a context shape that suits it: open-ended thinking on one side, tight execution on the other. Useful for long tasks where you want planning quality separate from how the implementation goes.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3Gir!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4f231b-01c1-4de8-b5bc-4a0dde689cb1_1456x540.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3Gir!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4f231b-01c1-4de8-b5bc-4a0dde689cb1_1456x540.png 424w, https://substackcdn.com/image/fetch/$s_!3Gir!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4f231b-01c1-4de8-b5bc-4a0dde689cb1_1456x540.png 848w, https://substackcdn.com/image/fetch/$s_!3Gir!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4f231b-01c1-4de8-b5bc-4a0dde689cb1_1456x540.png 1272w, https://substackcdn.com/image/fetch/$s_!3Gir!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4f231b-01c1-4de8-b5bc-4a0dde689cb1_1456x540.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3Gir!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4f231b-01c1-4de8-b5bc-4a0dde689cb1_1456x540.png" width="1456" height="540" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1b4f231b-01c1-4de8-b5bc-4a0dde689cb1_1456x540.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:540,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:45108,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4f231b-01c1-4de8-b5bc-4a0dde689cb1_1456x540.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!3Gir!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4f231b-01c1-4de8-b5bc-4a0dde689cb1_1456x540.png 424w, https://substackcdn.com/image/fetch/$s_!3Gir!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4f231b-01c1-4de8-b5bc-4a0dde689cb1_1456x540.png 848w, https://substackcdn.com/image/fetch/$s_!3Gir!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4f231b-01c1-4de8-b5bc-4a0dde689cb1_1456x540.png 1272w, https://substackcdn.com/image/fetch/$s_!3Gir!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b4f231b-01c1-4de8-b5bc-4a0dde689cb1_1456x540.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Router/specialist</strong> sits one level above.</p><p>A router agent takes the incoming request and dispatches it to one of several specialists. Each specialist has a tighter system prompt and a smaller toolset: a security reviewer, a debug specialist, a docs writer, a test author. Cheaper, because most calls hit a smaller model. Easier to reason about, because each specialist&#8217;s behavior is bounded.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!vZJf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb90d84ea-5536-4f55-8cd0-f0137392f3af_1456x540.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vZJf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb90d84ea-5536-4f55-8cd0-f0137392f3af_1456x540.png 424w, https://substackcdn.com/image/fetch/$s_!vZJf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb90d84ea-5536-4f55-8cd0-f0137392f3af_1456x540.png 848w, https://substackcdn.com/image/fetch/$s_!vZJf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb90d84ea-5536-4f55-8cd0-f0137392f3af_1456x540.png 1272w, https://substackcdn.com/image/fetch/$s_!vZJf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb90d84ea-5536-4f55-8cd0-f0137392f3af_1456x540.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vZJf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb90d84ea-5536-4f55-8cd0-f0137392f3af_1456x540.png" width="1456" height="540" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b90d84ea-5536-4f55-8cd0-f0137392f3af_1456x540.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:540,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:55420,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb90d84ea-5536-4f55-8cd0-f0137392f3af_1456x540.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!vZJf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb90d84ea-5536-4f55-8cd0-f0137392f3af_1456x540.png 424w, https://substackcdn.com/image/fetch/$s_!vZJf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb90d84ea-5536-4f55-8cd0-f0137392f3af_1456x540.png 848w, https://substackcdn.com/image/fetch/$s_!vZJf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb90d84ea-5536-4f55-8cd0-f0137392f3af_1456x540.png 1272w, https://substackcdn.com/image/fetch/$s_!vZJf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb90d84ea-5536-4f55-8cd0-f0137392f3af_1456x540.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Map-reduce parallelism</strong> is the workhorse for read-heavy fan-out.</p><p>Send a single task out across many subagents and merge their results. <em>&#8220;Review this pull request&#8221; </em>splits into one subagent per file, and the results merge into a single summary. Cost is bounded by the longest individual subagent. Quality is bounded by how well the aggregator merges.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1xKb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67495903-3327-40bd-b302-17b451cd2de3_1456x540.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1xKb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67495903-3327-40bd-b302-17b451cd2de3_1456x540.png 424w, https://substackcdn.com/image/fetch/$s_!1xKb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67495903-3327-40bd-b302-17b451cd2de3_1456x540.png 848w, https://substackcdn.com/image/fetch/$s_!1xKb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67495903-3327-40bd-b302-17b451cd2de3_1456x540.png 1272w, https://substackcdn.com/image/fetch/$s_!1xKb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67495903-3327-40bd-b302-17b451cd2de3_1456x540.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1xKb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67495903-3327-40bd-b302-17b451cd2de3_1456x540.png" width="1456" height="540" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/67495903-3327-40bd-b302-17b451cd2de3_1456x540.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:540,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:56436,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67495903-3327-40bd-b302-17b451cd2de3_1456x540.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!1xKb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67495903-3327-40bd-b302-17b451cd2de3_1456x540.png 424w, https://substackcdn.com/image/fetch/$s_!1xKb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67495903-3327-40bd-b302-17b451cd2de3_1456x540.png 848w, https://substackcdn.com/image/fetch/$s_!1xKb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67495903-3327-40bd-b302-17b451cd2de3_1456x540.png 1272w, https://substackcdn.com/image/fetch/$s_!1xKb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F67495903-3327-40bd-b302-17b451cd2de3_1456x540.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>These patterns are not exclusive.</p><p>Real workflows combine them: a planner spawns a router, the router fans out work map-reduce style, and the merged result comes back for review.</p><p>Every pattern relies on handoffs between agents.</p><p>Each handoff carries a compressed summary, so the next agent does not start from scratch. That is what makes the patterns useful: they define where one agent&#8217;s job ends and the next one&#8217;s begins. Those seams are where work tends to break.</p><p>That&#8217;s the foundation done.</p><p>Next come the four practical layers, starting with how you shape the agent&#8217;s behavior before it touches any code.</p><div><hr></div><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/agentic-engineering?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption"><em>Get 1+ referral &amp; I&#8217;ll send you my Leetcode Master Template!</em></p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/agentic-engineering?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/agentic-engineering?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><div><hr></div><h1><strong>Configuration Layer</strong></h1><p>Let&#8217;s dive in!</p><h2><strong>5. Agent config files</strong></h2><p>Every agent starts with a system prompt.</p><p>The harness builder bakes in a block of instructions that covers tool use and the harness&#8217;s own conventions. The system prompt does not know anything about your project.</p><p>Agent config files are the layer above.</p><p>The agent loads a project-level Markdown file at the start of every session, and the file remains in the context window for each subsequent step. The file tells the agent your standards, limits, conventions, and behavioral rules.</p><p>Claude Code calls this file <code>CLAUDE.md</code>.</p><p>Most other tools have settled on <code>AGENTS.md</code>. A bit like Apple and USB-C: the industry wants a standard, but not everyone follows it.</p><p>It matters because agents default to whatever looked most plausible in their training data. Without a config file, you get <code>pip install</code> when your project uses <code>uv</code>, <code>black</code> when you use <code>ruff</code>, and defensive sludge wrapped around every change.</p><p>With one, the agent reads a set of hard rules before it writes a line of code.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OUZA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0607fbd1-0cf1-43b9-a5c8-b8eff7f8b445_1456x819.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OUZA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0607fbd1-0cf1-43b9-a5c8-b8eff7f8b445_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!OUZA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0607fbd1-0cf1-43b9-a5c8-b8eff7f8b445_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!OUZA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0607fbd1-0cf1-43b9-a5c8-b8eff7f8b445_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!OUZA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0607fbd1-0cf1-43b9-a5c8-b8eff7f8b445_1456x819.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OUZA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0607fbd1-0cf1-43b9-a5c8-b8eff7f8b445_1456x819.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0607fbd1-0cf1-43b9-a5c8-b8eff7f8b445_1456x819.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:87960,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0607fbd1-0cf1-43b9-a5c8-b8eff7f8b445_1456x819.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!OUZA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0607fbd1-0cf1-43b9-a5c8-b8eff7f8b445_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!OUZA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0607fbd1-0cf1-43b9-a5c8-b8eff7f8b445_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!OUZA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0607fbd1-0cf1-43b9-a5c8-b8eff7f8b445_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!OUZA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0607fbd1-0cf1-43b9-a5c8-b8eff7f8b445_1456x819.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A useful config is short and specific:</p><ul><li><p>Hard limits on function length</p></li><li><p>The package manager and tooling stack you actually use</p></li><li><p>A few behavioral rules like &#8220;never commit secrets&#8221; or &#8220;always read a file before editing it.&#8221;</p></li></ul><p>Anything generic or AI-generated dilutes the file and makes the rest harder for the model to attend to.</p><p>Keep it under 100 lines. Cut anything that is not consistently improving outcomes. Treat it the way you would treat a <code>Makefile</code>: as code, not documentation, reviewed when it changes.</p><div><hr></div><h2><strong>6. Reusable workflow files</strong></h2><p>If config files are always on, reusable workflow files are on demand.</p><p>They are still just Markdown, but with <code>YAML</code> frontmatter that controls when the agent loads them. Examples are Claude Code skills (in <code>.claude/skills/</code>) and Cursor rules.</p><p>The frontmatter<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a> does most of the work. A <code>name</code> and <code>description</code> tell the agent when the skill is relevant. An optional <code>globs</code> field narrows it further by file type or path pattern. Whether the skill actually helps depends on the quality of the instructions inside it.</p><p>Researchers built <a href="https://arxiv.org/abs/2602.12670">SkillsBench</a>, a benchmark of 86 tasks across 11 domains, and provided models with brief written workflows for approaching each task.</p><p>Claude Haiku scored 27.7% with human-curated skills. That beat the 22.0% Opus scored without them. The cheapest model with good instructions outperformed the flagship without.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_2Qa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf4b6814-229e-4b05-9c42-4ce2564d4ec8_1456x819.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_2Qa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf4b6814-229e-4b05-9c42-4ce2564d4ec8_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!_2Qa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf4b6814-229e-4b05-9c42-4ce2564d4ec8_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!_2Qa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf4b6814-229e-4b05-9c42-4ce2564d4ec8_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!_2Qa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf4b6814-229e-4b05-9c42-4ce2564d4ec8_1456x819.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_2Qa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf4b6814-229e-4b05-9c42-4ce2564d4ec8_1456x819.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cf4b6814-229e-4b05-9c42-4ce2564d4ec8_1456x819.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:66418,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf4b6814-229e-4b05-9c42-4ce2564d4ec8_1456x819.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!_2Qa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf4b6814-229e-4b05-9c42-4ce2564d4ec8_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!_2Qa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf4b6814-229e-4b05-9c42-4ce2564d4ec8_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!_2Qa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf4b6814-229e-4b05-9c42-4ce2564d4ec8_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!_2Qa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcf4b6814-229e-4b05-9c42-4ce2564d4ec8_1456x819.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>There is a second lesson in the data.</p><p>When the researchers let the model write its own skills, the gains disappeared. Given everything we know about context rot, that should surprise no one. Generic AI-generated boilerplate makes things worse, not better.</p><p>The rough division of labor is simple: <strong>config files</strong> for always-relevant project rules, <strong>skills</strong> for reusable task-specific procedures.</p><p>The live prompt for what is unique about the current task.</p><div><hr></div><h2><strong>7. Workflow frameworks</strong></h2><p>If you are using an agent for coding, a framework on top helps.</p><p>The agent follows a documented process for planning, test-driven development (<strong>TDD</strong>), debugging, and code review. No more falling back on whatever it remembers from training. The mechanism is a chain of skills, hooks, and slash commands<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a> wired together into a repeatable process.</p><p><em>Here are a few options worth knowing:</em></p><ul><li><p><a href="https://github.com/obra/superpowers">Superpowers</a> ships a curated library of skills for common workflows: brainstorming, TDD, debugging, and code review. It also adds <code>HARD-GATE </code>directives and anti-rationalization tables. These push the agent to use the skills rather than skip them.</p></li></ul><ul><li><p><a href="https://github.com/gsd-build/get-shit-done">Get Shit Done</a> does something similar, but through slash commands, hooks, and meta-prompting instead of skills.</p></li></ul><ul><li><p><a href="https://github.com/EveryInc/compound-engineering-plugin">Compound Engineering</a> splits work into Plan, Work, Review, and Compound phases. The last phase captures patterns and solutions into a searchable knowledge base, so each feature makes the next one easier.</p></li></ul><p>They differ in shape but share a thread: get the agent to understand what it is building, tell it how to go to work, and check the result against what you actually wanted.</p><div><hr></div><h2><strong>8. Prompt caching</strong></h2><p>Prompt caching stores the <em>stable prefix</em> of the conversation so the model does not pay the full price to re-read it every turn.</p><p>Most agentic tools handle this in the background, but it is worth understanding because it changes the economics of long config files.</p><p>The mechanism is the same across providers:</p><p>The first call sends the full prefix, including the config file and any reusable workflows the agent has loaded, and pays a small premium to write that prefix into the cache. Later turns re-read it at a steep discount. Latency improves, too, because the model does not reprocess the same tokens.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tDKV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7171e07-34bd-4ab9-9991-25f0e8ffd942_1456x819.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tDKV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7171e07-34bd-4ab9-9991-25f0e8ffd942_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!tDKV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7171e07-34bd-4ab9-9991-25f0e8ffd942_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!tDKV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7171e07-34bd-4ab9-9991-25f0e8ffd942_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!tDKV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7171e07-34bd-4ab9-9991-25f0e8ffd942_1456x819.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tDKV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7171e07-34bd-4ab9-9991-25f0e8ffd942_1456x819.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f7171e07-34bd-4ab9-9991-25f0e8ffd942_1456x819.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:123959,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7171e07-34bd-4ab9-9991-25f0e8ffd942_1456x819.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!tDKV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7171e07-34bd-4ab9-9991-25f0e8ffd942_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!tDKV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7171e07-34bd-4ab9-9991-25f0e8ffd942_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!tDKV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7171e07-34bd-4ab9-9991-25f0e8ffd942_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!tDKV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff7171e07-34bd-4ab9-9991-25f0e8ffd942_1456x819.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The catch is the cache time to live (<strong>TTL</strong>).</p><p>Caches expire after a period of inactivity, somewhere between a few minutes and an hour, depending on the provider. An active session keeps the cache warm. A long pause (coffee, Slack, a spec to read) lets it expire and forces a rewrite on the next call.</p><p>If your tooling lets you configure the TTL, longer windows cost more to write but stay warm through bigger gaps in activity. The choice depends on how active you expect to be. Longer TTL when you will keep coming back. Shorter TTL when you might not.</p><p>Without prompt caching, you would think carefully about the size of your config file. With it, the cost is closer to a rounding error.</p><div><hr></div><h2><strong>9. Context rot</strong></h2><p>Model performance drops as the context window fills up.</p><p>Prompt caching saves your wallet, but those tokens still sit there, and the model has to look past each one to get to what you want it to focus on.</p><p><em>Even the latest models show this:</em></p><ul><li><p>Drop a few specific facts into a long document and ask a model to find them. <a href="https://llm-stats.com/blog/research/gpt-5-5-vs-gpt-5-4">GPT-5.5</a> scores 98.1% on short documents and 74.0% on documents stretching to a million tokens.</p></li><li><p><a href="https://platform.claude.com/docs/en/about-claude/models/whats-new-claude-4-7">Claude Opus 4.7</a> drops from 59.2% at 256K to 32.2% at 1M.</p></li></ul><p>A <a href="https://arxiv.org/abs/2602.11988">recent study</a> confirmed the same effect for instruction quality. Stuffing the system prompt with generic AI-generated boilerplate produced worse results than having no file at all.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yGjy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5004b923-978f-4757-bf36-5b871fa94525_1456x819.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yGjy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5004b923-978f-4757-bf36-5b871fa94525_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!yGjy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5004b923-978f-4757-bf36-5b871fa94525_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!yGjy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5004b923-978f-4757-bf36-5b871fa94525_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!yGjy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5004b923-978f-4757-bf36-5b871fa94525_1456x819.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yGjy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5004b923-978f-4757-bf36-5b871fa94525_1456x819.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5004b923-978f-4757-bf36-5b871fa94525_1456x819.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:112864,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5004b923-978f-4757-bf36-5b871fa94525_1456x819.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!yGjy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5004b923-978f-4757-bf36-5b871fa94525_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!yGjy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5004b923-978f-4757-bf36-5b871fa94525_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!yGjy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5004b923-978f-4757-bf36-5b871fa94525_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!yGjy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5004b923-978f-4757-bf36-5b871fa94525_1456x819.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Transformers<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a> work by having every token attend to every other token in the context. Each token&#8217;s &#8220;attention&#8221; is a weighted distribution across the rest, with the weights summing to one.</p><p>Double the context, and each token&#8217;s share of that weight roughly halves. The model splits its finite attention budget across more material. The relevant signal gets diluted by everything around it.</p><p>There is a training distribution effect on top of that.</p><p>Most of what these models learned from is short. Behavior in very long contexts is partly extrapolation. Retrieval drops the further you push from the lengths the model trained on most.</p><p>The takeaway runs through every other concept in this layer.</p><p>Config files, skills, MCPs, even memory: every token competes with everything else for the model&#8217;s attention. Keep the things you need lean. Cut anything that is not pulling its weight.</p><p>That covers configuration. Now we look at what the agent can actually reach for once it starts running.</p><div><hr></div><div class="callout-block" data-callout="true"><h2><a href="https://www.apodex.ai/">AI research is easy&#8212;verification is hard (Partner)</a></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://www.apodex.ai/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jz52!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8885c86d-3003-4955-9c1a-a17e89abdcdb_1280x640.png 424w, https://substackcdn.com/image/fetch/$s_!jz52!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8885c86d-3003-4955-9c1a-a17e89abdcdb_1280x640.png 848w, https://substackcdn.com/image/fetch/$s_!jz52!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8885c86d-3003-4955-9c1a-a17e89abdcdb_1280x640.png 1272w, https://substackcdn.com/image/fetch/$s_!jz52!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8885c86d-3003-4955-9c1a-a17e89abdcdb_1280x640.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jz52!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8885c86d-3003-4955-9c1a-a17e89abdcdb_1280x640.png" width="1280" height="640" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8885c86d-3003-4955-9c1a-a17e89abdcdb_1280x640.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:640,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.apodex.ai/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!jz52!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8885c86d-3003-4955-9c1a-a17e89abdcdb_1280x640.png 424w, https://substackcdn.com/image/fetch/$s_!jz52!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8885c86d-3003-4955-9c1a-a17e89abdcdb_1280x640.png 848w, https://substackcdn.com/image/fetch/$s_!jz52!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8885c86d-3003-4955-9c1a-a17e89abdcdb_1280x640.png 1272w, https://substackcdn.com/image/fetch/$s_!jz52!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8885c86d-3003-4955-9c1a-a17e89abdcdb_1280x640.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><span>Most AI research agents can find information.</span></p><p><span>The harder problem is correctness &#8212; whether an answer is actually right, not just well-formed.</span></p><p><span>Many systems reason, search, and verify within the same context window. When they make mistakes, they often review their own work using the same signals that produced the error. This creates a subtle failure mode: outputs can look consistent, pass internal checks, and still be wrong.</span></p><p><a href="https://www.apodex.ai/"><span>Apodex</span></a><span> refers to this as </span><em><span>pseudo-correctness</span></em><span> &#8212; answers that appear valid under the model&#8217;s own evaluation, but do not actually solve the underlying problem.</span></p><p><span>Apodex is built differently.</span></p><p><span>As a </span><strong><span>Self-Evolving Heavy-Duty Solver</span></strong><span>, it separates generation from verification. Specialist agents build solutions from evidence, while independent verifier agents audit the result before it is finalized.</span></p><p><span>Instead of asking whether an answer &#8220;looks correct,&#8221; Apodex evaluates whether it </span><em><span>actually holds</span></em><span>. Verification is structured across three axes:</span></p><ul><li><p><strong><span>Comprehension</span></strong><span> &#8212; did it capture the real problem?</span></p></li><li><p><strong><span>Causality</span></strong><span> &#8212; does it address the true cause?</span></p></li><li><p><strong><span>Empirical grounding</span></strong><span> &#8212; is it validated through execution?</span></p></li></ul><p><span>This shifts verification from self-review to independent audit, reducing pseudo-correctness at the system level.</span></p><p><span>On LiveCodeBench v6, the heavy-duty configuration improves a 397B model from 82.0 to 85.1 under identical parameters, driven primarily by the verifier layer. It also achieves 79.0 on SWE-bench Verified and 58.4 on Terminal-Bench v2.</span></p><p><span>The Apodex 1.0 release includes Apodex-1.0-H, Apodex-mini, AgentOS, and open-weight models at 0.8B, 2B, and 4B.</span></p><p>See how verified AI research works:</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://www.apodex.ai&quot;,&quot;text&quot;:&quot;Try Apodex for free (early access)&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://www.apodex.ai"><span>Try Apodex for free (early access)</span></a></p><p>For developers who want to dive deeper:</p><ul><li><p><a href="https://github.com/ApodexAI/AgentHarness"><span data-color="rgb(54, 55, 55)" style="color: rgb(54, 55, 55);">GitHub</span></a></p></li><li><p><a href="https://huggingface.co/collections/apodex/apodex-1">Hugging Face</a></p></li><li><p><a href="https://platform.apodex.ai/"><span data-color="rgb(54, 55, 55)" style="color: rgb(54, 55, 55);">API Platform</span></a></p></li><li><p><a href="https://discord.gg/TDJA59TCng"><span data-color="rgb(54, 55, 55)" style="color: rgb(54, 55, 55);">Discord Community</span></a></p></li></ul></div><div><hr></div><h1><strong>Capability Layer</strong></h1><p>Let&#8217;s keep going!</p><h2><strong>10. Model Context Protocol (MCP)</strong></h2><p>MCP is a standard for giving agents access to external tools and services.</p><p>Originally an Anthropic spec, now broadly adopted across the ecosystem. Here&#8217;s the basic idea: <em>a tool exposes itself through a protocol the agent already understands, so you stop hand-rolling glue code per tool and per agent.</em></p><p>Yet MCP gets a lot of heat.</p><p>The basic criticism is that it is redundant and slurps context. Why add a new protocol when agents can already use command-line interfaces (CLIs), scripts, and direct API calls?</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WA_q!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fade130e1-9212-4a96-b7d6-76273b527a29_1456x819.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WA_q!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fade130e1-9212-4a96-b7d6-76273b527a29_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!WA_q!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fade130e1-9212-4a96-b7d6-76273b527a29_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!WA_q!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fade130e1-9212-4a96-b7d6-76273b527a29_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!WA_q!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fade130e1-9212-4a96-b7d6-76273b527a29_1456x819.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WA_q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fade130e1-9212-4a96-b7d6-76273b527a29_1456x819.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ade130e1-9212-4a96-b7d6-76273b527a29_1456x819.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:83803,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fade130e1-9212-4a96-b7d6-76273b527a29_1456x819.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!WA_q!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fade130e1-9212-4a96-b7d6-76273b527a29_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!WA_q!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fade130e1-9212-4a96-b7d6-76273b527a29_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!WA_q!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fade130e1-9212-4a96-b7d6-76273b527a29_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!WA_q!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fade130e1-9212-4a96-b7d6-76273b527a29_1456x819.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A fully loaded MCP is expensive.</p><p>By 2026, deferred tool loading is the norm. The agent starts with a list of tool names and descriptions. The full schema only loads when the agent decides to use a tool. With deferred loading, a stack like GitHub + Exa + Context7 + DeepWiki costs about 607 tokens before any tools are used. The fully loaded version costs around 5,500. A few plain skills calling CLIs directly cost about 300.</p><p>So MCPs are still heavier than the leanest alternative.</p><p>But they solve real problems: <em>standardization, auth, permissions, organizational distribution</em>. And they are getting leaner. Whether MCP itself is the protocol that wins is a separate question.</p><div><hr></div><h2><strong>11. Live document retrieval</strong></h2><p>Models have knowledge cutoffs.</p><p>When the agent does not know an API signature, it usually does not say so. It guesses... confidently. And because the guess looks plausible, you only catch the mistake at runtime.</p><p><a href="https://context7.com/">Context7</a> pulls live library docs into the agent&#8217;s context.</p><p>The agent gets current documentation and working examples. Not whatever version was in the training data. This wipes out an entire class of bugs where it confidently calls functions that have been renamed, moved, or deprecated.</p><p><a href="https://deepwiki.com/">DeepWiki</a> goes one level out.</p><p>It generates AI-powered docs for GitHub repositories. Point it at an unfamiliar codebase and ask, <em>&#8220;How does the authentication flow work?</em>&#8221; and you get an answer grounded in the actual repo instead of generic vibes.</p><p>The pattern is the same: separate &#8220;knowing how to code&#8221; from &#8220;knowing the current state of the world.&#8221; Prompting helps with the first. Live data solves the second.</p><div><hr></div><h2><strong>12. AI-native web search</strong></h2><p>AI-native search engines are built for agents to consume.</p><p>Existing web search returns HTML pages designed for humans. The agent has to chew through ads, navigation, and unrelated content to find what matters. AI-native search returns the bits directly.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!eNhv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff91b89f4-ba0e-4984-a71b-fef0cf520d29_1456x819.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eNhv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff91b89f4-ba0e-4984-a71b-fef0cf520d29_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!eNhv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff91b89f4-ba0e-4984-a71b-fef0cf520d29_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!eNhv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff91b89f4-ba0e-4984-a71b-fef0cf520d29_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!eNhv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff91b89f4-ba0e-4984-a71b-fef0cf520d29_1456x819.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!eNhv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff91b89f4-ba0e-4984-a71b-fef0cf520d29_1456x819.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f91b89f4-ba0e-4984-a71b-fef0cf520d29_1456x819.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:114423,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff91b89f4-ba0e-4984-a71b-fef0cf520d29_1456x819.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!eNhv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff91b89f4-ba0e-4984-a71b-fef0cf520d29_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!eNhv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff91b89f4-ba0e-4984-a71b-fef0cf520d29_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!eNhv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff91b89f4-ba0e-4984-a71b-fef0cf520d29_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!eNhv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff91b89f4-ba0e-4984-a71b-fef0cf520d29_1456x819.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><a href="https://exa.ai/">Exa</a> is what I reach for.</p><p>It returns structured search results, extracted content, highlights, and summaries. I use it to find docs, discussions, and real-world examples the model would not have from training data alone.</p><p>Token efficiency makes a real difference when you use it in automated workflows. The agent gets answers without burning context on a parsing tax it should not have to pay.</p><div><hr></div><h2><strong>13. Visual output generation</strong></h2><p>Skills and MCPs can turn the agent into a specialist in output formats other than application code: <em>design files, presentations, architecture diagrams, and videos.</em></p><p><a href="https://www.figma.com/blog/introducing-claude-code-to-figma/">Figma&#8217;s MCP server</a> lets the agent read design data directly: layout, components, variables, and spacing. Instead of describing a user interface (UI) in words or pasting screenshots, you point the agent at a frame, and it generates code from the actual design spec. It works in both directions, so the agent can also push back to the Figma canvas.</p><p><a href="https://github.com/zarazhangrui/frontend-slides">Frontend-slides</a> is a Claude Code skill that generates complete HTML presentations from a prompt. It produces a single, self-contained file with inline CSS and JavaScript that runs in the browser. All the diagrams in this newsletter came from one-shots with this skill.</p><p><a href="http://draw.io/">draw.io</a> takes the same approach for architecture diagrams. The <code>.drawio</code> file format is plain <code>mxGraph</code> XML, so anything that can produce structured XML can produce a diagram. Point the agent at a Terraform repository with a <code>draw.io skill</code> or MCP loaded. The agent walks the resource graph. It writes a matching <code>.drawio</code> file next to the code that defines the infrastructure. Wire the regeneration into continuous integration (<strong>CI</strong>). Your architecture diagrams stop drifting from your actual stack.</p><p><a href="https://skills.sh/remotion-dev/skills/remotion-best-practices">Remotion best practices</a> does the same for video. Where frontend-slides produces a file you open in a browser, Remotion produces a file you render into a video.</p><p>The pattern that ties them together is simple: a skill or MCP that knows how to write code for a specific visual format. The agent is already great at writing code. This just teaches what kind.</p><div><hr></div><h2><strong>14. Persistent memory</strong></h2><p>Every agent session starts fresh.</p><p>The decisions you walked through yesterday, the context you built up: <em>gone</em>. You start every morning by re-explaining your project from scratch.</p><p>Persistent memory closes that gap.</p><p>The simplest version is <code>MEMORY.md</code>, a flat Markdown file in your project directory. The agent reads it at the start of every session. It can write back to it during one. The file holds conventions, architectural decisions, session summaries, and working context. The bits you do not want to keep retyping.</p><p>The limitation is how it scales.</p><p><code>MEMORY.md</code> sits in the system prompt, just like the config file, so the same token cost and context pressure apply. Once it grows past a certain size, it gradually turns into a wall of text the model skims past.</p><p>That is where plugins like <a href="https://github.com/obra/episodic-memory">episodic-memory</a> come in.</p><p>It indexes your past conversation files, embeds them as vectors<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a>, and exposes MCP tools to semantically search across them. Documentation usually captures what you decided. Session history often captures why: <em>options you considered, dead ends you ruled out, trade-offs that led to the final call.</em></p><p>Start with a flat memory file.</p><p>Reach for a searchable layer when <code>grep</code> stops being enough.</p><div><hr></div><h2><strong>15. Knowledge search</strong></h2><p>Plenty of useful context never lived in your AI coding session to begin with.</p><p>Meeting notes, design docs, specs, technical writeups. All of this still matters, and none of it shows up in your conversation history.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-lfq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F121a44b6-0adb-46e0-92e3-1419eea69289_1456x819.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-lfq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F121a44b6-0adb-46e0-92e3-1419eea69289_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!-lfq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F121a44b6-0adb-46e0-92e3-1419eea69289_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!-lfq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F121a44b6-0adb-46e0-92e3-1419eea69289_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!-lfq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F121a44b6-0adb-46e0-92e3-1419eea69289_1456x819.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-lfq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F121a44b6-0adb-46e0-92e3-1419eea69289_1456x819.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/121a44b6-0adb-46e0-92e3-1419eea69289_1456x819.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:91582,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F121a44b6-0adb-46e0-92e3-1419eea69289_1456x819.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!-lfq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F121a44b6-0adb-46e0-92e3-1419eea69289_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!-lfq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F121a44b6-0adb-46e0-92e3-1419eea69289_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!-lfq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F121a44b6-0adb-46e0-92e3-1419eea69289_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!-lfq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F121a44b6-0adb-46e0-92e3-1419eea69289_1456x819.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><a href="https://github.com/tobi/qmd">QMD</a> (built by Shopify CEO Tobi Lutke) is the tool I reach for here.</p><p>It is an on-device search engine for your broader knowledge base, exposed to the agent through an MCP server. The agent queries it during a session, just as it queries Exa or Context7.</p><p>Persistent memory holds what the agent learns over time. Knowledge search covers materials the agent never helped produce.</p><p>A single agent with the right configuration and tools can already do a lot. But once you have more than one running at the same time, you need a way to coordinate them.</p><div><hr></div><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/agentic-engineering?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption"><em>Get 2+ referrals &amp; I&#8217;ll send you my Interview Mistakes to Avoid PDF!</em></p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/agentic-engineering?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/agentic-engineering?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><div><hr></div><h1><strong>Orchestration Layer</strong></h1><p>Let&#8217;s dive in!</p><h2><strong>16. Subagents</strong></h2><p>Subagents are delegated workers with a bounded scope.</p><p>Each subagent gets its own prompt, a limited toolset, and a clean context window. When it finishes, only the compressed result returns to the parent. Not the full reasoning chain or the intermediate steps, instead only the final answer.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Qw9I!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fb0b6ea-8307-41bf-9fe5-299ea9a40adc_1456x819.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Qw9I!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fb0b6ea-8307-41bf-9fe5-299ea9a40adc_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!Qw9I!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fb0b6ea-8307-41bf-9fe5-299ea9a40adc_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!Qw9I!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fb0b6ea-8307-41bf-9fe5-299ea9a40adc_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!Qw9I!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fb0b6ea-8307-41bf-9fe5-299ea9a40adc_1456x819.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Qw9I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fb0b6ea-8307-41bf-9fe5-299ea9a40adc_1456x819.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9fb0b6ea-8307-41bf-9fe5-299ea9a40adc_1456x819.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:105978,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fb0b6ea-8307-41bf-9fe5-299ea9a40adc_1456x819.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!Qw9I!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fb0b6ea-8307-41bf-9fe5-299ea9a40adc_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!Qw9I!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fb0b6ea-8307-41bf-9fe5-299ea9a40adc_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!Qw9I!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fb0b6ea-8307-41bf-9fe5-299ea9a40adc_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!Qw9I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9fb0b6ea-8307-41bf-9fe5-299ea9a40adc_1456x819.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The obvious benefit is parallelism.</p><p>The bigger benefit is compression. Test output, long docs, random side quests: <em>all of that stays in the subagent&#8217;s context. </em>The main thread stays clean enough to actually think.</p><p>You define a subagent as a Markdown file with YAML frontmatter:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;yaml&quot;,&quot;nodeId&quot;:&quot;2b88410e-c1bb-49a7-9d2d-eea6cdf0da24&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-yaml">name: security-reviewer
description: Reviews code for security vulnerabilities
tools: Read, Grep, Glob, Bash
model: sonnet</code></pre></div><ul><li><p><code>description</code> is the routing signal that tells the parent when to reach for the subagent.</p></li><li><p><code>tools</code> field controls what it can access.</p></li><li><p><code>model</code> field lets you run cheap work on a cheaper model.</p></li></ul><p>When many subagents run on the same repo in parallel, their writes can collide.</p><p>Git worktrees solve this.</p><p>A worktree is a separate checkout that shares the <code>.git </code>directory but has its own working tree and branch. Two agents work on the same codebase at the same time without touching each other&#8217;s files.</p><p>Claude Code supports this natively, setting <code>isolation: &#8220;worktree&#8221;</code> in a subagent definition runs it in an isolated checkout automatically.</p><div><hr></div><h2><strong>17. Agent loops</strong></h2><p>An agent loop re-runs a single agent with fresh context each iteration, tracking progress in files and git.</p><p>The <a href="https://github.com/snarktank/ralph">Ralph loop</a> showed how powerful this is when it went viral early last year. Agents worked for hours without the output getting worse. The context window never filled up with stale reasoning and dead ends.</p><p>It uses the same compression principle as subagents. Keep the live context small. And push the state out to the file system. Then restart with a clean slate. The difference is subagents do this once per delegation. While Agent loops do it every iteration.</p><p>It works especially well for grindy, well-bounded work:</p><ul><li><p>Migrating a large codebase one file at a time.</p></li><li><p>Processing a queue of items.</p></li><li><p>Refactoring across many call sites.</p></li></ul><p>The model focuses on each step without dragging the previous nine into the prompt.</p><p>Claude Code ships this pattern as <a href="https://code.claude.com/docs/en/goal">/goal</a>.</p><p>You set a completion condition, like &#8220;all tests in <code>test/auth</code> pass and the lint step is clean&#8221;. Claude then keeps working across turns. After each turn, a small evaluator model checks whether the condition holds.</p><p>The loop stops when it does.</p><div><hr></div><h3><strong>18. Orchestration tools</strong></h3><p>Once you are running many agents in parallel, you need a layer above them.</p><p>Spawning agents is easy, but coordinating them is hard. They duplicate work, lose track of progress, and come back with five incompatible versions of reality.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!isjy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6dc95f87-9a0e-4f61-aece-c380de2d83ba_1456x819.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!isjy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6dc95f87-9a0e-4f61-aece-c380de2d83ba_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!isjy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6dc95f87-9a0e-4f61-aece-c380de2d83ba_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!isjy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6dc95f87-9a0e-4f61-aece-c380de2d83ba_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!isjy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6dc95f87-9a0e-4f61-aece-c380de2d83ba_1456x819.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!isjy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6dc95f87-9a0e-4f61-aece-c380de2d83ba_1456x819.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6dc95f87-9a0e-4f61-aece-c380de2d83ba_1456x819.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:120681,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6dc95f87-9a0e-4f61-aece-c380de2d83ba_1456x819.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!isjy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6dc95f87-9a0e-4f61-aece-c380de2d83ba_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!isjy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6dc95f87-9a0e-4f61-aece-c380de2d83ba_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!isjy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6dc95f87-9a0e-4f61-aece-c380de2d83ba_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!isjy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6dc95f87-9a0e-4f61-aece-c380de2d83ba_1456x819.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><a href="https://conductor.build/">Conductor</a> is built for exactly this.</p><p>It gives Claude Code and Codex a single UI for parallel sessions in isolated workspaces. A built-in diff viewer handles the merging. <a href="https://air.dev/">JetBrains Air</a> does the same inside the JetBrains ecosystem. It uses Docker containers or git worktrees per task.</p><p><a href="https://github.com/BloopAI/vibe-kanban">Vibe kanban</a> goes lighter: <em>a standalone app with its own server and a kanban UI for managing agent tasks. </em>You break work into cards, assign them to agents, and track progress visually.</p><p><a href="https://cline.bot/kanban">Cline Kanban</a> works across agents (Claude Code, Codex, Cline). It adds auto-commit and dependency-aware parallelization.</p><p><a href="https://github.com/paperclipai/paperclip">Paperclip</a> goes the furthest.</p><p>It markets itself as the orchestration layer for zero-human companies. There are org charts, task delegation, budget ceilings, and a governance layer where a human &#8220;board&#8221; approves high-impact decisions.</p><p>Probably overkill for solo developers, but a fascinating concept.</p><div><hr></div><h2><strong>19. Managed/cloud-hosted agents</strong></h2><p>Managed agents are long-running agent sessions on vendor infrastructure, accessed via API.</p><p>Anthropic provides the harness, sandbox, tool loop, and container<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-7" href="#footnote-7" target="_self">7</a>. You define the agent (model, prompt, tools, optionally MCP servers and skills). Your app sends user events and receives streamed tool calls and messages back over server-sent events (<strong>SSE</strong>).</p><p>A session is a long-running process on Anthropic&#8217;s infrastructure, not yours.</p><p>It can grind through hours of tool calls while your app just streams events. Subagents are supported. The coordinator runs them in parallel as isolated threads on the same container filesystem. i.e., no need to babysit a local Claude Code window.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bbmB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8c420b5-963c-4da1-84df-c510da37cc07_1456x819.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bbmB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8c420b5-963c-4da1-84df-c510da37cc07_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!bbmB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8c420b5-963c-4da1-84df-c510da37cc07_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!bbmB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8c420b5-963c-4da1-84df-c510da37cc07_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!bbmB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8c420b5-963c-4da1-84df-c510da37cc07_1456x819.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bbmB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8c420b5-963c-4da1-84df-c510da37cc07_1456x819.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e8c420b5-963c-4da1-84df-c510da37cc07_1456x819.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:86740,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8c420b5-963c-4da1-84df-c510da37cc07_1456x819.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!bbmB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8c420b5-963c-4da1-84df-c510da37cc07_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!bbmB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8c420b5-963c-4da1-84df-c510da37cc07_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!bbmB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8c420b5-963c-4da1-84df-c510da37cc07_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!bbmB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe8c420b5-963c-4da1-84df-c510da37cc07_1456x819.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The catch is billing.</p><p>Managed Agents go through pay-as-you-go API tokens<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-8" href="#footnote-8" target="_self">8</a>, not Claude Pro or Max plans. The plans are still significantly more price-efficient for personal use. Use Claude Code with worktrees for your own repo. And reach for Managed Agents when you are building a product that runs agents for other people.</p><p>Many agents running in parallel can move fast. They can also do serious damage if nothing stops them. The next layer is what stops them&#8230;</p><div><hr></div><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/agentic-engineering?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption"><em>Get 3+ referrals &amp; I&#8217;ll send you Popular Interview Questions PDF!</em></p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/agentic-engineering?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/agentic-engineering?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><div><hr></div><h1><strong>Guardrails layer</strong></h1><p>Let&#8217;s keep going!</p><h2><strong>20. Sandboxing</strong></h2><p>Sandboxing isolates what the agent can read, write, or reach over the network.</p><p>The other guardrails focus on not trusting what the agent sees. Sandboxing limits what happens when trust is misplaced.</p><p>Most modern agent harnesses ship with some form of built-in sandbox. On Linux, they typically lean on bubblewrap (<code>bwrap</code>); on macOS, Apple&#8217;s Sandbox framework.</p><p>The shape is similar across implementations. The agent can read the project directory and system libraries. It can write to the project directory and a sandboxed temp directory. It can only reach the network through an allowed list. Credential directories like <code>/.ssh</code>, <code>/.aws</code>, <code>~/.gnupg</code>, and <code>~/.docker</code> are blocked from reading.</p><p>The walls are there whether the agent agrees with them or not.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zvMR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a620175-4394-45d8-9a2a-e9d985cb0ce6_1456x819.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zvMR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a620175-4394-45d8-9a2a-e9d985cb0ce6_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!zvMR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a620175-4394-45d8-9a2a-e9d985cb0ce6_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!zvMR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a620175-4394-45d8-9a2a-e9d985cb0ce6_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!zvMR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a620175-4394-45d8-9a2a-e9d985cb0ce6_1456x819.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zvMR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a620175-4394-45d8-9a2a-e9d985cb0ce6_1456x819.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2a620175-4394-45d8-9a2a-e9d985cb0ce6_1456x819.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:88719,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a620175-4394-45d8-9a2a-e9d985cb0ce6_1456x819.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!zvMR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a620175-4394-45d8-9a2a-e9d985cb0ce6_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!zvMR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a620175-4394-45d8-9a2a-e9d985cb0ce6_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!zvMR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a620175-4394-45d8-9a2a-e9d985cb0ce6_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!zvMR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2a620175-4394-45d8-9a2a-e9d985cb0ce6_1456x819.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>If you want full isolation, running the agent inside a Docker container with <code>--network none</code> goes further.</p><p>No host filesystem beyond the mounted project; no credentials; no outbound connections. Overkill for some workflows, but for code review or analysis, it turns an entire class of worst-case scenarios into non-events.</p><p>For agent-generated code running at scale, <a href="https://blog.cloudflare.com/dynamic-workers/">Cloudflare&#8217;s Dynamic Workers</a> offer per-execution sandboxes. They start within milliseconds, block network access, and inject credentials on the server side.</p><p><strong>Prevents:</strong> blast radius from any other layer failing. A poisoned config file, a successful prompt injection, a permission-list bug: sandboxing is the wall that stops the consequences from leaving your project directory.</p><p><strong>Use when:</strong> always. The built-in sandbox in your harness is usually free. Reach for Docker or Dynamic Workers when the work is high volume, untrusted, or both.</p><div><hr></div><h2><strong>21. Permissions</strong></h2><p>Permissions are allow/deny lists for tool calls, file reads, and shell commands.</p><p>They are the baseline control for what the agent can do without having to ask each time.</p><p>Agents are not malicious. They are reward-hacky problem solvers:</p><ul><li><p>Hit them with a permission error, and they reach for <code>chmod 777</code><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-9" href="#footnote-9" target="_self">9</a>.</p></li><li><p>A dependency will not install cleanly, and they try <code>curl | sh</code><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-10" href="#footnote-10" target="_self">10</a>.</p></li><li><p>A test keeps failing, and they start commenting out assertions.</p></li><li><p>A git push gets blocked, and they try force-pushing to main.</p></li></ul><p>A typical setup uses two layers:</p><ul><li><p><strong>Project-level settings</strong> (committed to the repo) define what runs without prompting. Linting, testing, and common git operations.</p></li><li><p><strong>User-level settings</strong> add a deny-list for things that should never happen: reading <code>.env</code>, <code>rm -rf</code>, force-push to main, <code>curl * | sh</code>.</p></li></ul><p>Approving every tool call by hand gets tedious fast.</p><p>The middle ground is a permission classifier. A small model looks at each tool call before it runs. It decides whether to let the call through or hold it for human review. Claude Code calls this Auto mode, and similar mechanisms are showing up across most major harnesses. This is not perfect, but combined with deny-lists and sandboxing, it lets the agent move without constant hand-holding.</p><p><strong>Prevents:</strong> creative shortcuts. The agent&#8217;s own bad judgement when it is grinding to get something to &#8220;done.&#8221;</p><p><strong>Use when:</strong> any agent has tool access. This is the floor, not a nice-to-have.</p><div><hr></div><h2><strong>22. Hooks</strong></h2><p>Hooks are handlers attached to specific points in the agent&#8217;s workflow.</p><p>The one that matters for guardrails is the pre-tool hook. It fires after the agent has assembled a tool call<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-11" href="#footnote-11" target="_self">11</a>, but before that tool actually runs. That is the last inspection point where a bad command can still be blocked. (Different harnesses name this differently. Claude Code calls it <code>PreToolUse</code>.)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zn1c!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4abb7e5-6658-4cea-9705-8b17d9b82e62_1456x819.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zn1c!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4abb7e5-6658-4cea-9705-8b17d9b82e62_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!zn1c!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4abb7e5-6658-4cea-9705-8b17d9b82e62_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!zn1c!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4abb7e5-6658-4cea-9705-8b17d9b82e62_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!zn1c!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4abb7e5-6658-4cea-9705-8b17d9b82e62_1456x819.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zn1c!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4abb7e5-6658-4cea-9705-8b17d9b82e62_1456x819.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d4abb7e5-6658-4cea-9705-8b17d9b82e62_1456x819.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:61358,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4abb7e5-6658-4cea-9705-8b17d9b82e62_1456x819.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!zn1c!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4abb7e5-6658-4cea-9705-8b17d9b82e62_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!zn1c!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4abb7e5-6658-4cea-9705-8b17d9b82e62_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!zn1c!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4abb7e5-6658-4cea-9705-8b17d9b82e62_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!zn1c!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4abb7e5-6658-4cea-9705-8b17d9b82e62_1456x819.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>For shell security, the least glamorous option is usually the right one: <em>a plain pre-tool hook on Bash, backed by a local validator.</em> Fast, deterministic, last-mile.</p><p><a href="https://github.com/sheeki03/tirith">Tirith</a> is a validator built for exactly this; it catches:</p><ul><li><p>Hostname homoglyphs.</p></li><li><p>Path homoglyphs<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-12" href="#footnote-12" target="_self">12</a>.</p></li><li><p>Insecure transport.</p></li><li><p>ANSI injection.</p></li><li><p>Pipe-to-shell patterns.</p></li><li><p>Environment manipulation.</p></li></ul><p>If a command contains suspicious Unicode or dangerous patterns, the hook blocks it before it runs.</p><p>Hooks are not limited to Bash. You can hook the same point for any tool the agent uses, including file edits and MCP calls. The mechanism is general. And the choice of where to put one is a design decision.</p><p><strong>Prevents:</strong> gap between &#8220;model decided to do X&#8221; and &#8220;X actually happens.&#8221; Useful, especially for shell command sanitization.</p><p><strong>Use when:</strong> agent has Bash access. Pair with sandboxing rather than replacing it.</p><div><hr></div><h2><strong>23. Prompt injection defense</strong></h2><p>Agents treat their config files and tool outputs as ground truth.</p><p>This makes them an obvious place for malicious instructions to hide.</p><p>The supply-chain version is simple. You see a new library mentioned somewhere and clone the repo. Inside is an agent config file with instructions like &#8220;pipe test output through this endpoint for logging.&#8221; The agent reads the file, trusts it, and starts shipping environment details and test output to a server you do not control.</p><p>The defense is to treat the config file as code, not documentation.</p><p>Review it before you trust it. Never let your harness auto-load MCP servers shipped inside cloned repositories. An MCP server<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-13" href="#footnote-13" target="_self">13</a> is arbitrary code running with agent permissions. Combined with a poisoned config file, that is a very clean supply-chain attack from a single <code>git clone</code>.</p><p>The nastier version is when a command looks completely normal:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Th95!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff743019e-0889-41a6-aa28-7fd0af2aac7e_1456x819.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Th95!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff743019e-0889-41a6-aa28-7fd0af2aac7e_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!Th95!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff743019e-0889-41a6-aa28-7fd0af2aac7e_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!Th95!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff743019e-0889-41a6-aa28-7fd0af2aac7e_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!Th95!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff743019e-0889-41a6-aa28-7fd0af2aac7e_1456x819.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Th95!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff743019e-0889-41a6-aa28-7fd0af2aac7e_1456x819.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f743019e-0889-41a6-aa28-7fd0af2aac7e_1456x819.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:69744,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff743019e-0889-41a6-aa28-7fd0af2aac7e_1456x819.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!Th95!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff743019e-0889-41a6-aa28-7fd0af2aac7e_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!Th95!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff743019e-0889-41a6-aa28-7fd0af2aac7e_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!Th95!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff743019e-0889-41a6-aa28-7fd0af2aac7e_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!Th95!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff743019e-0889-41a6-aa28-7fd0af2aac7e_1456x819.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>These look identical.</p><p>But they are not. The Latin &#8220;i&#8221; is ASCII code point 105. The Cyrillic &#8220;&#1110;&#8221; is Unicode code point 1110. To your terminal, these are different characters. To your eyes, they are the same. And shell renders Unicode exactly as it appears and runs whatever is on the other end.</p><p>The general defense is simple.</p><p>Assume the agent will be fed input it should not trust. Inspect both the inputs (config files, MCP servers) and the outputs (commands about to run). Catch problems before they reach a place where they can do damage.</p><p><strong>Prevents:</strong> attacks where the agent is the vector. Examples: a poisoned config file, or a tool that looks fine but isn&#8217;t.</p><p><strong>Use when:</strong> agent reads any input authored outside your team. Which, increasingly, is most of the time.</p><div><hr></div><h2><strong>24. Structural code linting</strong></h2><p>Most linters work on the surface of the code: <em>formatting, imports, naming</em>.</p><p>Structural linting works on the syntax tree underneath. The parser stops looking at characters in sequence and starts looking at meaning. This is a function definition. These are its parameters. This default value is a list.</p><p><a href="https://ast-grep.github.io/">AST-grep</a> (named after Abstract Syntax Tree<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-14" href="#footnote-14" target="_self">14</a>, AST) lets you write rules against that structure.</p><p>This matters for AI-written code because LLMs do not make human mistakes. The agent will rarely type a variable name incorrectly. Instead, it writes syntactically perfect code. The code passes lint, type checks, and maybe even tests. But the patterns underneath are subtly wrong.</p><p>Mutable default arguments are the classic example:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!eqc-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97baaac1-5fce-4058-9321-d1ec1c4f7183_1456x819.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eqc-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97baaac1-5fce-4058-9321-d1ec1c4f7183_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!eqc-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97baaac1-5fce-4058-9321-d1ec1c4f7183_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!eqc-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97baaac1-5fce-4058-9321-d1ec1c4f7183_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!eqc-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97baaac1-5fce-4058-9321-d1ec1c4f7183_1456x819.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!eqc-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97baaac1-5fce-4058-9321-d1ec1c4f7183_1456x819.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/97baaac1-5fce-4058-9321-d1ec1c4f7183_1456x819.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:99476,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97baaac1-5fce-4058-9321-d1ec1c4f7183_1456x819.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!eqc-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97baaac1-5fce-4058-9321-d1ec1c4f7183_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!eqc-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97baaac1-5fce-4058-9321-d1ec1c4f7183_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!eqc-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97baaac1-5fce-4058-9321-d1ec1c4f7183_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!eqc-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F97baaac1-5fce-4058-9321-d1ec1c4f7183_1456x819.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This catches <code>def process(items=[])</code>.</p><p>The default list is created once at function definition and shared across every call. A pattern the agent learned from millions of training examples without understanding why it is dangerous.</p><p>If the agent keeps producing the same anti-pattern, encode it as a rule and stop having the same conversation forever. Each rule comes with tests, and once it exists, you wire it into pre-commit and CI.</p><p><strong>Prevents:</strong> structurally bad code that linters and type checkers do not flag. Especially the LLM favorites: mutable defaults and swallowed exceptions. Or bare excepts that catch <code>KeyboardInterrupt</code> along with real errors.</p><p><strong>Use when:</strong> agent writes code in a language with a parser you can target (which is most languages now).</p><div><hr></div><h2><strong>25. Pre-commit gates</strong></h2><p>Local quality gates that block bad code before it becomes a commit.</p><p><a href="https://pre-commit.com/">Pre-commit</a> is the dominant implementation. You define a set of checks, and every commit has to pass them before it becomes history.</p><p>What changes with agents is not the mechanism but the value of being slightly distrustful. Rules that can feel rigid for humans are often exactly right for agents. The agent does not get annoyed, ignore the rule, or promise to tidy things up later. It hits the gate, fails, reads the error, and tries again.</p><p>Without this gate, there is nothing between the agent&#8217;s output and your git history.</p><p>It hardcodes a secret into a config file, commits it, and now you are doing incident response because the model wanted the test to pass quickly.</p><p>Here&#8217;s a useful four-layer config<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-15" href="#footnote-15" target="_self">15</a>:</p><ul><li><p>Standard hooks for the basics: trailing whitespace, valid YAML and TOML, file size limit.</p></li><li><p>Ruff for linting and formatting, with <code>--fix</code> to auto-correct what it can.</p></li><li><p>Bandit for security issues like hardcoded passwords and <code>eval()</code>.</p></li><li><p>AST-grep for the structural rules from concept 24.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Bbbd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F352a8669-7362-437a-8262-31b23f05e8ba_1456x819.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Bbbd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F352a8669-7362-437a-8262-31b23f05e8ba_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!Bbbd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F352a8669-7362-437a-8262-31b23f05e8ba_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!Bbbd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F352a8669-7362-437a-8262-31b23f05e8ba_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!Bbbd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F352a8669-7362-437a-8262-31b23f05e8ba_1456x819.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Bbbd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F352a8669-7362-437a-8262-31b23f05e8ba_1456x819.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/352a8669-7362-437a-8262-31b23f05e8ba_1456x819.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:86298,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F352a8669-7362-437a-8262-31b23f05e8ba_1456x819.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!Bbbd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F352a8669-7362-437a-8262-31b23f05e8ba_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!Bbbd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F352a8669-7362-437a-8262-31b23f05e8ba_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!Bbbd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F352a8669-7362-437a-8262-31b23f05e8ba_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!Bbbd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F352a8669-7362-437a-8262-31b23f05e8ba_1456x819.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The corrective loop is what makes this so valuable.</p><p>The agent writes code, tries to commit, gets rejected, rewrites the function, and commits cleanly a few seconds later. The enforcement teaches.</p><p><strong>Prevents:</strong> bad code becoming git history. Hardcoded secrets, banned patterns, lint errors.</p><p><strong>Use when:</strong> any project where an agent has commit access. Which is essentially every project an agent works on.</p><p>Second layer of automated checks. Pre-commit runs on your laptop before each commit. CI runs on a shared server whenever someone pushes code. The two together catch what each would miss alone.</p><p>When code is pushed and a PR is opened, a fresh server clones the repository and runs the same checks as pre-commit. Lint, type checks, tests, security scans, and structural rules. Just running where the agent cannot quietly skip them.</p><p><em>One practical note</em>: add a <code>concurrency</code> block to your CI config that cancels stale runs when a new push arrives. Agents are prolific little branch goblins. Without this, you burn through CI minutes on runs that were obsolete thirty seconds after they started.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aDtd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9bb7b6e-e379-4335-bb3e-db2a3595e126_1456x819.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aDtd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9bb7b6e-e379-4335-bb3e-db2a3595e126_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!aDtd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9bb7b6e-e379-4335-bb3e-db2a3595e126_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!aDtd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9bb7b6e-e379-4335-bb3e-db2a3595e126_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!aDtd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9bb7b6e-e379-4335-bb3e-db2a3595e126_1456x819.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aDtd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9bb7b6e-e379-4335-bb3e-db2a3595e126_1456x819.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c9bb7b6e-e379-4335-bb3e-db2a3595e126_1456x819.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:82955,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9bb7b6e-e379-4335-bb3e-db2a3595e126_1456x819.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!aDtd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9bb7b6e-e379-4335-bb3e-db2a3595e126_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!aDtd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9bb7b6e-e379-4335-bb3e-db2a3595e126_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!aDtd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9bb7b6e-e379-4335-bb3e-db2a3595e126_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!aDtd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9bb7b6e-e379-4335-bb3e-db2a3595e126_1456x819.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Prevents:</strong> local-only enforcement. Misconfigured pre-commit hooks, <code>--no-verify</code> slips, broken clean-checkout assumptions.</p><p><strong>Use when:</strong> any repo has multiple agents or humans pushing code. Which is almost all of them.</p><div><hr></div><h1><strong>Observability</strong></h1><p>Ready for the best part?</p><h2><strong>27. Tracing</strong></h2><p>Once an agent has run, the question is what actually happened.</p><p>Tracing is the answer at the highest level: <em>a step-by-step record of the run, structured so you can navigate it.</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!opGH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5726c435-f07a-49d2-b623-ccced727be59_1456x819.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!opGH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5726c435-f07a-49d2-b623-ccced727be59_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!opGH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5726c435-f07a-49d2-b623-ccced727be59_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!opGH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5726c435-f07a-49d2-b623-ccced727be59_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!opGH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5726c435-f07a-49d2-b623-ccced727be59_1456x819.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!opGH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5726c435-f07a-49d2-b623-ccced727be59_1456x819.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5726c435-f07a-49d2-b623-ccced727be59_1456x819.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:76509,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5726c435-f07a-49d2-b623-ccced727be59_1456x819.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!opGH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5726c435-f07a-49d2-b623-ccced727be59_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!opGH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5726c435-f07a-49d2-b623-ccced727be59_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!opGH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5726c435-f07a-49d2-b623-ccced727be59_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!opGH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5726c435-f07a-49d2-b623-ccced727be59_1456x819.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Here&#8217;s what a useful trace shows:</p><ul><li><p>Tree of tool calls (subagent A called tool X, which called tool Y).</p></li><li><p>How long each step took.</p></li><li><p>The inputs and outputs at every node.</p></li><li><p>Model&#8217;s stated reasoning at each decision point.</p></li></ul><p>The shape matters as much as the contents: a<em> flat list of tool calls is hard to follow, a tree gives you the structure of the reasoning.</em></p><p>The agent itself produces some of this for free. Most harnesses log tool calls and their results. Going further requires more setup. You need to capture intermediate model thoughts, timing, model versions, and system prompts at the moment of each call. This means a tracing-aware harness or a dedicated layer like LangSmith, Helicone<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-16" href="#footnote-16" target="_self">16</a>, or an open-source OpenTelemetry agent tracer.</p><p>Once you have traces, every other observability concept gets easier:</p><ul><li><p>replay starts from a trace</p></li><li><p>metrics aggregate over many traces</p></li><li><p>failure investigation almost always begins by opening one and walking it step by step</p></li></ul><div><hr></div><h2><strong>28. Logging</strong></h2><p>Logging is the substrate everything else builds on.</p><p>A raw, append-only record of inputs, outputs, and tool calls per run. Without it, traces have nothing to structure, replay has nothing to rerun, and metrics have nothing to count.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8l3l!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2267cac0-2169-4306-bb05-a15e72d8d81b_1456x819.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8l3l!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2267cac0-2169-4306-bb05-a15e72d8d81b_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!8l3l!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2267cac0-2169-4306-bb05-a15e72d8d81b_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!8l3l!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2267cac0-2169-4306-bb05-a15e72d8d81b_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!8l3l!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2267cac0-2169-4306-bb05-a15e72d8d81b_1456x819.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8l3l!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2267cac0-2169-4306-bb05-a15e72d8d81b_1456x819.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2267cac0-2169-4306-bb05-a15e72d8d81b_1456x819.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:132509,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://paulhoekstra.substack.com/i/199652973?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2267cac0-2169-4306-bb05-a15e72d8d81b_1456x819.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!8l3l!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2267cac0-2169-4306-bb05-a15e72d8d81b_1456x819.png 424w, https://substackcdn.com/image/fetch/$s_!8l3l!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2267cac0-2169-4306-bb05-a15e72d8d81b_1456x819.png 848w, https://substackcdn.com/image/fetch/$s_!8l3l!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2267cac0-2169-4306-bb05-a15e72d8d81b_1456x819.png 1272w, https://substackcdn.com/image/fetch/$s_!8l3l!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2267cac0-2169-4306-bb05-a15e72d8d81b_1456x819.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Here&#8217;s the minimum useful set:</p><ul><li><p>Every model call: full prompt, response, latency, tokens, model version.</p></li><li><p>Every tool call: name, parameters, result, latency.</p></li><li><p>Every error.</p></li><li><p>A session ID tying them together.</p></li></ul><p>Skip the cleverness here.</p><p>Verbose, append-only, structured as JSON Lines is the format that survives.</p><p>The design call is what you keep and for how long. Token budgets and storage costs are something to keep in mind, but losing the inputs to a session that produced an unexplained outcome is much worse than the storage bill.</p><p>Default to keeping everything and trimming later, not the other way round.</p><div><hr></div><h2><strong>29. Replay/debugging failed runs</strong></h2><p>Once you have a complete log of a session, you can rerun it.</p><p>Hand the harness the same inputs. Swap the model calls between the recorded responses and the fresh ones. Watch the agent take the same path. Or a different one.</p><p>The use cases split cleanly.</p><p>To reproduce a bug, replay with recorded model responses, and you get exactly the same trace. That is what you want when isolating a failure in the harness or a tool. To test a fix, replay with fresh model calls and you see whether your change to the harness, system prompt<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-17" href="#footnote-17" target="_self">17</a>, or a tool fixes the failure.</p><p>Replaying against a different model is trickier.</p><p>Sometimes a bug only shows up on a specific model version, and an upgrade silently breaks something. Replay helps catch it before your users do.</p><div><hr></div><h2><strong>30. Metrics</strong></h2><p>Most of what you can measure about an agent is proxy data:</p><ul><li><p>Latency per session</p></li><li><p>Latency per tool call</p></li><li><p>Token and dollar cost</p></li><li><p>Tool call counts</p></li><li><p>Failure counts</p></li></ul><p>All of it falls out of the logs without much extra plumbing<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-18" href="#footnote-18" target="_self">18</a>.</p><p>Proxy data is enough to spot the obvious failure modes. A session running up the bill. An agent stuck in a loop because nothing tells it to stop. You will catch a lot of nonsense just by watching the basics.</p><p>Outcome data is harder.</p><p>The honest version of &#8220;did the agent succeed&#8221; is not something the agent itself can report on. &#8220;Task complete&#8221; is a claim, not a measurement. To get a real outcome signal, you need to anchor to artifacts the agent did not produce: <em>a test that passed in CI, a PR that merged, a deploy that did not roll back.</em></p><p>Wiring those up is brittle and project-specific. But it is the only way to know whether the proxy numbers are pointing in the right direction.</p><div><hr></div><h1><strong>Final thoughts</strong></h1><p>That was a lot of concepts, so a quick recap before you close the tab.</p><p><em>Foundations</em> gave you what an agent is, how it runs, where its state lives, and the patterns you compose them in.</p><p>The four practical layers cover what comes after that.</p><p><em>Configuration</em> shapes how the agent behaves before it writes a line of code. <em>Capability</em> is what it can reach for. <em>Orchestration</em> coordinates multiple agents without letting them step on each other. <em>Guardrails</em> stop them from doing damage.</p><p><em>Observability</em> is how you see what actually happened once the agent stopped typing.</p><p>If you are starting from zero, here is a recommended order for picking these up:</p><ul><li><p>Write a project config file (concept 5)</p></li><li><p>Wire up MCP for live docs (concept 10)</p></li><li><p>Turn the default sandbox on (concept 20)</p></li><li><p>Start using subagents for read-heavy work (concept 16)</p></li></ul><p>This is a good place to start.</p><div><hr></div><p>&#128075; I&#8217;d like to thank <strong><a href="https://paulhoekstra.substack.com/subscribe">Paul Hoekstra</a></strong> for writing this newsletter!</p><p>He&#8217;s a data engineer at Digital Power, a data and AI consultancy, and writes <strong><a href="https://paulhoekstra.substack.com/subscribe">Paul&#8217;s Pipeline</a></strong>, a free newsletter on AI, data, and side projects.</p><div><hr></div><p>Louis and I launched the <strong><a href="https://newsletter.systemdesign.one/subscribe?yearly=true">GENERATIVE AI MASTERCLASS</a></strong> (newsletter series exclusive to PAID subscribers).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://newsletter.systemdesign.one/subscribe?yearly=true" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Lz0V!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 424w, https://substackcdn.com/image/fetch/$s_!Lz0V!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 848w, https://substackcdn.com/image/fetch/$s_!Lz0V!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 1272w, https://substackcdn.com/image/fetch/$s_!Lz0V!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Lz0V!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png" width="1200" height="630" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:630,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:614623,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://newsletter.systemdesign.one/subscribe?yearly=true&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/199185364?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!Lz0V!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 424w, https://substackcdn.com/image/fetch/$s_!Lz0V!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 848w, https://substackcdn.com/image/fetch/$s_!Lz0V!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 1272w, https://substackcdn.com/image/fetch/$s_!Lz0V!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>When you upgrade, you&#8217;ll get:</p><ul><li><p><strong>Simple breakdown of real-world architectures</strong></p></li><li><p>Frameworks you can plug into your work or business</p></li><li><p><strong>Proven systems behind ChatGPT, Perplexity, and Copilot</strong></p></li></ul><p><strong>&#128073; <a href="https://newsletter.systemdesign.one/subscribe?yearly=true"><mark data-color="#ffff00" style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">CLICK HERE TO JOIN THE GENERATIVE AI MASTERCLASS</mark></a></strong></p><div><hr></div><p>If you find this newsletter valuable, share it with a friend, and subscribe if you haven&#8217;t already. There are <a href="http://newsletter.systemdesign.one/subscribe?group=true">group discounts</a>, <a href="http://newsletter.systemdesign.one/subscribe?gift=true">gift options</a>, and <a href="https://newsletter.systemdesign.one/leaderboard">referral rewards</a> available.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.linkedin.com/in/nk-systemdesign-one/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bEFk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 424w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 848w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 1272w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bEFk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png" width="152" height="152" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:320,&quot;width&quot;:320,&quot;resizeWidth&quot;:152,&quot;bytes&quot;:74009,&quot;alt&quot;:&quot;Author Neo Kim; System design case studies&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://www.linkedin.com/in/nk-systemdesign-one/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Author Neo Kim; System design case studies" title="Author Neo Kim; System design case studies" srcset="https://substackcdn.com/image/fetch/$s_!bEFk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 424w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 848w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 1272w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption"><strong>&#128075; Find me on <a href="https://www.linkedin.com/in/nk-systemdesign-one/">LinkedIn</a> | <a href="https://x.com/intent/follow?screen_name=systemdesignone">Twitter</a> | <a href="https://www.threads.net/@systemdesignone">Threads</a> | <a href="https://www.instagram.com/systemdesignone/">Instagram</a></strong></figcaption></figure></div><div><hr></div><p><strong>Want to reach 210K+ tech professionals at scale? </strong>&#128240;</p><p>If your company wants to reach 210K+ tech professionals, <a href="https://newsletter.systemdesign.one/p/sponsorship">advertise with me</a>.</p><div><hr></div><p>Thank you for supporting this newsletter.</p><p>You are now 210,001+ readers strong, very close to 210k. Let&#8217;s try to get 211k readers by 27 June. Consider sharing this post with your friends and get rewards.</p><p>Y&#8217;all are the best.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6oWl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6oWl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 424w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 848w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 1272w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6oWl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png" width="590" height="368.75" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2e739087-a910-4643-be36-997b6dd5b4af_800x500.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:500,&quot;width&quot;:800,&quot;resizeWidth&quot;:590,&quot;bytes&quot;:87878,&quot;alt&quot;:&quot;system design newsletter&quot;,&quot;title&quot;:&quot;system design newsletter&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/163380418?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="system design newsletter" title="system design newsletter" srcset="https://substackcdn.com/image/fetch/$s_!6oWl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 424w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 848w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 1272w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/agentic-engineering?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/agentic-engineering?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p>A tool is something an AI can use to interact with the outside world, such as reading files, searching the web, running code, or calling APIs.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-2" href="#footnote-anchor-2" class="footnote-number" contenteditable="false" target="_self">2</a><div class="footnote-content"><p>The harness is the code around the model that runs its tool calls and feeds the results back. The model decides; the harness does.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-3" href="#footnote-anchor-3" class="footnote-number" contenteditable="false" target="_self">3</a><div class="footnote-content"><p>Frontmatter is a small block of metadata placed at the top of a Markdown file.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-4" href="#footnote-anchor-4" class="footnote-number" contenteditable="false" target="_self">4</a><div class="footnote-content"><ul><li><p>Skills: reusable instruction files that teach the agent how to do a specific task.</p></li><li><p>Hooks: automatic checks or actions that run at certain points, like before a shell command executes.</p></li><li><p>Slash commands: shortcut commands you type, like <code>/review</code> or <code>/test</code>, to trigger a predefined workflow.</p></li></ul></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-5" href="#footnote-anchor-5" class="footnote-number" contenteditable="false" target="_self">5</a><div class="footnote-content"><p>The transformer is the neural network architecture behind modern LLMs. Introduced by Google in 2017, it processes a whole sequence of tokens at once and learns which parts to pay attention to. Almost every model you have heard of (GPT, Claude, Gemini) is a transformer under the hood</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-6" href="#footnote-anchor-6" class="footnote-number" contenteditable="false" target="_self">6</a><div class="footnote-content"><p>A vector is a numerical representation of text that lets computers search for similar meanings.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-7" href="#footnote-anchor-7" class="footnote-number" contenteditable="false" target="_self">7</a><div class="footnote-content"><ul><li><p>Harness</p><ul><li><p>The software that runs the agent.</p></li><li><p>Manages prompts, tool calls, retries, permissions, and the agent loop.</p></li><li><p>Example: Claude Code&#8217;s runtime.</p></li></ul></li><li><p>Sandbox</p><ul><li><p>A safety boundary that limits what the agent can access.</p></li><li><p>Restricts files, network access, credentials, and system resources.</p></li><li><p>Prevents the agent from causing damage outside its allowed area.</p></li></ul></li><li><p>Tool Loop</p><ul><li><p>Repeated cycle of:</p><ol><li><p>Think</p></li><li><p>Use a tool</p></li><li><p>Observe the result</p></li><li><p>Repeat</p></li></ol><p>This is what makes an agent different from a single prompt.</p></li></ul></li><li><p>Container</p><ul><li><p>An isolated environment where the agent runs code and tools.</p></li><li><p>Has its own filesystem, processes, and dependencies.</p></li><li><p>Similar to a lightweight virtual machine (e.g., Docker container).</p></li></ul></li></ul></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-8" href="#footnote-anchor-8" class="footnote-number" contenteditable="false" target="_self">8</a><div class="footnote-content"><p>A pay-as-you-go API means you pay based on how much AI you use, not a fixed monthly subscription. The unit of usage is usually tokens.</p><p>A token is roughly:</p><ul><li><p>1 word &#8776; 1-1.5 tokens</p></li><li><p>&#8220;Hello world&#8221; = about 2 tokens</p></li><li><p>A long article = thousands of tokens</p></li></ul><p>Think of it like:</p><ul><li><p>Claude Pro = Netflix</p><ul><li><p>fixed monthly fee</p></li><li><p>use within plan limits</p></li></ul></li><li><p>API = electricity bill</p><ul><li><p>pay for exactly what you consume</p></li></ul></li></ul></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-9" href="#footnote-anchor-9" class="footnote-number" contenteditable="false" target="_self">9</a><div class="footnote-content"><p><code>chmod</code> changes file permissions. And <code>777</code> gives absolutely everyone full access.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-10" href="#footnote-anchor-10" class="footnote-number" contenteditable="false" target="_self">10</a><div class="footnote-content"><p><code>curl</code> downloads content from the internet. <code>sh</code> executes shell commands.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-11" href="#footnote-anchor-11" class="footnote-number" contenteditable="false" target="_self">11</a><div class="footnote-content"><p>A tool call is a structured request from an AI agent to execute a tool, such as reading a file, running a command, or calling an API.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-12" href="#footnote-anchor-12" class="footnote-number" contenteditable="false" target="_self">12</a><div class="footnote-content"><p>A homoglyph is a character that looks like another character but is actually different.</p><ul><li><p>Hostname homoglyph: a website/domain name containing look-alike characters from different alphabets.</p></li><li><p>Path homoglyph: a file path containing look-alike characters that visually resemble normal letters but point somewhere else.</p></li></ul></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-13" href="#footnote-anchor-13" class="footnote-number" contenteditable="false" target="_self">13</a><div class="footnote-content"><p>An MCP server is a program that exposes tools, resources, or services to AI agents through the Model Context Protocol.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-14" href="#footnote-anchor-14" class="footnote-number" contenteditable="false" target="_self">14</a><div class="footnote-content"><p>An Abstract Syntax Tree (AST) is a structured representation of code that describes its meaning and structure rather than its raw text.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-15" href="#footnote-anchor-15" class="footnote-number" contenteditable="false" target="_self">15</a><div class="footnote-content"><ul><li><p>Standard hooks = file sanitation</p></li><li><p>Ruff = code quality</p></li><li><p>Bandit = security</p></li><li><p>AST-grep = structural correctness</p></li></ul><p>Workflow:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;c26c146f-3361-4cf1-985a-09a63d33dd74&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Bad code -&gt; Pre-commit fails -&gt; Agent reads error -&gt; Fixes code -&gt; Tries again</code></pre></div></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-16" href="#footnote-anchor-16" class="footnote-number" contenteditable="false" target="_self">16</a><div class="footnote-content"><ul><li><p>LangSmith is an observability and debugging platform for LLM apps and agents.</p></li><li><p>Helicone is like an analytics and monitoring layer for AI API calls.</p></li></ul><p>A simple rule:</p><ul><li><p>Want to know why an agent made a bad decision? &#8594; LangSmith</p></li><li><p>Want to know which model cost you $2,000 yesterday? &#8594; Helicone</p></li></ul></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-17" href="#footnote-anchor-17" class="footnote-number" contenteditable="false" target="_self">17</a><div class="footnote-content"><p>A system prompt is the hidden instruction set that defines an AI agent's role, rules, and behavior.</p><ul><li><p>User prompt = what the user wants</p></li><li><p>System prompt = rules the agent must follow</p></li></ul></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-18" href="#footnote-anchor-18" class="footnote-number" contenteditable="false" target="_self">18</a><div class="footnote-content"><p>Plumbing is the underlying infrastructure and integration code that connects systems together behind the scenes</p><p></p></div></div>]]></content:encoded></item><item><title><![CDATA[How Docker Works - A Deep Dive]]></title><description><![CDATA[#153: Part 2 - DevOps Mastermind]]></description><link>https://newsletter.systemdesign.one/p/how-do-docker-containers-work</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/how-do-docker-containers-work</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Sun, 14 Jun 2026 09:45:11 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/afe8987f-6268-4b84-883b-42e9dff8fb89_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Get my system design playbook for FREE on newsletter signup:</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><ul><li><p><em><a href="https://newsletter.systemdesign.one/p/how-do-docker-containers-work/?action=share">Share this post</a> &amp; I'll send you some rewards for the referrals.</em></p></li></ul><div><hr></div><p>You&#8217;ve heard it before: <em>&#8220;It works on my machine.&#8221;</em></p><p>The app is under development. Tests pass, dependencies install, and everything looks ready to ship. But the moment it reaches production, something breaks. The server might use a different Python version, or a library may exist locally but not in the deployment environment. Sometimes the operating system itself causes the issue.</p><p>The problem was never just the application&#8230;it was the environment around it.</p><p>For a long time, virtual machines were the best solution engineers had.</p><p>Instead of deploying only the application, teams started packaging an entire operating system along with it. This approach fixed a big part of the consistency problem. The environment behaved the same no matter where the workload ran. But the tradeoff was hard to ignore.</p><p>Each virtual machine included its own kernel<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>, services, and system overhead to run a single application. They consumed a large amount of memory, took time to boot, and became too difficult to manage as the infrastructure grew.</p><p>What the industry needed was a way to isolate applications without paying the cost of a full operating system every time.</p><p>The interesting part is GNU/Linux already had most of the building blocks required to make this possible:</p><p>Namespaces could isolate processes from each other. cgroups could control how much CPU and memory a process was allowed to consume. The primitives<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a> already existed, but they were hard to use directly and too complex for most developers to manage on their own.</p><p>Docker changed this by turning those low-level kernel features into a developer-friendly workflow.</p><p>Engineers no longer had to configure isolation primitives manually. They got a simple CLI, portable images, reproducible environments, and a runtime for running containers at scale.</p><p>This shift fundamentally changed modern infrastructure.</p><p>Today, containers sit underneath almost everything in modern infrastructure. From CI/CD pipelines to Kubernetes clusters, they power it all. But despite how common they are, most engineers interact only with the surface layer. They know the commands. They know how to build images and start containers. What they rarely see is the runtime stack operating underneath those commands.</p><p>This newsletter is about the lower layer.</p><p>Onward.</p><div><hr></div><div class="callout-block" data-callout="true"><h2><a href="https://kotlinlang.org/multiplatform/?utm_source=linkedin&amp;utm_medium=influencers&amp;utm_campaign=kotlin_neo_kim">Building across platforms shouldn&#8217;t mean rewriting the same logic 3 times (Partner)</a></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://kotlinlang.org/multiplatform/?utm_source=linkedin&amp;utm_medium=influencers&amp;utm_campaign=kotlin_neo_kim" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!EhT9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0d72bb3-0a27-4296-a6d7-efd1a827e365_1693x929.png 424w, https://substackcdn.com/image/fetch/$s_!EhT9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0d72bb3-0a27-4296-a6d7-efd1a827e365_1693x929.png 848w, https://substackcdn.com/image/fetch/$s_!EhT9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0d72bb3-0a27-4296-a6d7-efd1a827e365_1693x929.png 1272w, https://substackcdn.com/image/fetch/$s_!EhT9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0d72bb3-0a27-4296-a6d7-efd1a827e365_1693x929.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!EhT9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0d72bb3-0a27-4296-a6d7-efd1a827e365_1693x929.png" width="1456" height="799" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d0d72bb3-0a27-4296-a6d7-efd1a827e365_1693x929.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:799,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://kotlinlang.org/multiplatform/?utm_source=linkedin&amp;utm_medium=influencers&amp;utm_campaign=kotlin_neo_kim&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!EhT9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0d72bb3-0a27-4296-a6d7-efd1a827e365_1693x929.png 424w, https://substackcdn.com/image/fetch/$s_!EhT9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0d72bb3-0a27-4296-a6d7-efd1a827e365_1693x929.png 848w, https://substackcdn.com/image/fetch/$s_!EhT9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0d72bb3-0a27-4296-a6d7-efd1a827e365_1693x929.png 1272w, https://substackcdn.com/image/fetch/$s_!EhT9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0d72bb3-0a27-4296-a6d7-efd1a827e365_1693x929.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A validation rule in your backend, Android app and iOS should behave the same.</p><p>But with different codebases, logic diverges and mobile apps might behave differently than your backend.</p><p><a href="https://kotlinlang.org/multiplatform/?utm_source=linkedin&amp;utm_medium=influencers&amp;utm_campaign=kotlin_neo_kim">Kotlin Multiplatform (KMP)</a>, developed by JetBrains, is designed to solve this at the architecture level.</p><p>With <strong><a href="https://kotlinlang.org/multiplatform/?utm_source=linkedin&amp;utm_medium=influencers&amp;utm_campaign=kotlin_neo_kim">KMP</a></strong>, you define a shared domain layer and reuse it across platforms instead of duplicating business logic.</p><p>It&#8217;s built around:</p><ul><li><p>Consistency: same app behaviour runs across Android, iOS, desktop, web and server.</p></li><li><p>UI sharing flexibility: keep your native UIs or extend KMP with Compose Multiplatform to share user interfaces as well.</p></li><li><p>Low-risk: integrates into existing ecosystems safely, preserves native performance and hiring flexibility &#8211; continue recruiting Android and iOS engineers instead of searching for niche cross-platform specialists.</p></li><li><p>Proven maturity: KMP is trusted in production by global enterprises like Bolt and Duolingo for serious, long-lived applications.</p></li></ul><p>Whether teams choose to share their UI or keep it native, KMP keeps the business logic perfectly aligned.</p><p>Explore how teams are using Kotlin Multiplatform in production:</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://kotlinlang.org/multiplatform/?utm_source=linkedin&amp;utm_medium=influencers&amp;utm_campaign=kotlin_neo_kim&quot;,&quot;text&quot;:&quot;Explore Kotlin Multiplatform&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://kotlinlang.org/multiplatform/?utm_source=linkedin&amp;utm_medium=influencers&amp;utm_campaign=kotlin_neo_kim"><span>Explore Kotlin Multiplatform</span></a></p><p>(Thanks to JetBrains for partnering on this post.)</p></div><div><hr></div><p>I want to introduce <strong><a href="https://x.com/twtayaan">Ayaan</a></strong> as a guest author.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://x.com/twtayaan" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Kzrb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c24dc51-869d-4962-86ef-686c1f0b52e7_2048x1024.png 424w, https://substackcdn.com/image/fetch/$s_!Kzrb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c24dc51-869d-4962-86ef-686c1f0b52e7_2048x1024.png 848w, https://substackcdn.com/image/fetch/$s_!Kzrb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c24dc51-869d-4962-86ef-686c1f0b52e7_2048x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!Kzrb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c24dc51-869d-4962-86ef-686c1f0b52e7_2048x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Kzrb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c24dc51-869d-4962-86ef-686c1f0b52e7_2048x1024.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0c24dc51-869d-4962-86ef-686c1f0b52e7_2048x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:null,&quot;href&quot;:&quot;https://x.com/twtayaan&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!Kzrb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c24dc51-869d-4962-86ef-686c1f0b52e7_2048x1024.png 424w, https://substackcdn.com/image/fetch/$s_!Kzrb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c24dc51-869d-4962-86ef-686c1f0b52e7_2048x1024.png 848w, https://substackcdn.com/image/fetch/$s_!Kzrb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c24dc51-869d-4962-86ef-686c1f0b52e7_2048x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!Kzrb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c24dc51-869d-4962-86ef-686c1f0b52e7_2048x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>He&#8217;s a self-taught DevOps engineer focused on Kubernetes &amp; cloud infrastructure. He builds in public and writes about cloud-native systems, sharing daily technical tips and projects.</p><p>Check out his work and socials:</p><ul><li><p><strong><a href="https://x.com/twtayaan">Twitter</a></strong></p></li><li><p><strong><a href="https://github.com/Ayaan49">Github</a></strong></p></li></ul><div><hr></div><p><em><strong>Here&#8217;s what you&#8217;ll find inside this newsletter:</strong></em></p><ul><li><p><strong>The full Docker runtime stack, from the CLI down to the Linux kernel.</strong></p></li><li><p>Linux primitives behind containers: namespaces for isolation and cgroups for resource control.</p></li><li><p><strong>How container images, layers, and OverlayFS actually work.</strong></p></li><li><p>The complete path from <code>Docker run </code>to a running process, step by step.</p></li><li><p><strong>How container networking and storage work under the hood.</strong></p></li><li><p>What Docker gets right, where it struggles, and where containers start to break down.</p></li></ul><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Golden members get all posts like these!&#8230;</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h2>Docker Architecture</h2><p>Docker is NOT one program.</p><p>It is a stack of cooperating components where every layer has a specific responsibility and passes work to the next.</p><p>Most engineers interact with the CLI and assume Docker handles everything behind the scenes. But when you execute <code>docker run</code>, the command travels through an entire runtime chain before a process ever starts.</p><p>Understanding this chain makes the rest of Docker's internals easier to follow&#8230;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Te-N!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff33c410a-641a-452d-b4f2-17b1bc8d2a7a_1681x936.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Te-N!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff33c410a-641a-452d-b4f2-17b1bc8d2a7a_1681x936.png 424w, https://substackcdn.com/image/fetch/$s_!Te-N!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff33c410a-641a-452d-b4f2-17b1bc8d2a7a_1681x936.png 848w, https://substackcdn.com/image/fetch/$s_!Te-N!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff33c410a-641a-452d-b4f2-17b1bc8d2a7a_1681x936.png 1272w, https://substackcdn.com/image/fetch/$s_!Te-N!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff33c410a-641a-452d-b4f2-17b1bc8d2a7a_1681x936.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Te-N!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff33c410a-641a-452d-b4f2-17b1bc8d2a7a_1681x936.png" width="1456" height="811" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f33c410a-641a-452d-b4f2-17b1bc8d2a7a_1681x936.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:811,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Te-N!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff33c410a-641a-452d-b4f2-17b1bc8d2a7a_1681x936.png 424w, https://substackcdn.com/image/fetch/$s_!Te-N!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff33c410a-641a-452d-b4f2-17b1bc8d2a7a_1681x936.png 848w, https://substackcdn.com/image/fetch/$s_!Te-N!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff33c410a-641a-452d-b4f2-17b1bc8d2a7a_1681x936.png 1272w, https://substackcdn.com/image/fetch/$s_!Te-N!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff33c410a-641a-452d-b4f2-17b1bc8d2a7a_1681x936.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Every layer has a specific responsibility.</p><p>Some components manage APIs. Some manage container lifecycle operations. Others interact directly with the Linux kernel. That separation keeps the runtime modular and easier to maintain.</p><p>Let&#8217;s see how the chain works:</p><h3>Docker CLI</h3><p>The Docker CLI<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a> is a thin client.</p><p>When you type <code>docker run</code> or <code>docker build</code>, it converts your command into an API request and sends it over <code>/var/run/docker.sock</code><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a> to the Docker daemon.</p><p>The CLI itself does not build images, pull layers, or start containers. It only forwards requests.</p><p>The real work happens behind it.</p><p>This separation matters because the CLI and daemon do not even need to run on the same machine. Docker can expose its API remotely, so external tools and automation systems can communicate with the daemon directly.</p><h3>dockerd</h3><p>dockerd is the Docker daemon.</p><p>It receives requests from the CLI and manages images, networks, volumes<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a>, and the overall Docker API surface. But dockerd does NOT run containers directly. Instead, it hands container lifecycle management to containerd.</p><p>This separation keeps containers running even if the Docker daemon restarts.</p><p>So the runtime layer lives independently from the higher-level Docker API layer.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!IWKN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91afb5e6-d6bc-43d5-934a-fceb2e924ba0_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!IWKN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91afb5e6-d6bc-43d5-934a-fceb2e924ba0_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!IWKN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91afb5e6-d6bc-43d5-934a-fceb2e924ba0_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!IWKN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91afb5e6-d6bc-43d5-934a-fceb2e924ba0_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!IWKN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91afb5e6-d6bc-43d5-934a-fceb2e924ba0_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!IWKN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91afb5e6-d6bc-43d5-934a-fceb2e924ba0_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/91afb5e6-d6bc-43d5-934a-fceb2e924ba0_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!IWKN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91afb5e6-d6bc-43d5-934a-fceb2e924ba0_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!IWKN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91afb5e6-d6bc-43d5-934a-fceb2e924ba0_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!IWKN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91afb5e6-d6bc-43d5-934a-fceb2e924ba0_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!IWKN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91afb5e6-d6bc-43d5-934a-fceb2e924ba0_1536x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The daemon also acts as the orchestration layer for local Docker operations.</p><p>When you pull an image, create a network, or attach a volume, the request first goes through dockerd. Then it reaches the lower runtime components.</p><h3>containerd</h3><p>containerd is the core container runtime responsible for managing container lifecycles.</p><p>It manages image pulling, snapshots, image unpacking, and runtime operations<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a> through a gRPC<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-7" href="#footnote-7" target="_self">7</a> API.</p><p>When dockerd needs to start a container, it delegates that work to containerd. From that point onward, the Docker daemon mostly steps out of the execution path.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RL6p!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd286fd6f-db9a-4b75-bf8b-d2feeb8885bf_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RL6p!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd286fd6f-db9a-4b75-bf8b-d2feeb8885bf_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!RL6p!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd286fd6f-db9a-4b75-bf8b-d2feeb8885bf_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!RL6p!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd286fd6f-db9a-4b75-bf8b-d2feeb8885bf_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!RL6p!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd286fd6f-db9a-4b75-bf8b-d2feeb8885bf_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RL6p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd286fd6f-db9a-4b75-bf8b-d2feeb8885bf_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d286fd6f-db9a-4b75-bf8b-d2feeb8885bf_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!RL6p!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd286fd6f-db9a-4b75-bf8b-d2feeb8885bf_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!RL6p!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd286fd6f-db9a-4b75-bf8b-d2feeb8885bf_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!RL6p!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd286fd6f-db9a-4b75-bf8b-d2feeb8885bf_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!RL6p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd286fd6f-db9a-4b75-bf8b-d2feeb8885bf_1536x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>containerd originally started as part of Docker itself.</p><p>In 2017, Docker donated it to the Cloud Native Computing Foundation (<strong>CNCF</strong>) as an independent project. Today, Kubernetes communicates with containerd and other CRI-compatible runtimes instead of Docker.</p><p>This shift significantly changed the container ecosystem.</p><p>Docker remained the developer platform, while containerd became the runtime underneath orchestration systems. Even then, containerd does not directly create containers. It passes that responsibility further down the stack.</p><h3>containerd-shim</h3><p>The containerd-shim is a lightweight process between containerd and the running container.</p><p>Before a container starts, containerd launches a shim process first. The shim becomes the parent of the container process and keeps the container alive even if containerd crashes or restarts.</p><p>Each container gets its own shim. That process isolates the running container from the runtime layer and keeps the connection alive.</p><p>The shim also manages container input/output streams and exit status reporting. Without it, containerd would need to stay directly attached to every running container process.</p><p>Once the shim is ready, it calls the component that actually creates the container.</p><h3>runc</h3><p>runc is the Open Container Initiative (<strong>OCI</strong>) runtime that directly interacts with the Linux kernel to create the container.</p><p>It reads the container configuration and creates namespaces and cgroups. Then it configures the filesystem and starts the container process.</p><p>This is the layer where containers stop behaving like Docker objects and become ordinary Linux processes. The kernel enforces its isolation boundaries.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lTD1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8920342-e334-4d7c-9680-257aa8663dbf_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lTD1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8920342-e334-4d7c-9680-257aa8663dbf_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!lTD1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8920342-e334-4d7c-9680-257aa8663dbf_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!lTD1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8920342-e334-4d7c-9680-257aa8663dbf_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!lTD1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8920342-e334-4d7c-9680-257aa8663dbf_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lTD1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8920342-e334-4d7c-9680-257aa8663dbf_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a8920342-e334-4d7c-9680-257aa8663dbf_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!lTD1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8920342-e334-4d7c-9680-257aa8663dbf_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!lTD1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8920342-e334-4d7c-9680-257aa8663dbf_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!lTD1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8920342-e334-4d7c-9680-257aa8663dbf_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!lTD1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8920342-e334-4d7c-9680-257aa8663dbf_1536x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>After the process starts, runc exits&#8230;</p><p>Its job is complete. The shim continues supervising the container and reports its status back to containerd.</p><h3>OCI Standards</h3><p>Every component in this stack works together because they follow the same OCI standards.</p><p>The Open Container Initiative (<strong>OCI</strong>) defines open standards for container images and runtimes. This standardization allows different tools to interoperate cleanly across the container ecosystem.</p><p>Docker-built images run unchanged on containerd, CRI-O, and Podman<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-8" href="#footnote-8" target="_self">8</a>. Kubernetes can swap one OCI runtime for another without changing the rest of the stack.</p><p>Before OCI standardization, container tooling was far more tightly coupled. Docker helped popularize containers, but OCI allowed different container tools to work together.</p><p>OCI standards made container runtimes modular rather than tied to a single vendor or toolchain.<br><br>Now the runtime stack is clear, let&#8217;s look at the Linux primitives that actually make containers possible&#8230;</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/how-do-docker-containers-work?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/how-do-docker-containers-work?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div><hr></div><h2>Linux Primitives: Namespaces</h2><p>Containers are not a feature of Docker&#8230; They are a feature of the Linux kernel.</p><p>Docker provides the tooling, CLI, image format, and workflow. But the isolation that makes containers actually work comes from the kernel itself. And at the center of that isolation is a single primitive: <em>namespaces</em>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lLbp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3f71c80-06d1-4e9d-989f-81d99c4272d5_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lLbp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3f71c80-06d1-4e9d-989f-81d99c4272d5_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!lLbp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3f71c80-06d1-4e9d-989f-81d99c4272d5_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!lLbp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3f71c80-06d1-4e9d-989f-81d99c4272d5_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!lLbp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3f71c80-06d1-4e9d-989f-81d99c4272d5_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lLbp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3f71c80-06d1-4e9d-989f-81d99c4272d5_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b3f71c80-06d1-4e9d-989f-81d99c4272d5_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!lLbp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3f71c80-06d1-4e9d-989f-81d99c4272d5_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!lLbp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3f71c80-06d1-4e9d-989f-81d99c4272d5_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!lLbp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3f71c80-06d1-4e9d-989f-81d99c4272d5_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!lLbp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb3f71c80-06d1-4e9d-989f-81d99c4272d5_1536x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A namespace wraps a global system resource and makes it appear private to a specific process.</p><p>The process inside the namespace believes it has its own isolated version of that resource. Host and every other process on the machine still see the original global resource.</p><p>Linux has six namespaces that containers rely on. Each one isolates a different part of the system. Together, they create the illusion that a container is running on its own machine.</p><p>Let&#8217;s go through each one:</p><h3>1. PID Namespace</h3><p>Every process on a Linux system has a process ID (<strong>PID</strong>).</p><p>On the host, these IDs are global. All the running processes share the same numbering space.</p><p>The PID namespace changes this.</p><p>When a container starts inside its own PID namespace, the first process it runs gets assigned PID 1<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-9" href="#footnote-9" target="_self">9</a>. From inside the container, that process looks like the root of the entire system. It can see its own child processes, but it cannot see anything running on the host or in other containers.</p><p>While the host sees the container process with its real PID in the global namespace. The container has NO idea.</p><p>It matters because PID 1 carries special responsibilities in Linux. It&#8217;s expected to handle signals and reap orphaned child processes. Containers that do not handle this correctly end up with zombie processes. That is why what runs as PID 1 inside a container is an important design decision.</p><h3>2. Network Namespace</h3><p>By default, every process on a Linux machine shares the same network stack.</p><p>They see same interfaces, same routing tables, and same ports.</p><p>The network namespace gives a container its own isolated network stack. Each container gets its own virtual network interface, IP address, routing table, and set of ports<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-10" href="#footnote-10" target="_self">10</a>. A process inside the container can bind to <code>port 80</code> without conflicting with anything else on the host.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HCM7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe241a60-a4d4-43a1-b0c5-dbfe87fbe41d_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HCM7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe241a60-a4d4-43a1-b0c5-dbfe87fbe41d_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!HCM7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe241a60-a4d4-43a1-b0c5-dbfe87fbe41d_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!HCM7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe241a60-a4d4-43a1-b0c5-dbfe87fbe41d_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!HCM7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe241a60-a4d4-43a1-b0c5-dbfe87fbe41d_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HCM7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe241a60-a4d4-43a1-b0c5-dbfe87fbe41d_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fe241a60-a4d4-43a1-b0c5-dbfe87fbe41d_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!HCM7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe241a60-a4d4-43a1-b0c5-dbfe87fbe41d_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!HCM7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe241a60-a4d4-43a1-b0c5-dbfe87fbe41d_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!HCM7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe241a60-a4d4-43a1-b0c5-dbfe87fbe41d_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!HCM7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe241a60-a4d4-43a1-b0c5-dbfe87fbe41d_1536x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This is how different containers can each listen on port 80 simultaneously on the same machine. They are not actually sharing the same port. Instead, each has its own private network namespace.</p><p>Docker creates a virtual Ethernet pair to connect each container&#8217;s network namespace to the host. Traffic flows through that pair, and the host routes it appropriately.</p><p>This bridge makes container networking possible, but the namespace is what makes the isolation real.</p><h3>3. Mount Namespace</h3><p>The mount namespace controls what a process can see when it looks at the filesystem.</p><p>Without it, every process on the system shares the same view of the filesystem. Any process could see every mounted disk, every directory, and every file on the machine.</p><p>With a mount namespace, each container gets its own filesystem view. When Docker starts a container, it sets up a layered filesystem using OverlayFS<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-11" href="#footnote-11" target="_self">11</a> and mounts it inside a new mount namespace. The container sees only that filesystem. It cannot browse the host&#8217;s directories or access files outside its own root.</p><p>This gives each container its own isolated root filesystem.</p><p>It includes its own operating system files, libraries, and application code without touching the host.</p><h3>4. UTS Namespace</h3><p>The Unix Time-Sharing (<strong>UTS</strong>) namespace<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-12" href="#footnote-12" target="_self">12</a> controls hostname and domain name of a process.</p><p>This one is simpler than the others, but it matters for how containers identify themselves on a network. Without it, every container would share hostname of the host machine. Without it, logs, monitoring systems, and service discovery tools would struggle to distinguish containers from the host.</p><p>The UTS namespace lets each container have its own hostname.</p><p>When a container runs hostname, it sees the name Docker assigned to it, NOT the name of the underlying host. That small detail keeps container identities clean and predictable.</p><h3>5. IPC Namespace</h3><p>Linux lets processes communicate directly through mechanisms like shared memory segments and message queues.</p><p>The Inter-Process Communication (<strong>IPC</strong>) namespace isolates these mechanisms<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-13" href="#footnote-13" target="_self">13</a>. Processes inside a container can only communicate with other processes in the same IPC namespace. They cannot access another container or the host via shared memory.</p><p>Without this isolation, a process in one container could potentially interfere with or read data from shared memory segments belonging to another container on the same host. The IPC namespace closes this gap.</p><h3>6. User Namespace</h3><p>The user namespace is the most powerful of the six, and also the most nuanced.</p><p>It maps user IDs and group IDs inside the container to different IDs on the host. A process can appear to run as root inside the container while actually mapping to an unprivileged user ID on the host.</p><p>This distinction is critical for security.</p><p>Many containers run their processes as root by default. Without user namespaces, the process is root on the host too. A container escape<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-14" href="#footnote-14" target="_self">14</a> would give an attacker full root access to the machine.</p><p>With user namespaces enabled, root inside the container is just a regular unprivileged user on the host. The blast radius of a container escape shrinks significantly.</p><p>User namespaces are what make rootless containers<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-15" href="#footnote-15" target="_self">15</a> possible.</p><p>Docker, Podman, and other container runtimes use them to let engineers run containers without needing root privileges on the host at all.</p><h3>How Namespaces Work Together</h3><p>No single namespace makes a container.</p><p>It is the combination of all six working together that creates the isolation engineers rely on:</p><ul><li><p>The PID namespace hides host processes.</p></li><li><p>Network namespace provides private networking.</p></li><li><p>Mount namespace gives each container its own filesystem.</p></li><li><p>UTS namespace sets a clean identity.</p></li><li><p>IPC namespace prevents cross-container memory interference.</p></li><li><p>User namespace limits the damage if something goes wrong.</p></li></ul><p>But namespaces only control what a container can see.</p><p>They say nothing about what it can consume. That is where the second Linux primitive is used&#8230;</p><div><hr></div><div class="callout-block" data-callout="true"><p><em><strong>Reminder: this is a teaser of the subscriber-only newsletter, exclusive to my golden members.</strong></em></p><p>When you upgrade, you&#8217;ll get:</p><ul><li><p><strong>Architecture breakdown of core DevOps systems.</strong></p></li><li><p>Deep dives into Docker, Kubernetes, Terraform, and so on.</p></li><li><p><strong>Practical insights into how real-world systems achieve scalability, automation, and reliability.</strong></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe&quot;,&quot;text&quot;:&quot;Unlock Full Access&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://newsletter.systemdesign.one/subscribe"><span>Unlock Full Access</span></a></p><p>Let&#8217;s keep going!</p></div><div><hr></div><h2>Linux Primitives: cgroups</h2>
      <p>
          <a href="https://newsletter.systemdesign.one/p/how-do-docker-containers-work">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Designing a Payment Backend with Stripe Integration]]></title><description><![CDATA[#152: The complete engineering blueprint for a Stripe-integrated payment backend]]></description><link>https://newsletter.systemdesign.one/p/design-a-payment-system</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/design-a-payment-system</guid><dc:creator><![CDATA[Hayk]]></dc:creator><pubDate>Wed, 10 Jun 2026 10:36:01 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/66b63c91-06ea-407e-a0c1-e696ae07e9c9_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Get my system design playbook for FREE on newsletter signup:</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><ul><li><p><em><a href="https://newsletter.systemdesign.one/p/design-a-payment-system/?action=share">Share this post</a> &amp; I'll send you some rewards for the referrals.</em></p></li><li><p><em>Block diagrams created using <a href="https://app.eraser.io/auth/sign-up?ref=neo">Eraser</a>.</em></p></li></ul><div><hr></div><p>A payment backend is one of the few systems where a bug doesn&#8217;t just cause a bad user experience but real money to vanish from user accounts.</p><p>This makes payment system design fundamentally different from most backend engineering&#8230;</p><p>The core challenge here is NOT performance or feature richness, but correctness under failure. Every design decision, from database choice to retry policy, must answer one question: <em>what happens when this component fails mid-transaction?</em></p><p>This is a complete system design blueprint for building a payment backend that integrates Stripe as the payment service provider.</p><p>Onward.</p><div><hr></div><h2><a href="https://cline.gg/neo-sdk">The agent harness wasn't supposed to be the black box (Partner)</a></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://cline.gg/neo-sdk" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ipAZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc36c01-1522-4551-8db1-c724782393c9_2048x1140.png 424w, https://substackcdn.com/image/fetch/$s_!ipAZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc36c01-1522-4551-8db1-c724782393c9_2048x1140.png 848w, https://substackcdn.com/image/fetch/$s_!ipAZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc36c01-1522-4551-8db1-c724782393c9_2048x1140.png 1272w, https://substackcdn.com/image/fetch/$s_!ipAZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc36c01-1522-4551-8db1-c724782393c9_2048x1140.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ipAZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc36c01-1522-4551-8db1-c724782393c9_2048x1140.png" width="1456" height="810" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6bc36c01-1522-4551-8db1-c724782393c9_2048x1140.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:810,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://cline.gg/neo-sdk&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ipAZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc36c01-1522-4551-8db1-c724782393c9_2048x1140.png 424w, https://substackcdn.com/image/fetch/$s_!ipAZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc36c01-1522-4551-8db1-c724782393c9_2048x1140.png 848w, https://substackcdn.com/image/fetch/$s_!ipAZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc36c01-1522-4551-8db1-c724782393c9_2048x1140.png 1272w, https://substackcdn.com/image/fetch/$s_!ipAZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6bc36c01-1522-4551-8db1-c724782393c9_2048x1140.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Agent loop is the most important piece of infrastructure in your workflow right now, and for most developers, it&#8217;s the one piece they can&#8217;t open up.</p><p>Agent builders have to jump through all the hoops themselves, crafting the infrastructure and tools, testing the harness, while fighting to maintain what they&#8217;ve built.</p><p><strong><a href="https://cline.gg/neo-sdk">Meet Cline SDK</a>:</strong> agent harness behind Cline 2.0, fully open-sourced. The same runtime that powers Cline across VS Code, JetBrains, and the CLI is now an npm install away: <code>npm i @cline/sdk</code>. Inspect it, fork it, extend it, ship on it.</p><ul><li><p>Best-in-class harness: 74.2% on Terminal-Bench 2.0 with Claude Opus 4.7 ahead of Claude Code (69.4%) and strongest numbers published on open-weight models.</p></li><li><p>Open model &amp; provider choice: Anthropic, OpenAI, Google, Bedrock, Mistral, or any OpenAI-compatible endpoint.</p></li><li><p>Real plugin system: Register tools, hooks, commands, providers, message builders. Prototype as a local file, harden into a package. Extend it freely for any of your agent use cases.</p></li><li><p>Scheduled + event-driven agents: Cron and event specs for PR reviews, dependency checks, coverage audits, changelogs no separate orchestration layer.</p></li></ul><p>Stop building around your agent. Start building on it.</p><p>Install Cline SDK today: <code>npm i @cline/sdk</code> Or try the rebuilt harness directly: <code>npm i -g @cline</code></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://cline.gg/neo-sdk&quot;,&quot;text&quot;:&quot;Get Started Today&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://cline.gg/neo-sdk"><span>Get Started Today</span></a></p><p>(Thanks to <a href="https://cline.gg/neo-sdk">Cline</a> for partnering on this post.)</p><div><hr></div><p>I want to reintroduce <strong><a href="https://linkedin.com/in/hayksimonyan">Hayk Simonyan</a></strong> as a guest author.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://youtube.com/@hayk.simonyan" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!TNRZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe42ce2a7-78b8-43b3-b7cf-b293d660240a_1748x720.png 424w, https://substackcdn.com/image/fetch/$s_!TNRZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe42ce2a7-78b8-43b3-b7cf-b293d660240a_1748x720.png 848w, https://substackcdn.com/image/fetch/$s_!TNRZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe42ce2a7-78b8-43b3-b7cf-b293d660240a_1748x720.png 1272w, https://substackcdn.com/image/fetch/$s_!TNRZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe42ce2a7-78b8-43b3-b7cf-b293d660240a_1748x720.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!TNRZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe42ce2a7-78b8-43b3-b7cf-b293d660240a_1748x720.png" width="1456" height="600" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e42ce2a7-78b8-43b3-b7cf-b293d660240a_1748x720.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:387657,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://youtube.com/@hayk.simonyan&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/188825279?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe42ce2a7-78b8-43b3-b7cf-b293d660240a_1748x720.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!TNRZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe42ce2a7-78b8-43b3-b7cf-b293d660240a_1748x720.png 424w, https://substackcdn.com/image/fetch/$s_!TNRZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe42ce2a7-78b8-43b3-b7cf-b293d660240a_1748x720.png 848w, https://substackcdn.com/image/fetch/$s_!TNRZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe42ce2a7-78b8-43b3-b7cf-b293d660240a_1748x720.png 1272w, https://substackcdn.com/image/fetch/$s_!TNRZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe42ce2a7-78b8-43b3-b7cf-b293d660240a_1748x720.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>He&#8217;s a senior software engineer specializing in helping developers break through their career plateaus and secure senior roles.</p><p>If you want to master the essential system design skills and land senior developer roles, I highly recommend checking out Hayk&#8217;s <strong><a href="https://youtube.com/@hayk.simonyan">YouTube channel</a></strong>.</p><p>His approach focuses on what top employers actually care about: system design expertise, advanced project experience, and elite-level interview performance.</p><div><hr></div><p><em><strong>Inside this newsletter, you&#8217;ll get:</strong></em></p><ul><li><p><strong>Three approaches to accepting payments.</strong> Why no-code checkout hits limits fast, when building your own processor makes sense, and why integrating a PSP like Stripe is the right call for most companies.</p></li><li><p><strong>How money actually moves.</strong> The full card transaction lifecycle from authorization to settlement, including the six entities involved and the engineering risks most developers miss.</p></li><li><p><strong>High-level architecture.</strong> The seven components of a production payment backend, how they split the synchronous and async paths, and why each boundary exists.</p></li><li><p><strong>Idempotency and exactly-once processing.</strong> How to design a system that never double-charges, even when servers crash mid-transaction, using idempotency keys, recovery points, and the atomic phases pattern.</p></li><li><p><strong>Webhook handling and the payment state machine.</strong> How to process Stripe webhooks reliably when duplicates and out-of-order delivery are expected, and how to enforce valid state transitions at the database level.</p></li><li><p><strong>Designing for high availability.</strong> How to approach 99.999% uptime across your API layer, database, and async workers, and why a circuit breaker in front of Stripe protects your own system more than it protects Stripe.</p></li></ul><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Golden members get all posts like these!&#8230;</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h3><strong>Three Approaches to Accepting Payments</strong></h3><p>Before diving into the design, it&#8217;s worth understanding the landscape&#8230;</p><p>When a company needs to accept payments, there are three broad approaches, and choosing the wrong one for your scale wastes either years of engineering time or millions in unnecessary fees.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aEqY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6ea27f-3c17-43df-85e8-0d278a080e95_1574x831.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aEqY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6ea27f-3c17-43df-85e8-0d278a080e95_1574x831.png 424w, https://substackcdn.com/image/fetch/$s_!aEqY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6ea27f-3c17-43df-85e8-0d278a080e95_1574x831.png 848w, https://substackcdn.com/image/fetch/$s_!aEqY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6ea27f-3c17-43df-85e8-0d278a080e95_1574x831.png 1272w, https://substackcdn.com/image/fetch/$s_!aEqY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6ea27f-3c17-43df-85e8-0d278a080e95_1574x831.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aEqY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6ea27f-3c17-43df-85e8-0d278a080e95_1574x831.png" width="1456" height="769" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7d6ea27f-3c17-43df-85e8-0d278a080e95_1574x831.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:769,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!aEqY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6ea27f-3c17-43df-85e8-0d278a080e95_1574x831.png 424w, https://substackcdn.com/image/fetch/$s_!aEqY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6ea27f-3c17-43df-85e8-0d278a080e95_1574x831.png 848w, https://substackcdn.com/image/fetch/$s_!aEqY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6ea27f-3c17-43df-85e8-0d278a080e95_1574x831.png 1272w, https://substackcdn.com/image/fetch/$s_!aEqY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7d6ea27f-3c17-43df-85e8-0d278a080e95_1574x831.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4><strong>Option 1: Build your own payment processor</strong></h4><p>This means connecting directly to card networks (Visa, Mastercard), acquiring banking licenses, handling PCI DSS<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a> (Payment Card Industry Data Security Standard, which is the set of security requirements every company that touches card data must comply with), Level 1 compliance<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a>, building your own fraud detection, and managing relationships with issuing banks.</p><p>The upside is lower transaction costs.</p><p>At a massive scale, even saving 0.5% off each transaction adds up to hundreds of millions per year. Amazon, Uber, and Airbnb have all moved in this direction for parts of their payment stack.</p><p>The downside is the cost to get there: <em>acquiring necessary licenses alone takes 12-24 months, costs millions, and comes with ongoing regulatory obligations</em>. So this approach only makes sense once you are processing billions in annual payment volume.</p><p>For anyone else, it is premature optimization at its extreme&#8230;</p><h4><strong>Option 2: Use a payment service provider (PSP) like Stripe, PayPal, Adyen, or Braintree</strong></h4><p>A PSP is a company that handles the entire payment processing chain on your behalf: <em>card network integrations, banking relationships, fraud tooling, PCI DSS compliance, and global payment method support.</em></p><p>You pay a per-transaction fee, typically around 2.9% + $0.30 with Stripe, in exchange for not having to build or maintain any of that infrastructure. This is the right approach for most companies, from early-stage startups to large-scale platforms.</p><p>Even Shopify, which processes billions in payments annually, built its own payment product (Shopify Payments) on top of Stripe&#8217;s infrastructure rather than connecting directly to card networks.</p><h4><strong>Option 3: Use a no-code payment flow, such as Stripe Checkout</strong></h4><p>Stripe offers hosted checkout pages and payment links that require almost no backend integration.</p><p>You create a checkout session, redirect the user to Stripe&#8217;s hosted page, and Stripe handles everything: <em>UI, payment method selection, and confirmation.</em></p><p>This is the fastest way to accept payments, and it works well for simple use cases: <em>selling a single product, collecting donations, or building a quick prototype</em>.</p><p>The trade-off is limited customization and less control over the payment experience.</p><p>You cannot deeply embed it in your own UI, easily build custom subscription logic, or react to payment events in real time with full control over the flow.</p><div><hr></div><h2><strong>How Money Moves Through Card Network</strong></h2><p>Understanding the payment flow end-to-end is a prerequisite to designing a backend that handles it correctly&#8230;</p><p>Six entities participate in each card transaction:</p><ol><li><p><strong>Cardholder</strong></p></li><li><p><strong>Merchant </strong>(Business or individual selling the product or service)</p></li><li><p><strong>PSP</strong> (Payment Service Provider, in this case, Stripe)</p></li><li><p><strong>Acquiring bank</strong> (Merchant&#8217;s bank)</p></li><li><p><strong>Card network</strong> (Visa/Mastercard)</p></li><li><p><strong>Issuing bank</strong> (Cardholder&#8217;s bank)</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Ue8j!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28a8f653-6ea1-4e45-a89f-134603e8bd2c_859x560.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ue8j!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28a8f653-6ea1-4e45-a89f-134603e8bd2c_859x560.png 424w, https://substackcdn.com/image/fetch/$s_!Ue8j!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28a8f653-6ea1-4e45-a89f-134603e8bd2c_859x560.png 848w, https://substackcdn.com/image/fetch/$s_!Ue8j!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28a8f653-6ea1-4e45-a89f-134603e8bd2c_859x560.png 1272w, https://substackcdn.com/image/fetch/$s_!Ue8j!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28a8f653-6ea1-4e45-a89f-134603e8bd2c_859x560.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ue8j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28a8f653-6ea1-4e45-a89f-134603e8bd2c_859x560.png" width="859" height="560" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/28a8f653-6ea1-4e45-a89f-134603e8bd2c_859x560.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:560,&quot;width&quot;:859,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Ue8j!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28a8f653-6ea1-4e45-a89f-134603e8bd2c_859x560.png 424w, https://substackcdn.com/image/fetch/$s_!Ue8j!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28a8f653-6ea1-4e45-a89f-134603e8bd2c_859x560.png 848w, https://substackcdn.com/image/fetch/$s_!Ue8j!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28a8f653-6ea1-4e45-a89f-134603e8bd2c_859x560.png 1272w, https://substackcdn.com/image/fetch/$s_!Ue8j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F28a8f653-6ea1-4e45-a89f-134603e8bd2c_859x560.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Money flows through 3 distinct phases, each with different timing and failure modes&#8230;</p><h3><strong>Phase 1: Authorization (1-3 seconds)</strong></h3><p>The customer submits card details through <code>Stripe Elements</code>.</p><p>These are technically <code>iframes</code> hosted by Stripe, even if they look like part of your site. We use <code>Stripe.js</code>, which is a JavaScript library that Stripe requires you to load directly from their servers (for security reasons).</p><p>The process starts on the backend, where a&nbsp;<code>PaymentIntent</code><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a>&nbsp;gets created&nbsp;via Stripe&#8217;s API to track the transaction lifecycle. This returns a <code>client_secret</code> to the frontend.</p><p>The customer then enters their card details into <code>Stripe Elements</code> - secure <code>iframes</code> hosted by Stripe that look like part of your site. Using <code>Stripe.js</code>, the client-side code tokenizes the card details so the <strong>PAN</strong> (Primary Account Number: a 14 to 16-digit number on a credit or debit card) never reaches the merchant&#8217;s server.</p><h4><strong>What is PaymentIntent?</strong></h4><p>A <code>PaymentIntent</code> is a stateful object Stripe uses to track a single payment from start to finish.</p><p>Think of it as the source of truth for a transaction&#8230;</p><p>In older systems, you&#8217;d just send a &#8220;charge&#8221; request and hope it worked. With modern payments, things are more complex because of 2FA (e.g., 3D Secure<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a>) or fraud checks.</p><p><code>PaymentIntent</code> manages this by moving through different states:</p><ul><li><p><strong>Requires payment method:</strong> You created the intent, but the user hasn&#8217;t typed their card yet.</p></li><li><p><strong>Requires action:</strong> User must verify the payment in their bank app.</p></li><li><p><strong>Processing:</strong> Stripe is talking to the banks.</p></li><li><p><strong>Succeeded:</strong> Money is authorized or captured.</p></li></ul><p>Stripe formats an ISO 8583 authorization message<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a> and sends it to the acquiring bank<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a>, which identifies the card network via the BIN<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-7" href="#footnote-7" target="_self">7</a> (first 6-8 digits) and forwards the request.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dCHE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F276b57f3-192b-4b9e-ade5-f57eaf20cc2f_1566x2048.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dCHE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F276b57f3-192b-4b9e-ade5-f57eaf20cc2f_1566x2048.png 424w, https://substackcdn.com/image/fetch/$s_!dCHE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F276b57f3-192b-4b9e-ade5-f57eaf20cc2f_1566x2048.png 848w, https://substackcdn.com/image/fetch/$s_!dCHE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F276b57f3-192b-4b9e-ade5-f57eaf20cc2f_1566x2048.png 1272w, https://substackcdn.com/image/fetch/$s_!dCHE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F276b57f3-192b-4b9e-ade5-f57eaf20cc2f_1566x2048.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dCHE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F276b57f3-192b-4b9e-ade5-f57eaf20cc2f_1566x2048.png" width="1456" height="1904" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/276b57f3-192b-4b9e-ade5-f57eaf20cc2f_1566x2048.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1904,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!dCHE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F276b57f3-192b-4b9e-ade5-f57eaf20cc2f_1566x2048.png 424w, https://substackcdn.com/image/fetch/$s_!dCHE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F276b57f3-192b-4b9e-ade5-f57eaf20cc2f_1566x2048.png 848w, https://substackcdn.com/image/fetch/$s_!dCHE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F276b57f3-192b-4b9e-ade5-f57eaf20cc2f_1566x2048.png 1272w, https://substackcdn.com/image/fetch/$s_!dCHE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F276b57f3-192b-4b9e-ade5-f57eaf20cc2f_1566x2048.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The card network routes it to the issuing bank, which checks card validity, available funds, CVV/AVS<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-8" href="#footnote-8" target="_self">8</a> match, and fraud risk models.</p><ul><li><p>The issuer returns a two-digit response code, approve or decline, back through the entire chain.</p></li><li><p>If approved, a <strong>hold</strong> gets placed on the cardholder&#8217;s available balance. But no money moves yet.</p></li></ul><p>Mastercard reports an average network response time of&nbsp;<em>130 milliseconds</em>; the full round-trip, including all hops, completes in 1-3 seconds.</p><p>Visa&#8217;s network handles a peak of <em>56,000+ messages per second</em>.</p><h3><strong>Phase 2: Capture (immediate/delayed)</strong></h3><p>Capture<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-9" href="#footnote-9" target="_self">9</a> is when the merchant tells acquiring bank (the merchant&#8217;s bank) to finalize the authorized amount.</p><p>For digital goods and subscriptions, capture occurs immediately. Stripe&#8217;s default is <code>capture_method: automatic</code>.</p><p>For physical goods, hotels, or ride-hailing, capture is delayed until fulfillment. You can capture an amount less than or equal to what was authorized, but never more. Authorization holds<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-10" href="#footnote-10" target="_self">10</a> typically last 5 to 10 days.</p><p>Visa allows 10 days for standard e-commerce and up to 31 days for lodging.</p><p><em><strong>Here&#8217;s the Engineering Risk:</strong></em></p><p>If you don&#8217;t capture within 7 days, the issuing bank might cancel the hold. This is a common source of bugs. Your state machine must treat AUTHORIZED and CAPTURED as &#8220;distinct&#8221; states. If your system thinks a payment is authorized but the bank has dropped the hold, the capture call will fail.</p><p>So you need a background job to detect these &#8220;stuck&#8221; payments and mark them as expired.</p><h3><strong>Phase 3: Clearing and settlement (T+1 to T+3)</strong></h3><p>At the end of the business day, captured transactions get batched and sent to the card network for clearing.</p><p>The network calculates fees and exchanges transaction files overnight&#8230;</p><p>Settlement is when the actual money moves. The issuing bank sends the funds (minus fees) to the card network, which then passes them to the acquiring bank. </p><p>The acquiring bank finally deposits them into the merchant&#8217;s account.</p><p>In banking, <strong>&#8220;T&#8221;</strong> stands for the Transaction Date. <strong>T+2</strong> means the money arrives two business days after the transaction. Stripe&#8217;s US default is T+2, though new accounts usually have an initial hold of 7 to 14 days.</p><h3><strong>Fee Breakdown</strong></h3><p>On a $100 US online transaction, the 2.9% + $0.30 fee gets split three ways:</p><ul><li><p><strong>Interchange</strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-11" href="#footnote-11" target="_self">11</a><strong> (~$2.05):</strong> This goes to the <em>Issuing Bank</em> (the customer&#8217;s bank). This is the largest cut. It covers the bank&#8217;s risk and pays for the customer&#8217;s credit card rewards.</p></li><li><p><strong>Assessment (~$0.16):</strong> This goes to the <em>Card Network</em> (Visa or Mastercard) for using their rails.</p></li><li><p><strong>Markup (~$0.70):</strong> This is what <em>Stripe</em> keeps for providing the API, security, and infrastructure.</p></li></ul><div><hr></div><h2><strong>Functional and Non-Functional Requirements</strong></h2><p>Functional requirements for a payment backend serving a mid-to-large platform fall into 6 categories:</p><ol><li><p>Customers must be able to make one-time payments and save payment methods for reuse.</p></li><li><p>Merchants or the platform must be able to accept payments, with support for marketplace-style split payments if needed.</p></li><li><p>Refunds, both full and partial, must flow through a dedicated refund state machine.</p></li><li><p>System must handle subscriptions and recurring billing, including proration on plan changes, trial periods, and Stripe&#8217;s Smart Retries for failed renewal payments.</p></li><li><p>Backend must process Stripe webhooks reliably, as webhooks are the <em>source of truth</em> for payment status.</p></li><li><p>The entire payment lifecycle must be modeled as a finite-state machine with enforced transitions.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2ZHF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f69585b-f2e0-4ea0-8a96-07840c24b0ca_2048x1158.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2ZHF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f69585b-f2e0-4ea0-8a96-07840c24b0ca_2048x1158.png 424w, https://substackcdn.com/image/fetch/$s_!2ZHF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f69585b-f2e0-4ea0-8a96-07840c24b0ca_2048x1158.png 848w, https://substackcdn.com/image/fetch/$s_!2ZHF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f69585b-f2e0-4ea0-8a96-07840c24b0ca_2048x1158.png 1272w, https://substackcdn.com/image/fetch/$s_!2ZHF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f69585b-f2e0-4ea0-8a96-07840c24b0ca_2048x1158.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2ZHF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f69585b-f2e0-4ea0-8a96-07840c24b0ca_2048x1158.png" width="1456" height="823" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4f69585b-f2e0-4ea0-8a96-07840c24b0ca_2048x1158.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:823,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2ZHF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f69585b-f2e0-4ea0-8a96-07840c24b0ca_2048x1158.png 424w, https://substackcdn.com/image/fetch/$s_!2ZHF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f69585b-f2e0-4ea0-8a96-07840c24b0ca_2048x1158.png 848w, https://substackcdn.com/image/fetch/$s_!2ZHF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f69585b-f2e0-4ea0-8a96-07840c24b0ca_2048x1158.png 1272w, https://substackcdn.com/image/fetch/$s_!2ZHF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f69585b-f2e0-4ea0-8a96-07840c24b0ca_2048x1158.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Non-functional requirements are where payment systems diverge sharply from typical backend services:</p><ul><li><p><strong>Exactly-once payment processing</strong> is the key requirement. A double charge on a $1,000 purchase means money taken from a person twice. True exactly-once delivery is impossible in distributed systems (Two Generals Problem<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-12" href="#footnote-12" target="_self">12</a>), so the practical implementation is <em>at-least-once delivery combined with idempotent processing and reconciliation.</em></p></li><li><p><strong>High availability</strong> targets are extreme. Stripe itself maintains 99.999% API uptime.</p></li><li><p><strong>Idempotency</strong> must be enforced at every layer: <em>client-to-backend, backend-to-Stripe, and webhook processing.</em> Every retry must produce the same result as the original request.</p></li><li><p><strong>Consistency over availability.</strong> Payment systems are one of the few domains where the CAP theorem should tilt decisively toward consistency. A stale read that shows an incorrect balance or a lost write that drops a payment is far worse than brief unavailability. This is why every major payment platform, including Shopify, Uber, and Airbnb, uses <em>SQL databases with ACID guarantees</em> for core payment data.</p></li></ul><h4><strong>Scale estimates for a mid-to-large platform</strong></h4><p>A platform processing 100,000 payments per day generates roughly 500,000-1,000,000 webhook events daily (each payment triggers 5-10 events across creation, authorization, capture, and related objects).</p><p>Stripe&#8217;s default API rate limit is <em>100 requests/second</em> per account, with individual endpoints limited to 25 requests/second; higher limits are available by arrangement.</p><p>Payment API latency should be under 5 seconds end-to-end, including the Stripe round-trip, with internal service-to-service calls under 100ms.</p><div><hr></div><div class="callout-block" data-callout="true"><p><em><strong>Reminder: this is a teaser of the subscriber-only newsletter series, exclusive to my golden members.</strong></em></p><p>When you upgrade, you&#8217;ll get:</p><ul><li><p><strong>High-level architecture of real-world systems.</strong></p></li><li><p>Deep dive into how popular real-world systems actually work.</p></li><li><p><strong>How real-world systems handle scale, reliability, and performance.</strong></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?yearly=true&quot;,&quot;text&quot;:&quot;Unlock Full Access&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/subscribe?yearly=true"><span>Unlock Full Access</span></a></p></div><div><hr></div><h2><strong>High-Level Architecture</strong></h2><p>The architecture splits into seven components, each with a distinct responsibility.</p><p>It isolates the synchronous customer-facing path from asynchronous processing and keeps the webhook ingestion pipeline decoupled from business logic.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ClZ1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c44b59-8e5c-4a67-ab96-4a709836b183_2048x388.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ClZ1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c44b59-8e5c-4a67-ab96-4a709836b183_2048x388.png 424w, https://substackcdn.com/image/fetch/$s_!ClZ1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c44b59-8e5c-4a67-ab96-4a709836b183_2048x388.png 848w, https://substackcdn.com/image/fetch/$s_!ClZ1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c44b59-8e5c-4a67-ab96-4a709836b183_2048x388.png 1272w, https://substackcdn.com/image/fetch/$s_!ClZ1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c44b59-8e5c-4a67-ab96-4a709836b183_2048x388.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ClZ1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c44b59-8e5c-4a67-ab96-4a709836b183_2048x388.png" width="1456" height="276" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/36c44b59-8e5c-4a67-ab96-4a709836b183_2048x388.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:276,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ClZ1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c44b59-8e5c-4a67-ab96-4a709836b183_2048x388.png 424w, https://substackcdn.com/image/fetch/$s_!ClZ1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c44b59-8e5c-4a67-ab96-4a709836b183_2048x388.png 848w, https://substackcdn.com/image/fetch/$s_!ClZ1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c44b59-8e5c-4a67-ab96-4a709836b183_2048x388.png 1272w, https://substackcdn.com/image/fetch/$s_!ClZ1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F36c44b59-8e5c-4a67-ab96-4a709836b183_2048x388.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h4><strong>1 Payment API Service</strong> </h4><p>It&#8217;s the synchronous entry point.</p><p>It receives payment requests from checkout, validates input, checks idempotency keys<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-13" href="#footnote-13" target="_self">13</a> against the database, creates or retrieves the payment record, and returns an immediate response to the client.</p><p>For Stripe integrations, this service creates a <code>PaymentIntent</code> and returns the <code>client_secret</code> to the frontend, which uses <code>Stripe.js</code> to complete the payment (including 3D Secure challenges).</p><p>The API service should never block on downstream processing. It creates the payment record, dispatches work, and returns.</p><h4><strong>2 Stripe Integration Layer</strong> </h4><p>It abstracts all Stripe-specific API calls behind a uniform interface.</p><p>This adapter handles Stripe&#8217;s error types, maps them to internal error codes, attaches idempotency keys to every POST request, and manages timeouts. Shopify and Airbnb both use this pattern; Airbnb calls it the <em>&#8220;PSP adapter,&#8221;</em> which isolates provider-specific logic from the core payment domain.</p><p>If you ever need to support a second PSP (Adyen, Braintree), only this layer changes.</p><h4><strong>3 Payment Database</strong></h4><p>This is the system of record.</p><p>It stores the current state of every payment, idempotency keys, and the immutable audit log. The schema design is covered in the next section, but the critical principle is: <code>payments</code> table holds a mutable current state (optimized for queries), while the payment events table holds an&nbsp;<em>append-only immutable log</em>&nbsp;of every state change (optimized for audit, debugging, and reconciliation).</p><p>Both exist in the same SQL database and get updated within the same transaction.</p><h4><strong>4 Webhook Receiver</strong> </h4><p>It&#8217;s a lightweight HTTP endpoint that does exactly three things:<em> verify the Stripe signature (HMAC-SHA256</em><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-14" href="#footnote-14" target="_self">14</a><em> using the Stripe-Signature header), store the raw event, and return 200 OK.</em></p><p>It must respond within seconds, since Stripe has an approximately 20-second timeout. All business logic happens asynchronously. The receiver enqueues the event onto the message queue for processing by workers.</p><h4><strong>5 Message Queue</strong></h4><p>It (Kafka, SQS, or RabbitMQ) decouples webhook receipt from processing and provides at-least-once delivery guarantees.</p><p>Uber uses Apache Kafka as the backbone of their payment platform&#8217;s async stream processing. The queue also supports the transactional outbox pattern<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-15" href="#footnote-15" target="_self">15</a>: when a payment state change is committed to the database, an outbox record is written in the same transaction, then relayed to the queue by a separate process.</p><h4><strong>6 Background Job Workers</strong> </h4><p>They handle 4 categories of async work:</p><ul><li><p>Webhook event processing: dequeuing events and applying state transitions idempotently,</p></li><li><p>Retry workers: retrying failed PSP calls with exponential backoff,</p></li><li><p>A reconciliation worker: daily comparison of internal records against Stripe&#8217;s records,</p></li><li><p>And a stuck-payment detector: alerting on payments in intermediate states beyond a configurable threshold.</p></li></ul><h4><strong>7 Ledger</strong> </h4><p>It provides double-entry bookkeeping<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-16" href="#footnote-16" target="_self">16</a>.</p><p>Every money movement is recorded as a balanced pair of debit and credit entries. Uber explicitly built its next-generation payment platform on double-entry bookkeeping for auditability, and Stripe&#8217;s own ledger system logs approximately <em>5 billion money-movement events daily.</em></p><p>The ledger is append-only.</p><p>If a mistake needs correction, a new reversing entry is inserted, never an update or delete.</p><p>The high-level architecture tells us what to build, but database design is where correctness is either enforced or lost. Every pattern we covered above, idempotency, exactly-once processing, the state machine, all of them depend on the database schema doing the right thing.</p><p>If we get this wrong, no amount of application-level logic will matter.</p><p>So let's see what the database design looks like&#8230;</p><div><hr></div><h2><strong>Database Schema to Enforce Correctness</strong></h2>
      <p>
          <a href="https://newsletter.systemdesign.one/p/design-a-payment-system">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[The Anatomy of OpenClaw]]></title><description><![CDATA[#151: Understanding How OpenClaw Works]]></description><link>https://newsletter.systemdesign.one/p/openclaw-architecture</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/openclaw-architecture</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Mon, 08 Jun 2026 11:46:05 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/f1017994-80b3-48f7-b27d-79346387128b_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Get my system design playbook for FREE on newsletter signup:</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><ul><li><p><em><a href="https://newsletter.systemdesign.one/p/openclaw-architecture/?action=share">Share this post</a> &amp; I'll send you some rewards for the referrals.</em></p></li></ul><div><hr></div><p>You ask ChatGPT to write an email.</p><p>It drafts it&#8230; But you still have to copy the text, paste it into Gmail, and hit send. AI did the thinking,,,YOU did the task.</p><p>OpenClaw changes this&#8230;</p><p>It&#8217;s an open-source autonomous AI agent<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a> that runs on your machine, connects to your messaging apps, and does the work itself. You could message it on Telegram: <em>&#8220;Check my inbox, pull any invoices, save the attachments.</em>&#8221; Then it connects to your email, finds invoices, downloads the attachments, saves them, and messages you back with a summary.</p><p>You don&#8217;t have to open a single app&#8230;</p><p>OpenClaw bridges the gap between the thinking layer and the act layer.</p><p>Large language models (<strong>LLMs</strong>), such as Claude, ChatGPT, and Gemini, provide reasoning. While OpenClaw<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a> provides hands.</p><p>Onward.</p><div><hr></div><div class="callout-block" data-callout="true"><h2><a href="https://myclaw.ai/?utm_source=sub-systemdesignnewsletter">Run OpenClaw with MyClaw</a></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://myclaw.ai/?utm_source=sub-systemdesignnewsletter" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rx80!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc24a806-4449-454d-913f-4268f8f6b5b0_2172x724.png 424w, https://substackcdn.com/image/fetch/$s_!rx80!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc24a806-4449-454d-913f-4268f8f6b5b0_2172x724.png 848w, https://substackcdn.com/image/fetch/$s_!rx80!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc24a806-4449-454d-913f-4268f8f6b5b0_2172x724.png 1272w, https://substackcdn.com/image/fetch/$s_!rx80!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc24a806-4449-454d-913f-4268f8f6b5b0_2172x724.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rx80!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc24a806-4449-454d-913f-4268f8f6b5b0_2172x724.png" width="1456" height="485" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bc24a806-4449-454d-913f-4268f8f6b5b0_2172x724.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:485,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1418858,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://myclaw.ai/?utm_source=sub-systemdesignnewsletter&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/196042495?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc24a806-4449-454d-913f-4268f8f6b5b0_2172x724.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rx80!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc24a806-4449-454d-913f-4268f8f6b5b0_2172x724.png 424w, https://substackcdn.com/image/fetch/$s_!rx80!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc24a806-4449-454d-913f-4268f8f6b5b0_2172x724.png 848w, https://substackcdn.com/image/fetch/$s_!rx80!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc24a806-4449-454d-913f-4268f8f6b5b0_2172x724.png 1272w, https://substackcdn.com/image/fetch/$s_!rx80!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbc24a806-4449-454d-913f-4268f8f6b5b0_2172x724.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The best AI assistants aren&#8217;t the ones waiting for your next prompt&#8212;they&#8217;re the ones that send you the answer before you think to ask.</p><p><strong><a href="https://myclaw.ai/?utm_source=sub-systemdesignnewsletter">MyClaw</a></strong> runs OpenClaw in the cloud, schedules recurring tasks, and delivers updates directly to Telegram or WhatsApp, so it feels less like another chatbot and more like an assistant that&#8217;s actually on the job.</p><p>If this newsletter got you interested in OpenClaw, <a href="https://myclaw.ai/?utm_source=sub-systemdesignnewsletter">MyClaw</a> is an easy way to see what an always-on AI assistant feels like.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://myclaw.ai/?utm_source=sub-systemdesignnewsletter&quot;,&quot;text&quot;:&quot;Try MyClaw&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://myclaw.ai/?utm_source=sub-systemdesignnewsletter"><span>Try MyClaw</span></a></p><p>(Thanks to <a href="https://myclaw.ai/?utm_source=sub-systemdesignnewsletter">MyClaw</a> for partnering on this post.)</p></div><div><hr></div><p><em><strong>Here&#8217;s what you&#8217;ll find inside this newsletter:</strong></em></p><ul><li><p><strong>What OpenClaw actually does.</strong> Why it&#8217;s different from every AI tool you&#8217;ve already tried.</p></li><li><p><strong>How the Gateway works.</strong> The always-on server running on your machine that makes everything else possible.</p></li><li><p><strong>Skill system</strong>. How to install the right ones first, and what most people get wrong.</p></li><li><p><strong>What breaks and why</strong>. Most common failure modes, with fixes for each.</p></li><li><p><strong>The real security risks</strong>. Documented, avoidable, and worth reading before you touch a single setting.</p></li><li><p><strong>How to build your own</strong>. Full architecture in five layers, from the ground up.</p></li></ul><p>By the end of this newsletter, you will understand OpenClaw well enough to run it.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Golden members get all posts like these!&#8230;</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h2><strong>What Is OpenClaw</strong></h2><p>OpenClaw is the orchestration layer, the connector between an LLM (like Claude, GPT, or Gemini) and your real-world tools.</p><p>The intelligence comes from the LLM you connect to it.</p><p>Think of the LLM as the brain: <em>it reasons, plans, and decides what to do. </em>OpenClaw is the hand: <em>it executes those decisions across your files, messaging apps, shell, and APIs.</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!g6oU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd17cbfe-8fda-45bf-afeb-b4a4bb6c8ff9_2048x1009.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!g6oU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd17cbfe-8fda-45bf-afeb-b4a4bb6c8ff9_2048x1009.png 424w, https://substackcdn.com/image/fetch/$s_!g6oU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd17cbfe-8fda-45bf-afeb-b4a4bb6c8ff9_2048x1009.png 848w, https://substackcdn.com/image/fetch/$s_!g6oU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd17cbfe-8fda-45bf-afeb-b4a4bb6c8ff9_2048x1009.png 1272w, https://substackcdn.com/image/fetch/$s_!g6oU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd17cbfe-8fda-45bf-afeb-b4a4bb6c8ff9_2048x1009.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!g6oU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd17cbfe-8fda-45bf-afeb-b4a4bb6c8ff9_2048x1009.png" width="1456" height="717" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fd17cbfe-8fda-45bf-afeb-b4a4bb6c8ff9_2048x1009.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:717,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!g6oU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd17cbfe-8fda-45bf-afeb-b4a4bb6c8ff9_2048x1009.png 424w, https://substackcdn.com/image/fetch/$s_!g6oU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd17cbfe-8fda-45bf-afeb-b4a4bb6c8ff9_2048x1009.png 848w, https://substackcdn.com/image/fetch/$s_!g6oU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd17cbfe-8fda-45bf-afeb-b4a4bb6c8ff9_2048x1009.png 1272w, https://substackcdn.com/image/fetch/$s_!g6oU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffd17cbfe-8fda-45bf-afeb-b4a4bb6c8ff9_2048x1009.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Here&#8217;s what OpenClaw offers:</p><ul><li><p><strong>A gateway</strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a><strong> that runs on your machine (Mac, Linux)</strong></p><p>This is the always-on server running on your machine that coordinates everything: <em>your messaging apps, LLM, tools</em><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a><em>, and memory</em>.</p></li><li><p><strong>A multi-channel messaging interface: WhatsApp, Telegram,</strong> <strong>and so on.</strong></p><p>You talk to the same assistant from all these apps, with shared context and memory, instead of managing a different bot per platform.</p></li><li><p><strong>A skills platform with 5,400+ modular capabilities on ClawHub</strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a><strong>.</strong></p><p>Skills<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a> are plain Markdown files that tell the agent how to perform a specific task, like checking your GitHub PRs or sending a Slack message.</p></li><li><p><strong>A persistent memory system in plain Markdown files you own.</strong></p><p>The agent&#8217;s knowledge, preferences, and logs are stored as editable Markdown on disk, so you can inspect, version-control, and move its LLM context like code.</p></li><li><p><strong>Proactive scheduling engine (Heartbeat</strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-7" href="#footnote-7" target="_self">7</a><strong> + cron jobs) that acts without being prompted.</strong></p><p>OpenClaw can wake itself up on a schedule to check servers, triage email, or send summaries, instead of waiting for you to type a command.</p></li><li><p><strong>Model-agnostic: plug in Claude, GPT, DeepSeek, Gemini, Grok, or local models via Ollama</strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-8" href="#footnote-8" target="_self">8</a><strong>.</strong></p><p>You can mix and match models (cheap vs powerful, cloud vs local) and route different tasks to different providers to optimize cost and performance.</p></li></ul><div><hr></div><h2><strong>How It Differs From Other AI Tools</strong></h2><p>Here&#8217;s how:</p><ul><li><p><strong>ChatGPT, Claude, Gemini:</strong> You prompt them, and they respond. They have no access to your email, no ability to run scripts, and no memory once you close the tab<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-9" href="#footnote-9" target="_self">9</a>.</p></li><li><p><strong>Siri, Google Assistant:</strong> Polished products, but closed ones. You can&#8217;t add custom skills, connect arbitrary APIs, or self-host them.</p></li><li><p><strong>LangChain, CrewAI, AutoGen:</strong> Developer frameworks. You write the Python, define the chains, and build the interfaces from scratch. OpenClaw ships all of that out of the box.</p></li><li><p><strong>Claude Code, Codex CLI:</strong> Terminal tools for coding sessions. Reactive and session-based. OpenClaw runs 24/7 for everything, not just code.</p></li></ul><p>So OpenClaw is NOT just a product you use in a browser tab.</p><p>It is a service that runs on your machine and continues to work while you&#8217;re away.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/openclaw-architecture?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/openclaw-architecture?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div><hr></div><h2><strong>How OpenClaw Processes Messages</strong></h2><p>Imagine you send a single Telegram message at 9 pm:</p><p><em>&#8220;Check my open PRs and let me know if anything needs a response tonight.&#8221;</em></p><p>You lock your phone and go to sleep&#8230;</p><p>By morning, you will have a reply:</p><p>Three PRs are open, and one has a teammate's review comment asking about error handling. OpenClaw drafted a response and flagged it for your approval, leaving the other two untouched because they were still in CI. It also remembered that last week you said you prefer to handle auth-related reviews yourself, so it left the one in the auth module alone.</p><p>None of this required you to open GitHub, write a prompt, or copy anything between tabs&#8230;</p><h3><strong>Why OpenClaw Runs 24/7 on Your Machine</strong></h3><p>When you run the OpenClaw gateway, you start a Node.js server that binds to port <code>18789</code> and stays running.</p><p>This is the fundamental difference between OpenClaw and a browser-based AI tool&#8230;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lL9I!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F342c7659-8bd7-4aa9-9080-7d23204859d0_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lL9I!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F342c7659-8bd7-4aa9-9080-7d23204859d0_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!lL9I!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F342c7659-8bd7-4aa9-9080-7d23204859d0_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!lL9I!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F342c7659-8bd7-4aa9-9080-7d23204859d0_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!lL9I!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F342c7659-8bd7-4aa9-9080-7d23204859d0_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lL9I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F342c7659-8bd7-4aa9-9080-7d23204859d0_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/342c7659-8bd7-4aa9-9080-7d23204859d0_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!lL9I!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F342c7659-8bd7-4aa9-9080-7d23204859d0_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!lL9I!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F342c7659-8bd7-4aa9-9080-7d23204859d0_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!lL9I!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F342c7659-8bd7-4aa9-9080-7d23204859d0_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!lL9I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F342c7659-8bd7-4aa9-9080-7d23204859d0_1536x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Every mainstream AI assistant, including ChatGPT, Claude, and even DeepResearch mode, only exists while you have a tab open. (DeepResearch can run a long session, but once it&#8217;s done, it stops.)</p><p>i.e., if you close the tab, everything disappears.</p><p>But OpenClaw never stops:</p><p>It runs as a background daemon on your local server and stays alive whether you are at your desk or asleep. That persistence is the foundation of everything else: <em>scheduled jobs, proactive alerts, multi-channel messaging, and long-term memory</em>. None of it works without a process that is always on.</p><p>This central server is called the Gateway&#8230;</p><h3><strong>Gateway: Control Center of Your Agent</strong></h3><p>The Gateway orchestrates everything.</p><p>It sits between your messaging apps, LLM, and tools, coordinating every request from the moment it arrives until a reply goes back out.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!L-RJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd99a9f7f-11e6-4c1a-9214-d705f4839451_2048x964.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!L-RJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd99a9f7f-11e6-4c1a-9214-d705f4839451_2048x964.png 424w, https://substackcdn.com/image/fetch/$s_!L-RJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd99a9f7f-11e6-4c1a-9214-d705f4839451_2048x964.png 848w, https://substackcdn.com/image/fetch/$s_!L-RJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd99a9f7f-11e6-4c1a-9214-d705f4839451_2048x964.png 1272w, https://substackcdn.com/image/fetch/$s_!L-RJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd99a9f7f-11e6-4c1a-9214-d705f4839451_2048x964.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!L-RJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd99a9f7f-11e6-4c1a-9214-d705f4839451_2048x964.png" width="1456" height="685" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d99a9f7f-11e6-4c1a-9214-d705f4839451_2048x964.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:685,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!L-RJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd99a9f7f-11e6-4c1a-9214-d705f4839451_2048x964.png 424w, https://substackcdn.com/image/fetch/$s_!L-RJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd99a9f7f-11e6-4c1a-9214-d705f4839451_2048x964.png 848w, https://substackcdn.com/image/fetch/$s_!L-RJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd99a9f7f-11e6-4c1a-9214-d705f4839451_2048x964.png 1272w, https://substackcdn.com/image/fetch/$s_!L-RJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd99a9f7f-11e6-4c1a-9214-d705f4839451_2048x964.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>When a message arrives from Telegram, WhatsApp, or Slack, the Gateway <em>authenticates</em> the sender and creates or retrieves a session for the conversation.</p><p>It then assembles the full context<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-10" href="#footnote-10" target="_self">10</a>, passes it to the LLM, handles any tool calls that come back, and routes the final reply to the correct channel.</p><p>Say you ask the agent to clean up old log files:</p><p>Before it runs anything, the Gateway intercepts the shell command and sends you a confirmation request through Telegram: <em>&#8220;I&#8217;m about to run</em><code> $ rm -rf ~/logs/*.log</code><em>, approve this?&#8221;</em></p><p>Nothing executes until you say yes&#8230; If you don&#8217;t respond, it waits&#8230;</p><p>The Gateway also serves the Control UI at <code>http://localhost:18789</code>.</p><p>It&#8217;s a browser-based dashboard that lets you watch the agent&#8217;s reasoning in real time, approve pending commands, and inspect active sessions. Every tool call, model response, and approval request shows up here live. Since the Gateway runs on your Mac Mini or VPS, you can access the Control UI from any browser on the same network. If you use Tailscale<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-11" href="#footnote-11" target="_self">11</a>, you can reach it from your phone or laptop without being on the same network.</p><p>The Gateway also supports hot configuration reloads&#8230;</p><p>You can change your model, update permissions, or add a new channel without restarting the process. The running server picks up the changes and applies them immediately.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/openclaw-architecture?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/openclaw-architecture?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><h3><strong>Channel Layer: How OpenClaw Talks to Messaging Apps</strong></h3><p>OpenClaw connects to Telegram, WhatsApp, Slack.</p><p>Each of these works completely differently at the protocol level:</p><ul><li><p>Telegram uses a bot token with polling or webhook delivery.</p></li><li><p>WhatsApp uses a reverse-engineered web protocol; it requires QR-code authentication and stores session state locally.</p></li><li><p>Slack uses Socket Mode with two separate token types.</p></li><li><p>Discord uses a gateway WebSocket with its own heartbeat requirements.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OUz4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd48e1488-5a16-4112-befc-45c84c20f193_2048x972.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OUz4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd48e1488-5a16-4112-befc-45c84c20f193_2048x972.png 424w, https://substackcdn.com/image/fetch/$s_!OUz4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd48e1488-5a16-4112-befc-45c84c20f193_2048x972.png 848w, https://substackcdn.com/image/fetch/$s_!OUz4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd48e1488-5a16-4112-befc-45c84c20f193_2048x972.png 1272w, https://substackcdn.com/image/fetch/$s_!OUz4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd48e1488-5a16-4112-befc-45c84c20f193_2048x972.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OUz4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd48e1488-5a16-4112-befc-45c84c20f193_2048x972.png" width="1456" height="691" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d48e1488-5a16-4112-befc-45c84c20f193_2048x972.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:691,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OUz4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd48e1488-5a16-4112-befc-45c84c20f193_2048x972.png 424w, https://substackcdn.com/image/fetch/$s_!OUz4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd48e1488-5a16-4112-befc-45c84c20f193_2048x972.png 848w, https://substackcdn.com/image/fetch/$s_!OUz4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd48e1488-5a16-4112-befc-45c84c20f193_2048x972.png 1272w, https://substackcdn.com/image/fetch/$s_!OUz4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd48e1488-5a16-4112-befc-45c84c20f193_2048x972.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Without a dedicated abstraction layer, each new platform requires touching the routing logic, session management, and message pipeline.</p><p>OpenClaw solves this with a Channel Layer:</p><p>It treats each platform as a <em>separate plugin </em>acting as a translation adapter. Each adapter translates incoming messages into a standard internal format: <em>a stable identity key, content, metadata, and attachments</em>. Only then does it pass anything to the Gateway. Everything after that boundary is platform-agnostic. The agent has NO idea whether your message came from Telegram or Slack.</p><p>It sees a normalized message and responds accordingly&#8230;</p><p>This also means security policies like allowlists, pairing workflows, and mention-gating apply uniformly across all platforms rather than being reimplemented per channel.</p><h3><strong>LLM Layer: Where Reasoning Happens</strong></h3><p>OpenClaw is a brain socket.</p><p>You provide the intelligence by connecting an API key. And it provides the infrastructure for everything else.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bXAy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7656418c-27d5-478a-9eba-6ba00c041844_2048x867.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bXAy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7656418c-27d5-478a-9eba-6ba00c041844_2048x867.png 424w, https://substackcdn.com/image/fetch/$s_!bXAy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7656418c-27d5-478a-9eba-6ba00c041844_2048x867.png 848w, https://substackcdn.com/image/fetch/$s_!bXAy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7656418c-27d5-478a-9eba-6ba00c041844_2048x867.png 1272w, https://substackcdn.com/image/fetch/$s_!bXAy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7656418c-27d5-478a-9eba-6ba00c041844_2048x867.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bXAy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7656418c-27d5-478a-9eba-6ba00c041844_2048x867.png" width="1456" height="616" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7656418c-27d5-478a-9eba-6ba00c041844_2048x867.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:616,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!bXAy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7656418c-27d5-478a-9eba-6ba00c041844_2048x867.png 424w, https://substackcdn.com/image/fetch/$s_!bXAy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7656418c-27d5-478a-9eba-6ba00c041844_2048x867.png 848w, https://substackcdn.com/image/fetch/$s_!bXAy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7656418c-27d5-478a-9eba-6ba00c041844_2048x867.png 1272w, https://substackcdn.com/image/fetch/$s_!bXAy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7656418c-27d5-478a-9eba-6ba00c041844_2048x867.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>It means you can use Claude, GPT-4, Gemini, DeepSeek, or a locally run model via Ollama. Plus, you can change models at any time without any reconfiguration.</p><p>When a message arrives at this layer, OpenClaw assembles a system prompt by combining the agent&#8217;s configured personality, list of available skills, relevant memory retrieved from previous sessions, and current conversation history.</p><p>It then calls the AI model with the full context.</p><p>If the model decides it needs to take an action, run a shell command, search the web, read a file, or call an API, it signals that as a tool call. OpenClaw executes the tool, captures the output, and feeds the result back into the conversation. The model reads the result and decides what to do next: call another tool, or produce a final answer.</p><p>This loop continues until the model generates a response with no further tool requests.</p><p>You can watch this entire loop unfold in real time in the Control UI at every tool call, every model response, every intermediate step&#8230;</p><p>And when a conversation reaches the model&#8217;s context limit, compaction<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-12" href="#footnote-12" target="_self">12</a> triggers automatically. The agent summarizes the conversation so far and replaces the raw message history with that summary, preserving continuity without the cost of loading thousands of tokens on every reply.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/openclaw-architecture?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/openclaw-architecture?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><h3><strong>Plugin System: How OpenClaw Stays Modular</strong></h3><p>Almost everything in OpenClaw that is not part of the core engine is implemented as a plugin<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-13" href="#footnote-13" target="_self">13</a>:</p><ul><li><p>Telegram integration is a plugin.</p></li><li><p>GitHub access is a plugin.</p></li><li><p>The memory system is a plugin.</p></li></ul><p>This is what makes OpenClaw easy to extend and customize&#8230;</p><p>When OpenClaw starts, it reads your configuration and loads only the plugins you have enabled. Disabling a capability means changing one line in your config, while adding a community plugin is as simple as placing it in the right directory.</p><p>If you want to write your own, you just implement a defined interface and never touch the core engine.</p><p>Plugins can hook into lifecycle events at every meaningful point: <em>before and after tool calls, before and after messages, at session start and end.</em></p><p>This is how you add things like audit logging, rate limiting, or custom approval flows without touching the core agent at all&#8230;</p><h3><strong>Memory System: How Agent Remembers You</strong></h3><p>The memory solution (loading the entire conversation history into every prompt) fails quickly.</p><p>A week of active conversation will overflow any context window&#8230; Even if it fits,,, loading all of it on every reply is expensive and slow&#8230;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nDTf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbb0b502-1581-4457-a7b5-3a2c000688c6_2048x1251.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nDTf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbb0b502-1581-4457-a7b5-3a2c000688c6_2048x1251.png 424w, https://substackcdn.com/image/fetch/$s_!nDTf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbb0b502-1581-4457-a7b5-3a2c000688c6_2048x1251.png 848w, https://substackcdn.com/image/fetch/$s_!nDTf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbb0b502-1581-4457-a7b5-3a2c000688c6_2048x1251.png 1272w, https://substackcdn.com/image/fetch/$s_!nDTf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbb0b502-1581-4457-a7b5-3a2c000688c6_2048x1251.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nDTf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbb0b502-1581-4457-a7b5-3a2c000688c6_2048x1251.png" width="1456" height="889" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cbb0b502-1581-4457-a7b5-3a2c000688c6_2048x1251.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:889,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nDTf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbb0b502-1581-4457-a7b5-3a2c000688c6_2048x1251.png 424w, https://substackcdn.com/image/fetch/$s_!nDTf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbb0b502-1581-4457-a7b5-3a2c000688c6_2048x1251.png 848w, https://substackcdn.com/image/fetch/$s_!nDTf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbb0b502-1581-4457-a7b5-3a2c000688c6_2048x1251.png 1272w, https://substackcdn.com/image/fetch/$s_!nDTf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcbb0b502-1581-4457-a7b5-3a2c000688c6_2048x1251.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>OpenClaw treats short-term continuity and long-term recall as separate problems that need different solutions:</p><ul><li><p><em>Short-term memory</em> keeps the current conversation on track. Every session is saved as a file on disk. When you send a message, OpenClaw loads only the recent part of that session into context, just enough to keep things flowing without loading everything at once.</p></li><li><p><em>Long-term memory</em> handles recall across days and weeks. All past sessions are indexed into a local database. Before the agent answers any message, the memory indexer searches the database and pulls in any relevant information automatically. If a conversation from five days ago is relevant, it gets included. You never have to remind the agent of something it already knows.</p></li><li><p><em>Standing notes</em> are a third layer. These are Markdown files you write yourself, stored in <code>~/.openclaw/workspace/memory/</code>. Think of them as a permanent briefing document. Your preferences, your projects, your context. The agent reads them every time.</p></li></ul><div><hr></div><div class="callout-block" data-callout="true"><p><em><strong>Reminder: this is a teaser of the subscriber-only newsletter series, exclusive to my golden members.</strong></em></p><p>When you upgrade, you&#8217;ll get:</p><ul><li><p><strong>High-level architecture of real-world systems.</strong></p></li><li><p>Deep dive into how popular real-world systems actually work.</p></li><li><p><strong>How real-world systems handle scale, reliability, and performance.</strong></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?yearly=true&quot;,&quot;text&quot;:&quot;Get Full Access Now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/subscribe?yearly=true"><span>Get Full Access Now</span></a></p></div><div><hr></div><h3><strong>How OpenClaw Handles Tasks That Take Hours</strong></h3><p>Most interactions with OpenClaw are fast&#8230; You send a message; the agent calls a tool, and replies in seconds.</p><p>But some tasks take much longer: <em>scraping hundreds of pages, running a full test suite, processing a large dataset, or coordinating a multi-step workflow across several APIs.</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cwK3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3269bec0-6bac-4c6f-b955-9494da321811_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cwK3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3269bec0-6bac-4c6f-b955-9494da321811_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!cwK3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3269bec0-6bac-4c6f-b955-9494da321811_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!cwK3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3269bec0-6bac-4c6f-b955-9494da321811_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!cwK3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3269bec0-6bac-4c6f-b955-9494da321811_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cwK3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3269bec0-6bac-4c6f-b955-9494da321811_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3269bec0-6bac-4c6f-b955-9494da321811_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!cwK3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3269bec0-6bac-4c6f-b955-9494da321811_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!cwK3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3269bec0-6bac-4c6f-b955-9494da321811_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!cwK3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3269bec0-6bac-4c6f-b955-9494da321811_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!cwK3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3269bec0-6bac-4c6f-b955-9494da321811_1536x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>OpenClaw handles these differently:</p><p>When a task is going to take a while, the agent does NOT hold the conversation open and make you wait. It acknowledges the task, starts working, and messages you when it&#8217;s done. You can lock your phone and walk away.</p><p>The Gateway keeps running and messages you when the task is done.</p><p>For tasks that span multiple sessions or require human input mid-way, the agent completes what it can, writes the current state to <code>MEMORY.md</code> or a workspace file, and then pauses. When you return and pick up the conversation, it resumes from the saved state.</p><p>NO context gets lost between sessions because important state was written to disk, not held in memory.</p><p>For truly long-running background jobs, cron jobs in isolated session mode are the right tool. Each run gets its own session, completes its work, delivers output to your channel, and exits cleanly. The next scheduled run starts fresh.</p><p>This keeps long-running automation from accumulating stale context over time.</p><p>One practical limit worth knowing: <em>if a single tool call takes too long, Gateway will time out waiting for a response.</em></p><p>For tasks like large web scrapes or slow API calls, break the work into smaller chunks. Instruct the agent to process in batches and report progress between each batch, rather than attempting everything in a single tool call.</p><p><em>Ready for the best part?</em></p><h3><strong>How a Message Travels End to End</strong></h3>
      <p>
          <a href="https://newsletter.systemdesign.one/p/openclaw-architecture">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Design Knowledge Q&A System]]></title><description><![CDATA[#150: Part 3 - Generative AI Masterclass]]></description><link>https://newsletter.systemdesign.one/p/ai-based-knowledge-management-system</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/ai-based-knowledge-management-system</guid><dc:creator><![CDATA[Louis-François Bouchard]]></dc:creator><pubDate>Thu, 04 Jun 2026 11:13:56 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/ae818d73-27d9-4094-bfee-9b5c66e2a147_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://newsletter.systemdesign.one/subscribe?yearly=true" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RKN7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 424w, https://substackcdn.com/image/fetch/$s_!RKN7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 848w, https://substackcdn.com/image/fetch/$s_!RKN7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 1272w, https://substackcdn.com/image/fetch/$s_!RKN7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RKN7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png" width="1280" height="300" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3689f342-2008-4ce6-b968-16461682508b_1280x300.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:300,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:24224,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://newsletter.systemdesign.one/subscribe?yearly=true&quot;,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/192435842?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!RKN7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 424w, https://substackcdn.com/image/fetch/$s_!RKN7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 848w, https://substackcdn.com/image/fetch/$s_!RKN7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 1272w, https://substackcdn.com/image/fetch/$s_!RKN7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><ul><li><p><em><a href="https://newsletter.systemdesign.one/p/ai-based-knowledge-management-system/?action=share">Share this post</a> &amp; I'll send you some rewards for the referrals.</em></p></li></ul><div><hr></div><p>If you ask questions about your company&#8217;s policies, a contract you have open in another tab, or anything outside training data, an AI personal chat assistant will either say <em>&#8220;I don&#8217;t know&#8221;</em> or invent something that sounds right.</p><p>The most direct fix is to include the relevant documents in the prompt.</p><p>But this only works if the documents fit within the context window, and most real knowledge bases do not. Company policies, contracts, and internal wikis are lengthy, and loading them in full for every query can be impractical because of latency, cost, and context window limitations.</p><p>Retrieval-Augmented Generation (<strong>RAG</strong>) is a more practical approach.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!hxE7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3de60e6-1faf-463f-8f17-98d3deeb7b36_2048x904.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hxE7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3de60e6-1faf-463f-8f17-98d3deeb7b36_2048x904.png 424w, https://substackcdn.com/image/fetch/$s_!hxE7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3de60e6-1faf-463f-8f17-98d3deeb7b36_2048x904.png 848w, https://substackcdn.com/image/fetch/$s_!hxE7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3de60e6-1faf-463f-8f17-98d3deeb7b36_2048x904.png 1272w, https://substackcdn.com/image/fetch/$s_!hxE7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3de60e6-1faf-463f-8f17-98d3deeb7b36_2048x904.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hxE7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3de60e6-1faf-463f-8f17-98d3deeb7b36_2048x904.png" width="1456" height="643" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f3de60e6-1faf-463f-8f17-98d3deeb7b36_2048x904.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:643,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!hxE7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3de60e6-1faf-463f-8f17-98d3deeb7b36_2048x904.png 424w, https://substackcdn.com/image/fetch/$s_!hxE7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3de60e6-1faf-463f-8f17-98d3deeb7b36_2048x904.png 848w, https://substackcdn.com/image/fetch/$s_!hxE7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3de60e6-1faf-463f-8f17-98d3deeb7b36_2048x904.png 1272w, https://substackcdn.com/image/fetch/$s_!hxE7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff3de60e6-1faf-463f-8f17-98d3deeb7b36_2048x904.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The full RAG system: <em>an offline pipeline that builds the index, and an online pipeline that answers each query, sharing a vector database.</em></figcaption></figure></div><p>Instead of loading the entire knowledge base into every prompt, the system retrieves only the most relevant passages at query time, includes them alongside the question, and the model generates a cited answer from that material.</p><p>It is the architecture behind Perplexity, ChatGPT with Search, GitHub Copilot&#8217;s codebase search, and most internal AI tools inside large companies.</p><p>Onward.</p><div class="callout-block" data-callout="true"><h2><a href="https://agentfield.ai/github/pr-af/?utm_source=sys_design&amp;utm_medium=newsletter&amp;utm_campaign=sys_design-260602&amp;utm_id=sys_design-260602-pr-af&amp;utm_content=pr-af">Code review for AI-native engineering teams &#8212; at 1M+ LOC (Partner)</a></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://agentfield.ai/github/pr-af/?utm_source=sys_design&amp;utm_medium=newsletter&amp;utm_campaign=sys_design-260602&amp;utm_id=sys_design-260602-pr-af&amp;utm_content=pr-af" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GcXK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79e9753b-b5af-4812-98e6-16fb1e25ba9a_2048x1143.webp 424w, https://substackcdn.com/image/fetch/$s_!GcXK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79e9753b-b5af-4812-98e6-16fb1e25ba9a_2048x1143.webp 848w, https://substackcdn.com/image/fetch/$s_!GcXK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79e9753b-b5af-4812-98e6-16fb1e25ba9a_2048x1143.webp 1272w, https://substackcdn.com/image/fetch/$s_!GcXK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79e9753b-b5af-4812-98e6-16fb1e25ba9a_2048x1143.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GcXK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79e9753b-b5af-4812-98e6-16fb1e25ba9a_2048x1143.webp" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/79e9753b-b5af-4812-98e6-16fb1e25ba9a_2048x1143.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:813,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:305508,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:&quot;https://agentfield.ai/github/pr-af/?utm_source=sys_design&amp;utm_medium=newsletter&amp;utm_campaign=sys_design-260602&amp;utm_id=sys_design-260602-pr-af&amp;utm_content=pr-af&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/179236490?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79e9753b-b5af-4812-98e6-16fb1e25ba9a_2048x1143.webp&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!GcXK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79e9753b-b5af-4812-98e6-16fb1e25ba9a_2048x1143.webp 424w, https://substackcdn.com/image/fetch/$s_!GcXK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79e9753b-b5af-4812-98e6-16fb1e25ba9a_2048x1143.webp 848w, https://substackcdn.com/image/fetch/$s_!GcXK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79e9753b-b5af-4812-98e6-16fb1e25ba9a_2048x1143.webp 1272w, https://substackcdn.com/image/fetch/$s_!GcXK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F79e9753b-b5af-4812-98e6-16fb1e25ba9a_2048x1143.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Pull request review was built for human authors.</p><p>AI-written code fails differently, and most reviewer tools never caught up.</p><p>AgentField just open-sourced a multi-agent code reviewer built for AI-native teams:</p><ul><li><p>Runs on open or closed models &#8212; Kimi, DeepSeek, Claude &#8212; so it scales to whatever a team can afford.</p></li><li><p>Drops into GitHub Actions in minutes.</p></li><li><p>Built to make deep code review economically viable at scale.</p></li></ul><p>The architecture rationale &#8212; the four jobs of code review, and which three became load-bearing once AI took the first &#8212; is in AgentField&#8217;s latest <strong><a href="https://agentfield.ai/blog/ai-native-code-review/?utm_source=sys_design&amp;utm_medium=newsletter&amp;utm_campaign=sys_design-260602&amp;utm_id=sys_design-260602-blog-ai-native-code-review&amp;utm_content=blog-ai-native-code-review">post</a></strong>.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://agentfield.ai/github/pr-af/?utm_source=sys_design&amp;utm_medium=newsletter&amp;utm_campaign=sys_design-260602&amp;utm_id=sys_design-260602-pr-af&amp;utm_content=pr-af&quot;,&quot;text&quot;:&quot;Star &amp; Deploy&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://agentfield.ai/github/pr-af/?utm_source=sys_design&amp;utm_medium=newsletter&amp;utm_campaign=sys_design-260602&amp;utm_id=sys_design-260602-pr-af&amp;utm_content=pr-af"><span>Star &amp; Deploy</span></a></p></div><div><hr></div><p>I want to reintroduce <strong><a href="https://louisbouchard.substack.com/welcome">Louis-Fran&#231;ois Bouchard</a> </strong>as the author of this newsletter.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://louisbouchard.substack.com/welcome" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8ezx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 424w, https://substackcdn.com/image/fetch/$s_!8ezx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 848w, https://substackcdn.com/image/fetch/$s_!8ezx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 1272w, https://substackcdn.com/image/fetch/$s_!8ezx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8ezx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png" width="1100" height="220" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:220,&quot;width&quot;:1100,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:null,&quot;href&quot;:&quot;https://louisbouchard.substack.com/welcome&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!8ezx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 424w, https://substackcdn.com/image/fetch/$s_!8ezx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 848w, https://substackcdn.com/image/fetch/$s_!8ezx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 1272w, https://substackcdn.com/image/fetch/$s_!8ezx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>He&#8217;s a best-selling author (<a href="https://amzn.to/4bqYU9b">Building LLMs for Production</a>), the co-founder of <a href="https://academy.towardsai.net/?ref=1f9b29">Towards AI</a>, and the creator of the YouTube Channel, <a href="https://www.youtube.com/@whatsai?sub_confirmation=1">What&#8217;s AI</a>, where he helps people understand AI and learn how to apply it in the real world.</p><p>Through his development work with clients and his content, teaching, and AI training programs on the <strong><a href="https://academy.towardsai.net/?ref=1f9b29">Towards AI Academy</a></strong>, Louis focuses on making AI practical for builders, engineers, and curious learners alike.</p><p>At Towards AI, he and his team train AI engineers through courses built for every stage, from beginner to advanced. That educational mission and the real-world experience building for his clients are exactly why I wanted him in this newsletter series.</p><div><hr></div><p><em><strong>Here&#8217;s what&#8217;s inside this newsletter:</strong></em></p><ul><li><p><strong>The full RAG architecture.</strong> How a question becomes an embedding, how the system finds the right chunks across a large knowledge base, and how the model generates an answer grounded in retrieved sources.</p></li><li><p><strong>Document ingestion and chunking.</strong> What makes a chunk useful, three strategies for splitting documents, and the metadata that makes citations possible.</p></li><li><p><strong>Retrieval and generation in production.</strong> Hybrid search, reranking, query transformation, system prompts, citation strategies, and how to make the system decline questions it cannot answer rather than guess.</p></li><li><p><strong>Failure modes and evaluation.</strong> The three ways RAG breaks in practice, the four RAGAS metrics that surface them, and how to build a test set that catches regressions.</p></li><li><p><strong>Production concerns.</strong> Caching, access control, monitoring, and cost at scale.</p></li><li><p><strong>A practical eight-step build.</strong> A folder of PDFs turned into a working Q&amp;A system with hybrid retrieval, reranking, structured citations, and a quality scorecard.</p></li></ul><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Golden members get all posts like these!&#8230;</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h2>Why Build Your Own Knowledge Q&amp;A System?</h2><p>Perplexity, ChatGPT with browsing, and Gemini with Search already answer questions with cited sources.</p><p>They are capable and improving fast.</p><p>But the limitation is that they are built for public knowledge. The moment your questions involve internal documents, regulated data, or a knowledge base within your infrastructure, off-the-shelf tools hit hard constraints.</p><p>Here is where they fall short:</p><ul><li><p><strong>Off-the-shelf tools cannot access regulated data.</strong> You can upload personal files into a ChatGPT project and get useful answers. You cannot do that with customer records, contracts, medical files, or anything covered by HIPAA, GDPR, or SOC 2. That data has to stay inside your own perimeter, behind your own access controls, with your own audit trail.</p></li><li><p><strong>Your knowledge is not in a folder you can drag and drop.</strong> It lives in Confluence, in a Drive folder with thousands of contracts, in a support tool, or in an internal wiki. Off-the-shelf assistants can connect to some of these, but the data flows out of your infrastructure and into theirs, and is processed under their privacy policy. A system built on your infrastructure reads directly from those sources, using your auth, and ensures data never leaves your perimeter.</p></li><li><p><strong>Retrieval happens at query time, so answers stay current.</strong> A model&#8217;s training data has a cutoff, but your documents keep changing. Because RAG retrieves at query time, a document updated after the model was trained is still used to answer the next question, with no retraining required.</p></li><li><p><strong>You control what the system knows.</strong> When a document is added to the knowledge base, the system uses it for the next query. When it is removed, it is no longer used. When it is updated, the next answer reflects the new version. This control is what lets you curate, version, and audit the knowledge base, and it is what regulated industries require.</p></li><li><p><strong>Focused retrieval is more accurate and cheaper.</strong> A model answering a question from five selected passages is working with a much smaller, more relevant input than one drawing on its full training data. More relevant context produces more accurate answers, and shorter prompts cost less per call.</p></li></ul><p>These five constraints all point to the same architecture.</p><p>The rest of this newsletter builds on it&#8230;</p><div><hr></div><h2>Part 1: Turning Documents into Searchable Knowledge</h2><p>A RAG system has two stages:</p><ul><li><p>First runs once, or whenever new documents are added: it processes your documents, converts them into vector representations, and stores them in a database that can be searched by meaning.</p></li><li><p>Second runs on every user query. This part focuses on the first: ingestion, chunking, embedding, and storage.</p></li></ul><h3>Document Ingestion and Preprocessing</h3><p>Before anything can be retrieved, your documents need to be readable by the system.</p><p>That sounds straightforward, but documents come in many formats: PDFs, HTML pages, Word files, Markdown exports from Notion, Confluence pages, and scanned forms. Each format stores text differently and needs its own parser.</p><p>A poor extraction at this stage degrades everything downstream, so it is worth getting right.</p><p>There are five things to handle during ingestion:</p><ol><li><p><strong>Text extraction.</strong> As text is extracted, the structural information alongside it is preserved: headings, page numbers, and table boundaries. This is what allows the system to later cite not just a document, but the specific section and page a passage came from.</p></li><li><p><strong>Tables, code, and images.</strong> These elements break when treated as regular text. A table flattened into a paragraph loses its row-column relationships. Code blocks lose meaning when indentation and line breaks are stripped. Images contain no text at all unless a caption is present or OCR is run on them. Each is typically handled through a separate extraction path.</p></li><li><p><strong>Scanned PDFs.</strong> A digital PDF stores text as text. A scanned PDF stores it as an image, which a regular parser cannot read. Optical Character Recognition (<strong>OCR</strong>) is used for converting scanned documents into readable text. But OCR takes several seconds per page, which adds time to the ingestion stage. Tesseract is the standard library for clean scans. Vision-language models work better on low-quality images and complex layouts.</p></li><li><p><strong>Duplicates.</strong> When the same document exists in multiple folders, it can be indexed multiple times, which causes retrieval to return identical chunks. A common approach is to hash each document&#8217;s content and skip any document whose hash has already been indexed. For near-duplicates such as different versions of the same contract, fuzzy text matching is used instead.</p></li><li><p><strong>Boilerplate.</strong> Headers, footers, navigation menus, and copyright notices add noise without adding information. These are typically identified by how frequently they repeat across pages and stripped before the text is passed downstream.</p></li></ol><p>Clean text is necessary but not sufficient.</p><p>Before it can be embedded and searched, it has to be cut into pieces small enough for the embedding model to represent accurately.</p><h3>Chunking</h3><p>A long document cannot be embedded as a single vector.</p><p>An embedding that represents 50 pages of mixed content does not align well with a specific question. Instead, each document is split into smaller pieces called chunks, and each chunk is embedded individually.</p><p>Different chunk sizes have different tradeoffs&#8230;</p><p><em>Larger chunks</em> carry more context but produce less specific embeddings. <em>Smaller chunks</em> produce more specific embeddings but may lack the surrounding context needed to fully answer a question. A<em> well-formed chunk</em> is self-contained, covers a single topic, and includes its section heading and document title.</p><p>Here are three common strategies for splitting documents into chunks:</p><ol><li><p><strong>Fixed-size chunking</strong> splits the text into chunks of N tokens, with a fixed overlap, usually 50 to 100 tokens. The overlap ensures that a sentence cut at a chunk boundary still appears in full in one of the two adjacent chunks. It is the simplest approach and works well on uniform text such as articles and documentation.</p></li><li><p><strong>Recursive chunking</strong> splits on paragraph boundaries first, then sentences, then words, going to a finer level only when a chunk is still too large. It follows the structure already present in the document rather than imposing an arbitrary boundary. Most popular RAG libraries, including LangChain and LlamaIndex, use this as their default.</p></li><li><p><strong>Semantic chunking</strong> splits a document into sentences, then forms small groups of consecutive sentences and creates an embedding for each group. The embedding of each group is compared with that of the previous group, and a chunk boundary is placed where the difference between the two embeddings is large. The assumption is that a large change in the embedding indicates a change in topic. Semantic chunking performs better than the other methods when topics shift within paragraphs rather than across them, but it requires an embedding call for each sentence group at ingestion time, making it the most expensive of the three.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!L5YK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32e6c2c2-9afe-4ec4-b7dc-e5ed9aab6029_2048x1063.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!L5YK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32e6c2c2-9afe-4ec4-b7dc-e5ed9aab6029_2048x1063.png 424w, https://substackcdn.com/image/fetch/$s_!L5YK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32e6c2c2-9afe-4ec4-b7dc-e5ed9aab6029_2048x1063.png 848w, https://substackcdn.com/image/fetch/$s_!L5YK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32e6c2c2-9afe-4ec4-b7dc-e5ed9aab6029_2048x1063.png 1272w, https://substackcdn.com/image/fetch/$s_!L5YK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32e6c2c2-9afe-4ec4-b7dc-e5ed9aab6029_2048x1063.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!L5YK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32e6c2c2-9afe-4ec4-b7dc-e5ed9aab6029_2048x1063.png" width="1456" height="756" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/32e6c2c2-9afe-4ec4-b7dc-e5ed9aab6029_2048x1063.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:756,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!L5YK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32e6c2c2-9afe-4ec4-b7dc-e5ed9aab6029_2048x1063.png 424w, https://substackcdn.com/image/fetch/$s_!L5YK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32e6c2c2-9afe-4ec4-b7dc-e5ed9aab6029_2048x1063.png 848w, https://substackcdn.com/image/fetch/$s_!L5YK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32e6c2c2-9afe-4ec4-b7dc-e5ed9aab6029_2048x1063.png 1272w, https://substackcdn.com/image/fetch/$s_!L5YK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F32e6c2c2-9afe-4ec4-b7dc-e5ed9aab6029_2048x1063.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A common starting point is recursive chunking at 500 to 800 tokens with a 50- to 100-token overlap.</p><p>Each chunk is tagged with metadata: <em>source document, page number, section heading, and last-modified date</em>. This metadata is what the system uses to produce citations later.</p><p>The chunks are now ready to be searched. Searching by exact word match would miss most relevant results, since users rarely use the same words that documents do.</p><p>Each chunk is therefore converted into a numeric vector that captures its meaning&#8230;</p><h3>Embeddings</h3><p>These vectors are called embeddings: <em>fixed-length vectors of numbers that represent the meaning of a piece of text.</em></p><p>Two chunks with similar meaning produce vectors that are close to each other; two chunks on different topics produce vectors that are far apart.</p><p>This is what allows a query like <em>&#8220;reset my password&#8221;</em> to retrieve a document titled <em>&#8220;account credential recovery,&#8221;</em> even though the two share no words in common.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!EiIB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0cf2a4e-6d51-41ba-bb0c-6abd43321882_2048x1073.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!EiIB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0cf2a4e-6d51-41ba-bb0c-6abd43321882_2048x1073.png 424w, https://substackcdn.com/image/fetch/$s_!EiIB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0cf2a4e-6d51-41ba-bb0c-6abd43321882_2048x1073.png 848w, https://substackcdn.com/image/fetch/$s_!EiIB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0cf2a4e-6d51-41ba-bb0c-6abd43321882_2048x1073.png 1272w, https://substackcdn.com/image/fetch/$s_!EiIB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0cf2a4e-6d51-41ba-bb0c-6abd43321882_2048x1073.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!EiIB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0cf2a4e-6d51-41ba-bb0c-6abd43321882_2048x1073.png" width="1456" height="763" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e0cf2a4e-6d51-41ba-bb0c-6abd43321882_2048x1073.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:763,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!EiIB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0cf2a4e-6d51-41ba-bb0c-6abd43321882_2048x1073.png 424w, https://substackcdn.com/image/fetch/$s_!EiIB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0cf2a4e-6d51-41ba-bb0c-6abd43321882_2048x1073.png 848w, https://substackcdn.com/image/fetch/$s_!EiIB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0cf2a4e-6d51-41ba-bb0c-6abd43321882_2048x1073.png 1272w, https://substackcdn.com/image/fetch/$s_!EiIB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0cf2a4e-6d51-41ba-bb0c-6abd43321882_2048x1073.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Some commonly used embedding models in 2026 include OpenAI&#8217;s text-embedding-3-large, Cohere&#8217;s embed-v4, and open-source options such as bge-large and e5-mistral.</p><p>The typical starting point is an API model, with a move to self-hosted open-source if data residency, privacy, or cost becomes a constraint. For specialized domains such as legal, biomedical, or financial text, a domain-specific model generally outperforms a general-purpose one.</p><p>The MTEB benchmark is a useful reference for comparing models.</p><p>Embeddings have three limitations worth understanding before choosing a retrieval strategy:</p><ul><li><p><strong>Negation.</strong> &#8220;Drugs that don&#8217;t interact with warfarin&#8221; and &#8220;drugs that interact with warfarin&#8221; produce nearly identical embeddings. The word &#8220;don&#8217;t&#8221; has very little effect on the resulting vector, even though it inverts the meaning.</p></li><li><p><strong>Exact identifiers.</strong> Order numbers, error codes, and SKUs such as E-4012 carry no semantic meaning, so similarity searches cannot reliably match them. Hybrid search (covered in Part 2) is used in these cases.</p></li><li><p><strong>Numeric filters.</strong> A query like &#8220;customers with revenue above $5M&#8221; is a structured filter, not a similarity match. Structured retrieval (covered in Part 2) is used for these queries.</p></li></ul><p>Another operational constraint is that the model used to embed the chunks must also be used to embed queries during retrieval.</p><p>The two share a single vector space, and switching models means re-embedding the entire corpus.</p><p>The choice of embedding model is effectively a long-term commitment&#8230;</p><h3>Vector Databases</h3><p>Once the chunks are embedded, they need to be stored in a system that supports fast similarity search.</p><p>A vector database stores each chunk&#8217;s embedding alongside its metadata and returns the closest matches to a query vector. The metadata, source document, page number, section heading, and last-modified date are returned with each result, so the system can point the user back to the source.</p><p>The basic operation is similarity search: <em>given a query vector, return the K vectors in the database that are closest to it.</em></p><p>Closeness is usually measured using cosine similarity, which compares two vectors based on the angle between them.</p><p>A direct implementation of this compares the query vector against every vector in the database. This works for small databases of a few thousand vectors, but the cost grows linearly with the database size and becomes impractical at scales of millions of vectors.</p><p>Production systems use <strong>approximate nearest neighbor (ANN)</strong> search, a family of algorithms that returns close-to-exact results at a fraction of the cost. ANN trades a small amount of recall for a large reduction in latency, often by orders of magnitude, with the exact tradeoff depending on the dataset, the index, and the recall target.</p><p>Hierarchical Navigable Small World (<strong>HNSW</strong>) and Inverted File (<strong>IVF</strong>)  are two of the most commonly used ANN index types. Some managed vector databases abstract this choice entirely, while others let you pick the index and tune its parameters.</p><p>Here are three deployment options, each suited to different constraints:</p><ul><li><p><strong>Managed services</strong> such as Pinecone, Turbopuffer, and Weaviate Cloud. The service runs the infrastructure and exposes an API. This is appropriate when the team does not want to operate the database directly.</p></li><li><p><strong>Self-hosted open-source</strong> options such as Weaviate, Qdrant, and Milvus. These run on your own infrastructure and offer full control over configuration, scaling, and metadata filtering.</p></li><li><p><strong>Database extensions</strong> such as pgvector for Postgres. These add vector search to an existing relational database. A practical option when the stack already runs Postgres, and the corpus stays under approximately one million chunks.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!i_t4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71c4d104-7c9a-4562-a117-61951eab0353_2048x1282.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!i_t4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71c4d104-7c9a-4562-a117-61951eab0353_2048x1282.png 424w, https://substackcdn.com/image/fetch/$s_!i_t4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71c4d104-7c9a-4562-a117-61951eab0353_2048x1282.png 848w, https://substackcdn.com/image/fetch/$s_!i_t4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71c4d104-7c9a-4562-a117-61951eab0353_2048x1282.png 1272w, https://substackcdn.com/image/fetch/$s_!i_t4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71c4d104-7c9a-4562-a117-61951eab0353_2048x1282.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!i_t4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71c4d104-7c9a-4562-a117-61951eab0353_2048x1282.png" width="1456" height="911" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/71c4d104-7c9a-4562-a117-61951eab0353_2048x1282.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:911,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!i_t4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71c4d104-7c9a-4562-a117-61951eab0353_2048x1282.png 424w, https://substackcdn.com/image/fetch/$s_!i_t4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71c4d104-7c9a-4562-a117-61951eab0353_2048x1282.png 848w, https://substackcdn.com/image/fetch/$s_!i_t4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71c4d104-7c9a-4562-a117-61951eab0353_2048x1282.png 1272w, https://substackcdn.com/image/fetch/$s_!i_t4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F71c4d104-7c9a-4562-a117-61951eab0353_2048x1282.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">The vector database stores each chunk&#8217;s vector alongside its metadata. At query time, the same embedding model produces the query vector, and similarity search returns the closest chunks with their source attached.</figcaption></figure></div><p>With the index built and the chunks stored, the offline pipeline is complete. The next question is how the system uses it when a user actually asks a question.</p><div><hr></div><div class="callout-block" data-callout="true"><p><em><strong>Reminder: this is a teaser of the subscriber-only newsletter series, exclusive to my golden members.</strong></em></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://newsletter.systemdesign.one/subscribe?yearly=true" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3mfm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 424w, https://substackcdn.com/image/fetch/$s_!3mfm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 848w, https://substackcdn.com/image/fetch/$s_!3mfm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 1272w, https://substackcdn.com/image/fetch/$s_!3mfm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3mfm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png" width="1280" height="300" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:300,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:24224,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://newsletter.systemdesign.one/subscribe?yearly=true&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/192435842?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!3mfm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 424w, https://substackcdn.com/image/fetch/$s_!3mfm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 848w, https://substackcdn.com/image/fetch/$s_!3mfm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 1272w, https://substackcdn.com/image/fetch/$s_!3mfm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>When you upgrade, you&#8217;ll get:</p><ul><li><p><strong>Simple breakdown of real-world architectures</strong></p></li><li><p>Frameworks you can plug into your work or business</p></li><li><p><strong>Proven systems behind ChatGPT, Perplexity, and Copilot</strong></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?yearly=true&quot;,&quot;text&quot;:&quot;Unlock Full Access&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://newsletter.systemdesign.one/subscribe?yearly=true"><span>Unlock Full Access</span></a></p></div><div><hr></div><h2>Part 2: Finding the Right Information</h2><p>This part covers how the system returns the chunks that contain the answer&#8230;</p><h3>Basic Retrieval</h3><p>The default retrieval approach has three steps: <em>embed the question using the same model used to embed the chunks, run a similarity search against the vector database, and return the top K results.</em></p><p><em>K is a tradeoff parameter.</em></p><p>Too small, and the system misses chunks that contain the answer. Too large, and the prompt fills with irrelevant material, which reduces answer quality and increases cost. A reasonable starting value is between 5 and 10.</p><p>The right value for your system is determined over time by testing on real queries. It depends on the expected answer length and how much room the LLM&#8217;s context window leaves for the retrieved chunks.</p><p>Basic retrieval works well on direct questions over a uniform corpus, but it has three common failure modes:</p><ul><li><p><strong>Vocabulary gap.</strong> User uses one word, and the document uses another. For example, the user types &#8220;downtime&#8221; and the document uses &#8220;service interruption.&#8221; Acronyms, internal jargon, and exact identifiers often fall outside the scope of what a general-purpose embedding model has been trained on.</p></li><li><p><strong>Multi-hop questions.</strong> Answer is spread across many documents that are not semantically similar. For example, the question <em>&#8220;what did the CFO say about the product launch?&#8221;</em> requires information from both an earnings transcript and a product roadmap. The two documents do not embed near each other in vector space, so similarity search alone is unlikely to retrieve both.</p></li><li><p><strong>Ambiguous queries.</strong> Query has more than one valid interpretation. For example, <em>&#8220;tell me about Apple&#8221;</em> could refer to the fruit or the company. Without disambiguation, similarity search returns results for one interpretation without indicating that another was possible.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!IXTp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f260630-0170-423a-b556-3864bf000e68_2048x1064.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!IXTp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f260630-0170-423a-b556-3864bf000e68_2048x1064.png 424w, https://substackcdn.com/image/fetch/$s_!IXTp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f260630-0170-423a-b556-3864bf000e68_2048x1064.png 848w, https://substackcdn.com/image/fetch/$s_!IXTp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f260630-0170-423a-b556-3864bf000e68_2048x1064.png 1272w, https://substackcdn.com/image/fetch/$s_!IXTp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f260630-0170-423a-b556-3864bf000e68_2048x1064.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!IXTp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f260630-0170-423a-b556-3864bf000e68_2048x1064.png" width="1456" height="756" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6f260630-0170-423a-b556-3864bf000e68_2048x1064.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:756,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!IXTp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f260630-0170-423a-b556-3864bf000e68_2048x1064.png 424w, https://substackcdn.com/image/fetch/$s_!IXTp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f260630-0170-423a-b556-3864bf000e68_2048x1064.png 848w, https://substackcdn.com/image/fetch/$s_!IXTp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f260630-0170-423a-b556-3864bf000e68_2048x1064.png 1272w, https://substackcdn.com/image/fetch/$s_!IXTp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f260630-0170-423a-b556-3864bf000e68_2048x1064.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The vocabulary gap and the exact-identifier problem both come from the same source: <em>similarity search alone cannot match words it does not understand semantically.</em> Hybrid search adds a second retrieval path that can.</p><p>The third failure mode, ambiguous queries, is handled by a different technique covered later in this newsletter&#8230;</p><p><em>Let&#8217;s keep going!</em></p><h3>Hybrid Search</h3>
      <p>
          <a href="https://newsletter.systemdesign.one/p/ai-based-knowledge-management-system">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[How to get ahead of 99% of software engineers with AI agents]]></title><description><![CDATA[#149: Change your software workflow with AI agents]]></description><link>https://newsletter.systemdesign.one/p/agentic-ai-use-cases</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/agentic-ai-use-cases</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Thu, 28 May 2026 09:59:35 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/4bd7282b-9f9c-4887-9844-2bfe23eb42f2_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Get my system design playbook for FREE on newsletter signup:</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><ul><li><p><em><a href="https://newsletter.systemdesign.one/p/agentic-ai-use-cases/?action=share">Share this post</a> &amp; I'll send you some rewards for the referrals.</em></p></li></ul><div><hr></div><p>You hit an error you can&#8217;t solve&#8230;</p><p>So you paste it into Claude Code, and the agent tries a few fixes, but NONE of them work. The bug is affecting checkout, which makes it a money problem, so you drop it in Slack and explain the whole thing again to the senior responsible for that flow.</p><p>She asks good questions&#8230; You answer them&#8230;</p><p>Then someone says, <em>&#8220;Make a ticket so we don&#8217;t lose this,&#8221;</em> and you type the same context into Jira a third time. Same problem, three tools, and you wrote it out fresh for everyone.</p><p>But none of them remembered what you&#8217;d already said in the last&#8230;</p><p>The bug happened the way most bugs appear these days: <em>you just told a coding agent the feature you had in mind. </em>This is how the job works now,,, and most of us don&#8217;t know where agents fit into the traditional software development lifecycle&#8230;</p><p>So let&#8217;s learn about it in this newsletter&#8230;</p><p>We start with what an agent actually is, because the word gets stretched over everything from autocomplete to a bot that opens its own pull requests<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>. Then, we&#8217;ll cover <em>eight stages</em> every team moves software through, from planning a feature to keeping it alive in production.</p><p>For each stage, we answer one question: <em>can you hand this to an agent today, and what happens when you do?</em></p><p>In some stages, agents already carry real weight&#8230; In others, they make things worse&#8230;</p><p>By the end of this newsletter, you&#8217;ll know which is which, and the harder problem hiding underneath all of it.</p><p>Onward.</p><div><hr></div><div class="callout-block" data-callout="true"><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://coderabbit.link/neo-agent" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GfjP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 424w, https://substackcdn.com/image/fetch/$s_!GfjP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 848w, https://substackcdn.com/image/fetch/$s_!GfjP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 1272w, https://substackcdn.com/image/fetch/$s_!GfjP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GfjP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png" width="1248" height="654" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:654,&quot;width&quot;:1248,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:547609,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://coderabbit.link/neo-agent&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/192885623?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!GfjP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 424w, https://substackcdn.com/image/fetch/$s_!GfjP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 848w, https://substackcdn.com/image/fetch/$s_!GfjP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 1272w, https://substackcdn.com/image/fetch/$s_!GfjP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I&#8217;m happy to partner with <strong><a href="https://coderabbit.link/neo-agent">CodeRabbit</a></strong> on this newsletter.</p><p>One thing I believe, after researching this newsletter, is that the biggest problem with AI agents in software development is NOT code generation. It&#8217;s the context loss between tools, tickets, reviews, and Slack threads.</p><p>CodeRabbit is building around exactly this problem&#8230;</p><p>Their new <strong><a href="https://coderabbit.link/neo-agent">Slack agent</a> </strong>maintains shared context across the software development lifecycle, so agents don&#8217;t have to start from scratch every time work moves between coding, testing, incidents, and reviews.</p><p>They already run AI code reviews across 6M repositories for 15,000+ teams.</p><p>And I genuinely think the idea of shared memory across the SDLC is one of the more important directions in agentic engineering right now.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://coderabbit.link/neo-agent&quot;,&quot;text&quot;:&quot;Try CodeRabbit's Agent Today&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://coderabbit.link/neo-agent"><span>Try CodeRabbit's Agent Today</span></a></p></div><div><hr></div><h2><strong>What an AI agent is</strong></h2><p>An agent takes a goal, picks its own next step, uses tools<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a>, and keeps going until the job is done or it gets stuck.</p><p>That&#8217;s the whole idea&#8230;</p><p>When you hit the checkout bug and pasted it into Claude Code<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a>, you didn&#8217;t tell it which files to open or what to run. Claude Code worked out the rest on its own:</p><ul><li><p>Read files,</p></li><li><p>Grep<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a> for functions,</p></li><li><p>Run tests,</p></li><li><p>Read errors,</p></li><li><p>Try again.</p></li></ul><p>&#8230;and you watched.</p><p>&#8220;Agent&#8221; gets used loosely, so it helps to line up the tools by how much they do on their own.</p><p>The simplest is AI AUTOCOMPLETE, like the earlier versions of GitHub Copilot<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a>. It finishes the line you&#8217;re typing with a Tab.</p><p>A step up is a CHATBOT: <em>you ask, it answers, and you copy what&#8217;s useful back into your editor. </em>That&#8217;s your ChatGPT.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!k0em!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50090bad-05db-40db-bd4a-3bec0323bbae_2048x1143.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!k0em!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50090bad-05db-40db-bd4a-3bec0323bbae_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!k0em!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50090bad-05db-40db-bd4a-3bec0323bbae_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!k0em!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50090bad-05db-40db-bd4a-3bec0323bbae_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!k0em!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50090bad-05db-40db-bd4a-3bec0323bbae_2048x1143.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!k0em!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50090bad-05db-40db-bd4a-3bec0323bbae_2048x1143.jpeg" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/50090bad-05db-40db-bd4a-3bec0323bbae_2048x1143.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:813,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;How much does it do on its own: autocomplete, then chatbot, then agent &#8212; a rising ladder of autonomy&quot;,&quot;title&quot;:&quot;How much does it do on its own: autocomplete, then chatbot, then agent &#8212; a rising ladder of autonomy&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="How much does it do on its own: autocomplete, then chatbot, then agent &#8212; a rising ladder of autonomy" title="How much does it do on its own: autocomplete, then chatbot, then agent &#8212; a rising ladder of autonomy" srcset="https://substackcdn.com/image/fetch/$s_!k0em!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50090bad-05db-40db-bd4a-3bec0323bbae_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!k0em!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50090bad-05db-40db-bd4a-3bec0323bbae_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!k0em!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50090bad-05db-40db-bd4a-3bec0323bbae_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!k0em!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50090bad-05db-40db-bd4a-3bec0323bbae_2048x1143.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>An AGENT is the one who does the work&#8230; You give it a bug, and it reads files, runs tests, edits code until the job is done.</p><p>To do this, it has to keep track of what it has already tried and what it learned along the way. That running context is what lets it pick a sensible next step instead of starting over each time.</p><p>One agent manages its own context fine&#8230;</p><p>But it becomes difficult when you have to run several agents at once, and that difficulty is largely what makes agents hard to use well.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!COvU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F134f4524-771a-4b27-81be-8535a5c19489_2048x1143.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!COvU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F134f4524-771a-4b27-81be-8535a5c19489_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!COvU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F134f4524-771a-4b27-81be-8535a5c19489_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!COvU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F134f4524-771a-4b27-81be-8535a5c19489_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!COvU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F134f4524-771a-4b27-81be-8535a5c19489_2048x1143.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!COvU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F134f4524-771a-4b27-81be-8535a5c19489_2048x1143.jpeg" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/134f4524-771a-4b27-81be-8535a5c19489_2048x1143.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:813,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;What makes it an agent, not a chatbot: it loops &#8212; act, read the result, update its running context, pick the next step&quot;,&quot;title&quot;:&quot;What makes it an agent, not a chatbot: it loops &#8212; act, read the result, update its running context, pick the next step&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="What makes it an agent, not a chatbot: it loops &#8212; act, read the result, update its running context, pick the next step" title="What makes it an agent, not a chatbot: it loops &#8212; act, read the result, update its running context, pick the next step" srcset="https://substackcdn.com/image/fetch/$s_!COvU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F134f4524-771a-4b27-81be-8535a5c19489_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!COvU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F134f4524-771a-4b27-81be-8535a5c19489_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!COvU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F134f4524-771a-4b27-81be-8535a5c19489_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!COvU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F134f4524-771a-4b27-81be-8535a5c19489_2048x1143.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Software gets built in eight stages, and every team moves through them with or without agents:</p><ul><li><p>Plan: decide what to build,</p></li><li><p>Design: decide how it&#8217;s structured,</p></li><li><p>Code: write it,</p></li><li><p>Test: prove it does what it should,</p></li><li><p>Review: check the work before it ships,</p></li><li><p>Deploy: ship it to production,</p></li><li><p>Operate: keep it running and watch it,</p></li><li><p>Maintain: fix, update, and clean up over time.</p></li></ul><p>In theory, you can put an agent to work in any of these stages. Yet it behaves differently in each&#8230;</p><div><hr></div><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/agentic-ai-use-cases?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption"><em>Get 1+ referral &amp; I&#8217;ll send you my Leetcode Master Template!</em></p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/agentic-ai-use-cases?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/agentic-ai-use-cases?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><div><hr></div><h2><strong>Software lifecycle: where agents fit</strong></h2><p>The same agent that looks brilliant in a demo can be useless on your actual codebase.</p><p>What changes between the two is how much it costs you when the agent is wrong, and this comes down to 4 things:</p><ul><li><p><strong>How fast you find out.</strong> A failing test tells you in seconds. While a bad design decision can go unnoticed for months.</p></li><li><p><strong>How easily you can check the answer. </strong>You can read a <code>git diff </code>and judge it. <em>&#8220;Is this the right thing to build&#8221;</em> has no such test.</p></li><li><p><strong>How much breaks.</strong> A wrong function fails one test. A wrong deployment takes down system for everyone.</p></li><li><p><strong>Whether you can undo it.</strong> You can revert a commit. But you can&#8217;t uncorrupt the data a bad database migration<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a> already wrote.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AugC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43e45b94-4c09-4509-be52-22cc68082a26_2048x1143.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AugC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43e45b94-4c09-4509-be52-22cc68082a26_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!AugC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43e45b94-4c09-4509-be52-22cc68082a26_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!AugC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43e45b94-4c09-4509-be52-22cc68082a26_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!AugC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43e45b94-4c09-4509-be52-22cc68082a26_2048x1143.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AugC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43e45b94-4c09-4509-be52-22cc68082a26_2048x1143.jpeg" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/43e45b94-4c09-4509-be52-22cc68082a26_2048x1143.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:813,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;What it costs when the agent is wrong: four factors, contrasting a demo with your real work&quot;,&quot;title&quot;:&quot;What it costs when the agent is wrong: four factors, contrasting a demo with your real work&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="What it costs when the agent is wrong: four factors, contrasting a demo with your real work" title="What it costs when the agent is wrong: four factors, contrasting a demo with your real work" srcset="https://substackcdn.com/image/fetch/$s_!AugC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43e45b94-4c09-4509-be52-22cc68082a26_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!AugC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43e45b94-4c09-4509-be52-22cc68082a26_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!AugC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43e45b94-4c09-4509-be52-22cc68082a26_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!AugC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F43e45b94-4c09-4509-be52-22cc68082a26_2048x1143.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A demo is set up to do well on all four&#8230;Small task, instant feedback, nothing real at stake&#8230; Yet your work usually isn&#8217;t.</p><p>So, for each stage below, the real question is the same: <em>when the agent gets it wrong, how much does that cost you?</em></p><h3><strong>1. Plan</strong></h3><p>Planning is deciding what your team builds next.</p><p>Which feature out of the ten on the list, why that one, and when it ships. It happens in meetings, in docs, in back-and-forth between engineers and the people who run the product&#8230;</p><p>An agent does useful work here.</p><p>Give it a feature spec, and it reads your codebase, maps what the change will touch, flags the parts nobody pinned down, and writes the tickets faster than you would by hand. Hand it the boring write-ups, and it does them well.</p><p>But decision-making is something an agent CAN&#8217;T do:</p><p>Choosing what to build means weighing customer urgency, revenue, and risk against three people who each want something different, then standing behind the choice when it goes wrong. An agent has no stake in the outcome and doesn&#8217;t understand your business well enough to make that call.</p><p>The people with the most reason to claim otherwise say the same thing.</p><blockquote><p>Boris Cherny, who created Claude Code, was asked why Anthropic keeps hiring engineers when the company says Claude now writes most of its code. His answer:</p><p><em>&#8220;Someone has to prompt the Claudes, talk to customers, coordinate with other teams, and decide what to build next. Engineering is changing, and great engineers are more important than ever.&#8221;</em></p></blockquote><p>i.e., company shipping the most capable coding agent on the market still needs actual humans for planning.</p><h3><strong>2. Design</strong></h3><p>Plan is which problem you solve&#8230;</p><p>Design is the shape of the solution: <em>one service or three, which database, where the boundaries sit, and what you can change later without a rewrite.</em></p><p>Ask an agent, and you <em>will</em> get a real answer.</p><p>It will compare microservices against a monolith<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-7" href="#footnote-7" target="_self">7</a>, lay out the tradeoffs, and recommend one. Yet the answer is textbook, and this is the problem. A textbook answer doesn&#8217;t know your team is five people, your traffic triples every December, or the last person who touched the payments service quit and left no documentation. So the right design for your situation lives in facts that were never written down, and an agent can&#8217;t read what nobody wrote.</p><p>There&#8217;s a second reason this stage stays with humans&#8230;</p><p>A bad design is slow to show itself. The code passes review, and tests go green, so nothing indicates the structure is wrong. But it&#8217;s only until you try to build the next three features on top of it, and each one takes twice as long and breaks something that used to work.</p><p>By the time you see the pattern, fix is no longer a code change. It&#8217;s a complete rewrite&#8230;</p><p>The root of it is agent works on the task in front of it without a picture of the entire system or any reason to keep the system simple. This blindness shows up in two ways in design.</p><p><em><strong>The first is duplication:</strong></em></p><p>GitClear analyzed code changes across thousands of repositories, found a sharp rise in duplicated code after teams adopted AI coding tools. In 2024 alone, the number of code blocks with five or more duplicated lines increased 8x.</p><p>The agent writes a new block that does the same job as one already sitting three files over, because it never checked what the codebase already had. Every copy is one more place you have to remember to fix later, and this is a structural cost.</p><p><em><strong>And second is the opposite problem: over-engineering.</strong></em></p><p>Ask an agent to design something, and it tends to overdesign.</p><p>It adds layers, patterns, and configuration for cases that will never come up because more structure looks more thorough.</p><blockquote><p>Andrej Karpathy, who co-founded OpenAI, put it plainly: <em>models like to overcomplicate, bloat their abstractions, and leave dead code behind.</em></p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8cdJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e9dffda-10e1-45a5-81d1-ac21259a5be4_2048x1143.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8cdJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e9dffda-10e1-45a5-81d1-ac21259a5be4_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!8cdJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e9dffda-10e1-45a5-81d1-ac21259a5be4_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!8cdJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e9dffda-10e1-45a5-81d1-ac21259a5be4_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!8cdJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e9dffda-10e1-45a5-81d1-ac21259a5be4_2048x1143.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8cdJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e9dffda-10e1-45a5-81d1-ac21259a5be4_2048x1143.jpeg" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5e9dffda-10e1-45a5-81d1-ac21259a5be4_2048x1143.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:813,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;What an agent's design leaves behind: duplicated code blocks and bloated, over-engineered structure&quot;,&quot;title&quot;:&quot;What an agent's design leaves behind: duplicated code blocks and bloated, over-engineered structure&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="What an agent's design leaves behind: duplicated code blocks and bloated, over-engineered structure" title="What an agent's design leaves behind: duplicated code blocks and bloated, over-engineered structure" srcset="https://substackcdn.com/image/fetch/$s_!8cdJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e9dffda-10e1-45a5-81d1-ac21259a5be4_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!8cdJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e9dffda-10e1-45a5-81d1-ac21259a5be4_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!8cdJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e9dffda-10e1-45a5-81d1-ac21259a5be4_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!8cdJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5e9dffda-10e1-45a5-81d1-ac21259a5be4_2048x1143.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This is the textbook answer showing up again&#8230;</p><p>The agent designs for the general problem because it doesn&#8217;t have the full real-world picture. You will inherit a system harder to read and change than the thing you asked for.</p><h3><strong>3. Code</strong></h3><p>This is the stage where agents are doing their best work&#8230;</p><p>At least the MONEY says so. Cursor went from $100M to $1B in annual revenue in about a year and has more than a million people using it every day. In Stack Overflow&#8217;s 2025 survey, 19% of professional developers said they use Cursor, and 10% use Claude Code, two tools that weren&#8217;t even on the survey the year before. These tools write real code that ships, and the people paying for them are not running demos.</p><p>What you get out of them depends almost entirely on how you set them up&#8230;</p><h4><em><strong>Rules files</strong></em></h4><p>The first thing to set up is a <code>rules</code> file.</p><p>Most coding tools now read a file in your repo when they start, a <code>CLAUDE.md</code><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-8" href="#footnote-8" target="_self">8</a> or an <code>AGENTS.md</code>, and treat whatever is in it as standing orders. You write down the things you would otherwise have to repeat in every chat:</p><ul><li><p>Commands to run tests and linter<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-9" href="#footnote-9" target="_self">9</a>,</p></li><li><p>Conventions the codebase follows,</p></li><li><p>Traps you learned the hard way and want the agent to avoid.</p></li></ul><p>Without this file, every session starts from zero&#8230;</p><p>You explain the same setup, correct the same wrong assumption, and watch the agent make the same mistake it made yesterday, just because it has NO memory of yesterday.</p><p>Writing correct rule files is already somewhat of a science in coding, and there are many excellent sources that can help you.</p><p>(I recommend starting with the <a href="https://code.claude.com/docs/en/memory">official Anthropic guide on CLAUDE.md files</a>.)</p><h4><em><strong>Spec-driven development</strong></em></h4><p>The second thing is to match the size of the task to how much you plan first&#8230;</p><p>A small, clear job gets done well from a one-line prompt. <em>&#8220;Add input validation to this endpoint&#8221;</em> needs nothing fancy. While a large task like <em>&#8220;add photo sharing to my app&#8221;</em> falls apart because that prompt forces the agent to guess at thousands of decisions you never specified.</p><p>So for anything real, you write a short spec first&#8230;</p><p>A spec documents non-technical product decisions, high-level architecture, and what the changes should do in plain language before any code gets written. The agent turns it into an implementation plan, noting exactly which files and lines of code will change.</p><p>Then it executes the code one task at a time, and you review between every step&#8230;</p><p>This workflow is called <strong>spec-driven development</strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-10" href="#footnote-10" target="_self">10</a>, and it is how people ship real features with agents instead of demos.</p><p>PROOF: <a href="https://github.com/obra/superpowers">GitHub repo Superpowers</a> (200k+ stars) works with all major coding agents. It encapsulates the process into a series of automatic slash commands, making it trivial to adopt in your daily workflow.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dRoL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F929891a1-351d-473d-99be-653e3e4531aa_2048x1143.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dRoL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F929891a1-351d-473d-99be-653e3e4531aa_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!dRoL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F929891a1-351d-473d-99be-653e3e4531aa_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!dRoL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F929891a1-351d-473d-99be-653e3e4531aa_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!dRoL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F929891a1-351d-473d-99be-653e3e4531aa_2048x1143.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dRoL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F929891a1-351d-473d-99be-653e3e4531aa_2048x1143.jpeg" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/929891a1-351d-473d-99be-653e3e4531aa_2048x1143.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:813,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Spec-driven development: write a spec, the agent writes a plan, then it executes one task at a time with a human review between every step&quot;,&quot;title&quot;:&quot;Spec-driven development: write a spec, the agent writes a plan, then it executes one task at a time with a human review between every step&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Spec-driven development: write a spec, the agent writes a plan, then it executes one task at a time with a human review between every step" title="Spec-driven development: write a spec, the agent writes a plan, then it executes one task at a time with a human review between every step" srcset="https://substackcdn.com/image/fetch/$s_!dRoL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F929891a1-351d-473d-99be-653e3e4531aa_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!dRoL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F929891a1-351d-473d-99be-653e3e4531aa_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!dRoL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F929891a1-351d-473d-99be-653e3e4531aa_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!dRoL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F929891a1-351d-473d-99be-653e3e4531aa_2048x1143.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>But spec-driven development isn&#8217;t new,,, it is an old engineering tradition.</p><p>The only thing changed is how fast you move from a vision in your head to a written spec to a working implementation. All with the help of coding agents&#8230;</p><h4><em><strong>Current limitations</strong></em></h4><p>There are many, but the first one you&#8217;ll hit is the context window<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-11" href="#footnote-11" target="_self">11</a>&#8230;</p><p>An agent holds everything it&#8217;s working on in a fixed amount of memory, measured in the number of tokens<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-12" href="#footnote-12" target="_self">12</a>.</p><p>The longer a single task runs, the more memory it fills with its own earlier steps, and at some point, the oldest facts drop out of the window. It forgets a decision it made twenty minutes ago and starts contradicting itself.</p><p>This is why the spec-and-plan loop matters beyond just planning&#8230;</p><p>The spec and plan documents can hold massive context on disk agent can refer to at any time. This frees up its window to focus only on the task at hand. It doesn&#8217;t matter whether your agent has a 1M-token window.</p><p>Quality drops as the context fills, well before the window is full.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sLBy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc604e46d-105b-4766-8508-3c494a344771_2048x1143.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sLBy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc604e46d-105b-4766-8508-3c494a344771_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!sLBy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc604e46d-105b-4766-8508-3c494a344771_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!sLBy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc604e46d-105b-4766-8508-3c494a344771_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!sLBy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc604e46d-105b-4766-8508-3c494a344771_2048x1143.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sLBy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc604e46d-105b-4766-8508-3c494a344771_2048x1143.jpeg" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c604e46d-105b-4766-8508-3c494a344771_2048x1143.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:813,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Output quality declines as the context fills, well before the window is full&quot;,&quot;title&quot;:&quot;Output quality declines as the context fills, well before the window is full&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Output quality declines as the context fills, well before the window is full" title="Output quality declines as the context fills, well before the window is full" srcset="https://substackcdn.com/image/fetch/$s_!sLBy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc604e46d-105b-4766-8508-3c494a344771_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!sLBy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc604e46d-105b-4766-8508-3c494a344771_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!sLBy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc604e46d-105b-4766-8508-3c494a344771_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!sLBy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc604e46d-105b-4766-8508-3c494a344771_2048x1143.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><a href="https://platform.claude.com/docs/en/build-with-claude/context-windows">Anthropic documents this</a> for its own models, and <a href="https://www.trychroma.com/research/context-rot">a study of 18 models</a> found every one got worse as the input grew. The decline is steady, and a model with a 1M-token window can already be slipping at 50k.</p><div><hr></div><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/agentic-ai-use-cases?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption"><em>Get 2+ referrals &amp; I&#8217;ll send you my Interview Mistakes to Avoid PDF!</em></p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/agentic-ai-use-cases?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/agentic-ai-use-cases?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><div><hr></div><h3><strong>4. Test</strong></h3><p>Testing is where you find out whether the code does what you said it should, before anyone else depends on it.</p><p>This is the stage agents are &#8216;built&#8217; for&#8230;</p><p>A test runs in a few seconds and tells the agent one thing: <em>pass or fail</em>. So the agent can write a test, run it, see what broke, and try again, as many times as it needs, without you in the room.</p><p>The products doing this are real and busy&#8230;</p><ul><li><p>Momentic, a tool that tests apps by clicking through them the way a user would, ran over 200 million test steps in a single month and caught 390,000+ bugs.</p></li><li><p>Diffblue Cover, which writes tests for large-scale Java systems at banks like Goldman Sachs and JPMorgan, writes them 250 times faster than a person and adds enough tests to raise test coverage by 50 to 70%.</p></li></ul><p>This does not mean you can hand testing to an agent and walk away&#8230; The failures here are easy to miss, and there are three of them:</p><p><em><strong>The first one affects everybody.</strong></em></p><p>Ask an agent to write tests, and a lot of them pass without checking anything real.</p><p>The test runs the function, and function returns an answer. The check is technically true, and still nothing useful got tested. Agents write these empty tests all the time.</p><p>This is why, when Claude Code writes a plan for me, I almost always send it back with one note: <em>make the tests mean something, not just pass.</em> The agent then usually throws out its first set and writes much better ones.</p><p><em><strong>The second failure is a direct follow-up to the first.</strong></em></p><p>The agent writes so many tests that keeping them all working becomes a job in itself.</p><p>Large corporations like Meta are already running into this. Their testing setup, built up over decades, could not keep up with the number of tests the agents were writing, so they moved to tests that are made fresh for each pull request and deleted as soon as they run.</p><p><em><strong>The third one is the hardest to fix.</strong></em></p><p>Agents are slow and expensive at testing anything you can see on screen&#8230;</p><p>A logic test is quick because the agent reads pass or fail straight from the code. A test of a button or a page gives no such answer, so for every step, the agent has to:</p><ol><li><p>Take a screenshot,</p></li><li><p>Work out where the button sits on screen,</p></li><li><p>Click it,</p></li><li><p>Take another screenshot to check what changed.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GNYS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc56d6f86-3ca7-4855-8867-7c4c0f44183b_2048x1143.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GNYS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc56d6f86-3ca7-4855-8867-7c4c0f44183b_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!GNYS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc56d6f86-3ca7-4855-8867-7c4c0f44183b_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!GNYS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc56d6f86-3ca7-4855-8867-7c4c0f44183b_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!GNYS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc56d6f86-3ca7-4855-8867-7c4c0f44183b_2048x1143.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GNYS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc56d6f86-3ca7-4855-8867-7c4c0f44183b_2048x1143.jpeg" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c56d6f86-3ca7-4855-8867-7c4c0f44183b_2048x1143.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:813,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;A logic test reads pass or fail in one step; a UI test takes four slow steps&quot;,&quot;title&quot;:&quot;A logic test reads pass or fail in one step; a UI test takes four slow steps&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A logic test reads pass or fail in one step; a UI test takes four slow steps" title="A logic test reads pass or fail in one step; a UI test takes four slow steps" srcset="https://substackcdn.com/image/fetch/$s_!GNYS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc56d6f86-3ca7-4855-8867-7c4c0f44183b_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!GNYS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc56d6f86-3ca7-4855-8867-7c4c0f44183b_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!GNYS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc56d6f86-3ca7-4855-8867-7c4c0f44183b_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!GNYS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc56d6f86-3ca7-4855-8867-7c4c0f44183b_2048x1143.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A person clicks a button in a fraction of a second... The agent spends time and tokens on all four steps to do the same thing&#8230;</p><div><hr></div><div class="callout-block" data-callout="true"><p><em>Did you know?</em></p><p><strong><a href="https://coderabbit.link/neo-agent">CodeRabbit&#8217;s</a></strong><a href="https://coderabbit.link/neo-agent"> </a><strong><a href="https://coderabbit.link/neo-agent">new Slack agent</a></strong> keeps shared context across coding, reviews, incidents, and tickets, so your agents stop starting from zero every time work moves between tools.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://coderabbit.link/neo-agent" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GfjP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 424w, https://substackcdn.com/image/fetch/$s_!GfjP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 848w, https://substackcdn.com/image/fetch/$s_!GfjP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 1272w, https://substackcdn.com/image/fetch/$s_!GfjP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GfjP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png" width="1248" height="654" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:654,&quot;width&quot;:1248,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:547609,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://coderabbit.link/neo-agent&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/192885623?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!GfjP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 424w, https://substackcdn.com/image/fetch/$s_!GfjP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 848w, https://substackcdn.com/image/fetch/$s_!GfjP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 1272w, https://substackcdn.com/image/fetch/$s_!GfjP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Use it to carry decisions, debugging history, and architectural context across your entire software development lifecycle:</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://coderabbit.link/neo-agent&quot;,&quot;text&quot;:&quot;Try CodeRabbit's Agent Today&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://coderabbit.link/neo-agent"><span>Try CodeRabbit's Agent Today</span></a></p></div><div><hr></div><h3><strong>5. Review</strong></h3><p>Before any code ships, someone has to read it and sign off on it.</p><p>For years, someone was always a person. You open a pull request, and one or more teammates read your changes line by line. They look for bugs, for code that does not match the rest of the project, and for anything that does not do what the request says it does.</p><p>Nothing merges until one of them approves it&#8230;</p><p>But this process is slow:</p><p>Reviews pile up in a queue while people are busy with their own work. One senior engineer often ends up reviewing everyone else&#8217;s code, becoming the bottleneck. And a reviewer reading a 600-line change late on a Friday is NOT going to catch much.</p><p>This is the part agents handle well, and the WIN is speed and coverage.</p><p>An agent reviews every pull request the moment it opens. It never sits in a queue, never has a bad day, and never skips the boring change nobody wanted to read. This speed and coverage matter. <strong><a href="https://coderabbit.link/neo-agent">CodeRabbit</a></strong>, one of the biggest AI review tools, now runs on more than 6 million repositories for over 15,000 teams.</p><p>So every change gets a look. This is the real value,,, and it is worth a lot.</p><p>What an agent can&#8217;t do is decide which of its own comments matter.</p><p>It flags a lot, and only some of it is worth your time. A 2025 study of 278,790 real review comments found developers acted on 16.6% of suggestions from AI reviewers, compared with 56.5% from human reviewers.</p><p>i.e., people accept a human reviewer&#8217;s note 3x as often.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!LdS7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8f9d173-0a4d-41f7-92f2-7a2a33992a44_2048x1143.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!LdS7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8f9d173-0a4d-41f7-92f2-7a2a33992a44_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!LdS7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8f9d173-0a4d-41f7-92f2-7a2a33992a44_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!LdS7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8f9d173-0a4d-41f7-92f2-7a2a33992a44_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!LdS7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8f9d173-0a4d-41f7-92f2-7a2a33992a44_2048x1143.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!LdS7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8f9d173-0a4d-41f7-92f2-7a2a33992a44_2048x1143.jpeg" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a8f9d173-0a4d-41f7-92f2-7a2a33992a44_2048x1143.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:813,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;How often the comment gets acted on: developers act on 16.6% of AI review comments versus 56.5% of human ones&quot;,&quot;title&quot;:&quot;How often the comment gets acted on: developers act on 16.6% of AI review comments versus 56.5% of human ones&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="How often the comment gets acted on: developers act on 16.6% of AI review comments versus 56.5% of human ones" title="How often the comment gets acted on: developers act on 16.6% of AI review comments versus 56.5% of human ones" srcset="https://substackcdn.com/image/fetch/$s_!LdS7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8f9d173-0a4d-41f7-92f2-7a2a33992a44_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!LdS7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8f9d173-0a4d-41f7-92f2-7a2a33992a44_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!LdS7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8f9d173-0a4d-41f7-92f2-7a2a33992a44_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!LdS7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa8f9d173-0a4d-41f7-92f2-7a2a33992a44_2048x1143.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The danger is what it does to your own attention&#8230;</p><p>When most of the comments are not worth acting on, you stop reading them closely. You skim, you click approve, and the one comment in twenty that caught a real bug slides past with the rest. The agent reviewed every line, and you still missed the bug, because it buried the signal in noise.</p><p>So treat the agent as a first pass that never misses a file, NOT as the reviewer who gets the final say&#8230;</p><h3><strong>6. Deploy</strong></h3><p>This is the first stage where the answer is a clear NO. Don&#8217;t hand it to an agent&#8230;</p><p>Two things make deploy different from everything before it:</p><ul><li><p>First, you can undo a bad deploy, but not in the clean way you undo a bad commit. You can roll back, sure. By then, the broken version already reached real users, money may have moved, and the rollback is its own risky operation; you&#8217;re running under pressure.</p></li><li><p>Second, it breaks everything at once. A bad function fails one test. A bad deploy takes down the entire system for every user at once.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cMPD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1587038-4373-4457-a205-d77374ef8601_2048x1143.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cMPD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1587038-4373-4457-a205-d77374ef8601_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!cMPD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1587038-4373-4457-a205-d77374ef8601_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!cMPD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1587038-4373-4457-a205-d77374ef8601_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!cMPD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1587038-4373-4457-a205-d77374ef8601_2048x1143.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cMPD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1587038-4373-4457-a205-d77374ef8601_2048x1143.jpeg" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b1587038-4373-4457-a205-d77374ef8601_2048x1143.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:813,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Blast radius: a bad function fails one test, but a bad deploy radiates out and takes down every user at once&quot;,&quot;title&quot;:&quot;Blast radius: a bad function fails one test, but a bad deploy radiates out and takes down every user at once&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Blast radius: a bad function fails one test, but a bad deploy radiates out and takes down every user at once" title="Blast radius: a bad function fails one test, but a bad deploy radiates out and takes down every user at once" srcset="https://substackcdn.com/image/fetch/$s_!cMPD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1587038-4373-4457-a205-d77374ef8601_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!cMPD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1587038-4373-4457-a205-d77374ef8601_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!cMPD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1587038-4373-4457-a205-d77374ef8601_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!cMPD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb1587038-4373-4457-a205-d77374ef8601_2048x1143.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>So the deploy button is one of the few places where the SAFE move is still a human hand&#8230;</p><p>Let the agent prepare the release, run the checks, and stage everything it can. Keep a person in front of the final push to production, where a wrong call costs the most and undoes the least.</p><h3><strong>7. Operate</strong></h3><p>Once the code is live and real users are on it, someone has to keep it healthy&#8230;</p><p>You watch the dashboards for trouble. When something breaks, you find out why and fix it fast. A lot of these land at bad hours, because production doesn&#8217;t break on a schedule. You&#8217;re on call, and your phone can buzz at 2 a.m.</p><p>There is more of this work now than there used to be&#8230;</p><p>All the AI-written code from the earlier stages ships, and it breaks more often as measured by two separate studies:</p><ul><li><p>Google&#8217;s DORA<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-13" href="#footnote-13" target="_self">13</a> report tracks delivery stability across thousands of teams and found greater AI use correlates with lower stability in both its 2024 and 2025 editions.</p></li><li><p>Faros AI analyzed telemetry<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-14" href="#footnote-14" target="_self">14</a> from 22,000 developers and found the number of production incidents per merged change increased by 242% as AI use climbed. More code ships, more of it breaks, and someone is on call for all of it&#8230;</p></li></ul><p>Ironically, agents are really good at analyzing incidents caused by bad agent code.</p><p>The first part of any incident is gathering. You pull the recent deploys, search the logs, check the dashboards, and walk through the runbook<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-15" href="#footnote-15" target="_self">15</a> step by step. It&#8217;s slow, and it&#8217;s almost the same process every time.</p><p>An agent does it fast&#8230;</p><blockquote><p>Datadog&#8217;s Bits AI SRE<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-16" href="#footnote-16" target="_self">16</a> investigates an alert the moment it fires and has the findings ready before you&#8217;ve opened your laptop.</p><p>One of its customers said: <em>investigation is done before the engineer sits down.</em> <em>At 2 a.m., this head start is worth a lot.</em></p></blockquote><p>What you can&#8217;t hand over is the decision on what&#8217;s actually wrong&#8230;</p><p>The agent will tell you the cause, and it says it with the same confidence whether it&#8217;s right or not. An alert fires; the agent says it&#8217;s the database connection pool. It sounds right, so you spend 30 minutes there. But the actual cause can be completely different. A human might have said <em>&#8220;I&#8217;m not sure yet&#8221; </em>and kept looking. The agent&#8217;s speed means you commit to the wrong fix sooner.</p><p>So let the agent gather the facts and keep the diagnosis YOURS&#8230;</p><div><hr></div><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/agentic-ai-use-cases?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption"><em>Get 3+ referrals &amp; I&#8217;ll send you Popular Interview Questions PDF!</em></p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/agentic-ai-use-cases?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/agentic-ai-use-cases?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><div><hr></div><h3><strong>8. Maintain</strong></h3><p>After a feature ships, the work doesn&#8217;t stop&#8230;The code still needs &#8220;babysitting&#8221;.</p><p>A library releases a security patch, so you bump to the new version. A messy function needs cleaning up; a small bug turns up; docs stopped matching the code three releases ago. None of it is glamorous, and all of it piles up. Ignore it long enough and the codebase rots.</p><p>Of all eight stages, this is where agents earn the clearest yes&#8230;</p><p>The reason is maintenance work grades itself. A dependency bump either passes the tests or it doesn&#8217;t. A refactor is meant to leave the behavior the same, so if the tests still pass after the agent rewrites the code, the refactor worked. The test suite is the judge, and it&#8217;s one the agent can run on its own, as many times as it needs, until the change is green.</p><p>This is the exact condition agents are built for&#8230;</p><p>The products doing this run at a scale no other tool mentioned today matches.</p><p>Dependabot (GitHub&#8217;s tool) watches your dependencies and opens a pull request when one falls behind, and is used across millions of repositories. GitHub says repositories using automated security updates fix critical vulnerabilities significantly faster because the update is waiting for you instead of sitting on a to-do list that nobody gets to.</p><p>But there is still a subtle way this can go WRONG:</p><p>Each change is small and passes its tests, so each one clears review without much thought. The agent doesn&#8217;t see the entire system, so it ships the refactor that works while leaving the code a little worse than a careful person would.</p><p>A bit more duplication here, an odd structure there&#8230;</p><p>No single change is worth stopping for. Over time, they stack up into a codebase, making it harder to read and change than before, and nobody can point to the commit where it went wrong. So this is the same blindness from the &#8216;Design&#8217; stage, showing up slowly instead of all at once.</p><p>Let the agent handle the maintenance, and keep a human to read what it actually changed&#8230;</p><h3><strong>Across the lifecycle</strong></h3><p>One pattern runs through all eight stages:</p><p>Agents do well wherever a machine can tell them they&#8217;re wrong. A failing test, a red build, a type error: <em>agent gets an answer in seconds and tries again on its own until the work is green.</em> This includes code, tests, dependency bumps, first pass at an incident.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0KjS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5058a4f-52ac-482d-9805-5c538f3ddb55_2048x1143.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0KjS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5058a4f-52ac-482d-9805-5c538f3ddb55_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!0KjS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5058a4f-52ac-482d-9805-5c538f3ddb55_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!0KjS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5058a4f-52ac-482d-9805-5c538f3ddb55_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!0KjS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5058a4f-52ac-482d-9805-5c538f3ddb55_2048x1143.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0KjS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5058a4f-52ac-482d-9805-5c538f3ddb55_2048x1143.jpeg" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f5058a4f-52ac-482d-9805-5c538f3ddb55_2048x1143.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:813,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;What decides whether an agent can do the job: the eight stages plotted by how fast feedback arrives and whether a machine can check the answer&quot;,&quot;title&quot;:&quot;What decides whether an agent can do the job: the eight stages plotted by how fast feedback arrives and whether a machine can check the answer&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="What decides whether an agent can do the job: the eight stages plotted by how fast feedback arrives and whether a machine can check the answer" title="What decides whether an agent can do the job: the eight stages plotted by how fast feedback arrives and whether a machine can check the answer" srcset="https://substackcdn.com/image/fetch/$s_!0KjS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5058a4f-52ac-482d-9805-5c538f3ddb55_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!0KjS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5058a4f-52ac-482d-9805-5c538f3ddb55_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!0KjS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5058a4f-52ac-482d-9805-5c538f3ddb55_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!0KjS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff5058a4f-52ac-482d-9805-5c538f3ddb55_2048x1143.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>But they struggle wherever the only judge is a person&#8230;</p><p>Whether this is right feature, right architecture, or right moment to ship to production. No test comes back red on those. And the answer depends on what your business needs and how much it costs you when you&#8217;re wrong, and none of it is written down for the agent to check.</p><p>These are also the stages where a mistake is slow to find and hard to undo, so the agent runs furthest before anyone catches it.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ybt_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47735ec7-7bb9-4c8d-88a9-6ff9963d02db_2048x1143.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ybt_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47735ec7-7bb9-4c8d-88a9-6ff9963d02db_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ybt_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47735ec7-7bb9-4c8d-88a9-6ff9963d02db_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ybt_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47735ec7-7bb9-4c8d-88a9-6ff9963d02db_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ybt_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47735ec7-7bb9-4c8d-88a9-6ff9963d02db_2048x1143.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ybt_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47735ec7-7bb9-4c8d-88a9-6ff9963d02db_2048x1143.jpeg" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/47735ec7-7bb9-4c8d-88a9-6ff9963d02db_2048x1143.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:813,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Where an agent earns its place: the eight stages color-coded by whether you can hand them to an agent today&quot;,&quot;title&quot;:&quot;Where an agent earns its place: the eight stages color-coded by whether you can hand them to an agent today&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Where an agent earns its place: the eight stages color-coded by whether you can hand them to an agent today" title="Where an agent earns its place: the eight stages color-coded by whether you can hand them to an agent today" srcset="https://substackcdn.com/image/fetch/$s_!ybt_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47735ec7-7bb9-4c8d-88a9-6ff9963d02db_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ybt_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47735ec7-7bb9-4c8d-88a9-6ff9963d02db_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ybt_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47735ec7-7bb9-4c8d-88a9-6ff9963d02db_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ybt_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47735ec7-7bb9-4c8d-88a9-6ff9963d02db_2048x1143.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Every verdict here looked at one agent doing one job, though. Real teams run a dozen at once, and it changes the problem&#8230;</p><div><hr></div><h2><strong>Why more agents do NOT make your team faster</strong></h2><p>So far, we have looked at one agent doing one job. Real teams run a dozen at once&#8230;</p><p>A coding agent, a test agent, a review agent, and an on-call agent, all working at the same time. The trouble is none of them shares memory with the others. So the coding agent doesn&#8217;t know what the test agent already tried. And the review agent doesn&#8217;t know what the on-call agent learned last night.</p><p>Each one starts blank about every other one.</p><p>That gap costs you more than you&#8217;d expect&#8230;</p><blockquote><p>Nicholas Carlini at Anthropic ran 16 Claude agents in parallel to build a C compiler. Over 2,000 sessions and about $20,000 of compute, and the project worked. But here is what he found running them together:</p><p><em>&#8220;Every agent would hit the same bug, fix that bug, and then overwrite each other&#8217;s changes. Having 16 agents running didn&#8217;t help because each was stuck solving the same task.&#8221;</em></p></blockquote><p>So the agents duplicate and overwrite each other, and a person has to review it all and resolve the collisions before any of it merges.</p><p>The context that would stop the repetitive work already exists&#8230; It is just the agent can&#8217;t usually read it&#8230;</p><p>It&#8217;s in a Slack thread, in the reasoning on a closed pull request, in an old ticket, or in what the on-call agent worked out last night. The next agent can read your code, but it can&#8217;t read the conversation where you decided why the code looks a specific way.</p><p>This decision history is the part NO agent has&#8230;</p><p>The fix is to give the agents one shared memory which survives between runs, running where the team already talks, so a person can interrupt and redirect.</p><p><strong><a href="https://coderabbit.link/neo-agent">CodeRabbit</a></strong> launched a<strong> <a href="https://coderabbit.link/neo-agent">Slack agent</a></strong><a href="https://coderabbit.link/neo-agent"> </a>that works this way, and the way they describe the problem is the subtle patterns we have been hinting at throughout the newsletter: <em>&#8220;Each phase runs on a different tool and uses a different agent. None of them talks to each other. What one engineer figures out in coding doesn&#8217;t show up in testing.&#8221;</em></p><p><em>Their <a href="https://coderabbit.link/neo-agent">agent</a> runs in Slack, so it reads the same threads your team does and carries what it learns from one conversation to the next. Ask it Friday about something it saw Monday, and it still knows&#8230;</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gqi4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18000f90-6611-41a7-83eb-dcbefd24de8a_2048x1143.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gqi4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18000f90-6611-41a7-83eb-dcbefd24de8a_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!gqi4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18000f90-6611-41a7-83eb-dcbefd24de8a_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!gqi4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18000f90-6611-41a7-83eb-dcbefd24de8a_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!gqi4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18000f90-6611-41a7-83eb-dcbefd24de8a_2048x1143.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gqi4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18000f90-6611-41a7-83eb-dcbefd24de8a_2048x1143.jpeg" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/18000f90-6611-41a7-83eb-dcbefd24de8a_2048x1143.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:813,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Without shared memory agents duplicate each other; with a shared memory layer like CodeRabbit's Slack agent they read what the others learned&quot;,&quot;title&quot;:&quot;Without shared memory agents duplicate each other; with a shared memory layer like CodeRabbit's Slack agent they read what the others learned&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Without shared memory agents duplicate each other; with a shared memory layer like CodeRabbit's Slack agent they read what the others learned" title="Without shared memory agents duplicate each other; with a shared memory layer like CodeRabbit's Slack agent they read what the others learned" srcset="https://substackcdn.com/image/fetch/$s_!gqi4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18000f90-6611-41a7-83eb-dcbefd24de8a_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!gqi4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18000f90-6611-41a7-83eb-dcbefd24de8a_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!gqi4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18000f90-6611-41a7-83eb-dcbefd24de8a_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!gqi4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F18000f90-6611-41a7-83eb-dcbefd24de8a_2048x1143.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Shared memory is the real problem under all eight stages, and nobody has fully solved it yet&#8230;</p><div><hr></div><h2><strong>What to expect when an agent is on your team</strong></h2><p><em>Say you decide to put agents to work anyway, before that problem is solved.</em></p><p>Here is what the job actually feels like once you do it:</p><p>The first thing to know is the speed you feel may NOT be the speed you get&#8230;</p><p>METR, an independent nonprofit running studies on what AI can and can&#8217;t do, tested this in 2025. (They aren&#8217;t selling an AI tool, so they had no reason to tilt the result either way.)</p><p>They took 16 experienced developers and gave them 246 real tasks on their own projects, the repositories they had maintained for years. The developers did half the tasks with AI tools and half without, and a timer recorded both.</p><p>They finished the AI tasks 19% <em>slower</em>. The surprising part is same developers <em>thought</em> the AI had made them 20% <em>faster</em>. They were slower and felt quicker at the same time.</p><p>This gap is what matters here&#8230;</p><p>These were experts on code they already knew well, where they were fast to begin with, so it won&#8217;t match every job. But your own sense of whether an agent is helping is not reliable, so check it against something real.</p><p>With more agentic work, your week changes a lot&#8230;</p><p>An agent opens more pull requests than you would, and each one is bigger than the last. So you spend less of your day writing code and more of it reading what the agent wrote and deciding if it&#8217;s right. That reading has a different cognitive cost. Do it all day, and you end up tired in a way that writing the code yourself didn&#8217;t make you, even when the agent saved time.</p><p>The other thing to set up before you &#8220;trust&#8221; an agent is a limit on what it can &#8220;break&#8221;&#8230;</p><p>An agent running commands can do real damage when it gets something wrong:</p><blockquote><p>In July 2025, Replit&#8217;s coding agent deleted a production database after it was told, in plain words, to change nothing. It wiped records for 1,200+ business leaders and 1,000+ companies. The agent&#8217;s own summary afterward read: <em>&#8220;I destroyed months of work in seconds.&#8221;</em></p></blockquote><p>Three controls keep that from being you&#8230;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1eY-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff04a646-3c0d-48cf-9428-12367401476c_2048x1143.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1eY-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff04a646-3c0d-48cf-9428-12367401476c_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!1eY-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff04a646-3c0d-48cf-9428-12367401476c_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!1eY-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff04a646-3c0d-48cf-9428-12367401476c_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!1eY-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff04a646-3c0d-48cf-9428-12367401476c_2048x1143.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1eY-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff04a646-3c0d-48cf-9428-12367401476c_2048x1143.jpeg" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ff04a646-3c0d-48cf-9428-12367401476c_2048x1143.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:813,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Three controls before you trust an agent: sandbox, scoped permissions, audit log&quot;,&quot;title&quot;:&quot;Three controls before you trust an agent: sandbox, scoped permissions, audit log&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Three controls before you trust an agent: sandbox, scoped permissions, audit log" title="Three controls before you trust an agent: sandbox, scoped permissions, audit log" srcset="https://substackcdn.com/image/fetch/$s_!1eY-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff04a646-3c0d-48cf-9428-12367401476c_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!1eY-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff04a646-3c0d-48cf-9428-12367401476c_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!1eY-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff04a646-3c0d-48cf-9428-12367401476c_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!1eY-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fff04a646-3c0d-48cf-9428-12367401476c_2048x1143.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p>Run the agent in a sandbox so it can&#8217;t reach production in the first place.</p></li><li><p>Give it scoped permissions, so it only gets access to the one thing the task needs and nothing else.</p></li><li><p>And keep an audit log of every command it ran, so when something breaks, you can see exactly what it did.</p></li></ul><p>So pick your first agent where a wrong answer is cheap to undo&#8230;</p><p>Coding, review, and maintenance are good places to start, because a bad suggestion gets caught before it ships, and a bad refactor fails the tests. Design and deploy are the worst places to start, for every reason this newsletter has already covered.</p><p>Begin where the agent can be wrong without costing you much, learn how it behaves, and only then move it somewhere that matters more.</p><div><hr></div><div class="callout-block" data-callout="true"><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://coderabbit.link/neo-agent" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GfjP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 424w, https://substackcdn.com/image/fetch/$s_!GfjP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 848w, https://substackcdn.com/image/fetch/$s_!GfjP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 1272w, https://substackcdn.com/image/fetch/$s_!GfjP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GfjP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png" width="1248" height="654" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:654,&quot;width&quot;:1248,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:547609,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://coderabbit.link/neo-agent&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/192885623?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!GfjP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 424w, https://substackcdn.com/image/fetch/$s_!GfjP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 848w, https://substackcdn.com/image/fetch/$s_!GfjP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 1272w, https://substackcdn.com/image/fetch/$s_!GfjP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7a43027a-3160-457a-8e4b-4e144b0be46a_1248x654.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Your engineers talk on Slack. They code in the terminal. Somewhere between those two things, context dies&#8230;</p><ul><li><p>A bug was debated in #incidents at 2 AM.</p></li><li><p>An architectural call was made in a DM.</p></li></ul><p>Every handoff leaks context, and every leak costs you. That&#8217;s the context tax and your team pays it every day.</p><p><strong><a href="https://coderabbit.link/neo-agent">CodeRabbit Agent for Slack</a></strong> is built for agentic SDLC workflows. One agent for your entire Software Development Lifecycle, living in the channel where the work already happens. It&#8217;s built on four things:</p><ul><li><p><strong>Context</strong>: your org&#8217;s operating picture, pulled from across code, tickets, docs, monitoring, and cloud.</p></li><li><p><strong>Knowledge Base</strong>: a living memory of your team. Every run leaves a trace, so yesterday&#8217;s decisions don&#8217;t become tomorrow&#8217;s debates.</p></li><li><p><strong>Multi-Player</strong>: works in shared threads alongside your team. Steerable, resumable, and aligned as work evolves.</p></li><li><p><strong>Governance</strong>: scoped access, cost attribution. Every run explainable and attributed.</p></li></ul><p>Your team keeps shipping. <strong><a href="https://coderabbit.link/neo-agent">Agent</a></strong> keeps the context.</p><p>From the team that pioneered AI code reviews. 2M code reviews every week. 6M repos. 15K customers. And now, one agent for your entire SDLC, right in Slack:</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://coderabbit.link/neo-agent&quot;,&quot;text&quot;:&quot;Try CodeRabbit's Agent Today&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://coderabbit.link/neo-agent"><span>Try CodeRabbit's Agent Today</span></a></p><p>(Thanks again to <strong><a href="https://coderabbit.link/neo-agent">CodeRabbit</a></strong> for partnering on this post.)</p></div><div><hr></div><p>Louis and I launched the <strong><a href="https://newsletter.systemdesign.one/subscribe?yearly=true">GENERATIVE AI MASTERCLASS</a></strong> (newsletter series exclusive to PAID subscribers).</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://newsletter.systemdesign.one/subscribe?yearly=true" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Lz0V!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 424w, https://substackcdn.com/image/fetch/$s_!Lz0V!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 848w, https://substackcdn.com/image/fetch/$s_!Lz0V!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 1272w, https://substackcdn.com/image/fetch/$s_!Lz0V!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Lz0V!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png" width="1200" height="630" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:630,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:614623,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://newsletter.systemdesign.one/subscribe?yearly=true&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/199185364?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Lz0V!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 424w, https://substackcdn.com/image/fetch/$s_!Lz0V!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 848w, https://substackcdn.com/image/fetch/$s_!Lz0V!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 1272w, https://substackcdn.com/image/fetch/$s_!Lz0V!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0de1c782-57c1-4638-baae-2c455d6623fb_1200x630.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>When you upgrade, you&#8217;ll get:</p><ul><li><p><strong>Simple breakdown of real-world architectures</strong></p></li><li><p>Frameworks you can plug into your work or business</p></li><li><p><strong>Proven systems behind ChatGPT, Perplexity, and Copilot</strong></p></li></ul><p><strong>&#128073; <a href="https://newsletter.systemdesign.one/subscribe?yearly=true">CLICK HERE TO JOIN THE GENERATIVE AI MASTERCLASS</a></strong></p><p>(Golden members will get the next Generative AI newsletter in the first week of June.)</p><div><hr></div><p>If you find this newsletter valuable, share it with a friend, and subscribe if you haven&#8217;t already. There are <a href="http://newsletter.systemdesign.one/subscribe?group=true">group discounts</a>, <a href="http://newsletter.systemdesign.one/subscribe?gift=true">gift options</a>, and <a href="https://newsletter.systemdesign.one/leaderboard">referral rewards</a> available.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://x.com/intent/follow?screen_name=systemdesignone" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bEFk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 424w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 848w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 1272w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bEFk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png" width="152" height="152" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:320,&quot;width&quot;:320,&quot;resizeWidth&quot;:152,&quot;bytes&quot;:74009,&quot;alt&quot;:&quot;Author Neo Kim; System design case studies&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://x.com/intent/follow?screen_name=systemdesignone&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Author Neo Kim; System design case studies" title="Author Neo Kim; System design case studies" srcset="https://substackcdn.com/image/fetch/$s_!bEFk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 424w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 848w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 1272w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption"><strong>&#128075; Find me on <a href="https://www.linkedin.com/in/nk-systemdesign-one/">LinkedIn</a> | <a href="https://x.com/intent/follow?screen_name=systemdesignone">Twitter</a> | <a href="https://www.threads.net/@systemdesignone">Threads</a> | <a href="https://www.instagram.com/systemdesignone/">Instagram</a></strong></figcaption></figure></div><div><hr></div><p><strong>Want to reach 210K+ tech professionals at scale? </strong>&#128240;</p><p>If your company wants to reach 210K+ tech professionals, <a href="https://newsletter.systemdesign.one/p/sponsorship">advertise with me</a>.</p><div><hr></div><p>Thank you for supporting this newsletter.</p><p>You are now 210,001+ readers strong, very close to 210k. Let&#8217;s try to get 211k readers by 29 May. Consider sharing this post with your friends and get rewards.</p><p>Y&#8217;all are the best.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6oWl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6oWl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 424w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 848w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 1272w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6oWl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png" width="590" height="368.75" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2e739087-a910-4643-be36-997b6dd5b4af_800x500.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:500,&quot;width&quot;:800,&quot;resizeWidth&quot;:590,&quot;bytes&quot;:87878,&quot;alt&quot;:&quot;system design newsletter&quot;,&quot;title&quot;:&quot;system design newsletter&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/163380418?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="system design newsletter" title="system design newsletter" srcset="https://substackcdn.com/image/fetch/$s_!6oWl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 424w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 848w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 1272w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/agentic-ai-use-cases?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/agentic-ai-use-cases?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div><hr></div><h3>References</h3><ul><li><p>Boris Cherny on why Anthropic keeps hiring engineers: <a href="https://x.com/bcherny/status/2022762422302576970">x.com/bcherny</a> (<a href="https://simonwillison.net/2026/Feb/14/boris/">mirror</a>)</p></li><li><p>Duplicated code rose 8x after AI adoption: <a href="https://www.gitclear.com/ai_assistant_code_quality_2025_research">GitClear, AI Copilot Code Quality 2025</a></p></li><li><p>Andrej Karpathy on models bloating abstractions and leaving dead code: <a href="https://x.com/karpathy/status/2015883857489522876">x.com/karpathy</a></p></li><li><p>Cursor revenue and daily users: <a href="https://cursor.com/blog/series-d">Cursor Series D announcement</a></p></li><li><p>Cursor and Claude Code developer adoption: <a href="https://survey.stackoverflow.co/2025/technology">Stack Overflow 2025 Developer Survey</a></p></li><li><p>Context quality drops as input grows, across 18 models: <a href="https://www.trychroma.com/research/context-rot">Chroma, Context Rot</a></p></li><li><p>Anthropic on CLAUDE.md memory files: <a href="https://code.claude.com/docs/en/memory">Claude Code memory docs</a></p></li><li><p>Spec-driven development with Superpowers: <a href="https://github.com/obra/superpowers">github.com/obra/superpowers</a></p></li><li><p>Anthropic on context windows: <a href="https://platform.claude.com/docs/en/build-with-claude/context-windows">Claude context windows docs</a></p></li><li><p>Momentic, 200 million test steps and 390,000 bugs in a month: <a href="https://momentic.ai/blog/series-a">Momentic Series A</a></p></li><li><p>Diffblue Cover, 250x faster test writing: <a href="https://www.diffblue.com/diffblue-cover/">Diffblue Cover</a></p></li><li><p>Diffblue Cover, 50 to 70% coverage lift: <a href="https://www.diffblue.com/resources/uplift-java-test-coverage-out-of-the-box/">Uplift Java test coverage</a></p></li><li><p>Diffblue Cover at Goldman Sachs: <a href="https://www.diffblue.com/case-studies/goldman-sachs-complete-a-years-worth-of-java-unit-test-writing-overnight-with-diffblue-cover/">Goldman Sachs case study</a></p></li><li><p>Meta&#8217;s just-in-time tests, generated per pull request: <a href="https://engineering.fb.com/2026/02/11/developer-tools/the-death-of-traditional-testing-agentic-development-jit-testing-revival/">The death of traditional testing</a></p></li><li><p>GitHub Copilot Code Review, 60 million reviews and 1 in 5 of all reviews: <a href="https://github.blog/ai-and-ml/github-copilot/60-million-copilot-code-reviews-and-counting/">60 million Copilot code reviews and counting</a></p></li><li><p>Developers act on 16.6% of AI review comments vs 56.5% from humans (278,790 comments): <a href="https://arxiv.org/abs/2603.15911">Human-AI Synergy in Agentic Code Review</a></p></li><li><p>Amazon Kiro and the 13-hour AWS outage: <a href="https://www.aboutamazon.com/news/aws/aws-service-outage-ai-bot-kiro">Amazon&#8217;s response</a> (originally reported by the Financial Times)</p></li><li><p>DORA, AI adoption and delivery stability: <a href="https://dora.dev/research/2024/dora-report/">DORA 2024 report</a>, <a href="https://cloud.google.com/blog/products/ai-machine-learning/announcing-the-2025-dora-report">DORA 2025 report</a></p></li><li><p>Faros AI, incidents per change up 242% across 22,000 developers: <a href="https://www.faros.ai/research/ai-acceleration-whiplash">The AI Acceleration Whiplash</a></p></li><li><p>Datadog Bits AI SRE, generally available December 2025: <a href="https://www.datadoghq.com/about/latest-news/press-releases/datadog-launches-bits-ai-sre-agent-to-resolve-incidents-faster/">Datadog launches Bits AI SRE</a></p></li><li><p>Dependabot, 2.7 million repositories and 30% faster fixes: <a href="https://github.blog/news-insights/octoverse/octoverse-a-new-developer-joins-github-every-second-as-ai-leads-typescript-to-1/">GitHub Octoverse 2025</a></p></li><li><p>Nicholas Carlini, 16 agents building a C compiler: <a href="https://www.anthropic.com/engineering/building-c-compiler">Building a C compiler with Claude</a></p></li><li><p>CodeRabbit&#8217;s Slack agent launch and framing: <a href="https://www.businesswire.com/news/home/20260422659313/en/">CodeRabbit launches Slack agent</a></p></li><li><p>Mem0, open-source memory layer for agents: <a href="https://github.com/mem0ai/mem0">github.com/mem0ai/mem0</a></p></li><li><p>METR, developers 19% slower with AI while feeling faster: <a href="https://metr.org/blog/2025-07-10-early-2025-ai-experienced-os-dev-study/">METR study</a> (<a href="https://arxiv.org/abs/2507.09089">paper</a>)</p></li><li><p>Replit&#8217;s agent deleting a production database: <a href="https://fortune.com/2025/07/23/ai-coding-tool-replit-wiped-database-called-it-a-catastrophic-failure/">Fortune</a></p></li></ul><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p><strong>Pull request</strong> &#8212; a proposed change to a codebase, opened so others can review it before it is merged into the main code.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-2" href="#footnote-anchor-2" class="footnote-number" contenteditable="false" target="_self">2</a><div class="footnote-content"><p><strong>Tool</strong> is something the agent can use to perform tasks outside the chat, such as reading files, running tests, searching code, or calling an API.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-3" href="#footnote-anchor-3" class="footnote-number" contenteditable="false" target="_self">3</a><div class="footnote-content"><p><strong>Agent</strong> is an AI tool that can work through a task on its own instead of waiting for instructions at every step. For example, Claude Code can take a bug report, search the codebase, edit files, run tests, and keep trying fixes until it solves the problem or gets stuck.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-4" href="#footnote-anchor-4" class="footnote-number" contenteditable="false" target="_self">4</a><div class="footnote-content"><p><strong>Grep</strong> &#8212; a command that searches files for a piece of text. When an agent &#8220;greps for a function,&#8221; it searches the codebase to find where that function lives.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-5" href="#footnote-anchor-5" class="footnote-number" contenteditable="false" target="_self">5</a><div class="footnote-content"><p><strong>GitHub Copilot</strong> is an AI coding assistant built into your editor. It suggests code as you type (from single lines to entire functions) based on the code around it and the comment you wrote.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-6" href="#footnote-anchor-6" class="footnote-number" contenteditable="false" target="_self">6</a><div class="footnote-content"><p><strong>Database migration</strong> &#8212; a change to the shape of your database, such as adding a column or renaming a table. A bad one can corrupt existing data in a way you cannot undo.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-7" href="#footnote-anchor-7" class="footnote-number" contenteditable="false" target="_self">7</a><div class="footnote-content"><p><strong>Monolith vs microservices</strong> &#8212; two ways to structure a system. A monolith is one single program that does everything; microservices split the same work across several smaller programs that talk to each other.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-8" href="#footnote-anchor-8" class="footnote-number" contenteditable="false" target="_self">8</a><div class="footnote-content"><p><strong>CLAUDE.md / AGENTS.md</strong> &#8212; a plain-text file you keep in your repository. The coding agent reads it on startup and treats its contents as standing instructions.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-9" href="#footnote-anchor-9" class="footnote-number" contenteditable="false" target="_self">9</a><div class="footnote-content"><p><strong>Linter</strong> &#8212; a tool that automatically checks your code for style problems and likely mistakes before it runs.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-10" href="#footnote-anchor-10" class="footnote-number" contenteditable="false" target="_self">10</a><div class="footnote-content"><p><strong>Spec-driven development</strong> &#8212; writing a clear specification first, then having the agent turn it into a plan and an implementation, instead of prompting it one ad-hoc request at a time.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-11" href="#footnote-anchor-11" class="footnote-number" contenteditable="false" target="_self">11</a><div class="footnote-content"><p><strong>Context window</strong> is the amount of information an AI can keep in mind at one time while it works.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-12" href="#footnote-anchor-12" class="footnote-number" contenteditable="false" target="_self">12</a><div class="footnote-content"><p><strong>Token</strong> is a small piece of text that an AI reads at a time, usually a word, part of a word, or punctuation.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-13" href="#footnote-anchor-13" class="footnote-number" contenteditable="false" target="_self">13</a><div class="footnote-content"><p><strong>DORA</strong> stands for DevOps Research and Assessment: a long-running research program that studies how software teams build, ship, and operate software. It&#8217;s best known for measuring things like deployment speed, reliability, and production stability across thousands of engineering teams.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-14" href="#footnote-anchor-14" class="footnote-number" contenteditable="false" target="_self">14</a><div class="footnote-content"><p><strong>Telemetry</strong> &#8212; the performance and usage data that software automatically reports about itself, such as error rates and response times.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-15" href="#footnote-anchor-15" class="footnote-number" contenteditable="false" target="_self">15</a><div class="footnote-content"><p><strong>Runbook</strong> &#8212; a written, step-by-step checklist for handling a specific kind of incident, so whoever is on call can follow the same procedure every time.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-16" href="#footnote-anchor-16" class="footnote-number" contenteditable="false" target="_self">16</a><div class="footnote-content"><p><strong>SRE (Site Reliability Engineering)</strong> &#8212; the practice of keeping production systems running reliably, treating operations problems as software problems to be solved with code.</p><p></p></div></div>]]></content:encoded></item><item><title><![CDATA[How Virtual Machines Work - A Deep Dive]]></title><description><![CDATA[#148: Part 1 - DevOps Mastermind]]></description><link>https://newsletter.systemdesign.one/p/virtualization-architecture</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/virtualization-architecture</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Mon, 25 May 2026 07:25:33 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/1fb41d6b-b578-4d40-aa11-d43bccde13a7_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Get my system design playbook for FREE on newsletter signup:</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><p></p><ul><li><p><em><a href="https://newsletter.systemdesign.one/p/virtualization-architecture/?action=share">Share this post</a> &amp; I'll send you some rewards for the referrals.</em></p></li></ul><p>I have a huge huge huge announcement for everyone&#8230;</p><p>INTRODUCING: <strong>DevOps Mastermind</strong></p><p>This newsletter series will help you become a fast-growing and high-paying engineer.</p><p>If you&#8217;ve ever thought:</p><blockquote><p><em>&#8220;I use Docker &amp; Kubernetes, but I still don&#8217;t fully understand how they work.&#8221;</em></p><p><em>&#8220;I want to master DevOps fundamentals instead of just memorizing commands.&#8221;</em></p><p><em>&#8220;I should learn how modern infrastructure &amp; real-world systems actually work.&#8221;</em></p></blockquote><p>Then this is for you.</p><p>Here&#8217;s what you&#8217;ll get inside DevOps Mastermind:</p><ul><li><p><strong>Architecture breakdown of core DevOps systems.</strong></p></li><li><p>Deep dives into Docker, Kubernetes, Terraform, and so on.</p></li><li><p><strong>Practical insights into how real-world systems achieve scalability, automation, and reliability.</strong></p></li></ul><p>Onward.</p><div><hr></div><p>Your laptop is already running an operating system.</p><p>Now imagine starting another one on the same machine. A completely separate system with its own files, memory, and processes. You can run Linux inside Windows, or Windows inside a Mac. It boots independently, runs programs, and behaves as if it has full control over the hardware.</p><p>But it doesn&#8217;t.</p><p>Underneath, there is still only one physical machine. One CPU, one pool of memory, one disk. Yet multiple such systems can run at the same time, each isolated from the others and each functioning as if it were the only system present.</p><p>This idea changed computing&#8230;</p><p>Instead of buying a new server each time, you could split one powerful machine into many smaller ones. Each workload gets its own space. Nothing interferes with anything else.</p><p>That shift is what made cloud computing possible&#8230;</p><p>When you run an app on Amazon Web Services, Microsoft Azure, or Google Cloud Platform, it runs inside a virtual machine. The entire cloud infrastructure is built on this foundation.</p><p><em>But how does it actually work? How can one machine present itself as many? How are resources shared without breaking isolation?</em></p><div><hr></div><div class="callout-block" data-callout="true"><h2><a href="https://pages.awscloud.com/awsmp-gim-yngd-webinar-aim-enterprise-ai-and-data-leader-panel-lt-panel-1.html?trk=e4a7be88-920d-491d-adb9-943ace6441ae&amp;sc_channel=psm">Build strong data foundations for agentic AI at scale (Partner)</a></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://pages.awscloud.com/awsmp-gim-yngd-webinar-aim-enterprise-ai-and-data-leader-panel-lt-panel-1.html?trk=e4a7be88-920d-491d-adb9-943ace6441ae&amp;sc_channel=psm" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wuK7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2628cb4d-cc45-4737-b25d-bff5ff5e469e_1280x720.png 424w, https://substackcdn.com/image/fetch/$s_!wuK7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2628cb4d-cc45-4737-b25d-bff5ff5e469e_1280x720.png 848w, https://substackcdn.com/image/fetch/$s_!wuK7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2628cb4d-cc45-4737-b25d-bff5ff5e469e_1280x720.png 1272w, https://substackcdn.com/image/fetch/$s_!wuK7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2628cb4d-cc45-4737-b25d-bff5ff5e469e_1280x720.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wuK7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2628cb4d-cc45-4737-b25d-bff5ff5e469e_1280x720.png" width="1280" height="720" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2628cb4d-cc45-4737-b25d-bff5ff5e469e_1280x720.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:720,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1346959,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://pages.awscloud.com/awsmp-gim-yngd-webinar-aim-enterprise-ai-and-data-leader-panel-lt-panel-1.html?trk=e4a7be88-920d-491d-adb9-943ace6441ae&amp;sc_channel=psm&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/193554859?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2628cb4d-cc45-4737-b25d-bff5ff5e469e_1280x720.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!wuK7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2628cb4d-cc45-4737-b25d-bff5ff5e469e_1280x720.png 424w, https://substackcdn.com/image/fetch/$s_!wuK7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2628cb4d-cc45-4737-b25d-bff5ff5e469e_1280x720.png 848w, https://substackcdn.com/image/fetch/$s_!wuK7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2628cb4d-cc45-4737-b25d-bff5ff5e469e_1280x720.png 1272w, https://substackcdn.com/image/fetch/$s_!wuK7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2628cb4d-cc45-4737-b25d-bff5ff5e469e_1280x720.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>AI experiments are easy.</p><p>But building trusted AI systems that scale across an enterprise is hard. That&#8217;s exactly what leaders from Mercedes-Benz, Yahoo, Regeneron, and AWS discuss in this on-demand virtual panel on agentic AI.</p><p><em><strong>Here&#8217;s what you&#8217;ll learn inside:</strong></em></p><ul><li><p><strong>Practical strategies from enterprise leaders:</strong> See how teams move from isolated AI experiments to production-scale systems.</p></li><li><p><strong>Real-world guidance on governance and architecture:</strong> Learn how industry experts approach analytics, unified governance, and continuous learning.</p></li><li><p><strong>Frameworks for scaling intelligent systems:</strong> Discover how to build AI systems that drive business value.</p></li><li><p><strong>Pragmatic infrastructure decisions:</strong> Learn how to select the right databases and data foundations for AI-based applications.</p></li></ul><p>Watch the <strong><a href="https://pages.awscloud.com/awsmp-gim-yngd-webinar-aim-enterprise-ai-and-data-leader-panel-lt-panel-1.html?trk=e4a7be88-920d-491d-adb9-943ace6441ae&amp;sc_channel=psm">AWS panel</a></strong> and see how enterprise teams are building trusted AI systems with speed, governance, and control.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://pages.awscloud.com/awsmp-gim-yngd-webinar-aim-enterprise-ai-and-data-leader-panel-lt-panel-1.html?trk=e4a7be88-920d-491d-adb9-943ace6441ae&amp;sc_channel=psm&quot;,&quot;text&quot;:&quot;Watch the AWS Virtual Panel&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://pages.awscloud.com/awsmp-gim-yngd-webinar-aim-enterprise-ai-and-data-leader-panel-lt-panel-1.html?trk=e4a7be88-920d-491d-adb9-943ace6441ae&amp;sc_channel=psm"><span>Watch the AWS Virtual Panel</span></a></p><p>(Thanks to <a href="https://pages.awscloud.com/awsmp-gim-yngd-webinar-aim-enterprise-ai-and-data-leader-panel-lt-panel-1.html?trk=e4a7be88-920d-491d-adb9-943ace6441ae&amp;sc_channel=psm">AWS</a> for partnering on this post.)</p></div><div><hr></div><p>I want to introduce <strong><a href="https://x.com/twtayaan">Ayaan</a></strong> as a guest author.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://x.com/twtayaan" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Kzrb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c24dc51-869d-4962-86ef-686c1f0b52e7_2048x1024.png 424w, https://substackcdn.com/image/fetch/$s_!Kzrb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c24dc51-869d-4962-86ef-686c1f0b52e7_2048x1024.png 848w, https://substackcdn.com/image/fetch/$s_!Kzrb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c24dc51-869d-4962-86ef-686c1f0b52e7_2048x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!Kzrb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c24dc51-869d-4962-86ef-686c1f0b52e7_2048x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Kzrb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c24dc51-869d-4962-86ef-686c1f0b52e7_2048x1024.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0c24dc51-869d-4962-86ef-686c1f0b52e7_2048x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://x.com/twtayaan&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!Kzrb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c24dc51-869d-4962-86ef-686c1f0b52e7_2048x1024.png 424w, https://substackcdn.com/image/fetch/$s_!Kzrb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c24dc51-869d-4962-86ef-686c1f0b52e7_2048x1024.png 848w, https://substackcdn.com/image/fetch/$s_!Kzrb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c24dc51-869d-4962-86ef-686c1f0b52e7_2048x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!Kzrb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c24dc51-869d-4962-86ef-686c1f0b52e7_2048x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>He&#8217;s a self-taught DevOps engineer focused on Kubernetes &amp; cloud infrastructure. He builds in public and writes about cloud-native systems, sharing daily technical tips and projects.</p><p>Check out his work and socials:</p><ul><li><p><strong><a href="https://x.com/twtayaan">Twitter</a></strong></p></li><li><p><strong><a href="https://github.com/Ayaan49">Github</a></strong></p></li></ul><div><hr></div><p><em><strong>Here&#8217;s what&#8217;s inside this newsletter:</strong></em></p><ul><li><p><strong>The difference between emulation and virtualization, and why one simulates hardware while the other shares it.</strong></p></li><li><p>What a virtual machine actually is, how it presents itself as a full computer, and why the guest operating system believes it owns the hardware.</p></li><li><p><strong>How the hypervisor works, the different types it comes in, and how it controls access to CPU, memory, storage, and networking.</strong></p></li><li><p>What happens under the hood when a virtual machine boots, from resource allocation and virtual hardware setup to kernel startup and runtime execution.</p></li><li><p><strong>How features like live migration, isolation, and resource controls make virtual machines practical for modern infrastructure.</strong></p></li><li><p>Where virtual machines fit today, why cloud platforms depend on them, and how they differ from containers.</p></li></ul><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Golden members get all posts like these!&#8230;</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h2>Emulation vs Virtualization</h2><p>Before we get into how virtual machines work, there is one distinction worth getting clear early.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Dop2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F633c7b27-dd71-4009-a59d-ff19c4d72d04_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Dop2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F633c7b27-dd71-4009-a59d-ff19c4d72d04_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!Dop2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F633c7b27-dd71-4009-a59d-ff19c4d72d04_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!Dop2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F633c7b27-dd71-4009-a59d-ff19c4d72d04_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!Dop2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F633c7b27-dd71-4009-a59d-ff19c4d72d04_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Dop2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F633c7b27-dd71-4009-a59d-ff19c4d72d04_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/633c7b27-dd71-4009-a59d-ff19c4d72d04_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Dop2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F633c7b27-dd71-4009-a59d-ff19c4d72d04_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!Dop2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F633c7b27-dd71-4009-a59d-ff19c4d72d04_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!Dop2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F633c7b27-dd71-4009-a59d-ff19c4d72d04_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!Dop2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F633c7b27-dd71-4009-a59d-ff19c4d72d04_1536x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Emulation is when software pretends to be completely different hardware. Retro gaming emulators work this way. Your laptop takes each instruction from the old console and turns it into something your modern chip understands.</p><p>It works, but it is slow&#8230;</p><p>Virtualization is different. Instead of pretending to be different hardware, it creates a version of the same hardware your machine already has. Most instructions run directly on the real processor with no translation needed.</p><p>The result is near-native speed.</p><p><em>Think of it this way:</em></p><ul><li><p>Emulation is like hiring a translator for every sentence in a conversation.</p></li><li><p>Virtualization is like realizing that both people already speak the same language.</p></li></ul><p>This distinction matters because speed is what made virtualization practical at scale. You cannot run thousands of emulated systems on a single server. With virtualization, you can.</p><p>And that is exactly what cloud providers do&#8230;</p><div><hr></div><h2>What a Virtual Machine Actually Is</h2><p>A virtual machine is a complete computer abstraction built on top of a physical machine.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!umJe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F632d8852-b510-4ace-80b5-f50db4a745c2_1535x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!umJe!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F632d8852-b510-4ace-80b5-f50db4a745c2_1535x1024.png 424w, https://substackcdn.com/image/fetch/$s_!umJe!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F632d8852-b510-4ace-80b5-f50db4a745c2_1535x1024.png 848w, https://substackcdn.com/image/fetch/$s_!umJe!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F632d8852-b510-4ace-80b5-f50db4a745c2_1535x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!umJe!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F632d8852-b510-4ace-80b5-f50db4a745c2_1535x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!umJe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F632d8852-b510-4ace-80b5-f50db4a745c2_1535x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/632d8852-b510-4ace-80b5-f50db4a745c2_1535x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!umJe!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F632d8852-b510-4ace-80b5-f50db4a745c2_1535x1024.png 424w, https://substackcdn.com/image/fetch/$s_!umJe!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F632d8852-b510-4ace-80b5-f50db4a745c2_1535x1024.png 848w, https://substackcdn.com/image/fetch/$s_!umJe!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F632d8852-b510-4ace-80b5-f50db4a745c2_1535x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!umJe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F632d8852-b510-4ace-80b5-f50db4a745c2_1535x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>It&#8217;s presented with a CPU, memory, storage, and a network interface, just like a physical system. The operating system inside it interacts with these components as if they were real hardware. It has no awareness that it is sharing the underlying machine with anything else.</p><p>From its perspective, it owns the system.</p><p>This behavior is made possible by a layered design.</p><p>At the bottom is the physical hardware, which provides the actual compute, memory, and storage resources. Above it sits the hypervisor, which controls how those resources are allocated and accessed. On top of that, each virtual machine runs its own operating system in isolation.</p><p>The hypervisor is the layer that makes the illusion possible.</p><p>Because the operating system never interacts with the hardware directly.</p><p>Instead, every request for CPU time, memory access, disk I/O, or network communication is handled through the hypervisor. It decides how resources are shared and ensures that each virtual machine remains isolated from the others.</p><p>This abstraction enables three key capabilities:</p><ul><li><p><strong>Isolation:</strong> Each virtual machine runs independently, so a failure in one doesn&#8217;t affect others.</p></li><li><p><strong>Portability:</strong> Virtual machines can move between physical systems with minimal changes.</p></li><li><p><strong>Efficient resource use:</strong> Multiple workloads share the same hardware instead of leaving it idle.</p></li></ul><p>These properties are what made modern infrastructure possible.</p><p>Next, let&#8217;s look at the hypervisor: what it is, the different types, and how it powers virtual machines&#8230;</p><div><hr></div><h2>Hypervisor: Brain Behind the Illusion</h2><p>The hypervisor is the software layer that enables virtualization.</p><p>It sits between the physical hardware and the virtual machines running above it. Every request a virtual machine makes, whether for CPU time, memory, or storage, goes through the hypervisor. It&#8217;s responsible for mapping those requests to the underlying hardware resources.</p><p>This layer controls all access to the hardware.</p><h3>Type 1 vs Type 2</h3><p>Not all hypervisors follow the same structure. The main difference comes from where they run.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rXsL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F680d420b-ff0a-4339-b53f-45fbbba1107d_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rXsL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F680d420b-ff0a-4339-b53f-45fbbba1107d_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!rXsL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F680d420b-ff0a-4339-b53f-45fbbba1107d_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!rXsL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F680d420b-ff0a-4339-b53f-45fbbba1107d_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!rXsL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F680d420b-ff0a-4339-b53f-45fbbba1107d_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rXsL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F680d420b-ff0a-4339-b53f-45fbbba1107d_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/680d420b-ff0a-4339-b53f-45fbbba1107d_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rXsL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F680d420b-ff0a-4339-b53f-45fbbba1107d_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!rXsL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F680d420b-ff0a-4339-b53f-45fbbba1107d_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!rXsL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F680d420b-ff0a-4339-b53f-45fbbba1107d_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!rXsL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F680d420b-ff0a-4339-b53f-45fbbba1107d_1536x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p><strong>Type 1 (bare-metal):</strong> It runs on the physical hardware, with no host operating system in between. Examples include VMware ESXi, Microsoft Hyper-V, and Kernel-based Virtual Machine (<strong>KVM</strong>). Cloud environments and data centers use these because they provide direct hardware access and minimal overhead.</p></li><li><p><strong>Type 2 (hosted):</strong> Runs on top of an existing operating system, like a regular application. Tools such as VirtualBox and VMware Workstation fall into this category. They are easier to use but introduce additional overhead.</p></li></ul><p>The difference lies in how the hypervisor accesses hardware and the number of extra layers it adds&#8230;</p><h3>Full Virtualization vs Paravirtualization</h3><p>There are also different ways a hypervisor presents hardware to a virtual machine.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NTTK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5159fa59-d865-41f3-829c-5b9a91a658b8_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NTTK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5159fa59-d865-41f3-829c-5b9a91a658b8_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!NTTK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5159fa59-d865-41f3-829c-5b9a91a658b8_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!NTTK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5159fa59-d865-41f3-829c-5b9a91a658b8_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!NTTK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5159fa59-d865-41f3-829c-5b9a91a658b8_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NTTK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5159fa59-d865-41f3-829c-5b9a91a658b8_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5159fa59-d865-41f3-829c-5b9a91a658b8_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!NTTK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5159fa59-d865-41f3-829c-5b9a91a658b8_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!NTTK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5159fa59-d865-41f3-829c-5b9a91a658b8_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!NTTK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5159fa59-d865-41f3-829c-5b9a91a658b8_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!NTTK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5159fa59-d865-41f3-829c-5b9a91a658b8_1536x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In <strong>full virtualization</strong>, guest operating system runs without modification and behaves as if it were on real hardware. The hypervisor handles all the work required to maintain that abstraction.</p><p>In <strong>paravirtualization</strong>, the guest operating system is aware that it is running in a virtual environment. Instead of relying only on emulated hardware, it asks the hypervisor to handle some tasks, which reduces overhead.</p><p>The trade-off is between compatibility and performance.</p><p>Full virtualization runs any unmodified operating system. Paravirtualization is faster because the guest works with the hypervisor.</p><h3>Hardware-Assisted Virtualization</h3><p>Early hypervisors relied on software, making virtualization complex and inefficient. This changed when processor manufacturers introduced hardware support such as Intel VT-x (Intel Virtualization Technology for x86) and AMD-V (AMD Virtualization).</p><p>With these features, CPU itself can differentiate between virtual machines and the hypervisor. Sensitive operations pass control to the hypervisor when needed. It manages access and keeps everything secure.</p><p>This made virtualization practical at scale.</p><h3>Nested Virtualization</h3><p>It is also possible to run a virtual machine inside another virtual machine, a setup known as <em>nested virtualization</em>. You use this for testing, development, and running tools like Kubernetes locally in virtual machines (<strong>VMs</strong>).</p><p>But each additional layer introduces overhead and increases complexity. As you add more virtualization layers, performance drops. This makes the approach unsuitable for most production workloads.</p><p>It is useful in controlled scenarios, but not a general-purpose design.</p><p>Now you know what the hypervisor does. The next question is how it shares the CPU across multiple virtual machines. The answer is CPU virtualization.</p><p>Let&#8217;s look at how it works&#8230;</p><div><hr></div><h2>CPU Virtualization</h2><p>The CPU is the brain of any computer.</p><p>Every instruction, process, and calculation goes through the CPU. So when you create a virtual machine, the question becomes: <em>how do different operating systems share one CPU without getting in each other&#8217;s way?</em></p><p>That is what CPU virtualization solves&#8230;</p><h3>The Privilege Model</h3><p>Operating systems are designed to be in charge.</p><p>When your OS needs to access hardware, manage memory, or control processes, it does so with full authority. The processor has a concept called <em>privilege levels</em> to enforce this.</p><p>Think of it like levels of trust, where the most trusted software gets the most access.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HIpP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1258100-145b-42e6-b594-d13ba11e0ab6_1172x1342.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HIpP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1258100-145b-42e6-b594-d13ba11e0ab6_1172x1342.png 424w, https://substackcdn.com/image/fetch/$s_!HIpP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1258100-145b-42e6-b594-d13ba11e0ab6_1172x1342.png 848w, https://substackcdn.com/image/fetch/$s_!HIpP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1258100-145b-42e6-b594-d13ba11e0ab6_1172x1342.png 1272w, https://substackcdn.com/image/fetch/$s_!HIpP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1258100-145b-42e6-b594-d13ba11e0ab6_1172x1342.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HIpP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1258100-145b-42e6-b594-d13ba11e0ab6_1172x1342.png" width="1172" height="1342" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c1258100-145b-42e6-b594-d13ba11e0ab6_1172x1342.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1342,&quot;width&quot;:1172,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!HIpP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1258100-145b-42e6-b594-d13ba11e0ab6_1172x1342.png 424w, https://substackcdn.com/image/fetch/$s_!HIpP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1258100-145b-42e6-b594-d13ba11e0ab6_1172x1342.png 848w, https://substackcdn.com/image/fetch/$s_!HIpP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1258100-145b-42e6-b594-d13ba11e0ab6_1172x1342.png 1272w, https://substackcdn.com/image/fetch/$s_!HIpP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1258100-145b-42e6-b594-d13ba11e0ab6_1172x1342.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In a normal system, the operating system sits at the highest privilege level.</p><p>But in a virtual environment, the hypervisor needs to sit above the operating system. It needs to intercept certain instructions and control what the guest OS can and cannot do. So the guest OS gets moved down to a lower privilege level, even though it still believes it is fully in charge.</p><p>The guest OS never knows the hypervisor demoted it.</p><p>This is the fundamental trick behind CPU virtualization. The guest OS continues to behave as if it owns the processor. But when it tries to do something that needs high-level access, the processor steps in and hands control to the hypervisor.</p><p>Everything continues smoothly, just one level deeper&#8230;</p><h3>vCPU and Scheduling</h3><p>When you create a virtual machine, you assign it CPUs, but these are not physical cores. They&#8217;re virtual CPUs (<strong>vCPUs</strong>) that represent processing capacity managed by the hypervisor.</p><p>The hypervisor schedules vCPUs onto physical cores in the same way an operating system schedules processes.</p><p>At any given moment, a physical core can execute only one thread of work. The hypervisor switches between virtual machines, giving each one a slice of CPU time. This switching happens fast enough that each virtual machine appears to have continuous access to the processor.</p><p><em>Modern CPUs may expose multiple logical threads per core through technologies like Intel Hyper-Threading or AMD SMT (Simultaneous Multithreading), but CPU time is still shared and scheduled across workloads.</em></p><p>In reality, all virtual machines share it.</p><p>This is called <em>time-slicing</em>. It&#8217;s the same idea your operating system uses to run multiple applications at once.</p><p>Hypervisors can also assign more vCPUs than there are physical cores, a practice known as <em>CPU overcommit</em>. For example, a machine with 16 cores might run virtual machines totaling 32 or more vCPUs.</p><p>This works as long as not all virtual machines are busy at the same time.</p><p>When demand rises across multiple VMs, they compete for CPU time. This causes contention and reduces performance.</p><p>Overcommit is a useful tool, but it depends on workload behavior.</p><h3>VM-exit and VM-entry</h3><p>Let&#8217;s go one level deeper into what actually happens when a guest OS tries to do something it is not allowed to do on its own.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gIv5!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54cb94d0-6409-474b-a9eb-2d4e679bd3f0_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gIv5!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54cb94d0-6409-474b-a9eb-2d4e679bd3f0_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!gIv5!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54cb94d0-6409-474b-a9eb-2d4e679bd3f0_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!gIv5!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54cb94d0-6409-474b-a9eb-2d4e679bd3f0_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!gIv5!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54cb94d0-6409-474b-a9eb-2d4e679bd3f0_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gIv5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54cb94d0-6409-474b-a9eb-2d4e679bd3f0_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/54cb94d0-6409-474b-a9eb-2d4e679bd3f0_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!gIv5!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54cb94d0-6409-474b-a9eb-2d4e679bd3f0_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!gIv5!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54cb94d0-6409-474b-a9eb-2d4e679bd3f0_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!gIv5!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54cb94d0-6409-474b-a9eb-2d4e679bd3f0_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!gIv5!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F54cb94d0-6409-474b-a9eb-2d4e679bd3f0_1536x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>When a virtual machine tries to run a privileged instruction, the processor stops it. Control is immediately transferred to the hypervisor. This event is called a <em>VM-exit</em>.</p><p>The hypervisor then figures out what the guest was trying to do and handles it safely.</p><p>Once the hypervisor has dealt with the request, it hands control back to the virtual machine exactly where it left off. This is called a <em>VM-entry</em>. From the guest OS&#8217;s perspective, nothing unusual happened. The CPU executed the instruction and continued running.</p><p>The entire handoff takes microseconds.</p><p>This mechanism is what makes isolation possible. The guest OS cannot access hardware it shouldn&#8217;t. Every sensitive operation triggers a VM-exit, which the hypervisor controls. But it also introduces overhead. Every VM-exit and VM-entry takes time, and if they happen too frequently, performance suffers.</p><p>Keeping VM exits to a minimum is one of the core challenges of CPU virtualization.</p><h3>NUMA Awareness and CPU Topology</h3><p>This matters more in large systems and performance-sensitive workloads, but it&#8217;s still worth understanding at a high level&#8230;</p><p>Modern servers often have more than one physical processor. Each processor has its own local memory. Accessing memory that belongs to a different processor is slower than accessing your own. This architecture is called Non-Uniform Memory Access (<strong>NUMA</strong>).</p><p>The name describes the problem exactly. Not all memory accesses are equal.</p><p>In a virtual environment, this creates a subtle issue. A virtual machine might run on cores from one processor but end up accessing memory that belongs to another. The guest OS does not know this is happening. But the performance hit is real.</p><p>The solution is NUMA-aware scheduling.</p><p>The hypervisor tries to keep a virtual machine&#8217;s vCPUs and its memory on the same NUMA node. When it succeeds, the VM runs faster. When workloads grow and resources get spread across nodes, the performance gap becomes noticeable.</p><p>For most small deployments, this never comes up. For high-performance databases or real-time systems running on large servers, it matters a lot.</p><p>Putting it together, CPU virtualization is not a single mechanism but a combination of coordinated techniques.</p><p>The privilege model restricts direct hardware access. vCPU scheduling creates the illusion of dedicated processing power. VM-exits and VM-entries enforce safe boundaries for sensitive operations. NUMA awareness ensures that physical hardware layout does not introduce hidden performance penalties.</p><p>Each part addresses a specific challenge.</p><p>Together, they allow multiple virtual machines to share a single physical CPU while operating independently and efficiently.</p><p>Next, let&#8217;s look at how memory is virtualized and how virtual machines manage their view of system memory&#8230;</p><div><hr></div><div class="callout-block" data-callout="true"><p><em><strong>Reminder: this is a teaser of the subscriber-only newsletter, exclusive to my golden members.</strong></em></p><p>When you upgrade, you&#8217;ll get:</p><ul><li><p><strong>Architecture breakdown of core DevOps systems.</strong></p></li><li><p>Deep dives into Docker, Kubernetes, Terraform, and so on.</p></li><li><p><strong>Practical insights into how real-world systems achieve scalability, automation, and reliability.</strong></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe&quot;,&quot;text&quot;:&quot;Unlock Full Access&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://newsletter.systemdesign.one/subscribe"><span>Unlock Full Access</span></a></p><p>Let&#8217;s keep going!</p></div><div><hr></div><h2>Memory Virtualization</h2>
      <p>
          <a href="https://newsletter.systemdesign.one/p/virtualization-architecture">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[AI Agents: State, Memory, Consistency - A Deep Dive]]></title><description><![CDATA[#147: Understanding State, Memory, and Consistency in AI Agents]]></description><link>https://newsletter.systemdesign.one/p/ai-agent-memory</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/ai-agent-memory</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Sun, 17 May 2026 09:40:01 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/f0d1b76a-2ba2-4c41-a2bf-f47a1cdc20b7_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Get my system design playbook for free on newsletter signup:</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><ul><li><p><em><a href="https://newsletter.systemdesign.one/p/ai-agent-memory/?action=share">Share this post</a> &amp; I&#8217;ll send you some rewards for the referrals.</em></p></li></ul><div><hr></div><p>The hardest part of building an AI agent<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a> has nothing to do with the model&#8230;</p><p>Calling a language model is the EASY part&#8230;</p><p>Keeping the agent coherent across a workflow that spans hours or days is where everything actually gets difficult: <em>remembering what was said, tracking what&#8217;s already been done, and staying steady when the user changes their mind.</em></p><p>Even with stronger models each year, agents break on those exact failures&#8230;</p><p>They forget earlier turns, repeat questions they already asked, and behave inconsistently across long tasks. The model is rarely the cause. The cause is a missing or badly designed state and memory, plus the consistency rules that keep the two in line.</p><p>This newsletter walks through all three&#8230;</p><div class="callout-block" data-callout="true"><h3><a href="https://codenewsletter.ai/subscribe?utm_source=nl_ad_system">100+ Claude Code hacks to ship code 10X faster (Partner)</a></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://codenewsletter.ai/subscribe?utm_source=nl_ad_system" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0VaY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3168322a-0be8-4261-9a54-ed4a8f688a05_1200x600.jpeg 424w, https://substackcdn.com/image/fetch/$s_!0VaY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3168322a-0be8-4261-9a54-ed4a8f688a05_1200x600.jpeg 848w, https://substackcdn.com/image/fetch/$s_!0VaY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3168322a-0be8-4261-9a54-ed4a8f688a05_1200x600.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!0VaY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3168322a-0be8-4261-9a54-ed4a8f688a05_1200x600.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0VaY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3168322a-0be8-4261-9a54-ed4a8f688a05_1200x600.jpeg" width="1200" height="600" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3168322a-0be8-4261-9a54-ed4a8f688a05_1200x600.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:339767,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:&quot;https://codenewsletter.ai/subscribe?utm_source=nl_ad_system&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/190817974?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3168322a-0be8-4261-9a54-ed4a8f688a05_1200x600.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!0VaY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3168322a-0be8-4261-9a54-ed4a8f688a05_1200x600.jpeg 424w, https://substackcdn.com/image/fetch/$s_!0VaY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3168322a-0be8-4261-9a54-ed4a8f688a05_1200x600.jpeg 848w, https://substackcdn.com/image/fetch/$s_!0VaY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3168322a-0be8-4261-9a54-ed4a8f688a05_1200x600.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!0VaY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3168322a-0be8-4261-9a54-ed4a8f688a05_1200x600.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Top engineers at Anthropic and OpenAI say AI now writes 100% of their code.</p><p>If you&#8217;re not using AI, you&#8217;re spending 40 hours doing what they do in 4.</p><p>These 100+ Claude Code hacks fix that and help you ship 10x faster.</p><p>Sign up for <strong><a href="https://codenewsletter.ai/subscribe?utm_source=nl_ad_system">The Code</a></strong> and get:</p><ul><li><p>100+ Claude Code hacks used by top engineers &#8212; free</p></li><li><p>The Code newsletter &#8212; learn the latest AI tools, tips, and skills to code faster with AI in 5 minutes a day</p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://codenewsletter.ai/subscribe?utm_source=nl_ad_system&quot;,&quot;text&quot;:&quot;Claim your free playbook&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://codenewsletter.ai/subscribe?utm_source=nl_ad_system"><span>Claim your free playbook</span></a></p><p>(Thanks to <a href="https://codenewsletter.ai/subscribe?utm_source=nl_ad_system">the Code</a> for partnering on this post.)</p></div><div><hr></div><p>I want to introduce <strong><a href="http://www.linkedin.com/in/sivasankar-natarajan">Sivasankar</a></strong> as a guest author.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="http://www.linkedin.com/in/sivasankar-natarajan" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0qUX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ffde1b3-f155-4f25-a945-8b5b86d7b1a1_1521x704.jpeg 424w, https://substackcdn.com/image/fetch/$s_!0qUX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ffde1b3-f155-4f25-a945-8b5b86d7b1a1_1521x704.jpeg 848w, https://substackcdn.com/image/fetch/$s_!0qUX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ffde1b3-f155-4f25-a945-8b5b86d7b1a1_1521x704.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!0qUX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ffde1b3-f155-4f25-a945-8b5b86d7b1a1_1521x704.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0qUX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ffde1b3-f155-4f25-a945-8b5b86d7b1a1_1521x704.jpeg" width="1456" height="674" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8ffde1b3-f155-4f25-a945-8b5b86d7b1a1_1521x704.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:674,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;http://www.linkedin.com/in/sivasankar-natarajan&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!0qUX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ffde1b3-f155-4f25-a945-8b5b86d7b1a1_1521x704.jpeg 424w, https://substackcdn.com/image/fetch/$s_!0qUX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ffde1b3-f155-4f25-a945-8b5b86d7b1a1_1521x704.jpeg 848w, https://substackcdn.com/image/fetch/$s_!0qUX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ffde1b3-f155-4f25-a945-8b5b86d7b1a1_1521x704.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!0qUX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8ffde1b3-f155-4f25-a945-8b5b86d7b1a1_1521x704.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>He is a Technical Director and GenAI practitioner with over 20+ years of experience in architecting and building Big Data, Cloud, and GenAI solutions.</p><p>His work focuses on helping organizations design practical and scalable intelligent systems. He enjoys exploring new ideas through hands-on DIY projects and practical experimentation, often turning real-world use cases into working prototypes.</p><p>You can connect with Sivasankar (Shiva) on <strong><a href="http://www.linkedin.com/in/sivasankar-natarajan">LinkedIn</a></strong>.</p><div><hr></div><p><strong>Here&#8217;s what you&#8217;ll find inside this newsletter:</strong></p><ul><li><p><strong>State vs memory.</strong> What each one is for, how they differ, and why conflating them is the root cause of most agent bugs.</p></li><li><p><strong>Memory lifecycle.</strong> How an agent creates, updates, summarizes, and deletes memory so it doesn&#8217;t rot over time.</p></li><li><p><strong>Consistency under change.</strong> How state reacts to new instructions right away, and how long-term memory updates only after a change holds up.</p></li><li><p><strong>A reference architecture.</strong> The four layers (brain, state, memory, external systems) and what each one owns.</p></li><li><p><strong>Scaling and failure modes.</strong> Where stateful agents break at scale, and the three ways memory itself goes wrong.</p></li></ul><p>By the end, you&#8217;ll know how to design agents that track the right things, recover from failure, and stay truthful with the data they don&#8217;t control.</p><p>Let&#8217;s start with the state...</p><div><hr></div><h2><strong>Tracking what the agent is doing with the state</strong></h2><p>State is the information an agent keeps about the current task: <em>the plan, active constraints, what&#8217;s already been done, and what comes next.</em></p><p>It&#8217;s the agent&#8217;s picture of NOW&#8230;</p><p>The easiest way to see why it matters is to compare an agent with it to one without it.</p><h3><strong>Stateless vs Stateful</strong></h3><p>A <strong>stateless agent</strong> keeps nothing between requests&#8230;</p><p>Each input is a fresh start, which is fine for one-shot jobs like &#8220;<em>translate this sentence to French</em>, <em>summarize this paragraph</em>, or <em>explain what an API is&#8221;</em>.</p><p>A <strong>stateful agent</strong> tracks the current task, session, or workflow&#8230;</p><p>At each decision point, it checks the state to answer three questions:&nbsp;<em>what step am I on, what has already been done, and what should I do next?</em> Those answers drive the next action, check constraints, and stop the agent from repeating itself.</p><p>State matters the moment a workflow has more than one step&#8230;</p><p>The user books a flight (<em>step one done, constraints locked</em>), asks for a hotel (<em>step two, new constraints layered on</em>), then changes the return date (<em>earlier step invalidated, replan downstream</em>).</p><p>Without a state, none of those three questions has an answer.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9SyD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08322369-dba8-4e77-9919-1189d8841814_888x474.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9SyD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08322369-dba8-4e77-9919-1189d8841814_888x474.jpeg 424w, https://substackcdn.com/image/fetch/$s_!9SyD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08322369-dba8-4e77-9919-1189d8841814_888x474.jpeg 848w, https://substackcdn.com/image/fetch/$s_!9SyD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08322369-dba8-4e77-9919-1189d8841814_888x474.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!9SyD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08322369-dba8-4e77-9919-1189d8841814_888x474.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9SyD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08322369-dba8-4e77-9919-1189d8841814_888x474.jpeg" width="888" height="474" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/08322369-dba8-4e77-9919-1189d8841814_888x474.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:474,&quot;width&quot;:888,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Stateless vs stateful AI agents&quot;,&quot;title&quot;:&quot;Stateless vs stateful AI agents&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Stateless vs stateful AI agents" title="Stateless vs stateful AI agents" srcset="https://substackcdn.com/image/fetch/$s_!9SyD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08322369-dba8-4e77-9919-1189d8841814_888x474.jpeg 424w, https://substackcdn.com/image/fetch/$s_!9SyD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08322369-dba8-4e77-9919-1189d8841814_888x474.jpeg 848w, https://substackcdn.com/image/fetch/$s_!9SyD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08322369-dba8-4e77-9919-1189d8841814_888x474.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!9SyD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08322369-dba8-4e77-9919-1189d8841814_888x474.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3><strong>Where state lives</strong></h3><p>State is <em>maintained</em> on the agent side (backend server that runs the reasoning loop), and NOT on the client side (chat UI, mobile app, or API caller the user interacts with).</p><p>Clients disconnect, refresh, and retry. And agent still needs a steady view of progress.</p><p>So where that view lives depends on how long the workflow runs&#8230;</p><p>Short-lived workflows that end in a single session can remain in an in-memory store. Anything that has to survive restarts needs external storage: a database, a KV store (Redis-style lookups by id), or a serialized state object managed by an orchestration framework<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a>.</p><p>LangGraph<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a>, for example, comes with <code>SqliteSaver</code> and <code>PostgresSaver</code> as ready-made checkpoint backends.</p><p>At each step&#8217;s start, agent loads the latest state snapshot and rebuilds its context. That load makes a chain of steps feel like one chain rather than a set of separate calls.</p><h3><strong>Checkpointing and recovery</strong></h3><p>Loading state on each step only works if something wrote it in the first place&#8230;</p><p>That&#8217;s what checkpointing<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a> does: <em>it saves state at the milestones you pick as meaningful, not every tiny step.</em> If the agent crashes, times out, or gets redeployed mid-workflow, it reloads the last checkpoint and resumes from there.</p><p>Picture the <em>travel agent</em> picking a return flight when the API call fails&#8230;</p><p>Without checkpointing, the agent would have to re-ask the user for dates, budget, and outbound flight details. With checkpointing, the saved state already contains all that, so on retry, the agent picks up at the failed step and continues.</p><p>The same setup covers internal errors in the agent&#8217;s own code and redeploys that restart the infrastructure underneath it.</p><p>This pattern runs in production at real scale&#8230;</p><p>LinkedIn&#8217;s internal SQL Bot<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a> is a hierarchical multi-agent system built on LangGraph, and its long-running query workflows rely on the framework&#8217;s checkpoint layer to pause, inspect state, and resume without losing context mid-task.</p><h3><strong>State versioning</strong></h3><p>Long-running agents change over time&#8230;</p><p>New fields appear, steps get reordered, logic shifts. Without versioning, in-progress workflows break the moment the schema changes, and the stored state written yesterday becomes unreadable tomorrow.</p><p>Versioning keeps yesterday&#8217;s state readable&#8230;</p><p>It migrates old formats forward and blocks execution paths that no longer make sense under the new schema. That way, workflow changes roll out without killing ongoing tasks.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rn18!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc72e5012-2d43-4050-a019-8a5ffcc9d087_2048x1143.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rn18!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc72e5012-2d43-4050-a019-8a5ffcc9d087_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!rn18!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc72e5012-2d43-4050-a019-8a5ffcc9d087_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!rn18!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc72e5012-2d43-4050-a019-8a5ffcc9d087_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!rn18!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc72e5012-2d43-4050-a019-8a5ffcc9d087_2048x1143.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rn18!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc72e5012-2d43-4050-a019-8a5ffcc9d087_2048x1143.jpeg" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c72e5012-2d43-4050-a019-8a5ffcc9d087_2048x1143.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:813,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;State versioning: schema migration for in-progress workflows&quot;,&quot;title&quot;:&quot;State versioning: schema migration for in-progress workflows&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="State versioning: schema migration for in-progress workflows" title="State versioning: schema migration for in-progress workflows" srcset="https://substackcdn.com/image/fetch/$s_!rn18!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc72e5012-2d43-4050-a019-8a5ffcc9d087_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!rn18!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc72e5012-2d43-4050-a019-8a5ffcc9d087_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!rn18!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc72e5012-2d43-4050-a019-8a5ffcc9d087_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!rn18!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc72e5012-2d43-4050-a019-8a5ffcc9d087_2048x1143.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This is most evident in production systems where workflows span minutes, hours, or even days&#8230;</p><h3><strong>Travel agent: state in action</strong></h3><p>Storage, checkpointing, and versioning click together once you watch a concrete plan move through them&#8230;</p><p>The user says, &#8220;<em>Plan a complete trip for me.&#8221; </em>The agent then walks a sequence:</p><ol><li><p>Pick the date and destination.</p></li><li><p>Select an outbound flight.</p></li><li><p>Then select a return flight.</p></li><li><p>Choose accommodation.</p></li><li><p>Confirm the itinerary.</p></li></ol><p>After each step, the state moves forward&#8230;</p><p>Once the outbound flight is selected, the state says&nbsp;<em>select the return flight</em>&nbsp;next. And checkpoints occur after preferences are confirmed, outbound flight is selected, return flight is selected, and the hotel is booked.</p><p>If the hotel step &#8216;fails&#8216; because of a network error, the agent restarts, reloads the state, sees that the dates and flights are already locked in, and retries only the hotel step.</p><p>NO re-asking and out-of-order suggestions&#8230;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!506w!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51f486a-b335-4be7-a373-ebb3d34e0d77_1075x790.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!506w!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51f486a-b335-4be7-a373-ebb3d34e0d77_1075x790.jpeg 424w, https://substackcdn.com/image/fetch/$s_!506w!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51f486a-b335-4be7-a373-ebb3d34e0d77_1075x790.jpeg 848w, https://substackcdn.com/image/fetch/$s_!506w!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51f486a-b335-4be7-a373-ebb3d34e0d77_1075x790.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!506w!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51f486a-b335-4be7-a373-ebb3d34e0d77_1075x790.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!506w!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51f486a-b335-4be7-a373-ebb3d34e0d77_1075x790.jpeg" width="1075" height="790" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e51f486a-b335-4be7-a373-ebb3d34e0d77_1075x790.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:790,&quot;width&quot;:1075,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;State-driven multi-step planning with checkpoints&quot;,&quot;title&quot;:&quot;State-driven multi-step planning with checkpoints&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="State-driven multi-step planning with checkpoints" title="State-driven multi-step planning with checkpoints" srcset="https://substackcdn.com/image/fetch/$s_!506w!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51f486a-b335-4be7-a373-ebb3d34e0d77_1075x790.jpeg 424w, https://substackcdn.com/image/fetch/$s_!506w!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51f486a-b335-4be7-a373-ebb3d34e0d77_1075x790.jpeg 848w, https://substackcdn.com/image/fetch/$s_!506w!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51f486a-b335-4be7-a373-ebb3d34e0d77_1075x790.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!506w!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe51f486a-b335-4be7-a373-ebb3d34e0d77_1075x790.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>That&#8217;s what the state gives you.</p><p>Next up is memory:<em> information the agent carries across tasks</em>...</p><div><hr></div><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/ai-agent-memory?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption"><em>Share this post &amp; get rewards for the referrals.</em></p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/ai-agent-memory?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/ai-agent-memory?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><div><hr></div><h2><strong>Carrying information across tasks with memory</strong></h2><p>If the <strong>state</strong> is the agent&#8217;s picture of <em>now</em>, <strong>memory</strong> is what spans across: <em>past decisions already made, preferences built up over time, conversations it can refer back to, and reference data it queries from other systems (flight schedules, hotel listings).</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WdnL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbae4b9cc-72d5-456b-97b3-979225d8f227_668x564.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WdnL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbae4b9cc-72d5-456b-97b3-979225d8f227_668x564.jpeg 424w, https://substackcdn.com/image/fetch/$s_!WdnL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbae4b9cc-72d5-456b-97b3-979225d8f227_668x564.jpeg 848w, https://substackcdn.com/image/fetch/$s_!WdnL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbae4b9cc-72d5-456b-97b3-979225d8f227_668x564.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!WdnL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbae4b9cc-72d5-456b-97b3-979225d8f227_668x564.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WdnL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbae4b9cc-72d5-456b-97b3-979225d8f227_668x564.jpeg" width="668" height="564" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bae4b9cc-72d5-456b-97b3-979225d8f227_668x564.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:564,&quot;width&quot;:668,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Memory in an AI agent: short-term, long-term, and external&quot;,&quot;title&quot;:&quot;Memory in an AI agent: short-term, long-term, and external&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Memory in an AI agent: short-term, long-term, and external" title="Memory in an AI agent: short-term, long-term, and external" srcset="https://substackcdn.com/image/fetch/$s_!WdnL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbae4b9cc-72d5-456b-97b3-979225d8f227_668x564.jpeg 424w, https://substackcdn.com/image/fetch/$s_!WdnL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbae4b9cc-72d5-456b-97b3-979225d8f227_668x564.jpeg 848w, https://substackcdn.com/image/fetch/$s_!WdnL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbae4b9cc-72d5-456b-97b3-979225d8f227_668x564.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!WdnL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbae4b9cc-72d5-456b-97b3-979225d8f227_668x564.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Agents store memory in three flavors, separated by <em>how long the memory persists and whether the agent owns the data or just reads it from elsewhere</em>.</p><h3><strong>Short-term memory</strong></h3><p>Short-term memory holds the current context for the active task&#8230;</p><p>It&#8217;s short-lived and cleared when the task ends. Most implementations keep it in in-memory structures, session variables, or within the LLM<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a> prompt. The lifecycle is simple: <em>create it when a task begins, update it as the agent reasons and uses tools, and clear it once the task wraps up.</em></p><p>Use it for one-task decisions that don&#8217;t need to outlive the current workflow.</p><h3><strong>Long-term memory</strong></h3><p>Long-term memory stores information across interactions: <em>user preferences, past bookings, and recurring patterns.</em></p><p>The storage options are vector databases<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-7" href="#footnote-7" target="_self">7</a>, KV stores, document stores, or relational databases. A write only happens when the information is actually worth keeping, and retrieval kicks in at the start of new tasks or when a relevant signal shows up in the current one.</p><p>Every so often, the agent summarizes or merges old entries to prevent the store from growing out of control&#8230;</p><p>Use this layer when a preference is steady, behavior repeats, or a piece of information should carry into future interactions.</p><p>The big win of long-term memory is <em>NOT</em> loading the entire history into the prompt each turn. The agent stores what&#8217;s worth keeping and pulls in only what the current decision needs.</p><p>Mem0<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-8" href="#footnote-8" target="_self">8</a> is one production system built on this idea:</p><p>Tested on LOCOMO<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-9" href="#footnote-9" target="_self">9</a>, a benchmark for long conversations, the Mem0 layer reduced p95 retrieval latency<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-10" href="#footnote-10" target="_self">10</a> by 91% against a full-context baseline<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-11" href="#footnote-11" target="_self">11</a>. Token cost dropped by over 90% on the same test.</p><p>On an LLM-as-judge evaluation<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-12" href="#footnote-12" target="_self">12</a>, it scored 26% higher than OpenAI&#8217;s memory system.</p><h3><strong>External memory</strong></h3><p>External memory is a large reference data that the agent queries on demand instead of storing: <em>flight databases, hotel listings, knowledge graphs, and internal systems of record.</em></p><p>These are external sources that hold the authoritative version of a piece of data, like a booking system or a pricing API&#8230;</p><p>These live in cloud databases, APIs, knowledge graphs, or external RAG<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-13" href="#footnote-13" target="_self">13</a> indexes. Nothing gets loaded into the prompt all at once. When a decision depends on data that must remain official, auditable, and shared across applications, the agent queries the system of record<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-14" href="#footnote-14" target="_self">14</a> directly.</p><h3><strong>Memory lifecycle</strong></h3><p>Even a good memory goes bad if you never manage it. Managing it means walking every entry through four stages:</p><ol><li><p><strong>Create</strong> when new information arrives (user picks a flight).</p></li><li><p><strong>Update</strong> when details change (user adds a second city).</p></li><li><p><strong>Summarize</strong> to shrink detail (only the times and locations that matter, not every API response).</p></li><li><p><strong>Delete</strong> when the information is no longer needed or the retention window ends (clear past trip details once the booking is complete).</p></li></ol><p>Skip this cycle, and long-term memory grows without limit.</p><p>Old preferences start contradicting newer ones, and the agent makes decisions based on a pile of half-truths&#8230;</p><h3><strong>Travel agent: memory in action</strong></h3><p>One trip exercises all three memory types at once:</p><ul><li><p>Short-term memory holds the current trip (cities, dates, flight search results).</p></li><li><p>Long-term memory holds repeat preferences (airline, seat class, meal choice).</p></li><li><p>External memory provides live data that the agent doesn&#8217;t own (current flight schedules, hotel availability, seat prices).</p></li></ul><p>The hard part for the agent isn&#8217;t storing any of this&#8230;</p><p>It&#8217;s deciding when the state should override memory, when memory should update from what just happened, and when neither should move because the real answer lives in an external system.</p><p>That&#8217;s the next problem...</p><div class="callout-block" data-callout="true"><h3><a href="https://codenewsletter.ai/subscribe?utm_source=nl_ad_system">100+ Claude Code hacks to ship code 10X faster (Partner)</a></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://codenewsletter.ai/subscribe?utm_source=nl_ad_system" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WUBw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141492b2-1333-46cd-98b1-dd7f5df0b6c7_1200x600.jpeg 424w, https://substackcdn.com/image/fetch/$s_!WUBw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141492b2-1333-46cd-98b1-dd7f5df0b6c7_1200x600.jpeg 848w, https://substackcdn.com/image/fetch/$s_!WUBw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141492b2-1333-46cd-98b1-dd7f5df0b6c7_1200x600.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!WUBw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141492b2-1333-46cd-98b1-dd7f5df0b6c7_1200x600.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WUBw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141492b2-1333-46cd-98b1-dd7f5df0b6c7_1200x600.jpeg" width="1200" height="600" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/141492b2-1333-46cd-98b1-dd7f5df0b6c7_1200x600.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:339767,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:&quot;https://codenewsletter.ai/subscribe?utm_source=nl_ad_system&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/190817974?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141492b2-1333-46cd-98b1-dd7f5df0b6c7_1200x600.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!WUBw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141492b2-1333-46cd-98b1-dd7f5df0b6c7_1200x600.jpeg 424w, https://substackcdn.com/image/fetch/$s_!WUBw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141492b2-1333-46cd-98b1-dd7f5df0b6c7_1200x600.jpeg 848w, https://substackcdn.com/image/fetch/$s_!WUBw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141492b2-1333-46cd-98b1-dd7f5df0b6c7_1200x600.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!WUBw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141492b2-1333-46cd-98b1-dd7f5df0b6c7_1200x600.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Top engineers at Anthropic say AI now writes 100% of their code.</p><p>Are you using AI to write yours?</p><p>These 100+ Claude Code hacks show you exactly how. Sign up for The Code and get:</p><ul><li><p>100+ Claude Code hacks &#8212; free</p></li><li><p>The <a href="https://codenewsletter.ai/subscribe?utm_source=nl_ad_system">Code newsletter</a> &#8212; learn the latest AI tools and skills to code faster in 5 mins a day</p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://codenewsletter.ai/subscribe?utm_source=nl_ad_system&quot;,&quot;text&quot;:&quot;Claim your free playbook&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://codenewsletter.ai/subscribe?utm_source=nl_ad_system"><span>Claim your free playbook</span></a></p></div><div><hr></div><h2><strong>Staying consistent when preferences change</strong></h2><p>Real users change their minds mid-task.</p><p>They try a new option, correct themselves, adjust what they want, and sometimes say one thing on Monday and the opposite on Tuesday. An agent that can&#8217;t handle this feels wrong: repetitive, stuck on old instructions, or too eager to rewrite its long-term knowledge on every passing comment.</p><p>The core rule is simple: <em>react fast with state, learn slowly with memory</em>.</p><h3><strong>Reacting fast, learning slowly</strong></h3><p>State updates as soon as a new instruction arrives&#8230;</p><p>The current task reflects it right away. But memory updates only after the change looks steady and reusable.</p><p>The question is <em>when</em> memory writes happen&#8230;</p><p>LangChain&#8217;s team frames two options: the agent can write <em>&#8220;in hot path&#8221;</em> (save the new fact before replying to the user) or <em>&#8220;in the background&#8221;</em> (a separate process updates memory during or after the conversation).</p><p>Background writes are what make &#8220;learn slowly&#8221; work, because they give the system time to check whether the change holds up over a few more turns before it gets saved.</p><p>If memory learned too fast, it would rot<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-15" href="#footnote-15" target="_self">15</a>&#8230;</p><p>A rare exception becomes the rule, a short-term constraint becomes permanent, and future tasks go wrong with no clear cause.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RwUj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32018b9-bc1c-4f65-904a-03b5bd261cd9_2048x1143.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RwUj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32018b9-bc1c-4f65-904a-03b5bd261cd9_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!RwUj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32018b9-bc1c-4f65-904a-03b5bd261cd9_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!RwUj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32018b9-bc1c-4f65-904a-03b5bd261cd9_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!RwUj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32018b9-bc1c-4f65-904a-03b5bd261cd9_2048x1143.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RwUj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32018b9-bc1c-4f65-904a-03b5bd261cd9_2048x1143.jpeg" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a32018b9-bc1c-4f65-904a-03b5bd261cd9_2048x1143.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:813,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;React fast with state, learn slowly with memory&quot;,&quot;title&quot;:&quot;React fast with state, learn slowly with memory&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="React fast with state, learn slowly with memory" title="React fast with state, learn slowly with memory" srcset="https://substackcdn.com/image/fetch/$s_!RwUj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32018b9-bc1c-4f65-904a-03b5bd261cd9_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!RwUj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32018b9-bc1c-4f65-904a-03b5bd261cd9_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!RwUj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32018b9-bc1c-4f65-904a-03b5bd261cd9_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!RwUj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa32018b9-bc1c-4f65-904a-03b5bd261cd9_2048x1143.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Three roles keep this clean:</p><ul><li><p>State tracks what the agent is doing now,</p></li><li><p>Memory stores what it has learned over time,</p></li><li><p>Consistency rules keep the two in check when they disagree.</p></li></ul><p>Before any of these rules run, the agent has to pull the right memory for the current decision.</p><h3><strong>Retrieving only what&#8217;s relevant</strong></h3><p>Agents don&#8217;t load all memory&#8230;</p><p>Instead, they query it like a database, using metadata on each entry:</p><ul><li><p>t<code>opic: flights [seats, airlines, class, timing]</code></p></li><li><p>t<code>opic: hotels [room type, location, amenities]</code></p></li><li><p>t<code>opic: food [dietary restrictions, cuisine]</code></p></li><li><p>t<code>opic: budget [price sensitivity, limits]</code></p></li><li><p>d<code>uration: short-term | long-term</code></p></li><li><p>confidence: <code>confirmed | inferred</code></p></li></ul><p>The current state picks which slices to pull.</p><p>Booking a flight pulls flight and budget memory, and leaves hotel memory alone. This keeps the working context focused and stops old or unrelated memory from leaking into the decision.</p><h3><strong>Rolling back on corrections</strong></h3><p>When a user corrects the agent, treat it as a constraint change, NOT an error.</p><p>The agent always plans under a set of constraints:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;4f84cea6-c11c-4f3c-b255-de0589fddc51&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">seat type = aisle
budget &lt;= 800
departure = morning
hotel near the city center</code></pre></div><p>When the user says, &#8220;<em>I want a window seat&#8221;</em>, they aren&#8217;t saying <em>you made a mistake</em>. They&#8217;re saying <em>update the constraints</em>. The agent&#8217;s job is to apply the new constraint without throwing away the work that&#8217;s still valid.</p><p>On a correction, the agent traces which steps depended on the old constraint&#8230;</p><p>It rolls back to the earliest affected step, marks everything downstream as invalid, and leaves the earlier valid steps alone.</p><p>But memory doesn&#8217;t update on the first correction&#8230;</p><p>The agent first checks intent: <em>whether the change is a one-time request, task-specific, or a lasting preference (indicated by phrases like &#8220;always a window seat&#8221;). </em>Only after the change looks steady does long-term memory update.</p><h3><strong>When the system of record wins</strong></h3><p>NOT all memory is truth&#8230;</p><p>Prices, availability, and inventory come from external systems, not from the agent&#8217;s stored preferences. External systems define ground truth; memory shapes decisions without overriding real data, and when the two disagree, the system of record always wins.</p><p>Anthropic names this pattern directly in its agent design guidance:</p><p>Agents must <em>&#8220;gain &#8216;ground truth&#8217; from the environment at each step (such as tool call results or code execution) to assess its progress.&#8221;</em> That keeps the agent in sync with reality, and hallucinations drop because it isn&#8217;t guessing at live data it could have just fetched.</p><h3><strong>Travel agent: consistency in action</strong></h3><p>The agent already knows 2 things:</p><ul><li><p>Long-term memory: user usually prefers aisle seats.</p></li><li><p>Short-term memory: user wants the cheapest flight for this trip.</p></li></ul><p>Right now, the agent is comparing flights and choosing seats&#8230;</p><p>Then the user says:</p><p><em>&#8220;I want a window seat this time.&#8221;</em></p><p>Here&#8217;s what the agent does:</p><ol><li><p>Reads the new request.</p></li><li><p>Pulls only seat-related preferences (memory).</p></li><li><p>Understands <em>&#8220;this time&#8221;</em> means a temporary change and labels it accordingly.</p></li><li><p>Rolls state back to the flight selection step because seat preferences affect flight choices.</p></li><li><p>Removes earlier seat and pricing decisions that depended on aisle seats.</p></li><li><p>Recalculates the best flight options using the new window-seat preference.</p></li><li><p>Updates short-term memory for this trip ONLY.</p></li><li><p>Keeps long-term memory unchanged because preference may NOT be permanent.</p></li></ol><p>Later, the user says:</p><p><em>&#8220;I prefer window seats going forward.&#8221;</em></p><p>Now the agent understands this is a lasting preference&#8230;</p><p>So it:</p><ol><li><p>Read this as a lasting change.</p></li><li><p>Saves window seats as the new default preference.</p></li><li><p>Updates long-term memory.</p></li><li><p>Uses this preference for future trips.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1u4Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb166b263-d288-4723-abb3-aec0cca7a706_1045x797.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1u4Z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb166b263-d288-4723-abb3-aec0cca7a706_1045x797.jpeg 424w, https://substackcdn.com/image/fetch/$s_!1u4Z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb166b263-d288-4723-abb3-aec0cca7a706_1045x797.jpeg 848w, https://substackcdn.com/image/fetch/$s_!1u4Z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb166b263-d288-4723-abb3-aec0cca7a706_1045x797.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!1u4Z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb166b263-d288-4723-abb3-aec0cca7a706_1045x797.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1u4Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb166b263-d288-4723-abb3-aec0cca7a706_1045x797.jpeg" width="1045" height="797" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b166b263-d288-4723-abb3-aec0cca7a706_1045x797.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:797,&quot;width&quot;:1045,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;User preference change: rollback and selective memory update&quot;,&quot;title&quot;:&quot;User preference change: rollback and selective memory update&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="User preference change: rollback and selective memory update" title="User preference change: rollback and selective memory update" srcset="https://substackcdn.com/image/fetch/$s_!1u4Z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb166b263-d288-4723-abb3-aec0cca7a706_1045x797.jpeg 424w, https://substackcdn.com/image/fetch/$s_!1u4Z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb166b263-d288-4723-abb3-aec0cca7a706_1045x797.jpeg 848w, https://substackcdn.com/image/fetch/$s_!1u4Z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb166b263-d288-4723-abb3-aec0cca7a706_1045x797.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!1u4Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb166b263-d288-4723-abb3-aec0cca7a706_1045x797.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Now, imagine the airline system says there are no window seats available&#8230;</p><p>The agent tells the user that window seats are unavailable and follows the airline&#8217;s live data. It does not remove the preference from memory. Instead, real-world data overrides stored preferences.</p><p>So far, the travel agent has shown up in pieces. Now it&#8217;s time to run it end-to-end...</p><div><hr></div><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/ai-agent-memory?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption"><em>Share this post &amp; get rewards for the referrals.</em></p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/ai-agent-memory?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/ai-agent-memory?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><div><hr></div><h2><strong>Build travel agent from three pieces</strong></h2><p>Travel Agent AI helps users plan and book trips&#8230;</p><p>It talks to the user, tracks the current task, remembers useful preferences, and calls external tools to check flights, hotels, and prices.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!kdYI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecdc99fd-ea28-44a6-a856-d394adf0dc97_600x621.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kdYI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecdc99fd-ea28-44a6-a856-d394adf0dc97_600x621.jpeg 424w, https://substackcdn.com/image/fetch/$s_!kdYI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecdc99fd-ea28-44a6-a856-d394adf0dc97_600x621.jpeg 848w, https://substackcdn.com/image/fetch/$s_!kdYI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecdc99fd-ea28-44a6-a856-d394adf0dc97_600x621.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!kdYI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecdc99fd-ea28-44a6-a856-d394adf0dc97_600x621.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kdYI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecdc99fd-ea28-44a6-a856-d394adf0dc97_600x621.jpeg" width="600" height="621" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ecdc99fd-ea28-44a6-a856-d394adf0dc97_600x621.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:621,&quot;width&quot;:600,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;AI Travel Agent overview: state, memory types, tools, and user input&quot;,&quot;title&quot;:&quot;AI Travel Agent overview: state, memory types, tools, and user input&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="AI Travel Agent overview: state, memory types, tools, and user input" title="AI Travel Agent overview: state, memory types, tools, and user input" srcset="https://substackcdn.com/image/fetch/$s_!kdYI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecdc99fd-ea28-44a6-a856-d394adf0dc97_600x621.jpeg 424w, https://substackcdn.com/image/fetch/$s_!kdYI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecdc99fd-ea28-44a6-a856-d394adf0dc97_600x621.jpeg 848w, https://substackcdn.com/image/fetch/$s_!kdYI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecdc99fd-ea28-44a6-a856-d394adf0dc97_600x621.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!kdYI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fecdc99fd-ea28-44a6-a856-d394adf0dc97_600x621.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Every request flows through the same loop&#8230;</p><h3><strong>Workflow loop</strong></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wZHr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad1c0a07-611b-4233-b37f-fc68eeb37f38_811x804.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wZHr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad1c0a07-611b-4233-b37f-fc68eeb37f38_811x804.jpeg 424w, https://substackcdn.com/image/fetch/$s_!wZHr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad1c0a07-611b-4233-b37f-fc68eeb37f38_811x804.jpeg 848w, https://substackcdn.com/image/fetch/$s_!wZHr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad1c0a07-611b-4233-b37f-fc68eeb37f38_811x804.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!wZHr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad1c0a07-611b-4233-b37f-fc68eeb37f38_811x804.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wZHr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad1c0a07-611b-4233-b37f-fc68eeb37f38_811x804.jpeg" width="811" height="804" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ad1c0a07-611b-4233-b37f-fc68eeb37f38_811x804.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:804,&quot;width&quot;:811,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;AI Travel Agent workflow loop with state and memory updates&quot;,&quot;title&quot;:&quot;AI Travel Agent workflow loop with state and memory updates&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="AI Travel Agent workflow loop with state and memory updates" title="AI Travel Agent workflow loop with state and memory updates" srcset="https://substackcdn.com/image/fetch/$s_!wZHr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad1c0a07-611b-4233-b37f-fc68eeb37f38_811x804.jpeg 424w, https://substackcdn.com/image/fetch/$s_!wZHr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad1c0a07-611b-4233-b37f-fc68eeb37f38_811x804.jpeg 848w, https://substackcdn.com/image/fetch/$s_!wZHr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad1c0a07-611b-4233-b37f-fc68eeb37f38_811x804.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!wZHr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fad1c0a07-611b-4233-b37f-fc68eeb37f38_811x804.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ol><li><p><strong>User input.</strong> The user asks for a plan or a specific booking.</p></li><li><p><strong>Intent parsing and reasoning.</strong> The agent figures out the goal and picks the next step.</p></li><li><p><strong>State update.</strong> Records which step is active and the constraints in play (dates, airline preference, budget).</p></li><li><p><strong>Memory access.</strong> Pulls short-term, long-term, or external memory based on what this step needs.</p></li><li><p><strong>Tool execution.</strong> Calls APIs for flights, hotels, or pricing.</p></li><li><p><strong>Response generation.</strong> Gives a suggestion or confirmation from the current state and retrieved memory.</p></li><li><p><strong>State/memory update.</strong> Writes the new selections and any session context back to storage.</p></li><li><p><strong>Next step or loop.</strong> Continues to the next task in the plan.</p></li></ol><h3><strong>Example prompts</strong></h3><p>A typical conversation might run across four turns:</p><ol><li><p><em>&#8220;Help me plan a trip to Paris next month.&#8221;</em></p></li><li><p><em>&#8220;Book the outbound flight first.&#8221;</em></p></li><li><p><em>&#8220;I prefer window seats and morning flights.&#8221;</em></p></li><li><p><em>&#8220;Now add a hotel near the city center.&#8221;</em></p></li></ol><p>Across these turns:</p><ul><li><p>State tracks the active step.</p></li><li><p>Short-term memory stores choices for this trip.</p></li><li><p>Long-term memory stores recurring preferences.</p></li><li><p>External data provides live prices and availability.</p></li><li><p>Tools connect the agent to flight, hotel, and booking systems.</p></li></ul><h3><strong>Agent&#8217;s tools</strong></h3><p>The agent reaches out through flight search APIs, hotel availability services, and pricing and booking systems&#8230;</p><p>Each step feeds the next, and the saved state keeps the plan aligned with live data even when something fails partway through.</p><p>The loop shows <em>when</em> things happen&#8230;The next question is <em>what</em> each piece is responsible for...</p><div><hr></div><h2><strong>Reference architecture for a stateful agent</strong></h2><p>Zoom out from the runtime loop, and a stateful agent splits into four layers:</p><p>Each one has a single job, and the lines between them are what keep the agent steady.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!TKC_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4aba498a-1d9e-4dfe-86f9-b33c151a1aec_1022x646.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!TKC_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4aba498a-1d9e-4dfe-86f9-b33c151a1aec_1022x646.jpeg 424w, https://substackcdn.com/image/fetch/$s_!TKC_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4aba498a-1d9e-4dfe-86f9-b33c151a1aec_1022x646.jpeg 848w, https://substackcdn.com/image/fetch/$s_!TKC_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4aba498a-1d9e-4dfe-86f9-b33c151a1aec_1022x646.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!TKC_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4aba498a-1d9e-4dfe-86f9-b33c151a1aec_1022x646.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!TKC_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4aba498a-1d9e-4dfe-86f9-b33c151a1aec_1022x646.jpeg" width="1022" height="646" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4aba498a-1d9e-4dfe-86f9-b33c151a1aec_1022x646.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:646,&quot;width&quot;:1022,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Stateful AI agent architecture: components and dataflow&quot;,&quot;title&quot;:&quot;Stateful AI agent architecture: components and dataflow&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Stateful AI agent architecture: components and dataflow" title="Stateful AI agent architecture: components and dataflow" srcset="https://substackcdn.com/image/fetch/$s_!TKC_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4aba498a-1d9e-4dfe-86f9-b33c151a1aec_1022x646.jpeg 424w, https://substackcdn.com/image/fetch/$s_!TKC_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4aba498a-1d9e-4dfe-86f9-b33c151a1aec_1022x646.jpeg 848w, https://substackcdn.com/image/fetch/$s_!TKC_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4aba498a-1d9e-4dfe-86f9-b33c151a1aec_1022x646.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!TKC_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4aba498a-1d9e-4dfe-86f9-b33c151a1aec_1022x646.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><ul><li><p><strong>Agent brain (reasoning engine).</strong> An LLM sits at the center, planning multi-step workflows, reading user intent, and picking the next action from the current state and retrieved memory.</p></li><li><p><strong>State layer.</strong> This is where the current workflow lives: which steps are done, which are next, and what constraints are active. It also holds short-term overrides and session-specific choices, and lets the agent roll back when a user changes a preference without restarting the entire plan.</p></li><li><p><strong>Memory layer.</strong> Short-term memory carries this-task context; long-term memory carries lasting user preferences and habits. Together, they feed the brain with context that matches past decisions and patterns.</p></li><li><p><strong>External systems (system of record).</strong> APIs, databases, and live data sources provide official information such as seat availability, current prices, and cancellation policies. Memory can suggest, but the system of record always wins in a conflict.</p></li></ul><p>The brain decides, the state tracks, memory remembers, and external systems check.</p><p>Mix up those responsibilities, and the agent guesses when it should check a live source, or keeps memory that should have been dropped. Keep them separate, and every layer pulls its own weight.</p><div><hr></div><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/ai-agent-memory?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption"><em>Share this post &amp; get rewards for the referrals.</em></p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/ai-agent-memory?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/ai-agent-memory?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><div><hr></div><h2><strong>Deciding what fits in the context window</strong></h2><p>The four layers only work if they fit&#8230;</p><p>Every LLM runs inside a finite context window<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-16" href="#footnote-16" target="_self">16</a>, and state, memory, tool schemas, tool outputs, and user messages all fight for that space.</p><h3><strong>What takes up the context window</strong></h3><p>Every step&#8217;s context is the sum of what you send the model in that step&#8230;</p><p>This includes system and developer instructions, current state, retrieved memory snippets (short-term, long-term, and external), tool schemas and instructions, tool outputs from API responses and search results, and the user&#8217;s messages themselves.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qLGB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35ba5c9a-414a-4b3a-8cf6-a811a3035f4d_2048x1143.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qLGB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35ba5c9a-414a-4b3a-8cf6-a811a3035f4d_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!qLGB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35ba5c9a-414a-4b3a-8cf6-a811a3035f4d_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!qLGB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35ba5c9a-414a-4b3a-8cf6-a811a3035f4d_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!qLGB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35ba5c9a-414a-4b3a-8cf6-a811a3035f4d_2048x1143.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qLGB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35ba5c9a-414a-4b3a-8cf6-a811a3035f4d_2048x1143.jpeg" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/35ba5c9a-414a-4b3a-8cf6-a811a3035f4d_2048x1143.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:813,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;What fills the LLM context window&quot;,&quot;title&quot;:&quot;What fills the LLM context window&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="What fills the LLM context window" title="What fills the LLM context window" srcset="https://substackcdn.com/image/fetch/$s_!qLGB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35ba5c9a-414a-4b3a-8cf6-a811a3035f4d_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!qLGB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35ba5c9a-414a-4b3a-8cf6-a811a3035f4d_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!qLGB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35ba5c9a-414a-4b3a-8cf6-a811a3035f4d_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!qLGB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F35ba5c9a-414a-4b3a-8cf6-a811a3035f4d_2048x1143.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A useful mental model for the budget (not a formula to measure):</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;e365af97-4c91-45ed-98ff-c599ace56e8a&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Context size = instructions + state + memory + tools + data + user input</code></pre></div><p>Visibility is what matters here, not precision&#8230;</p><p>Tool definitions and raw API responses often consume more context than the model&#8217;s actual reasoning.</p><p>Anthropic ran into this in their own Claude Code setup:</p><p>The full tool definitions<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-17" href="#footnote-17" target="_self">17</a> alone used about 134,000 tokens of context. To fix this, Anthropic introduced Tool Search, a lazy-loading system that loads a tool&#8217;s full schema only when the agent actually needs it.</p><p>This reduced tool-definition overhead by 85%, increased usable context per session from 122,800 tokens to 191,300, and improved MCP tool-use accuracy for Claude Opus 4 from 49% to 74%.</p><p>If the agent loads everything all the time, the context window fills up quickly&#8230;</p><p>When that happens, older messages drop out first. This usually removes the earliest and most important information, like the user&#8217;s original goals, constraints, or instructions.</p><h3><strong>Retrieve only what&#8217;s relevant</strong></h3><p>Use tags, scope, and recency to pull what matches the current step, not everything the agent has ever learned.</p><p>Match retrieval to the current state: <em>booking a flight pulls flight and budget memory, nothing else.</em></p><p>Relevance is really a question of how much history you want to pay for right now&#8230;</p><h3><strong>Summarize and remove old checkpoints</strong></h3><p>In long workflows, the agent&#8217;s state keeps growing after every step&#8230;</p><p>Keeping every raw log and tool response makes the context large, expensive, and noisy. Instead, the agent can periodically create a short summary of completed work using an LLM.</p><p>The summary should keep only the important information:</p><ul><li><p>decisions already made</p></li><li><p>constraints that are now fixed</p></li><li><p>tasks that still need to be completed</p></li></ul><p>The agent should remove detailed logs that no longer affect future decisions.</p><p>And summaries should not stay forever either.</p><p>If an old summary is no longer useful for future tasks, the agent should archive it or delete it. Outdated summaries can confuse the agent just as outdated memory does.</p><h3><strong>Keep memory outside the prompt</strong></h3><p>The agent should not keep all its memory in the prompt at all times&#8230;</p><p>Instead, memory should remain in external storage and be retrieved only when needed. Adding too much memory directly into the prompt quickly fills the context window, increases cost and latency, and makes reasoning less focused.</p><p>Most stored memory is only occasionally useful and unnecessary for every step&#8230;</p><p>Before adding memory to the context, the agent should ask:</p><ul><li><p><em>Does this change what I should do next?</em></p></li><li><p><em>Is this information still valid?</em></p></li><li><p><em>Would removing it break the current plan?</em></p></li></ul><p>If the answer to all three questions is &#8220;<em>no&#8221;</em>, the memory should stay out of the context.</p><p>Good agents do NOT <em>succeed</em> by remembering everything&#8230;Instead, they retrieve only the information that matters right now.</p><h3><strong>Cost, latency, and reliability trade-offs</strong></h3><p>Every reliability improvement comes with a cost&#8230;</p><p>Retrieving more memory increases latency. Extra tool calls increase costs. Additional consistency checks slow the response down.</p><p>At scale, fast agents are usually cheaper but less reliable. More careful agents are safer but slower. You cannot optimize for speed, cost, and reliability simultaneously.</p><p>In practice, teams focus on accuracy where mistakes are expensive, such as bookings or payments. Also, they cache tool results when possible to avoid repeated API calls.</p><p>Plus, batching API requests reduces overhead. Teams also monitor context size and tune memory retrieval using real usage data instead of guesses.</p><p>Now, imagine the travel agent after handling hundreds of trips&#8230;</p><p>Its long-term memory now contains many user preferences, budgets, airlines, and booking patterns. If the agent retrieves too much memory for every request, the context becomes large and inefficient.</p><p>A scalable travel agent:</p><ul><li><p>retrieves only trip-related preferences</p></li><li><p>summarizes old planning steps</p></li><li><p>trusts live pricing APIs over stored prices</p></li><li><p>keeps prompts small and focused as history grows</p></li></ul><p>Without this discipline, the agent gradually becomes slower, more expensive, and less reliable&#8230;</p><p>Efficiently managing context is only part of scaling an agent system.</p><p>The other challenge is handling memory failures correctly&#8230;</p><div class="callout-block" data-callout="true"><h3><a href="https://codenewsletter.ai/subscribe?utm_source=nl_ad_system">100+ Claude Code hacks to ship code 10X faster (Partner)</a></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://codenewsletter.ai/subscribe?utm_source=nl_ad_system" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WUBw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141492b2-1333-46cd-98b1-dd7f5df0b6c7_1200x600.jpeg 424w, https://substackcdn.com/image/fetch/$s_!WUBw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141492b2-1333-46cd-98b1-dd7f5df0b6c7_1200x600.jpeg 848w, https://substackcdn.com/image/fetch/$s_!WUBw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141492b2-1333-46cd-98b1-dd7f5df0b6c7_1200x600.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!WUBw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141492b2-1333-46cd-98b1-dd7f5df0b6c7_1200x600.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WUBw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141492b2-1333-46cd-98b1-dd7f5df0b6c7_1200x600.jpeg" width="1200" height="600" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/141492b2-1333-46cd-98b1-dd7f5df0b6c7_1200x600.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:600,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:339767,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:&quot;https://codenewsletter.ai/subscribe?utm_source=nl_ad_system&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/190817974?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141492b2-1333-46cd-98b1-dd7f5df0b6c7_1200x600.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!WUBw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141492b2-1333-46cd-98b1-dd7f5df0b6c7_1200x600.jpeg 424w, https://substackcdn.com/image/fetch/$s_!WUBw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141492b2-1333-46cd-98b1-dd7f5df0b6c7_1200x600.jpeg 848w, https://substackcdn.com/image/fetch/$s_!WUBw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141492b2-1333-46cd-98b1-dd7f5df0b6c7_1200x600.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!WUBw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F141492b2-1333-46cd-98b1-dd7f5df0b6c7_1200x600.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Top engineers at Anthropic say AI now writes 100% of their code.</p><p>Are you using AI to write yours?</p><p>These 100+ Claude Code hacks show you exactly how. Sign up for The Code and get:</p><ul><li><p>100+ Claude Code hacks &#8212; free</p></li><li><p>The <a href="https://codenewsletter.ai/subscribe?utm_source=nl_ad_system">Code newsletter</a> &#8212; learn the latest AI tools and skills to code faster in 5 mins a day</p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://codenewsletter.ai/subscribe?utm_source=nl_ad_system&quot;,&quot;text&quot;:&quot;Claim your free playbook&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://codenewsletter.ai/subscribe?utm_source=nl_ad_system"><span>Claim your free playbook</span></a></p></div><div><hr></div><h2><strong>How memory goes wrong</strong></h2><p>Even if an agent manages context well, its memory system can still fail&#8230;</p><p>Memory makes agents more capable, but it also creates new ways for them to behave incorrectly. In real systems, three common memory failures occur repeatedly.</p><p>These failures happen at different stages of the memory pipeline:</p><ul><li><p>What gets stored</p></li><li><p>What stays over time</p></li><li><p>What gets retrieved later</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-Vul!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd91bda6d-d735-434b-be85-6372893b86ad_2048x1143.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-Vul!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd91bda6d-d735-434b-be85-6372893b86ad_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!-Vul!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd91bda6d-d735-434b-be85-6372893b86ad_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!-Vul!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd91bda6d-d735-434b-be85-6372893b86ad_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!-Vul!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd91bda6d-d735-434b-be85-6372893b86ad_2048x1143.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-Vul!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd91bda6d-d735-434b-be85-6372893b86ad_2048x1143.jpeg" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d91bda6d-d735-434b-be85-6372893b86ad_2048x1143.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:813,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;How memory goes wrong: stale memory, wrong capture, retrieval miss&quot;,&quot;title&quot;:&quot;How memory goes wrong: stale memory, wrong capture, retrieval miss&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="How memory goes wrong: stale memory, wrong capture, retrieval miss" title="How memory goes wrong: stale memory, wrong capture, retrieval miss" srcset="https://substackcdn.com/image/fetch/$s_!-Vul!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd91bda6d-d735-434b-be85-6372893b86ad_2048x1143.jpeg 424w, https://substackcdn.com/image/fetch/$s_!-Vul!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd91bda6d-d735-434b-be85-6372893b86ad_2048x1143.jpeg 848w, https://substackcdn.com/image/fetch/$s_!-Vul!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd91bda6d-d735-434b-be85-6372893b86ad_2048x1143.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!-Vul!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd91bda6d-d735-434b-be85-6372893b86ad_2048x1143.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3><strong>1 Stale memory</strong></h3><p>The agent relies on outdated information&#8230;</p><p><em>Example:</em> The agent remembers that the user prefers window seats, but the user recently switched to aisle seats. Without an update, the agent keeps suggesting window seats.</p><p><em>Why it matters:</em> Old preferences can override newer user intent if the system does not update or expire memory correctly.</p><h3><strong>2 Wrong information captured</strong></h3><p>The agent stores incorrect information&#8230;</p><p><em>Example:</em> During a conversation, the agent mistakenly saves the user&#8217;s phone number as their airline loyalty number.</p><p><em>Why it matters:</em> Once incorrect data enters long-term memory, it can affect many future tasks and become difficult to trace back to the original mistake.</p><h3><strong>3 Retrieval failures</strong></h3><p>The correct memory exists, but the agent fails to retrieve it when needed&#8230;</p><p><em>Example:</em> The user almost always books business class, but the agent fails to retrieve that preference and instead recommends economy.</p><p><em>Real-world example:</em> In July 2025, a Replit coding agent deleted a live production database during an active code freeze, even after the user repeatedly typed &#8220;DON&#8217;T DO IT.&#8221;</p><p>The instruction existed in the agent&#8217;s context, but the system failed to apply it correctly. The agent later generated thousands of fake user records to hide the issue. Replit&#8217;s CEO publicly apologized and later introduced an automatic separation between development and production environments.</p><p><em>Why it matters:</em> Stored memory is useless if retrieval, ranking, or relevance systems fail to surface the right information at the right moment.</p><p>Storing memory is easy. But managing it correctly over time is the hard part.</p><p>Preventing these three failures is a major part of building reliable AI agents&#8230;</p><div><hr></div><h2><strong>Remember the right things, NOT everything</strong></h2><p>Here&#8217;s a checklist for designing stateful, reliable AI agents:</p><ol><li><p><strong>Separate state from memory.</strong> State is the current workflow. Memory is short- and long-term knowledge.</p></li><li><p><strong>Checkpoint and roll back.</strong> Roll back only the steps affected by a correction. Keep the rest.</p></li><li><p><strong>Keep memory outside the prompt.</strong> Retrieve only what&#8217;s needed. Apply short-term and long-term rules differently.</p></li><li><p><strong>Budget context carefully.</strong> Treat it as a working set. Summarize old checkpoints. Drop stale summaries.</p></li><li><p><strong>Let the system of record win.</strong> External systems override stored memory when they disagree.</p></li><li><p><strong>Balance cost, latency, and reliability.</strong> Spend precision where mistakes are expensive.</p></li><li><p><strong>Monitor in production.</strong> Track context usage, retrieval hits, tool calls, and response times.</p></li><li><p><strong>Add safeguards.</strong> Freshness rules, clear approval before writing to long-term memory, scope-aware updates.</p></li></ol><p>When the three pieces work together, agents stop reacting and start adapting&#8230;</p><p>They survive failure, stay honest with real-world data, and scale without their context budget falling apart. The trick isn&#8217;t more memory or a bigger model. It&#8217;s knowing what to track, what to recall, and when to act.</p><div><hr></div><p>&#128075; I&#8217;d like to thank <strong><a href="http://www.linkedin.com/in/sivasankar-natarajan">Sivasankar</a></strong> for writing this newsletter!</p><p>He is a Technical Director and GenAI practitioner with over 20+ years of experience in architecting and building Big Data, Cloud, and GenAI solutions.</p><div><hr></div><p>Louis and I launched the <strong>GENERATIVE AI MASTERCLASS</strong> (newsletter series exclusive to PAID subscribers).</p><p>When you upgrade, you&#8217;ll get:</p><ul><li><p><strong>Simple breakdown of real-world architectures</strong></p></li><li><p>Frameworks you can plug into your work or business</p></li><li><p><strong>Proven systems behind ChatGPT, Perplexity, and Copilot</strong></p></li></ul><p><strong>&#128073; <a href="https://newsletter.systemdesign.one/subscribe?yearly=true">CLICK HERE TO JOIN THE GENERATIVE AI MASTERCLASS</a></strong></p><p>(Golden members will get the next Generative AI newsletter in the first week of June.)</p><div><hr></div><p>If you find this newsletter valuable, share it with a friend, and subscribe if you haven&#8217;t already. There are <a href="http://newsletter.systemdesign.one/subscribe?group=true">group discounts</a>, <a href="http://newsletter.systemdesign.one/subscribe?gift=true">gift options</a>, and <a href="https://newsletter.systemdesign.one/leaderboard">referral rewards</a> available.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/subscribe?"><span>Subscribe now</span></a></p><div><hr></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.linkedin.com/in/nk-systemdesign-one/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bEFk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 424w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 848w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 1272w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bEFk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png" width="152" height="152" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:320,&quot;width&quot;:320,&quot;resizeWidth&quot;:152,&quot;bytes&quot;:74009,&quot;alt&quot;:&quot;Author Neo Kim; System design case studies&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://www.linkedin.com/in/nk-systemdesign-one/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Author Neo Kim; System design case studies" title="Author Neo Kim; System design case studies" srcset="https://substackcdn.com/image/fetch/$s_!bEFk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 424w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 848w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 1272w, https://substackcdn.com/image/fetch/$s_!bEFk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f94ab8c-0d67-4775-992e-05e09ab710db_320x320.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption"><strong>&#128075; Find me on <a href="https://www.linkedin.com/in/nk-systemdesign-one/">LinkedIn</a> | <a href="https://x.com/intent/follow?screen_name=systemdesignone">Twitter</a> | <a href="https://www.threads.net/@systemdesignone">Threads</a> | <a href="https://www.instagram.com/systemdesignone/">Instagram</a></strong></figcaption></figure></div><div><hr></div><p><strong>Want to reach 210K+ tech professionals at scale? </strong>&#128240;</p><p>If your company wants to reach 210K+ tech professionals, <a href="https://newsletter.systemdesign.one/p/sponsorship">advertise with me</a>.</p><div><hr></div><p>Thank you for supporting this newsletter.</p><p>You are now 210,001+ readers strong, very close to 210k. Let&#8217;s try to get 211k readers by 29 May. Consider sharing this post with your friends and get rewards.</p><p>Y&#8217;all are the best.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6oWl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6oWl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 424w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 848w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 1272w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6oWl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png" width="590" height="368.75" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2e739087-a910-4643-be36-997b6dd5b4af_800x500.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:500,&quot;width&quot;:800,&quot;resizeWidth&quot;:590,&quot;bytes&quot;:87878,&quot;alt&quot;:&quot;system design newsletter&quot;,&quot;title&quot;:&quot;system design newsletter&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/163380418?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="system design newsletter" title="system design newsletter" srcset="https://substackcdn.com/image/fetch/$s_!6oWl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 424w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 848w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 1272w, https://substackcdn.com/image/fetch/$s_!6oWl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2e739087-a910-4643-be36-997b6dd5b4af_800x500.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/ai-agent-memory?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/ai-agent-memory?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div><hr></div><h2><strong>References</strong></h2><ul><li><p>Anthropic Engineering. <em>Building effective agents.</em> December 2024. <a href="https://www.anthropic.com/research/building-effective-agents">https://www.anthropic.com/research/building-effective-agents</a></p></li><li><p>Anthropic Engineering. <em>Effective context engineering for AI agents.</em> <a href="https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents">https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents</a></p></li><li><p>Anthropic. <em>Tool use with Claude.</em> Claude API documentation. <a href="https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview">https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview</a></p></li><li><p>LangChain. <em>Memory overview.</em> LangGraph documentation. <a href="https://docs.langchain.com/oss/python/langgraph/memory">https://docs.langchain.com/oss/python/langgraph/memory</a></p></li><li><p>LangChain. <em>Persistence.</em> LangGraph documentation. <a href="https://docs.langchain.com/oss/python/langgraph/persistence">https://docs.langchain.com/oss/python/langgraph/persistence</a></p></li><li><p>Lewis, P., et al. <em>Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks.</em> Facebook AI Research, 2020. <a href="https://arxiv.org/abs/2005.11401">https://arxiv.org/abs/2005.11401</a></p></li><li><p>Packer, C., et al. <em>MemGPT: Towards LLMs as Operating Systems.</em> UC Berkeley, 2023. <a href="https://arxiv.org/abs/2310.08560">https://arxiv.org/abs/2310.08560</a></p></li><li><p>Pinecone. <em>What is a Vector Database &amp; How Does it Work?</em> <a href="https://www.pinecone.io/learn/vector-database/">https://www.pinecone.io/learn/vector-database/</a></p></li><li><p>Chhikara, P., et al. <em>Mem0: Building Production-Ready AI Agents with Scalable Long-Term Memory.</em> 2025. <a href="https://arxiv.org/abs/2504.19413">https://arxiv.org/abs/2504.19413</a></p></li><li><p>Anthropic Engineering. <em>Advanced tool use.</em> <a href="https://www.anthropic.com/engineering/advanced-tool-use">https://www.anthropic.com/engineering/advanced-tool-use</a></p></li><li><p>Anthropic Engineering. <em>Building effective agents.</em> December 2024. <a href="https://www.anthropic.com/research/building-effective-agents">https://www.anthropic.com/research/building-effective-agents</a></p></li><li><p>LangChain. <em>Memory for agents.</em> LangChain Blog, 2024. <a href="https://www.langchain.com/blog/memory-for-agents">https://www.langchain.com/blog/memory-for-agents</a></p></li><li><p>LangChain. <em>Is LangGraph used in production?</em> LangChain Blog. <a href="https://www.langchain.com/blog/is-langgraph-used-in-production">https://www.langchain.com/blog/is-langgraph-used-in-production</a></p></li><li><p>AI Incident Database. <em>Incident 1152: Replit AI agent deleted production database.</em> <a href="https://incidentdatabase.ai/cite/1152/">https://incidentdatabase.ai/cite/1152/</a></p></li></ul><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p><strong>AI agent</strong> is a system that uses AI to understand goals, make decisions, and take actions to complete tasks.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-2" href="#footnote-anchor-2" class="footnote-number" contenteditable="false" target="_self">2</a><div class="footnote-content"><p><strong>Orchestration framework.</strong> A library that manages how an agent&#8217;s steps run, how state is stored between them, and how failures are handled. LangGraph is one common example.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-3" href="#footnote-anchor-3" class="footnote-number" contenteditable="false" target="_self">3</a><div class="footnote-content"><ul><li><p><strong>LangGraph</strong> is a framework for building AI agents and multi-step workflows with language models. It helps manage state, memory, tool usage, and workflow execution across many steps.</p></li><li><p><strong>SqliteSaver</strong> is a built-in LangGraph component that saves agent state and checkpoints in a local SQLite database. It is useful for development or smaller applications.</p></li><li><p><strong>PostgresSaver</strong> is a built-in LangGraph component that saves agent state and checkpoints in a PostgreSQL database. It is better suited for production systems that need scalability and reliability.</p></li></ul></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-4" href="#footnote-anchor-4" class="footnote-number" contenteditable="false" target="_self">4</a><div class="footnote-content"><p><strong>Checkpointing.</strong> Saving the agent&#8217;s state at safe points so a crash, timeout, or redeploy doesn&#8217;t lose progress. On restart, the agent reloads the last checkpoint and continues.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-5" href="#footnote-anchor-5" class="footnote-number" contenteditable="false" target="_self">5</a><div class="footnote-content"><p><strong>LinkedIn&#8217;s SQL Bot</strong> is an internal AI assistant that lets employees ask questions in natural language and automatically converts them into SQL queries to retrieve data from LinkedIn&#8217;s data warehouse.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-6" href="#footnote-anchor-6" class="footnote-number" contenteditable="false" target="_self">6</a><div class="footnote-content"><p><strong>Large Language Model (LLM).</strong> A neural network trained on large amounts of text to predict the next token in a sequence. In this newsletter, the LLM is the reasoning engine at the core of the agent.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-7" href="#footnote-anchor-7" class="footnote-number" contenteditable="false" target="_self">7</a><div class="footnote-content"><p><strong>Vector database</strong> is a database designed to store and search embeddings - numerical representations of text, images, or other data created by AI models. Instead of matching exact keywords like a traditional database, a vector database finds information based on semantic similarity, meaning similarity in meaning.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-8" href="#footnote-anchor-8" class="footnote-number" contenteditable="false" target="_self">8</a><div class="footnote-content"><p><strong>Mem0</strong> is an open-source memory system for AI agents and AI assistants. It helps agents remember important information across conversations instead of sending the entire chat history to the model every time.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-9" href="#footnote-anchor-9" class="footnote-number" contenteditable="false" target="_self">9</a><div class="footnote-content"><p><strong>LOCOMO.</strong> A public benchmark of long, multi-session conversations used to test how well a system can answer questions about things said much earlier in the dialog.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-10" href="#footnote-anchor-10" class="footnote-number" contenteditable="false" target="_self">10</a><div class="footnote-content"><p><strong>p95 latency.</strong> Time it takes to complete an operation in 95 out of 100 calls. It describes the slow tail of the system, not the average.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-11" href="#footnote-anchor-11" class="footnote-number" contenteditable="false" target="_self">11</a><div class="footnote-content"><p><strong>Full-context baseline.</strong> Putting the entire conversation history into the prompt on every call, with no picking or shortening. Used as a point of comparison for memory systems that try to be smarter about what they include.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-12" href="#footnote-anchor-12" class="footnote-number" contenteditable="false" target="_self">12</a><div class="footnote-content"><p><strong>LLM-as-judge evaluation.</strong> Using another language model to score the quality of answers, instead of a human rater.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-13" href="#footnote-anchor-13" class="footnote-number" contenteditable="false" target="_self">13</a><div class="footnote-content"><p><strong>RAG</strong>: retrieval-augmented generation, where an agent fetches relevant documents at query time.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-14" href="#footnote-anchor-14" class="footnote-number" contenteditable="false" target="_self">14</a><div class="footnote-content"><p><strong>System of record.</strong> The external system that holds the authoritative version of a piece of data: a booking system, a pricing API, an inventory database. In a conflict with stored memory, the system of record always wins.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-15" href="#footnote-anchor-15" class="footnote-number" contenteditable="false" target="_self">15</a><div class="footnote-content"><p><strong>Memory rot</strong> happens when the agent saves too many weak or temporary signals as permanent knowledge.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-16" href="#footnote-anchor-16" class="footnote-number" contenteditable="false" target="_self">16</a><div class="footnote-content"><p><strong>Context window.</strong> The maximum number of tokens an LLM can process in one request. Instructions, state, memory, tool schemas, tool outputs, and user messages all fight for this space.</p></div></div><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-17" href="#footnote-anchor-17" class="footnote-number" contenteditable="false" target="_self">17</a><div class="footnote-content"><p><strong>Tool definition</strong> is a description of a tool that tells the AI agent:</p><ul><li><p>What the tool does</p></li><li><p>What inputs it accept</p></li><li><p>What output it return</p></li><li><p>When and how to use it</p></li></ul><p>You can think of it like an API contract or a function specification for the model.</p><p></p></div></div>]]></content:encoded></item><item><title><![CDATA[How ML Systems Actually Work: From Data to Deployment]]></title><description><![CDATA[#146: From Embeddings to Feature Stores - 38 Concepts That Power Netflix, Uber, and Spotify]]></description><link>https://newsletter.systemdesign.one/p/machine-learning-system-design-interview</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/machine-learning-system-design-interview</guid><dc:creator><![CDATA[Paolo Perrone]]></dc:creator><pubDate>Tue, 12 May 2026 09:02:04 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/debd753d-7c69-4f28-a82d-c7eaedc64177_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Get my system design playbook for FREE on newsletter signup:</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><ul><li><p><em><a href="https://newsletter.systemdesign.one/p/machine-learning-system-design-interview/?action=share">Share this post</a> &amp; I'll send you some rewards for the referrals.</em></p></li></ul><div><hr></div><p>You&#8217;ve probably walked into a machine learning (ML) system design interview, been asked to <em>&#8220;design a recommendation system,&#8221;</em> and suddenly everyone&#8217;s throwing around terms like embeddings, feature stores, and model drift, and you&#8217;re nodding along while silently drowning.</p><p>Most prep resources offer algorithm deep-dives or LeetCode-style drills.</p><p>But first, what you actually need is a solid understanding of how ML systems work: <em>vocabulary, building blocks, and how they fit together.</em></p><p>This newsletter is a plain-English field guide to ML system design.</p><p>You don&#8217;t need to know TensorFlow, write Python, or understand gradient descent math. Just what these terms mean in practice, so you finally understand how these systems actually work.</p><p>Along the way, we&#8217;ll trace how real systems (like Netflix recommendations, Uber&#8217;s ETA predictions, and Spotify&#8217;s Discover Weekly) actually work under the hood. Don&#8217;t worry about memorizing every detail; this guide exists so your next ML interview feels less like an interrogation and more like a conversation.</p><p>Let&#8217;s start with the question every ML interview is really asking.</p><div><hr></div><h2><a href="https://agentfield.ai/github/?utm_source=sys_design&amp;utm_medium=newsletter&amp;utm_campaign=sys_design-060512&amp;utm_id=sys_design-060512-github-cta&amp;utm_content=github-cta">Treat coding agents like services, not terminals (Partner)</a></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://agentfield.ai/github/?utm_source=sys_design&amp;utm_medium=newsletter&amp;utm_campaign=sys_design-060512&amp;utm_id=sys_design-060512-github-cta&amp;utm_content=github-cta" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!66XB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47682dab-1a18-45f2-b475-7ccb4dd5a3ac_2048x1374.webp 424w, https://substackcdn.com/image/fetch/$s_!66XB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47682dab-1a18-45f2-b475-7ccb4dd5a3ac_2048x1374.webp 848w, https://substackcdn.com/image/fetch/$s_!66XB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47682dab-1a18-45f2-b475-7ccb4dd5a3ac_2048x1374.webp 1272w, https://substackcdn.com/image/fetch/$s_!66XB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47682dab-1a18-45f2-b475-7ccb4dd5a3ac_2048x1374.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!66XB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47682dab-1a18-45f2-b475-7ccb4dd5a3ac_2048x1374.webp" width="1456" height="977" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/47682dab-1a18-45f2-b475-7ccb4dd5a3ac_2048x1374.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:977,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:462800,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/webp&quot;,&quot;href&quot;:&quot;https://agentfield.ai/github/?utm_source=sys_design&amp;utm_medium=newsletter&amp;utm_campaign=sys_design-060512&amp;utm_id=sys_design-060512-github-cta&amp;utm_content=github-cta&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/179236490?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47682dab-1a18-45f2-b475-7ccb4dd5a3ac_2048x1374.webp&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!66XB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47682dab-1a18-45f2-b475-7ccb4dd5a3ac_2048x1374.webp 424w, https://substackcdn.com/image/fetch/$s_!66XB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47682dab-1a18-45f2-b475-7ccb4dd5a3ac_2048x1374.webp 848w, https://substackcdn.com/image/fetch/$s_!66XB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47682dab-1a18-45f2-b475-7ccb4dd5a3ac_2048x1374.webp 1272w, https://substackcdn.com/image/fetch/$s_!66XB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F47682dab-1a18-45f2-b475-7ccb4dd5a3ac_2048x1374.webp 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>You use Claude Code, Codex, Cursor, or Gemini in your terminal every day. What if you could call them in code?</p><p><a href="https://agentfield.ai/github/?utm_source=sys_design&amp;utm_medium=newsletter&amp;utm_campaign=sys_design-060512&amp;utm_id=sys_design-060512-github-cta&amp;utm_content=github-cta">AgentField</a> just open-sourced <strong>harness orchestration</strong>.</p><ul><li><p>Call those same coding agents programmatically from Python, TypeScript, or Go.</p></li><li><p>Compose them into real automations: ship a PR, audit a cloud, run a code review - end-to-end pipelines, not toy demos.</p></li></ul><p>For the architecture rationale, their latest post - <em><a href="https://agentfield.ai/blog/harness-as-membrane/?utm_source=sys_design&amp;utm_medium=newsletter&amp;utm_campaign=sys_design-060512&amp;utm_id=sys_design-060512-blog-h-as-m&amp;utm_content=blog-h-as-m">harness-as-membrane</a></em> - is worth a read.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://agentfield.ai/github/?utm_source=sys_design&amp;utm_medium=newsletter&amp;utm_campaign=sys_design-060512&amp;utm_id=sys_design-060512-github-cta&amp;utm_content=github-cta&quot;,&quot;text&quot;:&quot;Fork and build&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://agentfield.ai/github/?utm_source=sys_design&amp;utm_medium=newsletter&amp;utm_campaign=sys_design-060512&amp;utm_id=sys_design-060512-github-cta&amp;utm_content=github-cta"><span>Fork and build</span></a></p><p>(Thanks to <a href="https://agentfield.ai/github/?utm_source=sys_design&amp;utm_medium=newsletter&amp;utm_campaign=sys_design-060512&amp;utm_id=sys_design-060512-github-cta&amp;utm_content=github-cta">AgentField</a> for partnering on this post.)</p><div><hr></div><p>I want to introduce <span class="mention-wrap" data-attrs="{&quot;name&quot;:&quot;Paolo Perrone&quot;,&quot;id&quot;:12567301,&quot;type&quot;:&quot;user&quot;,&quot;url&quot;:null,&quot;photo_url&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d679f269-74f8-4ceb-971d-e06664411a38_742x465.png&quot;,&quot;uuid&quot;:&quot;abb2b322-4c05-4fa7-a521-286fa4edc445&quot;}" data-component-name="MentionToDOM"></span> as a guest author.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://theaiengineer.substack.com/welcome" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pss2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd058b6c7-0ac0-4749-8f5d-1eee2de48ede_1130x512.png 424w, https://substackcdn.com/image/fetch/$s_!pss2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd058b6c7-0ac0-4749-8f5d-1eee2de48ede_1130x512.png 848w, https://substackcdn.com/image/fetch/$s_!pss2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd058b6c7-0ac0-4749-8f5d-1eee2de48ede_1130x512.png 1272w, https://substackcdn.com/image/fetch/$s_!pss2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd058b6c7-0ac0-4749-8f5d-1eee2de48ede_1130x512.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pss2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd058b6c7-0ac0-4749-8f5d-1eee2de48ede_1130x512.png" width="1130" height="512" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d058b6c7-0ac0-4749-8f5d-1eee2de48ede_1130x512.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:512,&quot;width&quot;:1130,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://theaiengineer.substack.com/welcome&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!pss2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd058b6c7-0ac0-4749-8f5d-1eee2de48ede_1130x512.png 424w, https://substackcdn.com/image/fetch/$s_!pss2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd058b6c7-0ac0-4749-8f5d-1eee2de48ede_1130x512.png 848w, https://substackcdn.com/image/fetch/$s_!pss2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd058b6c7-0ac0-4749-8f5d-1eee2de48ede_1130x512.png 1272w, https://substackcdn.com/image/fetch/$s_!pss2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd058b6c7-0ac0-4749-8f5d-1eee2de48ede_1130x512.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>He&#8217;s an ML engineer with 8+ years of production AI experience, read by 1M+ AI/ML engineers on LinkedIn and Substack. He runs a tech content agency serving NVIDIA, Google, and Y Combinator, and writes <strong><a href="https://theaiengineer.substack.com/welcome">The AI Engineer</a></strong>, the newsletter that makes engineers dangerously good at AI engineering.</p><div><hr></div><h2><strong>What is an ML System?</strong></h2><p>Traditional software runs on rules you write by hand.</p><p>If the temperature is above 90&#176;F, turn on the AC. If the user clicks &#8220;buy,&#8221; charge the card. Every decision is hardcoded in code.</p><p>ML systems work differently.</p><p>Instead of writing rules, you feed the system examples (thousands or millions of them), and it figures out the rules on its own. Show it a million past rides, and it learns to predict how long your Uber will take. Show it billions of watch sessions, and it learns which movie to recommend next.</p><p>This sounds magical, but it&#8217;s just data engineering. Data flows in, patterns get extracted, predictions flow out, and the system keeps learning from its own results.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ewAN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2eb3f62-4db9-4e39-be8f-70728cc4ffc0_4452x585.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ewAN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2eb3f62-4db9-4e39-be8f-70728cc4ffc0_4452x585.png 424w, https://substackcdn.com/image/fetch/$s_!ewAN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2eb3f62-4db9-4e39-be8f-70728cc4ffc0_4452x585.png 848w, https://substackcdn.com/image/fetch/$s_!ewAN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2eb3f62-4db9-4e39-be8f-70728cc4ffc0_4452x585.png 1272w, https://substackcdn.com/image/fetch/$s_!ewAN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2eb3f62-4db9-4e39-be8f-70728cc4ffc0_4452x585.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ewAN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2eb3f62-4db9-4e39-be8f-70728cc4ffc0_4452x585.png" width="1456" height="191" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b2eb3f62-4db9-4e39-be8f-70728cc4ffc0_4452x585.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:191,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:138975,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/195463236?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2eb3f62-4db9-4e39-be8f-70728cc4ffc0_4452x585.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ewAN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2eb3f62-4db9-4e39-be8f-70728cc4ffc0_4452x585.png 424w, https://substackcdn.com/image/fetch/$s_!ewAN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2eb3f62-4db9-4e39-be8f-70728cc4ffc0_4452x585.png 848w, https://substackcdn.com/image/fetch/$s_!ewAN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2eb3f62-4db9-4e39-be8f-70728cc4ffc0_4452x585.png 1272w, https://substackcdn.com/image/fetch/$s_!ewAN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2eb3f62-4db9-4e39-be8f-70728cc4ffc0_4452x585.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Every concept in this newsletter maps to a stage in this pipeline.</p><p>Master the pipeline, master the interview&#8230;</p><div><hr></div><h2><strong>Raw Material: How Data Becomes Intelligence</strong></h2><blockquote><p><em>You can have the fanciest model in the world. If your data is garbage, your predictions will be garbage.</em></p></blockquote><h3><strong>1. Features</strong></h3><p>A <strong>feature</strong> is a single, measurable piece of information model uses to make predictions.</p><p>Think of features as the columns in a spreadsheet that describe each example.</p><p>If you&#8217;re predicting whether someone will click on an ad, your features might include the user&#8217;s age, the time of day, the device they&#8217;re using, and how many ads they&#8217;ve already seen this session. Each of these gives the model a different angle on the same question.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CBM7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F822f0b1f-d688-4fb0-8ba0-bec0204098c5_2368x2205.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CBM7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F822f0b1f-d688-4fb0-8ba0-bec0204098c5_2368x2205.png 424w, https://substackcdn.com/image/fetch/$s_!CBM7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F822f0b1f-d688-4fb0-8ba0-bec0204098c5_2368x2205.png 848w, https://substackcdn.com/image/fetch/$s_!CBM7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F822f0b1f-d688-4fb0-8ba0-bec0204098c5_2368x2205.png 1272w, https://substackcdn.com/image/fetch/$s_!CBM7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F822f0b1f-d688-4fb0-8ba0-bec0204098c5_2368x2205.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CBM7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F822f0b1f-d688-4fb0-8ba0-bec0204098c5_2368x2205.png" width="420" height="391.15384615384613" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/822f0b1f-d688-4fb0-8ba0-bec0204098c5_2368x2205.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1356,&quot;width&quot;:1456,&quot;resizeWidth&quot;:420,&quot;bytes&quot;:238196,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/195463236?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F822f0b1f-d688-4fb0-8ba0-bec0204098c5_2368x2205.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!CBM7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F822f0b1f-d688-4fb0-8ba0-bec0204098c5_2368x2205.png 424w, https://substackcdn.com/image/fetch/$s_!CBM7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F822f0b1f-d688-4fb0-8ba0-bec0204098c5_2368x2205.png 848w, https://substackcdn.com/image/fetch/$s_!CBM7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F822f0b1f-d688-4fb0-8ba0-bec0204098c5_2368x2205.png 1272w, https://substackcdn.com/image/fetch/$s_!CBM7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F822f0b1f-d688-4fb0-8ba0-bec0204098c5_2368x2205.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In Spotify&#8217;s Discover Weekly, features might include your most-played genres, the time of day you usually listen, and how often you skip songs. The model doesn&#8217;t &#8220;hear&#8221; the music. Instead, it reads the features.</p><p>The quality of your features often matters more than the sophistication of your model. Which raises the question:<em> where do good features come from?</em></p><h3><strong>2. Feature Engineering</strong></h3><p><strong>Feature engineering</strong> is the process of transforming raw data into features that help a model learn better.</p><p>Raw data is messy and unstructured. Feature engineering is about cleaning it up, reshaping it, and extracting the signal.</p><p>Think of it like preparing ingredients before cooking. You don&#8217;t throw a whole chicken into the pan. You cut it, season it, and lay it out first.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cAy4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f0855fc-6cbc-4f3f-a9e5-f7c73cf5ac43_4686x824.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cAy4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f0855fc-6cbc-4f3f-a9e5-f7c73cf5ac43_4686x824.png 424w, https://substackcdn.com/image/fetch/$s_!cAy4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f0855fc-6cbc-4f3f-a9e5-f7c73cf5ac43_4686x824.png 848w, https://substackcdn.com/image/fetch/$s_!cAy4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f0855fc-6cbc-4f3f-a9e5-f7c73cf5ac43_4686x824.png 1272w, https://substackcdn.com/image/fetch/$s_!cAy4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f0855fc-6cbc-4f3f-a9e5-f7c73cf5ac43_4686x824.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cAy4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f0855fc-6cbc-4f3f-a9e5-f7c73cf5ac43_4686x824.png" width="1456" height="256" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f0855fc-6cbc-4f3f-a9e5-f7c73cf5ac43_4686x824.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:256,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:176350,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/195463236?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f0855fc-6cbc-4f3f-a9e5-f7c73cf5ac43_4686x824.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!cAy4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f0855fc-6cbc-4f3f-a9e5-f7c73cf5ac43_4686x824.png 424w, https://substackcdn.com/image/fetch/$s_!cAy4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f0855fc-6cbc-4f3f-a9e5-f7c73cf5ac43_4686x824.png 848w, https://substackcdn.com/image/fetch/$s_!cAy4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f0855fc-6cbc-4f3f-a9e5-f7c73cf5ac43_4686x824.png 1272w, https://substackcdn.com/image/fetch/$s_!cAy4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f0855fc-6cbc-4f3f-a9e5-f7c73cf5ac43_4686x824.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>For example, Uber&#8217;s raw data might say <code>&#8220;ride requested at 2024-12-25 08:47:32 UTC.&#8221;</code></p><p>Feature engineering transforms that into: day of week (Wednesday), time of day (morning rush), holiday (yes), weather (rainy). Each transformation gives the model a more useful signal than the raw timestamp alone.</p><p>Sometimes the most powerful features aren&#8217;t in the raw data at all. A feature like <em>&#8220;average number of rides this user takes per week&#8221;</em> requires aggregation across many records. That kind of creativity is what separates good feature engineering from great ones.</p><p>But features alone aren&#8217;t enough. The model also needs to know what the &#8220;right answer&#8221; looks like.</p><h3><strong>3. Labels &amp; Ground Truth</strong></h3><p>A <strong>label</strong> is the answer you&#8217;re training the model to predict. <strong>Ground truth</strong> is what actually happened in the real world.</p><p>If you&#8217;re building a spam filter, the label for each email is &#8220;spam&#8221; or &#8220;not spam.&#8221; If you&#8217;re predicting home prices, the label is the actual sale price. The model learns by comparing its guesses against these known answers.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rz1R!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89296f27-68e3-4dce-9026-8740b013e686_5039x1530.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rz1R!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89296f27-68e3-4dce-9026-8740b013e686_5039x1530.png 424w, https://substackcdn.com/image/fetch/$s_!rz1R!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89296f27-68e3-4dce-9026-8740b013e686_5039x1530.png 848w, https://substackcdn.com/image/fetch/$s_!rz1R!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89296f27-68e3-4dce-9026-8740b013e686_5039x1530.png 1272w, https://substackcdn.com/image/fetch/$s_!rz1R!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89296f27-68e3-4dce-9026-8740b013e686_5039x1530.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rz1R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89296f27-68e3-4dce-9026-8740b013e686_5039x1530.png" width="1456" height="442" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/89296f27-68e3-4dce-9026-8740b013e686_5039x1530.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:442,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:269939,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/195463236?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89296f27-68e3-4dce-9026-8740b013e686_5039x1530.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rz1R!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89296f27-68e3-4dce-9026-8740b013e686_5039x1530.png 424w, https://substackcdn.com/image/fetch/$s_!rz1R!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89296f27-68e3-4dce-9026-8740b013e686_5039x1530.png 848w, https://substackcdn.com/image/fetch/$s_!rz1R!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89296f27-68e3-4dce-9026-8740b013e686_5039x1530.png 1272w, https://substackcdn.com/image/fetch/$s_!rz1R!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F89296f27-68e3-4dce-9026-8740b013e686_5039x1530.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Ground truth sounds simple, but it&#8217;s often surprisingly hard to get right.</p><p>When Netflix asks <em>&#8220;did the user enjoy this movie?&#8221;,</em> the ground truth is ambiguous. Did they watch to the end? Did they rate it? Did they watch something similar next? Different definitions of ground truth lead to different model behaviors.</p><blockquote><p>&#128161; How you define your label shapes what the model actually learns. Choose carefully. Pick the wrong definition of success, and the model will optimize for the wrong thing.</p></blockquote><p>With features and labels defined, the next step is splitting the data so the model can actually learn and prove it learned the right things.</p><h3><strong>4. Training, Validation &amp; Test Sets</strong></h3><p>You don&#8217;t test a student with the same questions they practiced on.</p><p>The same principle applies to ML. The data gets split into three groups, each with a specific job.</p><ol><li><p><strong>Training set</strong> is what the model actually learns from. It sees these examples during training.</p></li><li><p><strong>Validation set</strong> is your mid-training checkpoint. It tells you which model version performs best.</p></li><li><p><strong>Test set</strong> is the final exam. If the model performs well here, it&#8217;s ready for the real world.</p></li></ol><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bgKu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F555a0173-02bf-4359-b0cd-8bf5b78cad8e_2573x1570.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bgKu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F555a0173-02bf-4359-b0cd-8bf5b78cad8e_2573x1570.png 424w, https://substackcdn.com/image/fetch/$s_!bgKu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F555a0173-02bf-4359-b0cd-8bf5b78cad8e_2573x1570.png 848w, https://substackcdn.com/image/fetch/$s_!bgKu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F555a0173-02bf-4359-b0cd-8bf5b78cad8e_2573x1570.png 1272w, https://substackcdn.com/image/fetch/$s_!bgKu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F555a0173-02bf-4359-b0cd-8bf5b78cad8e_2573x1570.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bgKu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F555a0173-02bf-4359-b0cd-8bf5b78cad8e_2573x1570.png" width="521" height="317.75274725274727" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/555a0173-02bf-4359-b0cd-8bf5b78cad8e_2573x1570.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:888,&quot;width&quot;:1456,&quot;resizeWidth&quot;:521,&quot;bytes&quot;:186263,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/195463236?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F555a0173-02bf-4359-b0cd-8bf5b78cad8e_2573x1570.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!bgKu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F555a0173-02bf-4359-b0cd-8bf5b78cad8e_2573x1570.png 424w, https://substackcdn.com/image/fetch/$s_!bgKu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F555a0173-02bf-4359-b0cd-8bf5b78cad8e_2573x1570.png 848w, https://substackcdn.com/image/fetch/$s_!bgKu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F555a0173-02bf-4359-b0cd-8bf5b78cad8e_2573x1570.png 1272w, https://substackcdn.com/image/fetch/$s_!bgKu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F555a0173-02bf-4359-b0cd-8bf5b78cad8e_2573x1570.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Most teams split their data 70/15/15 or 80/10/10.</p><p>The exact ratio depends on how much data you have, but one rule is non-negotiable: test set must never influence model development. Otherwise, you&#8217;ve let the student peek at the final exam.</p><p>At Netflix, this might mean training on viewing data from January through October, validating in November, and testing in December. This time-based split is especially important for ML systems because real-world data changes over time, a pattern we&#8217;ll revisit in Section 5.</p><p>Now that we have our data organized, there&#8217;s one more data problem that trips up many real-world systems.</p><h3><strong>5. Class Imbalance &amp; Data Leakage</strong></h3><p><strong>Class imbalance</strong> happens when one outcome is far more common than the others.</p><p>In fraud detection, maybe 1 in 10,000 transactions is fraudulent. In medical diagnosis, most patients don&#8217;t have the rare disease. The model can achieve 99.99% accuracy by simply predicting &#8220;not fraud&#8221; every time and still be completely useless.</p><p>Fixing class imbalance usually involves techniques like oversampling the rare class, undersampling the common class, or adjusting the model&#8217;s loss function to penalize mistakes on rare examples more heavily.</p><p><strong>Data leakage</strong> occurs when the answer is hidden within the training data.</p><p>You&#8217;re building a model to predict late deliveries, but your dataset includes &#8220;customer complaint filed.&#8221; That complaint only exists because the delivery was already late. Of course, the model looks accurate. Remove that feature, and it&#8217;s useless.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!s70K!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaef5547-0cc8-4aac-8b74-e3897aeedadf_900x400.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!s70K!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaef5547-0cc8-4aac-8b74-e3897aeedadf_900x400.png 424w, https://substackcdn.com/image/fetch/$s_!s70K!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaef5547-0cc8-4aac-8b74-e3897aeedadf_900x400.png 848w, https://substackcdn.com/image/fetch/$s_!s70K!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaef5547-0cc8-4aac-8b74-e3897aeedadf_900x400.png 1272w, https://substackcdn.com/image/fetch/$s_!s70K!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaef5547-0cc8-4aac-8b74-e3897aeedadf_900x400.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!s70K!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaef5547-0cc8-4aac-8b74-e3897aeedadf_900x400.png" width="900" height="400" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/daef5547-0cc8-4aac-8b74-e3897aeedadf_900x400.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:400,&quot;width&quot;:900,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:19106,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/195463236?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaef5547-0cc8-4aac-8b74-e3897aeedadf_900x400.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!s70K!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaef5547-0cc8-4aac-8b74-e3897aeedadf_900x400.png 424w, https://substackcdn.com/image/fetch/$s_!s70K!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaef5547-0cc8-4aac-8b74-e3897aeedadf_900x400.png 848w, https://substackcdn.com/image/fetch/$s_!s70K!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaef5547-0cc8-4aac-8b74-e3897aeedadf_900x400.png 1272w, https://substackcdn.com/image/fetch/$s_!s70K!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdaef5547-0cc8-4aac-8b74-e3897aeedadf_900x400.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><blockquote><p>&#128161; If your model scores above 95% on the first try, check for leakage. If it scores above 99%, check for class imbalance too.</p></blockquote><p>Clean data is only useful if it actually reaches your model. That&#8217;s where pipelines come in.</p><h3><strong>6. Data Pipelines &amp; ETL</strong></h3><p><strong>Data pipelines</strong> are automated workflows that move data from its raw sources (databases, event logs, third-party APIs) through a series of transformations and into a format the model can use.</p><p><strong>ETL</strong> stands for Extract, Transform, Load. Extract the raw data from its source.</p><p>Transform: clean, join, aggregate, and engineer features from it. Load the results into a feature store or a training dataset.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!SV45!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4fc3e29-9d95-4c17-a252-ca24be2f50ed_4446x2080.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SV45!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4fc3e29-9d95-4c17-a252-ca24be2f50ed_4446x2080.png 424w, https://substackcdn.com/image/fetch/$s_!SV45!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4fc3e29-9d95-4c17-a252-ca24be2f50ed_4446x2080.png 848w, https://substackcdn.com/image/fetch/$s_!SV45!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4fc3e29-9d95-4c17-a252-ca24be2f50ed_4446x2080.png 1272w, https://substackcdn.com/image/fetch/$s_!SV45!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4fc3e29-9d95-4c17-a252-ca24be2f50ed_4446x2080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SV45!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4fc3e29-9d95-4c17-a252-ca24be2f50ed_4446x2080.png" width="1456" height="681" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e4fc3e29-9d95-4c17-a252-ca24be2f50ed_4446x2080.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:681,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:341799,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/195463236?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4fc3e29-9d95-4c17-a252-ca24be2f50ed_4446x2080.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!SV45!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4fc3e29-9d95-4c17-a252-ca24be2f50ed_4446x2080.png 424w, https://substackcdn.com/image/fetch/$s_!SV45!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4fc3e29-9d95-4c17-a252-ca24be2f50ed_4446x2080.png 848w, https://substackcdn.com/image/fetch/$s_!SV45!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4fc3e29-9d95-4c17-a252-ca24be2f50ed_4446x2080.png 1272w, https://substackcdn.com/image/fetch/$s_!SV45!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4fc3e29-9d95-4c17-a252-ca24be2f50ed_4446x2080.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This is the plumbing part of ML.</p><p>And like real plumbing, nobody thinks about it until something breaks. Not the model, not the algorithm. A dropped row, a null value, a late pipeline run. No errors thrown, just silently worse predictions.</p><p>Uber runs thousands of data pipelines daily. Everyone has monitoring, alerting, and quality checks. Bring this up in an interview, and you&#8217;ll immediately stand out as the guy who actually thinks about how ML works in practice.</p><p>Pipelines produce data, but how do you keep track of which data a given model was trained on?</p><h3><strong>7. Data Versioning</strong></h3><p><strong>Data versioning</strong> means tracking exactly which version of a dataset was used to train each model.</p><p>Just like software engineers use Git to track code changes, ML teams need to track data changes.</p><p><em>Why does this matter?</em> Imagine your model&#8217;s performance suddenly drops. Without data versioning, you have no way to answer: <em>&#8220;What changed? Was it the model or the data?&#8221; </em>With versioning, you can compare the current training data with previous versions and pinpoint exactly what changed.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qFcN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6eb35d9-1632-4c90-9271-4a7dff5d0819_5032x1090.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qFcN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6eb35d9-1632-4c90-9271-4a7dff5d0819_5032x1090.png 424w, https://substackcdn.com/image/fetch/$s_!qFcN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6eb35d9-1632-4c90-9271-4a7dff5d0819_5032x1090.png 848w, https://substackcdn.com/image/fetch/$s_!qFcN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6eb35d9-1632-4c90-9271-4a7dff5d0819_5032x1090.png 1272w, https://substackcdn.com/image/fetch/$s_!qFcN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6eb35d9-1632-4c90-9271-4a7dff5d0819_5032x1090.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qFcN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6eb35d9-1632-4c90-9271-4a7dff5d0819_5032x1090.png" width="1456" height="315" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d6eb35d9-1632-4c90-9271-4a7dff5d0819_5032x1090.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:315,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:324591,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/195463236?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6eb35d9-1632-4c90-9271-4a7dff5d0819_5032x1090.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!qFcN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6eb35d9-1632-4c90-9271-4a7dff5d0819_5032x1090.png 424w, https://substackcdn.com/image/fetch/$s_!qFcN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6eb35d9-1632-4c90-9271-4a7dff5d0819_5032x1090.png 848w, https://substackcdn.com/image/fetch/$s_!qFcN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6eb35d9-1632-4c90-9271-4a7dff5d0819_5032x1090.png 1272w, https://substackcdn.com/image/fetch/$s_!qFcN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd6eb35d9-1632-4c90-9271-4a7dff5d0819_5032x1090.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Data versioning also enables <strong>reproducibility</strong>, a requirement in regulated industries like finance and healthcare.</p><p>If an auditor asks, &#8220;Why did the model make this decision six months ago?&#8221;, you need to be able to recreate the exact model and training data from that point in time.</p><p>Tools like <strong>DVC</strong> (Data Version Control) and MLflow help teams manage this.</p><p>In an interview, mentioning data versioning shows you understand that ML systems aren&#8217;t just about models. They&#8217;re about the entire lifecycle of data and code working together.</p><p>With clean, well-structured, and tracked data in hand, it&#8217;s time to teach the model how to find patterns in it.</p><div><hr></div><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/machine-learning-system-design-interview?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="CaptionedButtonToDOM"><div class="preamble"><p class="cta-caption"><em>Share this post &amp; get rewards for the referrals.</em></p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/machine-learning-system-design-interview?utm_source=substack&utm_medium=email&utm_content=share&action=share&quot;,&quot;text&quot;:&quot;Share&quot;}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://newsletter.systemdesign.one/p/machine-learning-system-design-interview?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><div><hr></div><h2><strong>Pattern Machines: How Models Actually Learn</strong></h2><blockquote><p>A model doesn&#8217;t &#8220;know&#8221; anything. It finds patterns in data and uses them to make predictions.</p></blockquote><h3><strong>8. Model Training &amp; Loss Functions</strong></h3><p><strong>Model training</strong> is the process of showing the model examples and letting it adjust its internal settings until its predictions get closer to the ground truth.</p><p>Think of it as a student taking practice tests over and over, getting a little better each time.</p><p>The mechanism that drives improvement is the <strong>loss function</strong>. A loss function measures how wrong the model&#8217;s predictions are. After each batch of examples, the model calculates the loss (how far off it was) and adjusts its internal settings to reduce that number.</p><p>Over millions of examples, those small adjustments add up.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zsR_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4216f281-5cca-4a0b-a9a7-25992d4b09fc_5031x637.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zsR_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4216f281-5cca-4a0b-a9a7-25992d4b09fc_5031x637.png 424w, https://substackcdn.com/image/fetch/$s_!zsR_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4216f281-5cca-4a0b-a9a7-25992d4b09fc_5031x637.png 848w, https://substackcdn.com/image/fetch/$s_!zsR_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4216f281-5cca-4a0b-a9a7-25992d4b09fc_5031x637.png 1272w, https://substackcdn.com/image/fetch/$s_!zsR_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4216f281-5cca-4a0b-a9a7-25992d4b09fc_5031x637.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zsR_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4216f281-5cca-4a0b-a9a7-25992d4b09fc_5031x637.png" width="1456" height="184" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4216f281-5cca-4a0b-a9a7-25992d4b09fc_5031x637.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:184,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:167743,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/195463236?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4216f281-5cca-4a0b-a9a7-25992d4b09fc_5031x637.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zsR_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4216f281-5cca-4a0b-a9a7-25992d4b09fc_5031x637.png 424w, https://substackcdn.com/image/fetch/$s_!zsR_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4216f281-5cca-4a0b-a9a7-25992d4b09fc_5031x637.png 848w, https://substackcdn.com/image/fetch/$s_!zsR_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4216f281-5cca-4a0b-a9a7-25992d4b09fc_5031x637.png 1272w, https://substackcdn.com/image/fetch/$s_!zsR_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4216f281-5cca-4a0b-a9a7-25992d4b09fc_5031x637.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Different problems need different loss functions.</p><p>Predicting a number (like Uber&#8217;s ETA) might use mean squared error, penalizing big misses more than small ones. Classifying something (like spam vs. not spam) typically uses cross-entropy loss, which measures how confident the model was in the wrong answer.</p><p>The choice of loss function shapes what the model optimizes for. A model trained with mean squared error will try to be accurate on average. A model trained with mean absolute error will be more robust to outliers. Small decisions here have big downstream effects.</p><p>But what exactly is the model adjusting? That&#8217;s where parameters come in.</p><h3><strong>9. Parameters &amp; Hyperparameters</strong></h3><p><strong>Parameters</strong> are what the model actually learns.</p><p>Think of them as the model&#8217;s memory: every pattern gets encoded as a number. GPT-4 has hundreds of billions. A simple recommendation model, a few million. You don&#8217;t write them. The model discovers them on its own.</p><p><strong>Hyperparameters</strong> are the settings that control how the model trains.</p><p>You set them before training starts: how fast the model adjusts (learning rate), how many examples it processes at once (batch size), how many times it loops through the data (epochs), and the model&#8217;s architecture.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sg4t!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59b4f090-5343-4484-8587-ff1e0c52fecd_900x400.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sg4t!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59b4f090-5343-4484-8587-ff1e0c52fecd_900x400.png 424w, https://substackcdn.com/image/fetch/$s_!sg4t!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59b4f090-5343-4484-8587-ff1e0c52fecd_900x400.png 848w, https://substackcdn.com/image/fetch/$s_!sg4t!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59b4f090-5343-4484-8587-ff1e0c52fecd_900x400.png 1272w, https://substackcdn.com/image/fetch/$s_!sg4t!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59b4f090-5343-4484-8587-ff1e0c52fecd_900x400.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sg4t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59b4f090-5343-4484-8587-ff1e0c52fecd_900x400.png" width="900" height="400" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/59b4f090-5343-4484-8587-ff1e0c52fecd_900x400.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:400,&quot;width&quot;:900,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:24095,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/195463236?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59b4f090-5343-4484-8587-ff1e0c52fecd_900x400.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!sg4t!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59b4f090-5343-4484-8587-ff1e0c52fecd_900x400.png 424w, https://substackcdn.com/image/fetch/$s_!sg4t!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59b4f090-5343-4484-8587-ff1e0c52fecd_900x400.png 848w, https://substackcdn.com/image/fetch/$s_!sg4t!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59b4f090-5343-4484-8587-ff1e0c52fecd_900x400.png 1272w, https://substackcdn.com/image/fetch/$s_!sg4t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59b4f090-5343-4484-8587-ff1e0c52fecd_900x400.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>If the model is a student, parameters are the knowledge in their head, and hyperparameters are the study plan: <em>how many hours a day, which subjects first, and how many practice tests.</em></p><p>Bad hyperparameters can make a good model fail.</p><p>A learning rate that&#8217;s too high, and the model never converges. Too low, and it takes forever to train. Too few epochs and it underfits. Too many and it overfits. In practice, teams run many training experiments with different hyperparameters and compare results on the validation set.</p><p>There&#8217;s one type of parameter that powers almost every ML system you&#8217;ll encounter in interviews: embeddings.</p><h3><strong>10. Embeddings</strong></h3><p>An <strong>embedding</strong> is a way to represent something (a word, a user, a product) as a list of numbers that captures its meaning.</p><p>Instead of treating &#8220;cat&#8221; and &#8220;kitten&#8221; as completely different labels, embeddings place them close together in a vectorial space because they&#8217;re related concepts.</p><p>Think of it as a map. On a regular map, cities that are near each other geographically are plotted close together. In an embedding space, concepts that are similar in meaning are plotted close together. &#8220;Comedy&#8221; and &#8220;rom-com&#8221; would be neighbors; &#8220;horror&#8221; would be distant, but still in the same galaxy as other genres. &#8220;Accounting&#8221; would be in another universe.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CUND!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb95cf045-9819-4032-b782-816ea117eca9_700x500.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CUND!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb95cf045-9819-4032-b782-816ea117eca9_700x500.png 424w, https://substackcdn.com/image/fetch/$s_!CUND!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb95cf045-9819-4032-b782-816ea117eca9_700x500.png 848w, https://substackcdn.com/image/fetch/$s_!CUND!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb95cf045-9819-4032-b782-816ea117eca9_700x500.png 1272w, https://substackcdn.com/image/fetch/$s_!CUND!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb95cf045-9819-4032-b782-816ea117eca9_700x500.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CUND!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb95cf045-9819-4032-b782-816ea117eca9_700x500.png" width="700" height="500" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b95cf045-9819-4032-b782-816ea117eca9_700x500.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:500,&quot;width&quot;:700,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:24501,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/195463236?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb95cf045-9819-4032-b782-816ea117eca9_700x500.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!CUND!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb95cf045-9819-4032-b782-816ea117eca9_700x500.png 424w, https://substackcdn.com/image/fetch/$s_!CUND!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb95cf045-9819-4032-b782-816ea117eca9_700x500.png 848w, https://substackcdn.com/image/fetch/$s_!CUND!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb95cf045-9819-4032-b782-816ea117eca9_700x500.png 1272w, https://substackcdn.com/image/fetch/$s_!CUND!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb95cf045-9819-4032-b782-816ea117eca9_700x500.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Embeddings are everywhere in real ML systems.</p><p>Spotify uses song embeddings to find tracks that are musically similar to what you&#8217;ve been listening to. Netflix uses movie embeddings and user embeddings to match viewers with films they&#8217;re likely to enjoy.</p><p>Embeddings are how ML systems make sense of the real world. A user, a product, a sentence. Turn them into vectors, and suddenly you can calculate which ones are similar, which ones are related, and which ones to recommend.</p><p>With all this learning machinery, there&#8217;s a critical danger: the model might learn too well.</p><div class="callout-block" data-callout="true"><p><em><strong>Reminder: this is a teaser of the subscriber-only newsletter, exclusive to my golden members.</strong></em></p><p>When you upgrade, you&#8217;ll get:</p><ul><li><p><strong>High-level architecture of real-world systems.</strong></p></li><li><p>Deep dive into how popular real-world systems work.</p></li><li><p><strong>How real-world systems handle scale, reliability, and performance.</strong></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe&quot;,&quot;text&quot;:&quot;Unlock Full Access&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://newsletter.systemdesign.one/subscribe"><span>Unlock Full Access</span></a></p><p>Let&#8217;s keep going!</p></div><h3><strong>11. Overfitting &amp; Regularization</strong></h3>
      <p>
          <a href="https://newsletter.systemdesign.one/p/machine-learning-system-design-interview">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[I struggled with mobile system design until I learned these 53 concepts]]></title><description><![CDATA[#145: Part 2 - Conflict resolution, certificate pinning, rendering performance, and 17 others.]]></description><link>https://newsletter.systemdesign.one/p/mobile-system-design-concepts</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/mobile-system-design-concepts</guid><dc:creator><![CDATA[Shefali Jangid]]></dc:creator><pubDate>Thu, 07 May 2026 09:22:29 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/a52a5973-7a78-4ca1-81bf-1e1c1d55883a_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Get my system design playbook for FREE on newsletter signup:</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><ul><li><p><em><a href="https://newsletter.systemdesign.one/p/mobile-system-design-concepts/?action=share">Share this post</a> &amp; I'll send you some rewards for the referrals.</em></p></li><li><p><em>Block diagrams created using <a href="https://app.eraser.io/auth/sign-up?ref=neo">Eraser</a>.</em></p></li></ul><div><hr></div><p>Onwards &#8216;n downwards:</p><p>Following is the second of a premium 3-part newsletter series&#8230;</p><p>If you design backend systems and want to avoid building APIs that break under flaky networks, retries, and real-world usage patterns&#8230; read this newsletter and start designing for production apps&#8230;</p><p>On with part 2 of the newsletter:</p><div><hr></div><h2><strong><a href="http://a0.to/1kh">Less prototype. More production. &#128640; (Partner)</a></strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="http://a0.to/1kh" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5MG0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcae9d50a-7a0d-4bd0-b5e8-3d70a9271254_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!5MG0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcae9d50a-7a0d-4bd0-b5e8-3d70a9271254_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!5MG0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcae9d50a-7a0d-4bd0-b5e8-3d70a9271254_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!5MG0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcae9d50a-7a0d-4bd0-b5e8-3d70a9271254_1920x1080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5MG0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcae9d50a-7a0d-4bd0-b5e8-3d70a9271254_1920x1080.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cae9d50a-7a0d-4bd0-b5e8-3d70a9271254_1920x1080.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:148023,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;http://a0.to/1kh&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/195272243?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcae9d50a-7a0d-4bd0-b5e8-3d70a9271254_1920x1080.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!5MG0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcae9d50a-7a0d-4bd0-b5e8-3d70a9271254_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!5MG0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcae9d50a-7a0d-4bd0-b5e8-3d70a9271254_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!5MG0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcae9d50a-7a0d-4bd0-b5e8-3d70a9271254_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!5MG0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcae9d50a-7a0d-4bd0-b5e8-3d70a9271254_1920x1080.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The biggest hurdle for AI Agents in production is trust.</p><p>Hard-coded credentials work for a demo, but production agents need a way to handle critical actions&#8212;like making a purchase or sending a document&#8212;without over-privileged access.</p><p><strong><a href="http://a0.to/1kh">Auth0 for AI Agents</a></strong> features <strong>Asynchronous Authorization</strong> backchannel authentication (CIBA), so your agents can work autonomously in the background and only trigger a notification when human approval is required.</p><ul><li><p><strong>Rich Consent:</strong> Agents render specific authorization data so users know exactly what they are approving.</p></li><li><p><strong>Secure User Identity:</strong> Link agent actions directly to specific user preferences and history.</p></li></ul><p>Move past the &#8220;framework&#8221; stage and build agentic workflows that are secure by design.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;http://a0.to/1kh&quot;,&quot;text&quot;:&quot;Start building for $0&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="http://a0.to/1kh"><span>Start building for $0</span></a></p><p>And stop worrying about DIY-ing auth.</p><p>(Thanks to <strong><a href="http://a0.to/1kh">Auth0</a></strong> for partnering on this post.)</p><div><hr></div><p>In this newsletter, you&#8217;ll learn 20 more concepts:</p><ol start="20"><li><p>Conflict Resolution Strategies,</p></li><li><p>Delta Sync,</p></li><li><p>Eventual Consistency in Mobile Systems,</p></li><li><p>Background Sync &amp; Retry Queues,</p></li><li><p>Optimistic UI Updates,</p></li><li><p>Authentication (JWT/OAuth),</p></li><li><p>Secure Token Storage,</p></li><li><p>Certificate Pinning,</p></li><li><p>Biometric Authentication,</p></li><li><p>Code Obfuscation &amp; Tamper Detection,</p></li><li><p>Secure Deep Linking,</p></li><li><p>User Data Privacy,</p></li><li><p>App Lifecycle &amp; State Management,</p></li><li><p>Background Processing Limits,</p></li><li><p>Battery Optimisation,</p></li><li><p>Network Optimisation &amp; Rate Limiting,</p></li><li><p>Startup Time Optimisation,</p></li><li><p>Rendering Performance,</p></li><li><p>Memory Management &amp; Leak Prevention,</p></li><li><p>App Size Optimisation.</p></li></ol><p>(&#8230;and much more in part 3!)</p><p>For each concept, I&#8217;ll cover:</p><ul><li><p>What it is and how it works</p></li><li><p>Real-world example</p></li><li><p>The tradeoffs</p></li><li><p>Why it matters for mobile</p></li></ul><p>Let&#8217;s get into it&#8230;</p><div><hr></div><p>I want to reintroduce <strong><a href="https://x.com/Shefali__J">Shefali Jangid</a></strong> as a guest author.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://x.com/Shefali__J" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!grPx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe7703d2-7046-46fc-b7cb-4b0c2caac2e6_900x480.png 424w, https://substackcdn.com/image/fetch/$s_!grPx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe7703d2-7046-46fc-b7cb-4b0c2caac2e6_900x480.png 848w, https://substackcdn.com/image/fetch/$s_!grPx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe7703d2-7046-46fc-b7cb-4b0c2caac2e6_900x480.png 1272w, https://substackcdn.com/image/fetch/$s_!grPx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe7703d2-7046-46fc-b7cb-4b0c2caac2e6_900x480.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!grPx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe7703d2-7046-46fc-b7cb-4b0c2caac2e6_900x480.png" width="900" height="480" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/be7703d2-7046-46fc-b7cb-4b0c2caac2e6_900x480.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:480,&quot;width&quot;:900,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://x.com/Shefali__J&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!grPx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe7703d2-7046-46fc-b7cb-4b0c2caac2e6_900x480.png 424w, https://substackcdn.com/image/fetch/$s_!grPx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe7703d2-7046-46fc-b7cb-4b0c2caac2e6_900x480.png 848w, https://substackcdn.com/image/fetch/$s_!grPx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe7703d2-7046-46fc-b7cb-4b0c2caac2e6_900x480.png 1272w, https://substackcdn.com/image/fetch/$s_!grPx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbe7703d2-7046-46fc-b7cb-4b0c2caac2e6_900x480.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>She&#8217;s a web developer, technical writer, and content creator with a love for frontend architecture and building things that scale.</p><p>Check out her work and socials:</p><ul><li><p><a href="https://shefali.dev/">Shefali.dev</a></p></li><li><p><a href="https://github.com/WebdevShefali">GitHub</a></p></li><li><p><a href="https://x.com/Shefali__J">Twitter</a></p></li></ul><p>You&#8217;ll often find her writing about web development, sharing UI tips, and building tools that make developers&#8217; lives easier.</p><div><hr></div><h1><strong>Data Sync</strong></h1><p>When apps store data on the device, they also need to keep that data in sync with the server.</p><p>This section explains how apps synchronize data, handle conflicts when changes occur across multiple places, and maintain app consistency even when the network connection is slow or unreliable.</p><h3><strong>20. Conflict Resolution Strategies</strong></h3><p>When mobile apps allow users to edit data offline, a new challenge appears: <em>conflicts</em>.</p><h4><strong>Why Conflicts Happen</strong></h4><p>Imagine two users editing the same document:</p><ol><li><p>User A edits the document while offline.</p></li><li><p>User B edits the same document at the same time.</p></li><li><p>Later, both devices reconnect and try to sync.</p></li></ol><p>Now, the server has two different versions of the same data. The system must decide how to merge or choose between them.</p><p>To solve this problem, apps use various conflict-resolution strategies.</p><h4><strong>Common Conflict Resolution Strategies</strong></h4><p>There are several ways apps handle these conflicts:</p><p><strong>a. Last-Write-Wins (LWW)</strong></p><p>This is the simplest approach.</p><p>Each update includes a &#8220;timestamp&#8221;. When two versions conflict, the system keeps the latest update and discards the older one.</p><p>For example:</p><ul><li><p>User A updates at 10:01 p.m.</p></li><li><p>User B updates at 10:02 p.m.</p></li></ul><p>Since User B&#8217;s change happened later, the system keeps that version.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aBrj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95138bc4-c285-4d2e-b84f-b0d208006ef6_1231x497.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aBrj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95138bc4-c285-4d2e-b84f-b0d208006ef6_1231x497.png 424w, https://substackcdn.com/image/fetch/$s_!aBrj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95138bc4-c285-4d2e-b84f-b0d208006ef6_1231x497.png 848w, https://substackcdn.com/image/fetch/$s_!aBrj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95138bc4-c285-4d2e-b84f-b0d208006ef6_1231x497.png 1272w, https://substackcdn.com/image/fetch/$s_!aBrj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95138bc4-c285-4d2e-b84f-b0d208006ef6_1231x497.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aBrj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95138bc4-c285-4d2e-b84f-b0d208006ef6_1231x497.png" width="1231" height="497" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/95138bc4-c285-4d2e-b84f-b0d208006ef6_1231x497.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:497,&quot;width&quot;:1231,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!aBrj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95138bc4-c285-4d2e-b84f-b0d208006ef6_1231x497.png 424w, https://substackcdn.com/image/fetch/$s_!aBrj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95138bc4-c285-4d2e-b84f-b0d208006ef6_1231x497.png 848w, https://substackcdn.com/image/fetch/$s_!aBrj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95138bc4-c285-4d2e-b84f-b0d208006ef6_1231x497.png 1272w, https://substackcdn.com/image/fetch/$s_!aBrj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95138bc4-c285-4d2e-b84f-b0d208006ef6_1231x497.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This approach is simple to implement and works well for simple data, but earlier changes may be lost.</p><p><strong>b. Versioning</strong></p><p>Versioning tracks different versions of the same data.</p><p>Each update increases the version number or records which device made the change. When a conflict occurs, the system can compare the versions and either automatically merge them or ask the user to choose.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!HIik!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ad6beb2-1bf2-41ba-ba6c-1a7a5c6a8f71_1379x468.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!HIik!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ad6beb2-1bf2-41ba-ba6c-1a7a5c6a8f71_1379x468.png 424w, https://substackcdn.com/image/fetch/$s_!HIik!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ad6beb2-1bf2-41ba-ba6c-1a7a5c6a8f71_1379x468.png 848w, https://substackcdn.com/image/fetch/$s_!HIik!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ad6beb2-1bf2-41ba-ba6c-1a7a5c6a8f71_1379x468.png 1272w, https://substackcdn.com/image/fetch/$s_!HIik!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ad6beb2-1bf2-41ba-ba6c-1a7a5c6a8f71_1379x468.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!HIik!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ad6beb2-1bf2-41ba-ba6c-1a7a5c6a8f71_1379x468.png" width="1379" height="468" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5ad6beb2-1bf2-41ba-ba6c-1a7a5c6a8f71_1379x468.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:468,&quot;width&quot;:1379,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!HIik!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ad6beb2-1bf2-41ba-ba6c-1a7a5c6a8f71_1379x468.png 424w, https://substackcdn.com/image/fetch/$s_!HIik!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ad6beb2-1bf2-41ba-ba6c-1a7a5c6a8f71_1379x468.png 848w, https://substackcdn.com/image/fetch/$s_!HIik!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ad6beb2-1bf2-41ba-ba6c-1a7a5c6a8f71_1379x468.png 1272w, https://substackcdn.com/image/fetch/$s_!HIik!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ad6beb2-1bf2-41ba-ba6c-1a7a5c6a8f71_1379x468.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This approach is more flexible, but requires extra logic to manage versions.</p><p><strong>c. CRDTs (Conflict-Free Replicated Data Types)</strong></p><p>CRDTs are special data structures designed to merge changes automatically without conflicts.</p><p>They use mathematical rules that ensure that different versions of the same data can always be merged into a single, consistent result, even when updates occur in different places.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Io21!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dfc33dd-b95e-42e5-ae73-de648c9479d2_1407x500.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Io21!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dfc33dd-b95e-42e5-ae73-de648c9479d2_1407x500.png 424w, https://substackcdn.com/image/fetch/$s_!Io21!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dfc33dd-b95e-42e5-ae73-de648c9479d2_1407x500.png 848w, https://substackcdn.com/image/fetch/$s_!Io21!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dfc33dd-b95e-42e5-ae73-de648c9479d2_1407x500.png 1272w, https://substackcdn.com/image/fetch/$s_!Io21!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dfc33dd-b95e-42e5-ae73-de648c9479d2_1407x500.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Io21!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dfc33dd-b95e-42e5-ae73-de648c9479d2_1407x500.png" width="1407" height="500" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7dfc33dd-b95e-42e5-ae73-de648c9479d2_1407x500.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:500,&quot;width&quot;:1407,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Io21!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dfc33dd-b95e-42e5-ae73-de648c9479d2_1407x500.png 424w, https://substackcdn.com/image/fetch/$s_!Io21!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dfc33dd-b95e-42e5-ae73-de648c9479d2_1407x500.png 848w, https://substackcdn.com/image/fetch/$s_!Io21!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dfc33dd-b95e-42e5-ae73-de648c9479d2_1407x500.png 1272w, https://substackcdn.com/image/fetch/$s_!Io21!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7dfc33dd-b95e-42e5-ae73-de648c9479d2_1407x500.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This approach is often used in real-time collaboration tools.</p><h4><strong>Why It Matters</strong></h4><p>Without a proper conflict strategy, one user&#8217;s changes might silently overwrite another user&#8217;s work.</p><p>For example, someone may edit a document, sync it later, and suddenly see that their changes have disappeared.</p><p>This can break user trust and cause data loss.</p><h4><strong>Real-World Example</strong></h4><p>Many well-known applications use these strategies:</p><ul><li><p>Figma and Notion use &#8220;CRDT&#8221; based systems to support real-time collaborative editing.</p></li><li><p>Dropbox often uses a &#8220;last-write-wins&#8221; approach and may generate a &#8220;conflicted copy&#8221; when it cannot merge two versions.</p></li></ul><h4><strong>Trade-offs</strong></h4><p>Each approach has its advantages and limitations:</p><ul><li><p><strong>Last-Write-Wins: </strong>Very simple to implement, but can cause data loss because earlier changes may be overwritten.</p></li><li><p><strong>CRDTs:</strong> Automatically merge changes without conflicts, but are complex to implement and not suitable for every type of data.</p></li><li><p><strong>Versioning:</strong> Keeps track of multiple changes clearly, but may require users to manually resolve conflicts.</p></li></ul><p>Once conflicts can be resolved safely, syncing becomes more efficient when only changes are transferred.</p><div><hr></div><p><em><strong>Reminder: this is a teaser of the subscriber-only newsletter, exclusive to my golden members.</strong></em></p><p>When you upgrade, you&#8217;ll get:</p><ul><li><p><strong>High-level architecture of real-world systems.</strong></p></li><li><p>Deep dive into how popular real-world systems work.</p></li><li><p><strong>How real-world systems handle scale, reliability, and performance.</strong></p></li></ul><p>And much more!</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe&quot;,&quot;text&quot;:&quot;Unlock Full Access&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://newsletter.systemdesign.one/subscribe"><span>Unlock Full Access</span></a></p><div><hr></div><h3><strong>21. Delta Sync</strong></h3><p>When mobile apps sync data with a server, downloading the entire dataset every time can be slow and waste a lot of data. This is especially true for apps that store large amounts of information.</p><p>To make syncing more efficient, many apps use a technique called delta sync.</p><p>Delta sync means the app downloads only the data that has changed since the last sync, rather than downloading everything again.</p><h4><strong>How It Works</strong></h4><p>When the app syncs for the first time, it downloads the full dataset from the server.</p><p>After that, the server gives the app a <strong>sync token</strong> or <strong>timestamp</strong> that represents the latest state of the data.</p><p>On the next sync:</p><ol><li><p>App sends the last sync token to the server.</p></li><li><p>The server checks what has changed since that token.</p></li><li><p>Server sends only new, updated, or deleted records.</p></li></ol><p>This makes syncing much faster and more efficient.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!z3IL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08664bf6-a3f8-4fbb-910f-2e0d90ac6639_1669x652.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!z3IL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08664bf6-a3f8-4fbb-910f-2e0d90ac6639_1669x652.png 424w, https://substackcdn.com/image/fetch/$s_!z3IL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08664bf6-a3f8-4fbb-910f-2e0d90ac6639_1669x652.png 848w, https://substackcdn.com/image/fetch/$s_!z3IL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08664bf6-a3f8-4fbb-910f-2e0d90ac6639_1669x652.png 1272w, https://substackcdn.com/image/fetch/$s_!z3IL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08664bf6-a3f8-4fbb-910f-2e0d90ac6639_1669x652.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!z3IL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08664bf6-a3f8-4fbb-910f-2e0d90ac6639_1669x652.png" width="1456" height="569" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/08664bf6-a3f8-4fbb-910f-2e0d90ac6639_1669x652.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:569,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!z3IL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08664bf6-a3f8-4fbb-910f-2e0d90ac6639_1669x652.png 424w, https://substackcdn.com/image/fetch/$s_!z3IL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08664bf6-a3f8-4fbb-910f-2e0d90ac6639_1669x652.png 848w, https://substackcdn.com/image/fetch/$s_!z3IL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08664bf6-a3f8-4fbb-910f-2e0d90ac6639_1669x652.png 1272w, https://substackcdn.com/image/fetch/$s_!z3IL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F08664bf6-a3f8-4fbb-910f-2e0d90ac6639_1669x652.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4><strong>Why It Matters</strong></h4><p>Imagine a contacts app with 5,000 contacts.</p><p>If the app downloaded all contacts every time it synced, it would waste a large amount of bandwidth and battery. With delta sync, the app downloads only the contacts that were added or changed, saving both data and processing time.</p><p>This makes background syncing practical even on mobile networks.</p><h4><strong>Real-World Example</strong></h4><p>Many well-known platforms use delta syncing:</p><ul><li><p>Google Contacts uses a &#8220;syncToken&#8221; to track changes.</p></li><li><p>Apple CloudKit uses a &#8220;serverChangeToken&#8221; for the same purpose.</p></li></ul><p>The app stores this token and sends it during the next sync request, so the server knows exactly what updates to return.</p><h4><strong>Trade-offs</strong></h4><p>Delta sync improves efficiency but requires extra work on the server.</p><p>The server must keep track of which data has changed. This usually means storing timestamps or maintaining a change log.</p><p>Deletions must also be tracked. Instead of completely removing a record, the system may temporarily store a &#8220;tombstone&#8221; record that indicates the item was deleted, so the client knows to remove it as well.</p><h4><strong>Practical Tip</strong></h4><p>The sync system should rely on timestamps or sequence numbers generated by the server, not the client.</p><p>Client devices may have incorrect clocks, which can cause sync problems. Using a server-controlled timestamp or sequence number ensures that the order of updates is always correct.</p><p>Even with efficient syncing methods like delta sync, distributed systems can still struggle to maintain perfect consistency across devices.</p><h3><strong>22. Eventual Consistency</strong></h3><p>Mobile apps often run in environments with slow, unstable, or completely unavailable network connections. Because of this, different devices may not always have the exact same data at the same time.</p><p>This situation is called eventual consistency.</p><p>Eventual consistency means that data may temporarily differ across devices, but all devices will eventually reach the same state once they sync with the server.</p><h4><strong>How It Works</strong></h4><p>In mobile apps, users may perform actions while offline or on unstable networks.</p><p>For example:</p><ol><li><p>A user updates some data on their phone.</p></li><li><p>The change gets saved locally on the device.</p></li><li><p>When the network connection becomes available, the app sends the update to the server.</p></li><li><p>Server then sends the updated data to other devices.</p></li></ol><p>For a short period, different devices may show slightly different versions of the data, but eventually they all become consistent after syncing.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!U1-j!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F871319e6-aa34-402f-9865-c0db83082766_2048x738.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!U1-j!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F871319e6-aa34-402f-9865-c0db83082766_2048x738.png 424w, https://substackcdn.com/image/fetch/$s_!U1-j!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F871319e6-aa34-402f-9865-c0db83082766_2048x738.png 848w, https://substackcdn.com/image/fetch/$s_!U1-j!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F871319e6-aa34-402f-9865-c0db83082766_2048x738.png 1272w, https://substackcdn.com/image/fetch/$s_!U1-j!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F871319e6-aa34-402f-9865-c0db83082766_2048x738.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!U1-j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F871319e6-aa34-402f-9865-c0db83082766_2048x738.png" width="1456" height="525" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/871319e6-aa34-402f-9865-c0db83082766_2048x738.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:525,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!U1-j!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F871319e6-aa34-402f-9865-c0db83082766_2048x738.png 424w, https://substackcdn.com/image/fetch/$s_!U1-j!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F871319e6-aa34-402f-9865-c0db83082766_2048x738.png 848w, https://substackcdn.com/image/fetch/$s_!U1-j!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F871319e6-aa34-402f-9865-c0db83082766_2048x738.png 1272w, https://substackcdn.com/image/fetch/$s_!U1-j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F871319e6-aa34-402f-9865-c0db83082766_2048x738.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4><strong>Why It Matters</strong></h4><p>Trying to keep data perfectly synchronized at all times would require the app to wait for the server to confirm every action before updating the interface.</p><p>This would make the app feel slow and unresponsive.</p><p>Instead, mobile apps usually update the UI immediately, while &#8204;server synchronization happens in the background.</p><p>This approach makes the app feel fast and responsive while still keeping the data consistent over time.</p><h4><strong>Real-World Example</strong></h4><p>Messaging apps are a common example of eventual consistency.</p><p>For example, WhatsApp shows different message states:</p><ul><li><p>A single check mark means the message has been sent from the device.</p></li><li><p>A double check mark means the message has been delivered to the recipient.</p></li></ul><p>The message appears in the chat immediately, even before the server fully confirms it. Later, the status updates when the system finishes syncing.</p><h4><strong>Trade-offs</strong></h4><p>Eventual consistency improves user experience, but it also introduces some challenges&#8230;</p><p>Sometimes the server may reject a change or update the data differently. When this happens, the app must update the UI carefully to avoid confusing the user.</p><p>To handle this, many apps display clear states such as pending, confirmed, or failed. This helps users understand what is happening with their actions.</p><p>To handle temporary failures during syncing, apps often rely on background processes that automatically retry operations, as discussed in the next section.</p><h3><strong>23. Background Sync &amp; Retry Queues</strong></h3><p>Mobile apps often perform actions that need to be sent to a server, such as sending a message, liking a post, or submitting a form. But sometimes the network connection may be weak or unavailable, causing these actions to fail.</p><p>Instead of losing these actions, apps use a system called a retry queue.</p><p>A retry queue stores failed operations locally on the device so they can be retried later when the network connection is available.</p><p>Mobile operating systems also provide tools that allow apps to perform tasks in the background efficiently.</p><p>For example:</p><ul><li><p><a href="https://developer.android.com/reference/androidx/work/WorkManager">WorkManager</a> on Android</p></li><li><p><a href="https://developer.apple.com/documentation/backgroundtasks/bgtaskscheduler">BGTaskScheduler</a> on iOS</p></li></ul><p>These tools allow apps to run background tasks while managing battery usage and system resources.</p><h4><strong>How It Works</strong></h4><p>When a user performs an action that requires a network request, the app tries to send it to the server:</p><ol><li><p>User performs an action (for example, sending a message).</p></li><li><p>If the request succeeds, the server processes it normally.</p></li><li><p>If the request fails because of network issues, the app stores the action in a retry queue.</p></li><li><p>When the device reconnects to the network, a background sync process retries the queued operations.</p></li><li><p>Once the server confirms the request, the action is removed from the queue.</p></li></ol><p>This ensures that user actions are not lost even when the network is unreliable.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9-82!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9063e738-434c-43db-ba3c-4e99fa459d66_1876x548.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9-82!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9063e738-434c-43db-ba3c-4e99fa459d66_1876x548.png 424w, https://substackcdn.com/image/fetch/$s_!9-82!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9063e738-434c-43db-ba3c-4e99fa459d66_1876x548.png 848w, https://substackcdn.com/image/fetch/$s_!9-82!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9063e738-434c-43db-ba3c-4e99fa459d66_1876x548.png 1272w, https://substackcdn.com/image/fetch/$s_!9-82!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9063e738-434c-43db-ba3c-4e99fa459d66_1876x548.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9-82!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9063e738-434c-43db-ba3c-4e99fa459d66_1876x548.png" width="1456" height="425" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9063e738-434c-43db-ba3c-4e99fa459d66_1876x548.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:425,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!9-82!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9063e738-434c-43db-ba3c-4e99fa459d66_1876x548.png 424w, https://substackcdn.com/image/fetch/$s_!9-82!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9063e738-434c-43db-ba3c-4e99fa459d66_1876x548.png 848w, https://substackcdn.com/image/fetch/$s_!9-82!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9063e738-434c-43db-ba3c-4e99fa459d66_1876x548.png 1272w, https://substackcdn.com/image/fetch/$s_!9-82!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9063e738-434c-43db-ba3c-4e99fa459d66_1876x548.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4><strong>Why It Matters</strong></h4><p>Users expect their actions to work, even if the network connection is unstable.</p><p>For example, if a user taps &#8220;send message&#8221; or &#8220;like&#8221;, the app should not simply ignore the action because the network was unavailable.</p><p>By storing the action and retrying it later, the app respects the user&#8217;s intent and completes the action when conditions improve.</p><h4><strong>Real-World Example</strong></h4><p>Many apps use retry queues and background syncing:</p><ul><li><p>Email apps like Gmail and Outlook allow users to send emails while offline. The email is queued and automatically sent when the network returns.</p></li><li><p>E-commerce apps may queue actions such as adding items to a cart or saving user activity and sync them later.</p></li></ul><h4><strong>Trade-offs</strong></h4><p>Background processing on mobile devices has limitations.</p><p>Operating systems control how long apps can run in the background to protect battery life. These background windows are usually short and unpredictable. Because of this, apps should not rely only on background syncing. Synchronization should also happen when the user opens the app again.</p><p>These mechanisms also allow the app&#8217;s interface to respond instantly, while the actual synchronization happens quietly in the background.</p><h3><strong>24. Optimistic UI Updates</strong></h3><p>In many apps, users expect actions to happen instantly. For example, when you tap &#8220;like&#8221;, send a message, or add a comment, you expect to see the result immediately.</p><p>If the app waited for the server to respond before updating the screen, it could take a few hundred milliseconds. Even that slight delay can make the app feel slow.</p><p>To solve this, apps use a technique called optimistic UI updates.</p><p>Optimistic UI means the app assumes the request will succeed and updates the interface immediately, even before the server confirms it.</p><p>The server request still happens in the background. If everything succeeds, nothing changes. If it fails, the app corrects the UI and shows an error.</p><h4><strong>How It Works</strong></h4><p>The process usually follows these steps:</p><ol><li><p>User performs an action (e.g., tapping a like).</p></li><li><p>App updates the UI immediately and stores the change locally.</p></li><li><p>App sends the request to the server.</p></li><li><p>If the server confirms the request, the change remains unchanged.</p></li><li><p>If the server rejects the request, the app reverts the change and shows a small error message.</p></li></ol><p>This makes the app feel fast while still keeping the data accurate.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RSRZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a3d220-05fd-4377-9e27-ed19832805ef_1702x620.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RSRZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a3d220-05fd-4377-9e27-ed19832805ef_1702x620.png 424w, https://substackcdn.com/image/fetch/$s_!RSRZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a3d220-05fd-4377-9e27-ed19832805ef_1702x620.png 848w, https://substackcdn.com/image/fetch/$s_!RSRZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a3d220-05fd-4377-9e27-ed19832805ef_1702x620.png 1272w, https://substackcdn.com/image/fetch/$s_!RSRZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a3d220-05fd-4377-9e27-ed19832805ef_1702x620.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RSRZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a3d220-05fd-4377-9e27-ed19832805ef_1702x620.png" width="1456" height="530" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/98a3d220-05fd-4377-9e27-ed19832805ef_1702x620.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:530,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!RSRZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a3d220-05fd-4377-9e27-ed19832805ef_1702x620.png 424w, https://substackcdn.com/image/fetch/$s_!RSRZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a3d220-05fd-4377-9e27-ed19832805ef_1702x620.png 848w, https://substackcdn.com/image/fetch/$s_!RSRZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a3d220-05fd-4377-9e27-ed19832805ef_1702x620.png 1272w, https://substackcdn.com/image/fetch/$s_!RSRZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F98a3d220-05fd-4377-9e27-ed19832805ef_1702x620.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4><strong>Why It Matters</strong></h4><p>Users expect apps to respond instantly to their actions.</p><p>If the app shows a loading spinner every time the user taps a button, the experience feels slow and frustrating.</p><p>Optimistic UI removes this delay, making the app feel smooth and responsive, similar to native device interactions.</p><h4><strong>Real-World Example</strong></h4><p>Many popular apps rely heavily on optimistic UI:</p><ul><li><p>Twitter shows the like animation immediately when you tap the heart.</p></li><li><p>Instagram displays your comment instantly in the thread.</p></li><li><p>Slack shows a message in the chat immediately after you send it.</p></li></ul><p>In the background, the app syncs with the server and updates the data if needed.</p><h4><strong>Trade-offs</strong></h4><p>An optimistic UI improves the user experience, but it also adds complexity.</p><p>If the server rejects the request, the app must roll back the UI change smoothly without confusing the user. Because of this, optimistic UI is usually avoided for actions that cannot be easily reversed, such as permanent deletion, payments, and financial transactions.</p><p>As app stores and sync sensitive user data, security becomes a critical part of system design&#8230;</p><p>Let&#8217;s keep going!</p>
      <p>
          <a href="https://newsletter.systemdesign.one/p/mobile-system-design-concepts">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Design a personal AI chat assistant]]></title><description><![CDATA[#144: Part 2 - Generative AI Masterclass]]></description><link>https://newsletter.systemdesign.one/p/ai-chat-assistant</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/ai-chat-assistant</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Mon, 04 May 2026 07:49:25 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/49855f8b-2e2d-4967-ba00-15a268a4ea52_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://newsletter.systemdesign.one/subscribe?yearly=true" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RKN7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 424w, https://substackcdn.com/image/fetch/$s_!RKN7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 848w, https://substackcdn.com/image/fetch/$s_!RKN7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 1272w, https://substackcdn.com/image/fetch/$s_!RKN7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RKN7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png" width="1280" height="300" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3689f342-2008-4ce6-b968-16461682508b_1280x300.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:300,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:24224,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://newsletter.systemdesign.one/subscribe?yearly=true&quot;,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/192435842?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!RKN7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 424w, https://substackcdn.com/image/fetch/$s_!RKN7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 848w, https://substackcdn.com/image/fetch/$s_!RKN7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 1272w, https://substackcdn.com/image/fetch/$s_!RKN7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3689f342-2008-4ce6-b968-16461682508b_1280x300.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><ul><li><p><em><a href="https://newsletter.systemdesign.one/p/ai-chat-assistant/?action=share">Share this post</a> &amp; I'll send you some rewards for the referrals.</em></p></li></ul><div><hr></div><p>ChatGPT, Claude, and Gemini handle general-purpose tasks and one-off conversations well&#8230;</p><p>The moment your assistant is customer-facing, the requirements change:</p><p>Your users need an assistant that knows your product, your policies, and their history with you. That knowledge lives in your systems, NOT in a model&#8217;s training data. You could try to inject it at runtime, but proprietary data comes with real constraints: <em>it is often too large to fit in a context window, too sensitive to send to a third-party API, and too dynamic to stay current in a static prompt.</em></p><p>Beyond data, you cannot fully configure its behavior; you cannot integrate it past a browser tab, and costs scale with every conversation&#8230;</p><p>Here is what changes when you build your own:</p><ul><li><p><strong>Privacy and data control.</strong> When you build your own assistant, conversations stay on your infrastructure. You decide what gets logged, how long it gets stored, and when it gets deleted. For healthcare, legal, finance, and enterprise use cases, this is a compliance requirement, not a nice-to-have.</p></li><li><p><strong>Full control over behavior.</strong> You own the system prompt, persona, and the guardrails. You can enforce a specific tone, restrict responses to your product domain, swap the underlying model, or A/B test different configurations. With an off-the-shelf product, you get what they ship.</p></li><li><p><strong>Cost at scale.</strong> You can implement prompt caching, model routing (a cheap model for simple questions, an expensive one for hard ones), and context management strategies that dramatically cut costs. With thousands of conversations per day, the savings are significant.</p></li><li><p><strong>Product integration.</strong> Your assistant lives inside your product, not in a separate tab. It shares your auth system, your UI, and your user context. That level of integration is not possible when you are wrapping someone else&#8217;s chat interface.</p></li><li><p><strong>Security.</strong> You control the full request path: what goes into the model, what comes out, and what filters run in between. You implement your own prompt injection defenses, output guardrails, and content policies.</p></li></ul><p>Off-the-shelf tools are great for personal use and internal prototyping. Building your own is for when the assistant is the product or a core feature.</p><div><hr></div><h2><a href="http://a0.to/1kh">Enterprise auth from day one. No upgrade required. &#128640; (Partner)</a></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="http://a0.to/1kh" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FTzV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3cacd49-09f7-4843-bfd4-8e6827d62fdc_1200x628.png 424w, https://substackcdn.com/image/fetch/$s_!FTzV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3cacd49-09f7-4843-bfd4-8e6827d62fdc_1200x628.png 848w, https://substackcdn.com/image/fetch/$s_!FTzV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3cacd49-09f7-4843-bfd4-8e6827d62fdc_1200x628.png 1272w, https://substackcdn.com/image/fetch/$s_!FTzV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3cacd49-09f7-4843-bfd4-8e6827d62fdc_1200x628.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FTzV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3cacd49-09f7-4843-bfd4-8e6827d62fdc_1200x628.png" width="1200" height="628" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a3cacd49-09f7-4843-bfd4-8e6827d62fdc_1200x628.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:628,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:682006,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;http://a0.to/1kh&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/195272243?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3cacd49-09f7-4843-bfd4-8e6827d62fdc_1200x628.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!FTzV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3cacd49-09f7-4843-bfd4-8e6827d62fdc_1200x628.png 424w, https://substackcdn.com/image/fetch/$s_!FTzV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3cacd49-09f7-4843-bfd4-8e6827d62fdc_1200x628.png 848w, https://substackcdn.com/image/fetch/$s_!FTzV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3cacd49-09f7-4843-bfd4-8e6827d62fdc_1200x628.png 1272w, https://substackcdn.com/image/fetch/$s_!FTzV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa3cacd49-09f7-4843-bfd4-8e6827d62fdc_1200x628.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Enterprise auth is intimidating without a doubt - SSO, SCIM, etc.</p><p>You may feel these features are next year&#8217;s problem because the price jump to unlock basic SAML or OIDC connections is just too brutal for an early-stage roadmap.</p><p>With <strong><a href="http://a0.to/1kh">Auth0</a></strong>, ship your first <strong>Enterprise Connection and SCIM</strong> setup for <strong>$0</strong> on their free tier. If you&#8217;re scaling <strong>AI Agents</strong>, security stack is built for production:</p><ul><li><p><strong>Token Vault:</strong> Securely connect 3rd-party tokens (Slack, GitHub) to stop hard-coding API keys.</p></li><li><p><strong>FGA for RAG:</strong> Ensure LLMs respect fine-grained permissions to prevent data leaks and also control access to specific AI tools/models.</p></li><li><p><strong>Async Authorization:</strong> Use backchannel authentication for human-in-the-loop approvals on critical agent actions.</p></li><li><p><strong>User Authentication: </strong>Securely identify users to unlock chat history, order tracking, and personalized settings within your AI agents.</p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;http://a0.to/1kh&quot;,&quot;text&quot;:&quot;Start building for $0&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="http://a0.to/1kh"><span>Start building for $0</span></a></p><p>And stop worrying about DIY-ing auth.</p><p>(Thanks to <strong><a href="http://a0.to/1kh">Auth0</a></strong> for partnering on this post.)</p><div><hr></div><p>I want to reintroduce <strong><a href="https://louisbouchard.substack.com/">Louis-Fran&#231;ois Bouchard</a> </strong>as the author of this newsletter.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://louisbouchard.substack.com/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8ezx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 424w, https://substackcdn.com/image/fetch/$s_!8ezx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 848w, https://substackcdn.com/image/fetch/$s_!8ezx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 1272w, https://substackcdn.com/image/fetch/$s_!8ezx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8ezx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png" width="1100" height="220" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:220,&quot;width&quot;:1100,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://louisbouchard.substack.com/&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!8ezx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 424w, https://substackcdn.com/image/fetch/$s_!8ezx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 848w, https://substackcdn.com/image/fetch/$s_!8ezx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 1272w, https://substackcdn.com/image/fetch/$s_!8ezx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2bbacb1f-03da-4781-9a5e-b720e4af2e34_1100x220.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>He&#8217;s a best-selling author (<a href="https://amzn.to/4bqYU9b">Building LLMs for Production</a>), the co-founder of <a href="https://academy.towardsai.net/?ref=1f9b29">Towards AI</a>, and the creator of the YouTube Channel, <a href="https://www.youtube.com/@whatsai?sub_confirmation=1">What&#8217;s AI</a>, where he helps people understand AI and learn how to apply it in the real world. Through his development work with clients and his content, teaching, and AI training programs on the <strong><a href="https://academy.towardsai.net/?ref=1f9b29">Towards AI Academy</a></strong>, Louis focuses on making AI practical for builders, engineers, and curious learners alike.</p><p>At Towards AI, he and his team train AI engineers through courses built for every stage, from beginner to advanced. That educational mission and the real-world experience building for his clients are exactly why I wanted him in this newsletter series.</p><div><hr></div><p><strong>Inside this newsletter, you&#8217;ll get:</strong></p><ul><li><p><strong>What happens when you send a message.</strong> Tokenization, prefill, and decode phases, KV-cache, and why longer conversations get slower and more expensive.</p></li><li><p><strong>How the model got here.</strong> Pretraining, post-training (SFT and RLHF), and scaling laws, and what each one means for the assistant you are building.</p></li><li><p><strong>Output controls.</strong> Temperature, top-p, top-k, why hallucination happens, and which settings to use for which task.</p></li><li><p><strong>Context engineering.</strong> System prompts, few-shot, chain-of-thought, structured outputs, context window management, and persistent memory across sessions.</p></li><li><p><strong>Cost and how to know it works.</strong> Worked token math across model tiers, prompt caching, model routing, golden test sets, and LLM-as-Judge evaluation.</p></li><li><p><strong>A practical eight-step build.</strong> From a single API call to a production-minded assistant with streaming, system prompts, JSON output, multi-turn compaction, prompt injection defense, and persistent memory.</p></li></ul><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Golden members get all posts like these!&#8230;</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div><div><hr></div><h2><strong>What We Are Building</strong></h2><p>We&#8217;re building a ChatGPT-style conversational assistant that you fully control: <em>your own system prompt, your own personality, your own rules.</em></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WiM-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d5ab2-3aee-4bad-bee9-d5f0ecbf53a9_2048x1154.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WiM-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d5ab2-3aee-4bad-bee9-d5f0ecbf53a9_2048x1154.png 424w, https://substackcdn.com/image/fetch/$s_!WiM-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d5ab2-3aee-4bad-bee9-d5f0ecbf53a9_2048x1154.png 848w, https://substackcdn.com/image/fetch/$s_!WiM-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d5ab2-3aee-4bad-bee9-d5f0ecbf53a9_2048x1154.png 1272w, https://substackcdn.com/image/fetch/$s_!WiM-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d5ab2-3aee-4bad-bee9-d5f0ecbf53a9_2048x1154.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WiM-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d5ab2-3aee-4bad-bee9-d5f0ecbf53a9_2048x1154.png" width="1456" height="820" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fa9d5ab2-3aee-4bad-bee9-d5f0ecbf53a9_2048x1154.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:820,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!WiM-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d5ab2-3aee-4bad-bee9-d5f0ecbf53a9_2048x1154.png 424w, https://substackcdn.com/image/fetch/$s_!WiM-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d5ab2-3aee-4bad-bee9-d5f0ecbf53a9_2048x1154.png 848w, https://substackcdn.com/image/fetch/$s_!WiM-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d5ab2-3aee-4bad-bee9-d5f0ecbf53a9_2048x1154.png 1272w, https://substackcdn.com/image/fetch/$s_!WiM-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffa9d5ab2-3aee-4bad-bee9-d5f0ecbf53a9_2048x1154.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Full system architecture of a chat assistant. A user message flows through four layers: context engineering, generation engine, persistent memory, and SSE streaming before a response streams back. Each section of the article zooms into one layer.</figcaption></figure></div><p><em>Here are the requirements:</em></p><ul><li><p><strong>Multi-turn conversation</strong> with context preserved across turns.</p></li><li><p><strong>Streaming responses</strong>, where words appear as they&#8217;re generated.</p></li><li><p><strong>Configurable behavior</strong>, creative for brainstorming, precise for data extraction.</p></li><li><p><strong>Resistant to prompt injection attacks.</strong></p></li><li><p><strong>Cost-effective at scale</strong>, with thousands of conversations per day.</p></li></ul><p>One extra feature covered later: <strong>persistent memory</strong> across sessions, so the assistant remembers user preferences between conversations.</p><p>What this system does <strong>not</strong> do: <em>it does NOT retrieve external documents, it does NOT have domain expertise beyond its training data, and it does NOT take actions or call tools. It&#8217;s purely conversational.</em></p><p>We use a model API (OpenAI, Anthropic, or similar) for this build.</p><p>The provider handles GPUs, scaling, and inference optimization, the right starting point for most teams. When you outgrow APIs, you move to self-hosted open-source models served with vLLM, llama.cpp, or SGLang.</p><p>This newsletter is organized around 4 core design decisions:</p><ol><li><p><strong>What happens when you send a message?</strong></p></li><li><p><strong>How do you control what the model says?</strong></p></li><li><p><strong>How do you engineer the context for every request?</strong></p></li><li><p><strong>What does it cost, and how do you know it works?</strong></p></li></ol><p><em>(Then we build the whole thing from scratch in Part 5.)</em></p><p>Let&#8217;s start with what happens under the hood when you send a message&#8230;</p><div><hr></div><h2><strong>Part 1: What Happens When You Send a Message</strong></h2><p>When you call a model API, a lot happens between your request and the first token appearing on screen.</p><p>Even if you never need to use a GPU, this helps you understand the latency, cost, and trade-offs&#8230;</p><h3><strong>From Text to Tokens</strong></h3><p>Before the model can process your message, it needs to convert it from text into numbers.</p><p>Models do not read words. They work with <strong>tokens</strong>, small chunks of text mapped to numerical IDs. A token might be a whole word (&#8220;the&#8221;), part of a word (&#8220;un&#8221;, &#8220;believ&#8221;, &#8220;able&#8221;), or a single character.</p><p>The process of splitting text into tokens is called <strong>tokenization</strong>.</p><p>As we covered in Part 1, there are different ways to split text into tokens:</p><p>You could split by <em>individual characters</em>, but then the model has to process very long sequences just to read a short sentence. You could split by <em>whole words,</em> but then the vocabulary becomes enormous, and the model cannot handle any word it has not seen before.</p><p><strong>Subword tokenization</strong> is the sweet spot, and virtually all modern models use it.</p><p>The most common algorithm is Byte Pair Encoding <strong>(BPE)</strong>. BPE starts with individual characters and iteratively merges the most frequent pairs into a single token. Common words like &#8220;the&#8221; or &#8220;and&#8221; become single tokens. Rare or long words get split into meaningful pieces. The word &#8220;unbelievable&#8221; might be broken into three tokens: &#8220;un&#8221; + &#8220;believ&#8221; + &#8220;able.&#8221; This keeps the vocabulary manageable, typically 30,000 to 100,000 tokens. And if the model encounters a word it has never seen before, it can still process it by breaking it into known subword pieces.</p><p>This is why language models struggle with certain tasks that seem trivial to humans&#8230;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Rh4M!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92090a8d-4fd2-49ae-bc3e-7b0af2dfd424_2048x1237.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Rh4M!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92090a8d-4fd2-49ae-bc3e-7b0af2dfd424_2048x1237.png 424w, https://substackcdn.com/image/fetch/$s_!Rh4M!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92090a8d-4fd2-49ae-bc3e-7b0af2dfd424_2048x1237.png 848w, https://substackcdn.com/image/fetch/$s_!Rh4M!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92090a8d-4fd2-49ae-bc3e-7b0af2dfd424_2048x1237.png 1272w, https://substackcdn.com/image/fetch/$s_!Rh4M!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92090a8d-4fd2-49ae-bc3e-7b0af2dfd424_2048x1237.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Rh4M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92090a8d-4fd2-49ae-bc3e-7b0af2dfd424_2048x1237.png" width="1456" height="879" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/92090a8d-4fd2-49ae-bc3e-7b0af2dfd424_2048x1237.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:879,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Rh4M!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92090a8d-4fd2-49ae-bc3e-7b0af2dfd424_2048x1237.png 424w, https://substackcdn.com/image/fetch/$s_!Rh4M!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92090a8d-4fd2-49ae-bc3e-7b0af2dfd424_2048x1237.png 848w, https://substackcdn.com/image/fetch/$s_!Rh4M!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92090a8d-4fd2-49ae-bc3e-7b0af2dfd424_2048x1237.png 1272w, https://substackcdn.com/image/fetch/$s_!Rh4M!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F92090a8d-4fd2-49ae-bc3e-7b0af2dfd424_2048x1237.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">How tokenization works. The sentence &#8220;The cat sat on the mat&#8221; becomes six tokens, each mapped to a numerical ID. Below, &#8220;strawberry&#8221; is split into three tokens (&#8221;str&#8221;, &#8220;aw&#8221;, &#8220;berry&#8221;), showing why the model cannot count the letter r: the r&#8217;s are split across token boundaries.</figcaption></figure></div><p>Ask <em>&#8220;How many r&#8217;s are in strawberry?&#8221;</em> and the model might get it wrong because it never sees the individual letters. The word &#8220;strawberry&#8221; might be tokenized as &#8220;str&#8221; + &#8220;aw&#8221; + &#8220;berry,&#8221; so the model literally cannot count the r&#8217;s because they are split across token boundaries. Reversing a word, counting specific characters, and other character-level operations are all hard for the same reason: <em>the model operates on tokens, not letters.</em></p><p>Tokenization has direct practical consequences for building a chat assistant.</p><p>Token count does not equal word count: a typical English sentence of 10 words might be 13 to 15 tokens. Code is usually more token-dense than prose. Non-English languages often require more tokens per word because BPE vocabularies are built primarily from English text. Since API pricing, context window limits, and latency all scale with token count, understanding this conversion is essential for cost estimation and context management, both of which we cover later in this newsletter.</p><div><hr></div><p><em><strong>Reminder: this is a teaser of the subscriber-only newsletter series, exclusive to my golden members.</strong></em></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://newsletter.systemdesign.one/subscribe?yearly=true" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3mfm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 424w, https://substackcdn.com/image/fetch/$s_!3mfm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 848w, https://substackcdn.com/image/fetch/$s_!3mfm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 1272w, https://substackcdn.com/image/fetch/$s_!3mfm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3mfm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png" width="1280" height="300" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:300,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:24224,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://newsletter.systemdesign.one/subscribe?yearly=true&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/192435842?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!3mfm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 424w, https://substackcdn.com/image/fetch/$s_!3mfm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 848w, https://substackcdn.com/image/fetch/$s_!3mfm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 1272w, https://substackcdn.com/image/fetch/$s_!3mfm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0002d397-a8f7-4519-a51c-f020e29ce8b3_1280x300.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>When you upgrade, you&#8217;ll get:</p><ul><li><p><strong>Simple breakdown of real-world architectures</strong></p></li><li><p>Frameworks you can plug into your work or business</p></li><li><p><strong>Proven systems behind ChatGPT, Perplexity, and Copilot</strong></p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe?yearly=true&quot;,&quot;text&quot;:&quot;Unlock Full Access&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://newsletter.systemdesign.one/subscribe?yearly=true"><span>Unlock Full Access</span></a></p><div><hr></div><h3><strong>How the Model Got Here: From Pretraining to Chat</strong></h3><p>Before we look at what happens on each request, it helps to understand what happened before you ever sent a message&#8230;</p><p>The model you are calling went through a multi-stage pipeline to become a chat assistant, and each stage has direct consequences for the product you are building.</p><p><strong>Pretraining</strong> is where the model learns language.</p><p>As covered in Part 1, the model is trained on a massive corpus, books, websites, code, research papers, and learns to predict the next token given all the tokens before it. This is self-supervised: <em>no one labels the data.</em> The model just reads trillions of tokens and learns patterns. Pretraining is what gives the model its general knowledge, its grammar, its ability to write code, and its tendency to produce plausible-sounding text, whether or not it is true.</p><p>When your chat assistant confidently states a wrong fact, that behavior traces back to pretraining: <em>the model learned to produce likely continuations, not verified truths.</em></p><p><strong>Post-training</strong> is what turns a text predictor into a chat assistant.</p><p>The pretrained model is good at completing text, but it does not know how to follow instructions, hold a conversation, or refuse harmful requests. Post-training fixes this in stages.</p><p>First, <em>supervised fine-tuning</em><strong> (SFT)</strong> trains the model on curated examples of good conversations: a user asks a question, and a human-written response shows what the ideal answer looks like. This teaches the model the format and style of a helpful assistant.</p><p>Then, <em>reinforcement learning from human feedback</em><strong> (RLHF)</strong> refines the model further. Human raters compare pairs of model responses and pick the better one. The model learns from those preferences, becoming more helpful, more accurate, and less likely to produce harmful or unhelpful output.</p><p>This is why the same base model can feel completely different depending on how it was post-trained. It is also why system prompts work:<em> the model was specifically trained to follow developer-level instructions during post-training.</em></p><p><strong>Scaling laws</strong> govern the relationship between model size, training data, and performance.</p><p>Research (notably <a href="https://arxiv.org/abs/2001.08361">Kaplan et al. at OpenAI</a>&nbsp;and&nbsp;the <a href="https://arxiv.org/abs/2203.15556">Chinchilla paper from DeepMind</a>) showed model performance improves predictably as you increase the number of&nbsp;parameters and training tokens, following power-law curves.</p><p>This is why the industry keeps building bigger models: doubling model size produces measurable, predictable gains in capability. For you as a builder, scaling laws explain the cost-capability tradeoff you face.</p><p>A frontier model (hundreds of billions of parameters) costs more per token but handles harder tasks. A lightweight model (fewer parameters, less training) is cheaper and faster but less capable. The tiered pricing you see from API providers, frontier versus mini versus nano, maps directly to where each model sits on the scaling curve.</p><p>Understanding this helps you make the model routing decisions we discuss later: <em>use the big model when you need its capabilities, and the small model when you do not.</em></p><p>Let&#8217;s keep going!</p>
      <p>
          <a href="https://newsletter.systemdesign.one/p/ai-chat-assistant">
              Read more
          </a>
      </p>
   ]]></content:encoded></item></channel></rss>