<?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>Tue, 11 Aug 2026 20:40:53 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[How to Build an AI Research Agent]]></title><description><![CDATA[#168: Part 5 - Generative AI Masterclass]]></description><link>https://newsletter.systemdesign.one/p/how-to-build-an-ai-research-agent-with-mcp</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/how-to-build-an-ai-research-agent-with-mcp</guid><dc:creator><![CDATA[Louis-François Bouchard]]></dc:creator><pubDate>Mon, 10 Aug 2026 11:52:40 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/d2b86b6a-ebce-4e7d-8e38-91cd730878a2_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/how-to-build-an-ai-research-agent-with-mcp/?action=share">Share this lette</a>r &amp; I&#8217;ll send you some rewards for the referrals.</em></p></li></ul><div><hr></div><p><span>The smartest AI models in the world cannot decide, mid-answer, they need more information and go get it&#8230;</span></p><p><span>They can reason at length, draft legal memos, and score in the 99th percentile on standardized tests. But every response they produce comes from what is already in the </span><em><span>context window</span></em><span>.</span></p><p><span>They have no mechanism to act on the world, observe the results, and adjust.</span></p><p><span>For most tasks, this is enough. For any task where the answer requires searching, reading, discarding dead ends, and circling in over many steps, a passive model is the wrong architecture.</span></p><p><span>An </span><em><span>agent</span></em><span> gives the model this ability&#8230;</span></p><p><span>Instead of generating a response from a single prompt, the model decides what to do next, calls a tool, reads the result, and keeps going until it has enough. The model stops being something you call and becomes something that runs.</span></p><p><span>This loop is the entire idea behind agents, and it is how Perplexity Deep Research, ChatGPT agent mode, Claude Code, and Cursor all work under the surface.</span></p><p><span>Those products handle general use cases well.</span></p><p><span>While building your own is worth it when you need to control the runtime: </span><em><span>which tools the model can call, how the loop is structured, when it stops, and how you measure its success.</span></em></p><p><span>Onward.</span></p><div><hr></div><div class="callout-block" data-callout="true"><h2><strong><a href="https://getunblocked.link/8IncW41">[Webinar] Can you prove AI is working?</a></strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://getunblocked.link/8IncW41" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!i1B8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2723ec39-244c-4904-9ca8-ea5b65523913_1600x900.png 424w, https://substackcdn.com/image/fetch/$s_!i1B8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2723ec39-244c-4904-9ca8-ea5b65523913_1600x900.png 848w, https://substackcdn.com/image/fetch/$s_!i1B8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2723ec39-244c-4904-9ca8-ea5b65523913_1600x900.png 1272w, https://substackcdn.com/image/fetch/$s_!i1B8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2723ec39-244c-4904-9ca8-ea5b65523913_1600x900.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!i1B8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2723ec39-244c-4904-9ca8-ea5b65523913_1600x900.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2723ec39-244c-4904-9ca8-ea5b65523913_1600x900.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;:279908,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://getunblocked.link/8IncW41&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/206682047?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2723ec39-244c-4904-9ca8-ea5b65523913_1600x900.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_!i1B8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2723ec39-244c-4904-9ca8-ea5b65523913_1600x900.png 424w, https://substackcdn.com/image/fetch/$s_!i1B8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2723ec39-244c-4904-9ca8-ea5b65523913_1600x900.png 848w, https://substackcdn.com/image/fetch/$s_!i1B8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2723ec39-244c-4904-9ca8-ea5b65523913_1600x900.png 1272w, https://substackcdn.com/image/fetch/$s_!i1B8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2723ec39-244c-4904-9ca8-ea5b65523913_1600x900.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 aria-hidden="true" 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><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><strong><a href="https://getunblocked.link/8IncW41">Join live on Aug 19 (FREE)</a></strong><span> to learn:</span></p><ul><li><p>The 4 metrics to measure where AI gains leak out before production.</p></li><li><p>The 8 stages of context maturity, the specific walls capping your metrics, and a free tool to pinpoint where your team is.</p></li><li><p>Why more MCPs and bigger context windows aren&#8217;t enough, and what it takes to get real value from your agents.</p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://getunblocked.link/8IncW41&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://getunblocked.link/8IncW41"><span>Register Now</span></a></p><p><em><span>(Thanks to </span><a href="https://getunblocked.link/8IncW41">Unblocked</a><span> for partnering on this newsletter.)</span></em></p></div><div><hr></div><p><em><span>This newsletter builds a research agent from scratch:</span></em></p><p><span>A complex question goes in&#8230; The system breaks it into focused sub-questions, calls tools in a loop, reads the sources worth reading, and then returns a structured report with citations. </span></p><p><span>Think about how a person actually answers a HARD question.</span></p><p><span>They do not produce the answer in one pass. They search for something, read what comes back, realize it raises a new question, search again, discard a dead end, and circle in on an answer over many steps.</span></p><p><span>The model we built in the </span><a href="https://newsletter.systemdesign.one/p/fine-tuning-ai-models"><span>last newsletter</span></a><span> cannot do any of this.</span></p><p><span>Its knowledge is frozen at training; its memory ends at the context window, and every response comes from what it already knows. For explaining a concept or drafting a document, answering in one pass is fine.</span></p><p><span>For a question where the answer has to be found rather than recalled, one pass is the wrong shape entirely.</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_!ojYx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466969d9-c374-486d-afd3-5f34eeb80407_2048x978.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ojYx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466969d9-c374-486d-afd3-5f34eeb80407_2048x978.png 424w, https://substackcdn.com/image/fetch/$s_!ojYx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466969d9-c374-486d-afd3-5f34eeb80407_2048x978.png 848w, https://substackcdn.com/image/fetch/$s_!ojYx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466969d9-c374-486d-afd3-5f34eeb80407_2048x978.png 1272w, https://substackcdn.com/image/fetch/$s_!ojYx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466969d9-c374-486d-afd3-5f34eeb80407_2048x978.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ojYx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466969d9-c374-486d-afd3-5f34eeb80407_2048x978.png" width="1456" height="695" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/466969d9-c374-486d-afd3-5f34eeb80407_2048x978.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:695,&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_!ojYx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466969d9-c374-486d-afd3-5f34eeb80407_2048x978.png 424w, https://substackcdn.com/image/fetch/$s_!ojYx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466969d9-c374-486d-afd3-5f34eeb80407_2048x978.png 848w, https://substackcdn.com/image/fetch/$s_!ojYx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466969d9-c374-486d-afd3-5f34eeb80407_2048x978.png 1272w, https://substackcdn.com/image/fetch/$s_!ojYx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F466969d9-c374-486d-afd3-5f34eeb80407_2048x978.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 aria-hidden="true" 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><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 implemented pipeline. A user question is decomposed into focused sub-questions, answered by parallel worker loops over MCP tools, and synthesized into a cited report. The reviewer is attached to the main run; the judge is a separate post-report evaluation step.</figcaption></figure></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>Inside this newsletter, you&#8217;ll get:</span></strong></em></p><ul><li><p><strong><span>The agent loop.</span></strong><span> The think-act-observe cycle that makes an agent an agent, and why most agents fail not at reasoning but at knowing when to stop.</span></p></li></ul><ul><li><p><strong><span>Tool design.</span></strong><span> Why the model&#8217;s success depends almost entirely on how a tool is described, how to make errors recoverable, and why quality drops once you pass about 20 tools.</span></p></li></ul><ul><li><p><strong><span>MCP and the tool ecosystem.</span></strong><span> How one protocol lets any model talk to any tool, when a ready-made server is enough, and when writing your own is worth it.</span></p></li></ul><ul><li><p><strong><span>Multi-agent patterns.</span></strong><span> How orchestrator-worker and parallel-and-synthesize patterns work, and what the cost multiplier looks like in practice.</span></p></li></ul><ul><li><p><strong><span>Evaluating agents.</span></strong><span> Why scoring the final answer is not enough, and how to catch the failure where the agent gets it right in 50 tool calls when 5 would have done.</span></p></li></ul><ul><li><p><strong><span>Practical build.</span></strong><span> A small research agent in plain Python: an MCP server that exposes </span><code>search</code><span> and </span><code>fetch</code><span>, an agent loop with native function calling, a deep-research flow that decomposes, fans out, synthesizes, and reviews, and a binary judge.</span></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"><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>Why Build Your Own Agent?</span></h2><p><span>For many tasks, a hosted agent/agent mode is a good choice.</span></p><p><span>ChatGPT Agent Mode, Perplexity Deep Research, Claude Code for coding tasks, Manus, and Devin already give you the convenience of an agent: </span><em><span>a model that reasons across steps, calls tools, and keeps going until it has enough.</span></em></p><p><span>For generic web research, coding in a local repo, or a single person using it interactively without audit/cost constraints, a </span><em><span>hosted product</span></em><span> will usually be faster to deploy than anything you would build yourself.</span></p><p><span>The case for building your own comes down to what hosted products cannot give you: </span><em><span>ownership of the runtime</span></em><span>.</span></p><p><span>Let&#8217;s dive in!</span></p><ul><li><p><strong><span>Tool control.</span></strong><span> </span><em><span>Hosted agents</span></em><span> do not know your customer relationship management system (</span>CRM)<span>, your warehouse, or your internal services. They cannot read your pipeline tracker, write to your ticketing system, or trigger a deployment. Your </span><em><span>own agent</span></em><span> exposes only the tools you allow, with the scopes you set. A literature research agent that searches PubMed first, ranks results by impact factor, and checks for retractions is a different artifact from a generic web searcher. The value is in the actions only your tools can take, and the safety model follows directly from that: a tool that does not exist in your runtime cannot be called.</span></p></li><li><p><strong><span>Workflow control.</span></strong><span> With your </span><em><span>own agent</span></em><span>, you decide the sequence, stopping rules, and escalation path. Always search these sources first. Require a citation after every claim. Cap the loop at ten turns. Route low-confidence answers to a human reviewer instead of letting the model guess. Hosted agents ship with whatever defaults the vendor chose, and you cannot change them.</span></p></li><li><p><strong><span>Audit and evaluation.</span></strong><span> Every tool call, every observation, and every model decision can be written to a trajectory log you own and can replay. You can run your own evaluation on this trajectory, not just on the final answer. Regulated industries need that trail by default, and your own agent emits it. A </span><em><span>hosted agent </span></em><span>gives you, at best, what the vendor decides to expose.</span></p></li><li><p><strong><span>Cost and latency.</span></strong><span> A </span><em><span>scoped agent</span></em><span> over your own tools typically spends fewer tokens per task than a </span><em><span>general-purpose agent</span></em><span>, because it does not need to discover which sources to trust on every run. Tight retrieval loops over your own infrastructure also avoid the multi-second round-trip that external web calls introduce. The fastest tool is one you control.</span></p></li></ul><p><span>Also, building your own agent does not mean building the primitives from scratch.</span></p><p><span>Native tool calling, the loop itself, and context handling are now standardized across providers, and frameworks such as LangGraph and OpenAI Agents SDK ship them. So what you build is the tool layer, workflow, and evaluation.</span></p><p><span>The loop is the runtime; your application is the set of tools, prompts, and stopping rules you run on it.</span></p><p><span>If the task is generic, data is public, and a hosted product already meets the bar, building your own is the </span><em><span>wrong</span></em><span> investment&#8230;</span></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/how-to-build-an-ai-research-agent-with-mcp?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-build-an-ai-research-agent-with-mcp?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><h2><span>What We Are Building</span></h2><p><span>The system we&#8217;re building is a research agent.</span></p><p><span>A user types a question, the model breaks it into focused sub-questions, calls web search and page fetch in a loop to gather sources, and writes a structured report with citations when it has enough.</span></p><p><span>A typical input is a question like </span><em><span>&#8220;Summarize the recent literature on LLM agent evaluation, focused on trajectory metrics,&#8221;</span></em><span> and it returns a 600 to 1,200-word report with two/three sections, 8 to 15 inline citations, and a confidence rating per section. A run takes 10 to 20 tool calls and 2 to 4 minutes, almost all of it spent reading fetched pages rather than on the model&#8217;s own reasoning.</span></p><p><span>These numbers are design targets, not measurements from a specific run.</span></p><p><span>The build runs under a few fixed constraints:</span></p><p><span>The loop stops on a completion signal or at an iteration cap of ten turns. Every claim in the final report has to cite a retrieved source, which a reviewer checks at the end of the run. Token-budget caps and a low-confidence escalation path are production guardrails we describe but do not implement (in Part 6 walkthrough).</span></p><p><span>Every run writes a trajectory log of model calls, tool calls, observations, and stop reasons.</span></p><p><span>Building this system means designing several layers that depend on one another.</span></p><p><span>The model picks the next action. The harness is everything that makes the action useful:</span><em><span> the loop that runs the model in a cycle, the tools it can call, the protocol it uses to reach external services, the memory it carries between turns, and the evaluation that tells you whether any of it worked</span></em><span>. Each layer has its own failure modes, and none of them work in isolation.</span></p><p><span>This </span>newsletter<span> works through five questions in order:</span></p><ul><li><p><span>How the agent loop runs and when it stops,</span></p></li><li><p><span>How to design tools the model uses correctly,</span></p></li><li><p><span>When to use MCP and what it provides,</span></p></li><li><p><span>When one agent is not enough and how memory changes the design,</span></p></li><li><p><span>And how to measure whether the system works without letting it run up an unbounded bill. </span></p></li></ul><p><span>The </span><em><span>loop</span></em><span> comes first because nothing else in the system matters if it does not terminate.</span></p><p><span>Let&#8217;s start!</span></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/how-to-build-an-ai-research-agent-with-mcp?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-build-an-ai-research-agent-with-mcp?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div><hr></div><h2><span>Part 1: The Agent Loop</span></h2><p><span>The agent loop is the core of the system.</span></p><p><span>Everything else--tools, memory, multi-agent patterns, evaluation--sits on top of it.</span></p><p><span>Getting the loop right means understanding what it is, how each turn runs, and most importantly, how it stops.</span></p><h3><span>What is an Agent</span></h3><p><span>Anthropic&#8217;s engineering team describes an agent as an LLM that uses tools in a loop, autonomously, until it has accomplished a task.</span></p><p><span>There is a model that decides what to do next, a set of tools it can call, and a loop that runs the model, executes the tool call, feeds the result back, and repeats.</span></p><ul><li><p><span>Remove the tools, and you have a chat assistant.</span></p></li><li><p><span>Remove the loop, and you have a one-shot function call, like a chatbot that queries a weather API once and reports back with no iteration.</span></p></li><li><p><span>Remove the model, and you have a workflow.</span></p></li></ul><p>The easiest way to see where the agent sits is to plot it on a line.</p><p>At one end is a <em>single LLM call</em>. You ask a question; the model thinks once, and returns an answer. There is no opportunity to gather new information/change course.</p><p>In the middle is a <em>workflow</em>. Your code fixed the steps in advance. For example: search the web, fetch the top result, then summarize it. Every task follows the same sequence, whether it is the correct sequence or not.</p><p>At the other end is an <em>agent</em>. Instead of following a fixed path, the model decides what to do next. It could search the web, read a page, search again with a better query, or stop and answer when it has enough information.</p><p>The key difference is who controls the next step&#8230;</p><p>In a workflow, your code decides. In an agent, the model decides based on what it has learned so far.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!JAlv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9670dca3-fd9f-4066-9f19-a394103d11a6_2048x978.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!JAlv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9670dca3-fd9f-4066-9f19-a394103d11a6_2048x978.png 424w, https://substackcdn.com/image/fetch/$s_!JAlv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9670dca3-fd9f-4066-9f19-a394103d11a6_2048x978.png 848w, https://substackcdn.com/image/fetch/$s_!JAlv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9670dca3-fd9f-4066-9f19-a394103d11a6_2048x978.png 1272w, https://substackcdn.com/image/fetch/$s_!JAlv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9670dca3-fd9f-4066-9f19-a394103d11a6_2048x978.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!JAlv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9670dca3-fd9f-4066-9f19-a394103d11a6_2048x978.png" width="1456" height="695" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9670dca3-fd9f-4066-9f19-a394103d11a6_2048x978.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:695,&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_!JAlv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9670dca3-fd9f-4066-9f19-a394103d11a6_2048x978.png 424w, https://substackcdn.com/image/fetch/$s_!JAlv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9670dca3-fd9f-4066-9f19-a394103d11a6_2048x978.png 848w, https://substackcdn.com/image/fetch/$s_!JAlv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9670dca3-fd9f-4066-9f19-a394103d11a6_2048x978.png 1272w, https://substackcdn.com/image/fetch/$s_!JAlv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9670dca3-fd9f-4066-9f19-a394103d11a6_2048x978.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 aria-hidden="true" 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><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">Where an agent sits on the control-flow spectrum. A workflow runs a fixed sequence chosen in code (left). An agent decides the next step at runtime by picking among the available tools (right).</figcaption></figure></div><h3><span>How One Run Executes</span></h3><p><span>Each turn of the loop has three steps:</span></p><ol><li><p><span>Model thinks and emits either a tool call or a final answer.</span></p></li><li><p><span>The code acts, running the tool the model picked.</span></p></li><li><p><span>Result is observed by being appended to the context for the next turn.</span></p></li></ol><p><span>This is the </span><em><span>think-act-observe</span></em><span> cycle, and it runs until one of the stop conditions trips.</span></p><p><span>A typical research run takes 10 to 20 turns before the model decides it has enough to answer.</span></p><p><span>The cycle itself is fixed&#8230; Yet how the model organizes its thinking inside each turn is not, and this choice is the loop pattern.</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_!Uyro!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a3ce186-2e91-46f9-9765-8c6724267b46_2048x1002.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Uyro!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a3ce186-2e91-46f9-9765-8c6724267b46_2048x1002.png 424w, https://substackcdn.com/image/fetch/$s_!Uyro!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a3ce186-2e91-46f9-9765-8c6724267b46_2048x1002.png 848w, https://substackcdn.com/image/fetch/$s_!Uyro!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a3ce186-2e91-46f9-9765-8c6724267b46_2048x1002.png 1272w, https://substackcdn.com/image/fetch/$s_!Uyro!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a3ce186-2e91-46f9-9765-8c6724267b46_2048x1002.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Uyro!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a3ce186-2e91-46f9-9765-8c6724267b46_2048x1002.png" width="1456" height="712" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3a3ce186-2e91-46f9-9765-8c6724267b46_2048x1002.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:712,&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_!Uyro!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a3ce186-2e91-46f9-9765-8c6724267b46_2048x1002.png 424w, https://substackcdn.com/image/fetch/$s_!Uyro!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a3ce186-2e91-46f9-9765-8c6724267b46_2048x1002.png 848w, https://substackcdn.com/image/fetch/$s_!Uyro!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a3ce186-2e91-46f9-9765-8c6724267b46_2048x1002.png 1272w, https://substackcdn.com/image/fetch/$s_!Uyro!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a3ce186-2e91-46f9-9765-8c6724267b46_2048x1002.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 aria-hidden="true" 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><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">One turn of the loop runs Think, Act, Observe. Three guards sit on the loop edges: a final answer with no tool call, an iteration cap of 15 to 25 turns, or a budget cap on tokens or dollars. The completion signal returns the final answer; the iteration or budget caps stop the loop and return a partial result or failure flag.</figcaption></figure></div><h3><span>Loop Patterns</span></h3><p><span>Here are three named patterns that cover most real systems:</span></p><ul><li><p><strong><span>ReAct</span></strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a><span> </span><em><span>(Yao et al., 2022)</span></em><span> interleaves a reasoning trace with each tool call (&#8221;I need X, so I search Y&#8221;) and is the &#8220;most common&#8221; shape for prompted agents.</span></p></li><li><p><strong><span>Plan-and-Execute</span></strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a><span> </span><em><span>(LangChain, 2023, building on Wang et al.&#8217;s Plan-and-Solve)</span></em><span> separates planning from execution: a first call returns a short-step plan, a second loop executes it, and the agent replans on failure. It&#8217;s better for &#8220;long tasks&#8221; where wandering off-plan is expensive.</span></p></li><li><p><strong><span>Reflection</span></strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a><span> </span><em><span>(Shinn et al.&#8217;s Reflexion, 2023)</span></em><span> adds a critic step: the agent reads the draft answer, lists problems, and feeds them back. It earns its keep when single-pass quality plateaus.</span></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_!IH7j!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dd12fcf-5ce9-4536-9e08-191fa13423f1_2048x1056.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!IH7j!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dd12fcf-5ce9-4536-9e08-191fa13423f1_2048x1056.png 424w, https://substackcdn.com/image/fetch/$s_!IH7j!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dd12fcf-5ce9-4536-9e08-191fa13423f1_2048x1056.png 848w, https://substackcdn.com/image/fetch/$s_!IH7j!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dd12fcf-5ce9-4536-9e08-191fa13423f1_2048x1056.png 1272w, https://substackcdn.com/image/fetch/$s_!IH7j!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dd12fcf-5ce9-4536-9e08-191fa13423f1_2048x1056.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!IH7j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dd12fcf-5ce9-4536-9e08-191fa13423f1_2048x1056.png" width="1456" height="751" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3dd12fcf-5ce9-4536-9e08-191fa13423f1_2048x1056.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:751,&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_!IH7j!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dd12fcf-5ce9-4536-9e08-191fa13423f1_2048x1056.png 424w, https://substackcdn.com/image/fetch/$s_!IH7j!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dd12fcf-5ce9-4536-9e08-191fa13423f1_2048x1056.png 848w, https://substackcdn.com/image/fetch/$s_!IH7j!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dd12fcf-5ce9-4536-9e08-191fa13423f1_2048x1056.png 1272w, https://substackcdn.com/image/fetch/$s_!IH7j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dd12fcf-5ce9-4536-9e08-191fa13423f1_2048x1056.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 aria-hidden="true" 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><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>A reasonable starting point is a </span><em><span>prompted ReAct loop</span></em><span>.</span></p><p><span>Move to </span><em><span>Plan-and-Execute</span></em><span> when exploration is expensive, and add Reflection when quality plateaus. Reasoning models like the o-series and Claude with extended thinking are an orthogonal choice that move the planning inside the model; try one when planning quality is the bottleneck.</span></p><p><span>Whichever pattern you pick, the loop has to stop.</span></p><p><span>This is the part most people get wrong.</span></p><h3><span>Stopping the Loop</span></h3><p><span>Most agent failures are termination failures.</span></p><p><span>The model keeps searching, refining, and searching, never deciding it has enough. Without a hard stop, one stuck task burns $50 of tokens.</span></p><p><span>A system needs three stop conditions</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a><span>, and the loop fires on whichever trips first:</span></p><ul><li><p><span>Completion signal: the model emits a final answer with no tool call.</span></p></li><li><p><span>Iteration cap: a hard limit of 15&#8211;25 turns for research, and fewer for simple tasks.</span></p></li><li><p><span>Budget cap: maximum number of tokens or dollars per task that returns partial results plus a flag when it trips.</span></p></li></ul><p><span>When either cap consistently fires on a given question type, it usually signals that a tool is broken or the question is mismatched with the agent&#8217;s design.</span></p><p><span>Before reaching for an agent at all, it is worth asking whether the task actually needs one. Most tasks are workflows with known steps. An agent is the &#8220;right&#8221; choice when the path </span><em><span>cannot</span></em><span> be determined until you see the data.</span></p><p><span>If the steps are known up front, hard-coding them is faster, cheaper, and easier to debug&#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>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><div><hr></div><h2><span>Part 2: Designing Tools the Model Can Use</span></h2>
      <p>
          <a href="https://newsletter.systemdesign.one/p/how-to-build-an-ai-research-agent-with-mcp">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[10 System Design Solutions Explained in 15 Minutes]]></title><description><![CDATA[#167: A practical guide to common system design challenges]]></description><link>https://newsletter.systemdesign.one/p/system-design-patterns</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/system-design-patterns</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Wed, 05 Aug 2026 14:57:01 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/9d4b6b27-e865-4362-9fef-e829dabbf9a5_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><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/system-design-patterns/?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>System design can feel overwhelming, but a small set of patterns carries most of the weight in real-world systems.</p><p>In this newsletter, I&#8217;ll cover the 10 most important system design patterns to solve common problems.</p><p>For each, I&#8217;ll share:</p><ul><li><p>What problem it solves,</p></li><li><p>How it works,</p></li><li><p>Tradeoffs.</p></li></ul><p>Let&#8217;s start!</p><h4 style="text-align: center;"><strong>&#167;</strong></h4><div class="callout-block" data-callout="true"><h2><a href="https://superblocks.com/?utm_source=newsletter&amp;utm_medium=influencer&amp;utm_content=neo_kim">Superblocks just launched something big for enterprise AI (Partner)</a></h2><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_!w6uY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21609af1-96d1-4a60-b4d2-16d0ba57ff1f_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!w6uY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21609af1-96d1-4a60-b4d2-16d0ba57ff1f_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!w6uY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21609af1-96d1-4a60-b4d2-16d0ba57ff1f_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!w6uY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21609af1-96d1-4a60-b4d2-16d0ba57ff1f_1920x1080.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!w6uY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21609af1-96d1-4a60-b4d2-16d0ba57ff1f_1920x1080.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/21609af1-96d1-4a60-b4d2-16d0ba57ff1f_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;:394894,&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%2F21609af1-96d1-4a60-b4d2-16d0ba57ff1f_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_!w6uY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21609af1-96d1-4a60-b4d2-16d0ba57ff1f_1920x1080.png 424w, https://substackcdn.com/image/fetch/$s_!w6uY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21609af1-96d1-4a60-b4d2-16d0ba57ff1f_1920x1080.png 848w, https://substackcdn.com/image/fetch/$s_!w6uY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21609af1-96d1-4a60-b4d2-16d0ba57ff1f_1920x1080.png 1272w, https://substackcdn.com/image/fetch/$s_!w6uY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21609af1-96d1-4a60-b4d2-16d0ba57ff1f_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 aria-hidden="true" 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><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>Until now, CIOs and CISOs had two choices:</p><ul><li><p>Block vibe coding completely.</p></li><li><p>Or open the floodgates and risk sensitive company data.</p></li></ul><p>Neither is a good option!</p><p><strong>INTRODUCING <a href="https://superblocks.com/?utm_source=newsletter&amp;utm_medium=influencer&amp;utm_content=neo_kim">SUPERBLOCKS 3.0</a></strong></p><p>The secure, governed way to vibe code enterprise software&#8230;</p><p>Business teams can now build production-ready internal apps from a single prompt.</p><ul><li><p>Unlike consumer tools such as Replit &amp; Lovable, every app runs inside your own AWS account and VPC, so your data &#8220;never&#8221; leaves your private cloud.</p></li><li><p>Instead of relying on one big AI agent, Superblocks orchestrates specialized agents across the build, routes simpler work to lower-cost open-source models, and cuts token costs by up to 30%.</p></li><li><p>Before anything ships, a swarm of security agents scans every deployment for business logic flaws, chained authentication bypasses, and supply-chain vulnerabilities.</p></li></ul><p>Company login, role-based permissions, audit logs, encryption, and governance are enforced automatically across every app.</p><p>So everyone builds and nothing ships ungoverned.</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 3.0 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://superblocks.com/?utm_source=newsletter&amp;utm_medium=influencer&amp;utm_content=neo_kim"><span>TRY SUPERBLOCKS 3.0 TODAY</span></a></p><p><em>(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 letter.)</em></p></div><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2>1. Caching</h2><p>Imagine the &#8220;same&#8221; API route gets called a thousand times per second.</p><p>And each call hits the database for the result.</p><p>i.e., every read will:</p><ul><li><p>access disk storage,</p></li><li><p>lock tables during reads,</p></li><li><p>consume connection pool slots.</p></li></ul><p>But all this work just to return data that has NOT changed since the last request&#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_!Oe9C!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe83e8fa-c0cb-4b78-99fe-8817e35b7658_1672x941.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Oe9C!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe83e8fa-c0cb-4b78-99fe-8817e35b7658_1672x941.png 424w, https://substackcdn.com/image/fetch/$s_!Oe9C!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe83e8fa-c0cb-4b78-99fe-8817e35b7658_1672x941.png 848w, https://substackcdn.com/image/fetch/$s_!Oe9C!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe83e8fa-c0cb-4b78-99fe-8817e35b7658_1672x941.png 1272w, https://substackcdn.com/image/fetch/$s_!Oe9C!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe83e8fa-c0cb-4b78-99fe-8817e35b7658_1672x941.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Oe9C!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe83e8fa-c0cb-4b78-99fe-8817e35b7658_1672x941.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fe83e8fa-c0cb-4b78-99fe-8817e35b7658_1672x941.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;:552095,&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/202141184?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe83e8fa-c0cb-4b78-99fe-8817e35b7658_1672x941.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_!Oe9C!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe83e8fa-c0cb-4b78-99fe-8817e35b7658_1672x941.png 424w, https://substackcdn.com/image/fetch/$s_!Oe9C!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe83e8fa-c0cb-4b78-99fe-8817e35b7658_1672x941.png 848w, https://substackcdn.com/image/fetch/$s_!Oe9C!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe83e8fa-c0cb-4b78-99fe-8817e35b7658_1672x941.png 1272w, https://substackcdn.com/image/fetch/$s_!Oe9C!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe83e8fa-c0cb-4b78-99fe-8817e35b7658_1672x941.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 aria-hidden="true" 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><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">Cache-aside pattern</figcaption></figure></div><p>You can use<strong> </strong><em>in-memory caching</em> to solve this problem by storing <em>frequently</em> accessed data in memory.</p><p>Your app checks the &#8220;cache&#8221; first before querying the database. <em>Cache hits</em> return data from memory, while <em>cache misses</em> query the database &amp; then store the result for later.</p><h4>Advantages</h4><p>You get extremely fast response times because memory access is 100x faster than disk.</p><p>Plus the database handles fewer requests since only cache misses reach it. Also, this lets you scale &#8220;read&#8221; capacity without adding more database replicas.</p><h4>Disadvantages</h4><p>But cache invalidation becomes difficult because it's hard to know exactly when cached data must be removed/refreshed.</p><p>Also you need to keep the cache &amp; database in &#8220;sync&#8221; to avoid stale data. Plus, memory is significantly more expensive than disk storage.</p><p>This increases infrastructure costs.</p><h4>Best practices</h4><p>So cache only the data that can tolerate some staleness, such as product catalogs &amp; user profiles.</p><p>Besides, set an appropriate Time-to-Live (<strong>TTL</strong>) based on how often the data changes. Also use the cache-aside pattern<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a> to keep the cache populated only when data is requested.</p><p>Caching gives you fast reads for data that doesn&#8217;t change often.</p><p>But it only helps when the same data gets requested over &amp; over. <em>So what about systems where users read &#8220;different&#8221; data?</em></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2>2. Scaling reads</h2><p>Your query performance looks good,,, but your database is &#8220;struggling&#8221;.</p><p><span>The problem is NOT slow queries; instead, it&#8217;s the&nbsp;</span><em>volume</em><span>.</span> Thousands of users hit your API at the same time&#8230;</p><p>Every query runs fast, but every request still:</p><ul><li><p>Uses CPU on the database server</p></li><li><p>Consumes a database connection</p></li><li><p>Waits in line when the server gets overloaded</p></li></ul><p>To overcome slow reads, you can add indexes and tune query execution plans.</p><p>This lets you get the most out of your existing servers. Then, when your servers reach their limits, add <em>read replicas</em>&#8230;</p><p>Your application sends writes to the primary database and routes reads to replicas&#8230;While the replicas stay synchronized through replication.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!oVNW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fd8e98b-ace1-4a97-a75b-94ae30d87ce7_1448x1086.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!oVNW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fd8e98b-ace1-4a97-a75b-94ae30d87ce7_1448x1086.png 424w, https://substackcdn.com/image/fetch/$s_!oVNW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fd8e98b-ace1-4a97-a75b-94ae30d87ce7_1448x1086.png 848w, https://substackcdn.com/image/fetch/$s_!oVNW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fd8e98b-ace1-4a97-a75b-94ae30d87ce7_1448x1086.png 1272w, https://substackcdn.com/image/fetch/$s_!oVNW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fd8e98b-ace1-4a97-a75b-94ae30d87ce7_1448x1086.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!oVNW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fd8e98b-ace1-4a97-a75b-94ae30d87ce7_1448x1086.png" width="1448" height="1086" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7fd8e98b-ace1-4a97-a75b-94ae30d87ce7_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;:638846,&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/202141184?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fd8e98b-ace1-4a97-a75b-94ae30d87ce7_1448x1086.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_!oVNW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fd8e98b-ace1-4a97-a75b-94ae30d87ce7_1448x1086.png 424w, https://substackcdn.com/image/fetch/$s_!oVNW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fd8e98b-ace1-4a97-a75b-94ae30d87ce7_1448x1086.png 848w, https://substackcdn.com/image/fetch/$s_!oVNW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fd8e98b-ace1-4a97-a75b-94ae30d87ce7_1448x1086.png 1272w, https://substackcdn.com/image/fetch/$s_!oVNW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7fd8e98b-ace1-4a97-a75b-94ae30d87ce7_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 aria-hidden="true" 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><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">Read-replica pattern</figcaption></figure></div><h4>Advantages</h4><p>You can scale reads simply by adding more replicas instead of upgrading a single database server.</p><p>Also, you can reduce latency by placing replicas closer to your users. Plus distributing reads across many servers prevents one database from becoming a bottleneck.</p><h4>Disadvantages</h4><p>Yet replication is NOT instant; replicas need time to copy changes from the primary.</p><p>Also, read-after-write requests may receive stale data if they hit a replica too soon. Plus, running replicas adds operational complexity because they must be monitored, maintained, and kept healthy.</p><h4>Best practices</h4><p>So optimize your existing database before adding more infrastructure.</p><p>Also, use read replicas only when eventually consistent reads are acceptable. Besides, route critical read-after-write operations to the primary database to guarantee fresh data.</p><p>Read replicas are great for high-read traffic applications where some stale data is acceptable. <em>But how do you manage high-write traffic?</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/system-design-patterns?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-patterns?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2>3. Scaling writes</h2><p>Your database handles every write,,, but eventually:</p><ul><li><p>You&#8217;ve already optimized inserts &amp; added batching,</p></li><li><p>You cannot keep upgrading to a <em>larger</em> database instance,</p></li><li><p>CPU and IOPS<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a> (Input/Output Operations Per Second) has reached their limits.</p></li></ul><p>You can solve this through sharding.</p><p>i.e., distribute writes across many database nodes&#8230;</p><p>You choose a partition key, and a hash function routes each record to a specific shard. Think of sharding like splitting a large phone book by region, where every region has its own book.</p><p>Yet each shard stores only a &#8220;subset&#8221; of the entire data&#8230;</p><p>So it&#8217;s important to choose a good partition key:</p><ul><li><p>User IDs: many of them, evenly distributed</p></li><li><p>Geographic regions: related data stays together for better local queries</p></li><li><p>Time windows: great for time-series data where older shards become read-only</p></li></ul><p>This lets you scale writes...</p><p>You can add shards to increase capacity &amp; reduce latency by placing shards closer to users.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fnCe!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F726c5214-f237-40cf-b385-e5d008cd8247_1448x1086.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fnCe!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F726c5214-f237-40cf-b385-e5d008cd8247_1448x1086.png 424w, https://substackcdn.com/image/fetch/$s_!fnCe!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F726c5214-f237-40cf-b385-e5d008cd8247_1448x1086.png 848w, https://substackcdn.com/image/fetch/$s_!fnCe!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F726c5214-f237-40cf-b385-e5d008cd8247_1448x1086.png 1272w, https://substackcdn.com/image/fetch/$s_!fnCe!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F726c5214-f237-40cf-b385-e5d008cd8247_1448x1086.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fnCe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F726c5214-f237-40cf-b385-e5d008cd8247_1448x1086.png" width="1448" height="1086" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/726c5214-f237-40cf-b385-e5d008cd8247_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;:652561,&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/202141184?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F726c5214-f237-40cf-b385-e5d008cd8247_1448x1086.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_!fnCe!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F726c5214-f237-40cf-b385-e5d008cd8247_1448x1086.png 424w, https://substackcdn.com/image/fetch/$s_!fnCe!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F726c5214-f237-40cf-b385-e5d008cd8247_1448x1086.png 848w, https://substackcdn.com/image/fetch/$s_!fnCe!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F726c5214-f237-40cf-b385-e5d008cd8247_1448x1086.png 1272w, https://substackcdn.com/image/fetch/$s_!fnCe!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F726c5214-f237-40cf-b385-e5d008cd8247_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 aria-hidden="true" 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><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">Database sharding</figcaption></figure></div><h4>Advantages</h4><p>You can scale write capacity simply by <em>adding</em> more shards instead of relying on a single database server.</p><p>Plus, each shard handles only part of the total traffic, which reduces the load on individual machines. Also, placing shards closer to users can reduce write latency.</p><h4>Disadvantages</h4><p>But resharding is difficult because moving data between shards requires downtime and/or complex migrations.</p><p>Also, changing your partition key later requires relocating large amounts of data (this is expensive!). Plus, queries spanning many shards require extra coordination to combine the results.</p><h4>Best practices</h4><p>So choose partition keys with many distinct values to distribute traffic evenly.</p><p>Also monitor for hot partitions and rebalance shards if necessary. Besides, design your schema to minimize queries that must access many shards.</p><p>Sharding distributes writes across different machines. <em>But what about distributing them across time?..</em></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2>4. Message queues</h2><p>Imagine your API receives a burst of 10,000 requests in one minute.</p><p>Each request triggers database writes. And this could make your system performance BAD. Some requests succeed, while others fail/time out!</p><p>Then the problems cascade:</p><ul><li><p>One slow service <em>blocks</em> the entire request chain</p></li><li><p>Services must scale together even with different workloads</p></li><li><p>Retry logic makes it worse, as clients repeatedly hit the same overloaded endpoint</p></li></ul><p>You can solve this problem using message queues such as Amazon SQS, RabbitMQ, or Kafka.</p><p>They buffer messages between services. So when one service slows down, it has <em>less</em> impact on the others.</p><p>Here&#8217;s how a message queue works:</p><ol><li><p>Producers send messages to the queue</p></li><li><p>The queue stores messages until they&#8217;re ready to be processed</p></li><li><p>Consumers retrieve messages at their own pace, process them, &amp; then acknowledge completion</p></li></ol><p>So instead of processing requests immediately, your API places them in a message queue.</p><p>Background services then process the messages asynchronously&#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_!ByJ-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F159f6350-dbcf-4409-9a47-cbce9bc9d47f_1448x1086.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ByJ-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F159f6350-dbcf-4409-9a47-cbce9bc9d47f_1448x1086.png 424w, https://substackcdn.com/image/fetch/$s_!ByJ-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F159f6350-dbcf-4409-9a47-cbce9bc9d47f_1448x1086.png 848w, https://substackcdn.com/image/fetch/$s_!ByJ-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F159f6350-dbcf-4409-9a47-cbce9bc9d47f_1448x1086.png 1272w, https://substackcdn.com/image/fetch/$s_!ByJ-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F159f6350-dbcf-4409-9a47-cbce9bc9d47f_1448x1086.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ByJ-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F159f6350-dbcf-4409-9a47-cbce9bc9d47f_1448x1086.png" width="1448" height="1086" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/159f6350-dbcf-4409-9a47-cbce9bc9d47f_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;:717150,&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/202141184?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F159f6350-dbcf-4409-9a47-cbce9bc9d47f_1448x1086.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_!ByJ-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F159f6350-dbcf-4409-9a47-cbce9bc9d47f_1448x1086.png 424w, https://substackcdn.com/image/fetch/$s_!ByJ-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F159f6350-dbcf-4409-9a47-cbce9bc9d47f_1448x1086.png 848w, https://substackcdn.com/image/fetch/$s_!ByJ-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F159f6350-dbcf-4409-9a47-cbce9bc9d47f_1448x1086.png 1272w, https://substackcdn.com/image/fetch/$s_!ByJ-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F159f6350-dbcf-4409-9a47-cbce9bc9d47f_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 aria-hidden="true" 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><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">Message broker workflow</figcaption></figure></div><h4>Advantages</h4><p>Message queues &#8220;absorb traffic spikes&#8221; because messages get stored until workers can process them.</p><p>Plus, they decouple services, so each one can scale independently. Besides they set the foundation for event-driven architectures where services communicate through events instead of direct API calls.</p><h4>Disadvantages</h4><p>But in asynchronous processing, clients do NOT immediately know whether a request has completed successfully.</p><p>Also, message queues add <em>latency</em> because work happens later instead of during the request. Plus, they introduce another piece of infrastructure that must be deployed, monitored &amp; maintained.</p><h4>Best practices</h4><p>So make consumers idempotent<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a> because messages could be delivered more than once.</p><p>Also use dead letter queues<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a> to isolate failed messages. Besides, monitor queue depth because growing backlogs are often an early sign of system problems.</p><p>Message queues make asynchronous processing possible. <em>But what does asynchronous processing actually look like from a user&#8217;s perspective?</em></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><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>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>(If this newsletter has helped you become a better software engineer, consider subscribing to support my work.)</p></div><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2>5. Asynchronous processing</h2>
      <p>
          <a href="https://newsletter.systemdesign.one/p/system-design-patterns">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Vertical Small LLMs: A Deep Dive]]></title><description><![CDATA[#166: How a fine-tuned 3-billion-parameter model beats today&#8217;s frontier models at one job, and how to build one this weekend]]></description><link>https://newsletter.systemdesign.one/p/fine-tuning-small-language-models</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/fine-tuning-small-language-models</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Mon, 03 Aug 2026 10:27:31 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/1fb507eb-84c3-4f9d-9b8e-e510437b2d32_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/fine-tuning-small-language-models/?action=share">Share this letter</a> &amp; I&#8217;ll send you some rewards for the referrals.</em></p></li></ul><h4 style="text-align: center;"><strong>&#167;</strong></h4><p>I shipped this new feature:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;520ca934-9bbd-4107-bde0-465508e2c42b&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">&#8594; Read support ticket,
&#8594; Choose the right tag,
&#8594; Then route the request to right person.</code></pre></div><p>The simplest way to build the feature is to call a frontier model through an API&#8230;</p><p>Yet this approach doesn&#8217;t scale because of API costs, latency, and data sensitivity risks. Plus, the model isn't solving a HARD reasoning problem. Instead, it's making the same decision a thousand times a day.</p><p>So I tried a &#8220;boring&#8221; alternative approach:</p><blockquote><p><em>Fine-tune a 3 billion parameter model on my desk in 74 minutes.</em></p><p><em>On one legal-labeling task, it scored 81.7% -- ahead of Claude Sonnet 4.6 at 77% and GPT-5.5 at 76.7%.</em></p></blockquote><p>i.e., the small model is NOT smarter than a frontier model. But a specialist and does one narrow task extremely well.</p><p>Onward.</p><h4 style="text-align: center;"><strong>&#167;</strong></h4><div class="callout-block" data-callout="true"><h2><a href="https://getunblocked.link/8IncW41">[Webinar] Can you prove AI is working?</a></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://getunblocked.link/8IncW41" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!i1B8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2723ec39-244c-4904-9ca8-ea5b65523913_1600x900.png 424w, https://substackcdn.com/image/fetch/$s_!i1B8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2723ec39-244c-4904-9ca8-ea5b65523913_1600x900.png 848w, https://substackcdn.com/image/fetch/$s_!i1B8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2723ec39-244c-4904-9ca8-ea5b65523913_1600x900.png 1272w, https://substackcdn.com/image/fetch/$s_!i1B8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2723ec39-244c-4904-9ca8-ea5b65523913_1600x900.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!i1B8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2723ec39-244c-4904-9ca8-ea5b65523913_1600x900.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2723ec39-244c-4904-9ca8-ea5b65523913_1600x900.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;:279908,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://getunblocked.link/8IncW41&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/206682047?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2723ec39-244c-4904-9ca8-ea5b65523913_1600x900.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_!i1B8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2723ec39-244c-4904-9ca8-ea5b65523913_1600x900.png 424w, https://substackcdn.com/image/fetch/$s_!i1B8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2723ec39-244c-4904-9ca8-ea5b65523913_1600x900.png 848w, https://substackcdn.com/image/fetch/$s_!i1B8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2723ec39-244c-4904-9ca8-ea5b65523913_1600x900.png 1272w, https://substackcdn.com/image/fetch/$s_!i1B8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2723ec39-244c-4904-9ca8-ea5b65523913_1600x900.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 aria-hidden="true" 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><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><strong><a href="https://getunblocked.link/8IncW41">Join live on Aug 19 (FREE)</a></strong> to learn:</p><ul><li><p>The 4 metrics to measure where AI gains leak out before production.</p></li><li><p>The 8 stages of context maturity, the specific walls capping your metrics, and a free tool to pinpoint where your team is.</p></li><li><p>Why more MCPs and bigger context windows aren&#8217;t enough, and what it takes to get real value from your agents.</p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://getunblocked.link/8IncW41&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://getunblocked.link/8IncW41"><span>Register Now</span></a></p><p><em>(Thanks to <a href="https://getunblocked.link/8IncW41">Unblocked</a> for partnering on this newsletter.)</em></p></div><h4 style="text-align: center;"><strong>&#167;</strong></h4><p>I want to introduce <strong><a href="https://maven.com/stemplicity/become-an-agentic-ai-engineer?promoCode=AGENTS2026">Kukeshajanth Kodeswaran</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://maven.com/stemplicity/become-an-agentic-ai-engineer?promoCode=AGENTS2026" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8LqG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bd11839-c003-4a8e-9ae3-0f32de16cf49_3200x1800.png 424w, https://substackcdn.com/image/fetch/$s_!8LqG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bd11839-c003-4a8e-9ae3-0f32de16cf49_3200x1800.png 848w, https://substackcdn.com/image/fetch/$s_!8LqG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bd11839-c003-4a8e-9ae3-0f32de16cf49_3200x1800.png 1272w, https://substackcdn.com/image/fetch/$s_!8LqG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bd11839-c003-4a8e-9ae3-0f32de16cf49_3200x1800.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8LqG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bd11839-c003-4a8e-9ae3-0f32de16cf49_3200x1800.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9bd11839-c003-4a8e-9ae3-0f32de16cf49_3200x1800.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;:732019,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://maven.com/stemplicity/become-an-agentic-ai-engineer?promoCode=AGENTS2026&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/206682047?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bd11839-c003-4a8e-9ae3-0f32de16cf49_3200x1800.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_!8LqG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bd11839-c003-4a8e-9ae3-0f32de16cf49_3200x1800.png 424w, https://substackcdn.com/image/fetch/$s_!8LqG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bd11839-c003-4a8e-9ae3-0f32de16cf49_3200x1800.png 848w, https://substackcdn.com/image/fetch/$s_!8LqG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bd11839-c003-4a8e-9ae3-0f32de16cf49_3200x1800.png 1272w, https://substackcdn.com/image/fetch/$s_!8LqG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9bd11839-c003-4a8e-9ae3-0f32de16cf49_3200x1800.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 aria-hidden="true" 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><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 the co-founder of <strong>modalis</strong> and Director of Engineering at <strong>Launchpad.AI</strong>, where he&#8217;s shipped AI systems running in production at Nike, Mr. Cooper, and Levi&#8217;s.</p><p>If you want to learn to build production-grade AI agents, I highly recommend his live Maven bootcamp: <strong><a href="https://maven.com/stemplicity/become-an-agentic-ai-engineer?promoCode=AGENTS2026"><span>Become an Agentic AI Engineer</span></a></strong> and <strong><a href="https://maven.com/stemplicity/ai-in-finance?promoCode=AIFINANCE200"><span>Master AI Agents for Business</span></a></strong>. He teaches it with Dr. Ryan Ahmed - he also co-authored the #1 Claude course on Udemy, and the Maven cohorts are rated 4.9.</p><p>(You&#8217;ll also get an exclusive <a href="https://maven.com/stemplicity/become-an-agentic-ai-engineer?promoCode=AGENTS2026">20% discount</a> when you use the link.)</p><h4 style="text-align: center;"><strong>&#167;</strong></h4><p><em><strong>Here&#8217;s what&#8217;s inside this newsletter:</strong></em></p><ul><li><p><strong>Why a tiny AI can outperform a large one. </strong>The narrow class of problems where a 3B model can beat frontier models, where it falls short, and why size alone doesn&#8217;t decide the winner.</p></li><li><p><strong>The specialist&#8217;s toolbox.</strong> Retrieval-Augmented Generation (RAG), Low-Rank Adaptation (LoRA), distillation, and quantization; what each technique solves and when each belongs in your stack.</p></li><li><p><strong>Production architecture quietly replacing one-model-fits-all. </strong>Where small models handle routine work, where frontier models still earn their cost, and why routing between them changes economics.</p></li><li><p><strong>A real benchmark from start to finish.</strong> A fine-tuned SmolLM3 model, a legal contract dataset, head-to-head results against GPT-5.5 and Claude Sonnet 4.6, and what the numbers actually mean.</p></li><li><p><strong>Decision framework for your next AI project.</strong> Which workloads deserve a vertical small LLM, which should stay with a frontier model, and where you&#8217;ll spend time and money without seeing better results.</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"><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><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2>What Makes a Small AI Different?</h2><p>The idea comes down to two words: <em>small &amp; vertical</em>.</p><p>A small language model usually has between 1 and 8 billion parameters. i.e., it&#8217;s small enough to run on hardware you already own. A 3 billion-parameter model can run on a gaming GPU, and many models in this range even run on a modern laptop. But frontier models are much larger. They run in cloud data centers, and you access them through an API.</p><p>A vertical model is trained for &#8220;one&#8221; domain. Instead of becoming good at every task, it becomes extremely good at one. For example, banking support, contract review, medical Q&amp;A. </p><p>Think of it like hiring people:</p><p>A frontier model is a general practitioner who knows a <em>little</em> about many subjects. A vertical small model is like a heart surgeon. You wouldn&#8217;t ask a surgeon to file your taxes, and you wouldn&#8217;t ask a general practitioner to perform heart surgery. Each is built for a different job.</p><p>The same idea applies to AI.</p><p>If your company workflow keeps making the same decision over &amp; over, a vertical small model can outperform a much larger general-purpose model on that specific task.</p><p>IMPORTANT: small doesn&#8217;t mean <em>weak</em>&#8230; it just means &#8220;focused&#8221;.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_kE_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F550a3d4b-ff95-4ee4-a61d-995426c8358b_1600x900.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_kE_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F550a3d4b-ff95-4ee4-a61d-995426c8358b_1600x900.png 424w, https://substackcdn.com/image/fetch/$s_!_kE_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F550a3d4b-ff95-4ee4-a61d-995426c8358b_1600x900.png 848w, https://substackcdn.com/image/fetch/$s_!_kE_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F550a3d4b-ff95-4ee4-a61d-995426c8358b_1600x900.png 1272w, https://substackcdn.com/image/fetch/$s_!_kE_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F550a3d4b-ff95-4ee4-a61d-995426c8358b_1600x900.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_kE_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F550a3d4b-ff95-4ee4-a61d-995426c8358b_1600x900.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/550a3d4b-ff95-4ee4-a61d-995426c8358b_1600x900.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_!_kE_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F550a3d4b-ff95-4ee4-a61d-995426c8358b_1600x900.png 424w, https://substackcdn.com/image/fetch/$s_!_kE_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F550a3d4b-ff95-4ee4-a61d-995426c8358b_1600x900.png 848w, https://substackcdn.com/image/fetch/$s_!_kE_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F550a3d4b-ff95-4ee4-a61d-995426c8358b_1600x900.png 1272w, https://substackcdn.com/image/fetch/$s_!_kE_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F550a3d4b-ff95-4ee4-a61d-995426c8358b_1600x900.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 aria-hidden="true" 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><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 style="text-align: center;"><strong>&#167;</strong></h4><h2>Why Companies Build Their Own Small Models</h2><p>If frontier models are so capable, why do companies build their own small models?</p><p>Here&#8217;s why:</p><h4>1. Cost</h4><p>A frontier model is <em>inexpensive</em><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a> for a few requests.</p><p>The problem appears when your application handles millions of them every day. Suppose every support ticket, insurance claim, or contract goes through AI. Even a small cost per request adds up quickly.</p><p>A self-hosted small model, or an inexpensive hosted one (such as <a href="https://groq.com">Groq</a>), can reduce inference costs by 25-60 times for these <em>repetitive</em> tasks.</p><p>For a high-volume system, this can save thousands or even millions of dollars each year.</p><h4>2. Speed</h4><p>Latency matters just as much.</p><p>When you call a frontier model, every request travels across the internet to a remote data center before the model can respond. The network trip often takes longer than the model&#8217;s actual computation<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a>.</p><p>A small 3B model running on your local server avoids this extra trip.</p><p>A background check company moved its high-volume background check system from a hosted frontier model to a fine-tuned small model running locally.</p><p>This reduced their response times from several seconds to less than a second<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a>.</p><h4>3. Data Privacy</h4><p>Sometimes the decision has nothing to do with cost or speed.</p><p>Many banks, hospitals, government agencies, and law firms cannot send sensitive customer data to an external AI service because of legal, regulatory, and/or company requirements.</p><p>In these cases, running an open model on their own infrastructure lets them keep the data inside their own environment while still using AI.</p><p>For these organizations, the question isn&#8217;t, <em>&#8220;Which model is cheaper?&#8221;</em> Instead, <em>&#8220;Which model lets us use AI without our data leaving the building?&#8221;</em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/fine-tuning-small-language-models?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/fine-tuning-small-language-models?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!e5ZD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba19d3bf-8c00-4b74-90c0-73df033b5fbe_1600x900.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!e5ZD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba19d3bf-8c00-4b74-90c0-73df033b5fbe_1600x900.png 424w, https://substackcdn.com/image/fetch/$s_!e5ZD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba19d3bf-8c00-4b74-90c0-73df033b5fbe_1600x900.png 848w, https://substackcdn.com/image/fetch/$s_!e5ZD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba19d3bf-8c00-4b74-90c0-73df033b5fbe_1600x900.png 1272w, https://substackcdn.com/image/fetch/$s_!e5ZD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba19d3bf-8c00-4b74-90c0-73df033b5fbe_1600x900.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!e5ZD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba19d3bf-8c00-4b74-90c0-73df033b5fbe_1600x900.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ba19d3bf-8c00-4b74-90c0-73df033b5fbe_1600x900.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_!e5ZD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba19d3bf-8c00-4b74-90c0-73df033b5fbe_1600x900.png 424w, https://substackcdn.com/image/fetch/$s_!e5ZD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba19d3bf-8c00-4b74-90c0-73df033b5fbe_1600x900.png 848w, https://substackcdn.com/image/fetch/$s_!e5ZD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba19d3bf-8c00-4b74-90c0-73df033b5fbe_1600x900.png 1272w, https://substackcdn.com/image/fetch/$s_!e5ZD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fba19d3bf-8c00-4b74-90c0-73df033b5fbe_1600x900.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 aria-hidden="true" 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><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 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>How Small Model Works</span></h2><p>Building a small model is usually much simpler than most people expect&#8230;</p><p>You don&#8217;t train a model from scratch. Instead, you start with a small open base model and improve it using one/more of these techniques<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a>:</p><h4>1. Retrieval-Augmented Generation (RAG)</h4><p>The model searches your company&#8217;s documents before answering a question.</p><p>Instead of relying only on what it learned during training, it also uses the latest information from your knowledge base.</p><p>For &#8220;most&#8221; applications, this is enough. No extra training required!</p><h4>2. Fine-Tuning</h4><p>If the model keeps making the <em>same</em> type of decision, you can teach it using &#8220;examples&#8221; from your data.</p><p>The most common approach is Low-Rank Adaptation (<strong>LoRA</strong>). Instead of retraining all billions of model parameters, LoRA trains only a small set of new parameters while leaving the original model unchanged.</p><p>This makes fine-tuning cheaper and faster. A model that normally requires many GPUs can be fine-tuned on a single GPU in about an hour.</p><p>(More on this later&#8230;)</p><h4>3. Distillation</h4><p>A large, powerful model generates high-quality answers.</p><p>Those answers then become training data for a smaller model. So the smaller model learns to produce similar results at a fraction of the cost<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a>.</p><h4>4. Quantization</h4><p>After the model is trained, you can shrink it by storing its parameters with lower numerical precision, so it fits on smaller hardware.</p><p>For example, converting a 7-billion-parameter model from 16-bit to 4-bit precision reduces its size from about 14 GB to around 4.5 GB, with <em>little</em> loss in accuracy.</p><h4>Putting It Together</h4><p>A typical production setup looks like this:</p><ol><li><p>A small model receives the request.</p></li><li><p>RAG provides the latest company information.</p></li><li><p>LoRA fine-tune teaches the model your specific task.</p></li><li><p>Quantization reduces the hardware needed to run it.</p></li><li><p>If the request is too difficult, it&#8217;s forwarded to a larger frontier model.</p></li></ol><p>This approach gives you the speed and low cost of a small model while still having a powerful model available for the few requests that need 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_!VA49!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ff08221-f37d-440e-9c84-7df5922e386f_1600x900.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VA49!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ff08221-f37d-440e-9c84-7df5922e386f_1600x900.png 424w, https://substackcdn.com/image/fetch/$s_!VA49!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ff08221-f37d-440e-9c84-7df5922e386f_1600x900.png 848w, https://substackcdn.com/image/fetch/$s_!VA49!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ff08221-f37d-440e-9c84-7df5922e386f_1600x900.png 1272w, https://substackcdn.com/image/fetch/$s_!VA49!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ff08221-f37d-440e-9c84-7df5922e386f_1600x900.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VA49!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ff08221-f37d-440e-9c84-7df5922e386f_1600x900.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9ff08221-f37d-440e-9c84-7df5922e386f_1600x900.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_!VA49!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ff08221-f37d-440e-9c84-7df5922e386f_1600x900.png 424w, https://substackcdn.com/image/fetch/$s_!VA49!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ff08221-f37d-440e-9c84-7df5922e386f_1600x900.png 848w, https://substackcdn.com/image/fetch/$s_!VA49!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ff08221-f37d-440e-9c84-7df5922e386f_1600x900.png 1272w, https://substackcdn.com/image/fetch/$s_!VA49!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ff08221-f37d-440e-9c84-7df5922e386f_1600x900.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 aria-hidden="true" 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><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"><em>RAG plus fine-tune stack</em></figcaption></figure></div><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2>Where Small Models Fall Short</h2><p>Small models are powerful, but they&#8217;re not the right tool for every job:</p><h4>1. They struggle with complex tasks</h4><p>A specialized model works best if it repeats the same type of decision over and over.</p><p>Give it a large, open-ended task, like designing a software system or writing a complex database migration, and its performance drops quickly.</p><p>For example, on real-world coding benchmarks, fine-tuned small coding models score around 20% to 36%, while today&#8217;s frontier models score closer to 80% to 88%.</p><h4>2. They can still hallucinate</h4><p>A specialized model is <em>not</em> automatically more accurate.</p><p>Legal AI systems built specifically for lawyers still invent facts. Popular legal research tools, such as Lexis+ AI and Westlaw AI<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a><strong>,</strong> produced hallucinations in 17% to 33% of their answers.</p><p>Plus models tuned specifically for medicine gave hallucination-free answers only 51% of the time, while general models hit 77%. </p><p>Specialized does not always mean more reliable.</p><p>So when a vendor says a domain model is more reliable because it&#8217;s specialized, ask for the numbers and evaluate a model on your own data.</p><h4>3. Fine-tuning has tradeoffs</h4><p>Fine-tuning teaches a model new skills, but it can also weaken existing ones.</p><p>The model would become better at your task while becoming worse at general knowledge/reasoning. Plus, fine-tuning can unintentionally reduce a model&#8217;s built-in safety behavior, even when the training data itself is harmless.</p><p>Every time you fine-tune a model, you must test it again before putting it into production.</p><h4>4. Benchmarks don&#8217;t tell the entire story</h4><p>A small model can have a good benchmark score and still perform poorly for your use case.</p><p>Sometimes models get a high score because they have already seen <em>similar</em> benchmark questions during training. When researchers evaluate them on completely &#8220;new data&#8221;, the scores can drop significantly.</p><p>So it&#8217;s very important to benchmark your own and perform well on the real tasks your users care about</p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2>How to Combine Small and Large Models</h2><p>The goal is not to make a small model do everything.</p><p>Instead, the goal is to use the correct model for each request.</p><p>Most production systems run both a small model and a frontier model together. The small model handles the (90%) common requests, while the frontier model takes over when the task (10%) is too difficult.</p><p>Let&#8217;s dive in!</p><h4>1. Model Routing</h4><p>The simplest approach is model routing.</p><p>Every request goes to the (cheap) small model first. If the model is confident, it returns its answer immediately. If its confidence falls below a threshold, the request is forwarded to a frontier model instead.</p><p>Open-source model &#8220;routers&#8221; follow this approach.</p><p>They can achieve about 95% of the quality of a frontier model while reducing inference costs by roughly 85%.</p><h4>2. Speculative Decoding</h4><p>Another optimization technique is speculative decoding.</p><p>The small model generates a draft response first. Instead of generating the entire answer from scratch, the frontier model verifies the draft and corrects it if necessary.</p><p>Because checking a draft is faster than writing one from scratch, speculative decoding can improve speed by around 3-4 times while producing the same final output.</p><h4>3. On-Device AI</h4><p>The same idea also appears on mobile devices.</p><p><a href="https://www.apple.com/apple-intelligence/">Apple Intelligence</a> uses a (3B) small model running directly on the device for everyday tasks. Only requests that need more reasoning/external knowledge are sent to larger models in the cloud.</p><p>This reduces latency, lowers cloud costs, and keeps more user data on the device.</p><h4>4. Measure Before You Ship</h4><p>None of these techniques matter if you don&#8217;t evaluate your model properly.</p><p>Don&#8217;t rely on public benchmarks alone. Build your own held-out test set<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-7" href="#footnote-7" target="_self">7</a> using real-world examples from your app, and ensure the model has <em>never</em> seen those examples during training.</p><p>This is the only reliable way to know whether your model is improving or simply performing well on familiar benchmarks.</p><p>(I followed the same process for the experiment later in this newsletter, and I&#8217;ll show you exactly how...)</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yOGm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d0084d4-a6f7-4756-a29b-0150a28bdf17_1600x900.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yOGm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d0084d4-a6f7-4756-a29b-0150a28bdf17_1600x900.png 424w, https://substackcdn.com/image/fetch/$s_!yOGm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d0084d4-a6f7-4756-a29b-0150a28bdf17_1600x900.png 848w, https://substackcdn.com/image/fetch/$s_!yOGm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d0084d4-a6f7-4756-a29b-0150a28bdf17_1600x900.png 1272w, https://substackcdn.com/image/fetch/$s_!yOGm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d0084d4-a6f7-4756-a29b-0150a28bdf17_1600x900.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yOGm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d0084d4-a6f7-4756-a29b-0150a28bdf17_1600x900.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3d0084d4-a6f7-4756-a29b-0150a28bdf17_1600x900.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_!yOGm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d0084d4-a6f7-4756-a29b-0150a28bdf17_1600x900.png 424w, https://substackcdn.com/image/fetch/$s_!yOGm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d0084d4-a6f7-4756-a29b-0150a28bdf17_1600x900.png 848w, https://substackcdn.com/image/fetch/$s_!yOGm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d0084d4-a6f7-4756-a29b-0150a28bdf17_1600x900.png 1272w, https://substackcdn.com/image/fetch/$s_!yOGm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3d0084d4-a6f7-4756-a29b-0150a28bdf17_1600x900.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 aria-hidden="true" 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><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 style="text-align: center;"><strong>&#167;</strong></h4><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>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></div><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2>Where Small Models Work Best</h2><p>Small models work best when the job is simple, repetitive, and happens thousands or millions of times.</p><p>Instead of solving a new problem every time, they make the same type of decision again &amp; again.</p><p>Let&#8217;s look at some use cases:</p><h4>1. Support Tickets</h4><p>A customer sends a support message.</p><p>The model decides which team should handle it and forwards it to the right place. The task is always the same; the volume is high, and the potential answers are limited. This is exactly the kind of job where a small model can outperform a large model.</p><p>A model with one billion parameters (or less) beat GPT-5 on this task.</p><h4>2. Contract Review</h4><p>Many companies use AI to find specific information in contracts.</p><p>For example:</p><ul><li><p>Find the termination clause.</p></li><li><p>Extract the liability limit.</p></li><li><p>Identify the renewal date.</p></li></ul><p>The model isn&#8217;t trying to understand every detail of the contract.</p><p>Instead, it&#8217;s looking for the same pieces of information in documents that all follow a similar structure. This is another task where a specialized small model can outperform GPT-5.</p><p>(I&#8217;ll use the example later in this newsletter&#8230;)</p><h4>3. Regulated Industries</h4><p>Small models are also a good fit for industries such as healthcare, finance, and law.</p><p>In many cases, sensitive customer data cannot be sent to an external AI service because of legal, regulatory, and/or company requirements. Running a small model on your own infrastructure keeps the data inside your environment.</p><p>These applications also focus on a narrow domain.</p><p>The model doesn&#8217;t need to know everything on the internet. It only needs to perform well on the specific tasks your organization asks it to do every day.</p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2>Why Run Your Own Model</h2><p>Running your own small model isn&#8217;t just about saving money.</p><p>It also gives you more control over how your AI system works.</p><p>Let&#8217;s dive in!</p>
      <p>
          <a href="https://newsletter.systemdesign.one/p/fine-tuning-small-language-models">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[What You Need to Master (And Avoid) to Build Fast, Reliable, and Scalable APIs]]></title><description><![CDATA[#165: Nine Tips for High-Performance APIs]]></description><link>https://newsletter.systemdesign.one/p/api-performance</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/api-performance</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Wed, 29 Jul 2026 10:27:09 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/20061fd8-849b-468b-8c07-53f79a51293e_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><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/api-performance/?action=share">Share this letter</a> &amp; I&#8217;ll send you some rewards for the referrals.</em></p></li></ul><div><hr></div><blockquote><p><em><span>How do you speed up your API?</span></em></p></blockquote><p><span>Every request requires work&#8230;Parse the payload, query the database, package the response, then send it back. i.e., each step takes time&#8230;</span></p><p><span>As traffic increases, these tiny delays add up:</span></p><ul><li><p>Servers struggle under load,</p></li><li><p><span>Users wait longer for responses,</span></p></li><li><p><span>Costs increase as you add more machines.</span></p></li></ul><p><span>The solution is NOT to write faster code.</span></p><p><span>Instead, build smarter systems that do less work, handle more traffic, and stay fast under pressure.</span></p><p><span>Let&#8217;s dive into proven ways to build high-performance APIs&#8230;</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><div class="callout-block" data-callout="true"><h3><a href="https://psxid.figma.com/neokim">Turn your ideas into interactive prototypes in mins (Partner)</a></h3><p>Everybody has product ideas&#8230;</p><p>But the HARD part is turning them into something people can click, test, and give feedback on before you spend weeks building it.</p><p>This is where <strong><a href="https://psxid.figma.com/neokim">Figma Make</a></strong> comes in&#8230;</p><p>With Figma Make, you can turn ideas or existing Figma designs into realistic, interactive prototypes to explore user flows, validate concepts, and iterate faster.</p><p>Here&#8217;s what you can do:</p><ul><li><p>Turn ideas into clickable prototypes in minutes.</p></li><li><p>Explore different user flows before development.</p></li><li><p>Create realistic interactions for usability testing.</p></li><li><p>Iterate quickly inside Figma using prompts.</p></li></ul><p>Whether you&#8217;re a designer, PM, founder, or engineer, Figma Make helps you move from concept to a testable prototype much faster.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://psxid.figma.com/neokim&quot;,&quot;text&quot;:&quot;Try Figma Make 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://psxid.figma.com/neokim"><span>Try Figma Make Today</span></a></p><p><em>(Thanks to <a href="https://psxid.figma.com/neokim">Figma</a> for partnering with this newsletter.)</em></p></div><h4 style="text-align: center;"><strong>&#167;</strong></h4><p><em><strong>Here&#8217;s what&#8217;s inside this newsletter:</strong></em></p><ul><li><p><strong>Why latency grows even when your code is efficient. </strong>The real bottlenecks hiding in databases, networks, and downstream services, and why scaling an API is mostly about reducing unnecessary work.</p></li><li><p><strong>The architecture patterns behind high-performance APIs.</strong> What caching, asynchronous processing, connection pooling, load balancing, rate limiting, and circuit breakers each solve, and why production systems combine them instead of relying on one optimization.</p></li><li><p><strong>Every optimization has a failure mode</strong>. Why stale caches, pool exhaustion, retry storms, payload bloat, and poorly tuned autoscaling can reduce reliability while trying to improve performance.</p></li><li><p><strong>Your API is only as fast as its slowest dependency.</strong> Why databases, external services, network round trips, and inefficient payloads usually dominate end-to-end request latency, long before your application code becomes the bottleneck.</p></li><li><p><strong>Nine prompts to review your API architecture.</strong> Audit latency bottlenecks, database access, caching strategy, scaling readiness, observability, and resilience to identify high-impact performance improvements before traffic exposes weak points.</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"><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><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>1. Caching and compression</span></h2><p><span>If responses didn&#8217;t change, you should STOP recomputing them.</span></p><p><span>This is the core idea behind </span><em><span>caching</span></em><span>: store responses so you can reuse them later. This skips expensive operations such as database queries, data manipulation, and/or API calls.</span></p><p><span>Here&#8217;s how it works:</span></p><ol><li><p><span>Your API receives a request X for the first time</span></p><ul><li><p><span>It does the usual steps: parse, query the database, package it into a response Y, and send the response</span></p></li><li><p><span>Right before/after sending, it stores Y somewhere in-memory; Y is now a cached response to request X</span></p></li></ul></li><li><p><span>Your API receives a request X for the second time</span></p><ul><li><p><span>It checks the cache first and sees that the response Y is already there, so it returns it; this is a </span><em><span>cache hit</span></em></p></li><li><p><span>It&#8217;s a lot faster because there were NO database queries, API calls, or data manipulation</span></p></li></ul></li><li><p><span>But what happens when the response to X is no longer Y?</span></p><ul><li><p><span>If the cache serves outdated data, your users see </span><em><span>stale results</span></em><span> (this is bad)</span></p></li><li><p><span>Your API needs to remove the stale data and update it with a fresh copy; this is called </span><em><span>cache invalidation</span></em></p></li><li><p><span>There are different techniques for invalidation: time-to-live (</span><strong><span>TTL</span></strong><span>), manual removal, cache-control headers</span></p></li></ul></li></ol><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Vu3V!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca2b29f8-28f4-4201-b644-ee1698132e97_11392x2379.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Vu3V!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca2b29f8-28f4-4201-b644-ee1698132e97_11392x2379.png 424w, https://substackcdn.com/image/fetch/$s_!Vu3V!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca2b29f8-28f4-4201-b644-ee1698132e97_11392x2379.png 848w, https://substackcdn.com/image/fetch/$s_!Vu3V!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca2b29f8-28f4-4201-b644-ee1698132e97_11392x2379.png 1272w, https://substackcdn.com/image/fetch/$s_!Vu3V!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca2b29f8-28f4-4201-b644-ee1698132e97_11392x2379.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Vu3V!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca2b29f8-28f4-4201-b644-ee1698132e97_11392x2379.png" width="658" height="137.3846153846154" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ca2b29f8-28f4-4201-b644-ee1698132e97_11392x2379.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:304,&quot;width&quot;:1456,&quot;resizeWidth&quot;:658,&quot;bytes&quot;:1770556,&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/208543063?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca2b29f8-28f4-4201-b644-ee1698132e97_11392x2379.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_!Vu3V!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca2b29f8-28f4-4201-b644-ee1698132e97_11392x2379.png 424w, https://substackcdn.com/image/fetch/$s_!Vu3V!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca2b29f8-28f4-4201-b644-ee1698132e97_11392x2379.png 848w, https://substackcdn.com/image/fetch/$s_!Vu3V!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca2b29f8-28f4-4201-b644-ee1698132e97_11392x2379.png 1272w, https://substackcdn.com/image/fetch/$s_!Vu3V!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fca2b29f8-28f4-4201-b644-ee1698132e97_11392x2379.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption">Read through cache</figcaption></figure></div><p><span>Caching is useful for data that does NOT change often.</span></p><p><span>Think of requests like profile lookups or product catalog searches. Popular implementations are in-memory caches (</span><a href="https://redis.io/"><span>Redis</span></a><span>, </span><a href="https://memcached.org/"><span>Memcached</span></a><span>) and edge caches (</span><a href="https://www.fastly.com/"><span>Fastly</span></a><span>, </span><a href="https://developers.cloudflare.com/cache/"><span>Cloudflare</span></a><span>).</span></p><h4><span>Downsides of caching</span></h4><ul><li><p><span>Stale data: cache can serve outdated responses if invalidation is not managed well</span></p></li><li><p><span>Complexity: invalidation logic adds extra logic when to remove/refresh entries</span></p></li><li><p><span>Hard to debug: behavior depends on timing, not just code logic</span></p></li></ul><div class="pullquote"><p><em>&#8220;There are only two hard things in computer science: cache invalidation &amp; naming things.&#8221; -- Phil Karlton</em></p></div><h3><span>Compression explained</span></h3><p><span>If the responses are too BIG, then make them smaller.</span></p><p><span>This is the core idea behind </span><em><span>compression</span></em><span>: shrink the payload before sending it over the network. It removes </span><em><span>redundancy</span></em><span>, such as repeated characters or formatting. A smaller, but equal result travels faster &amp; uses less bandwidth.</span></p><p><span>Here is how it works:</span></p><ol><li><p><span>Your API and the client agree on which compression format to use</span></p><ul><li><p><span>This process often happens through the </span><code>Accept-Encoding </code><span>and </span><code>Content-Encoding</code><span> HTTP headers</span></p></li><li><p><span>For example, a client requests </span><code>Accept-Encoding: gzip</code><span>, and the API replies with </span><code>Content-Encoding: gzip</code></p></li></ul></li><li><p><span>Your API prepares the response data Y</span></p><ul><li><p><span>Before sending, it runs Y through a compression algorithm</span></p></li><li><p><span>This makes Y smaller, so it uses less network bandwidth &amp; gets sent faster</span></p></li></ul></li><li><p><span>The smaller, compressed version of Y gets sent over the network</span></p></li><li><p><span>Client receives this compressed version of Y</span></p><ul><li><p><span>Before using it, the client runs the response through a decompression algorithm</span></p></li><li><p><span>This makes it grow to its original size again</span></p></li></ul></li></ol><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lWMg!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9031edc2-3bd0-4021-93d5-b3f724a13ad5_10868x6267.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lWMg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9031edc2-3bd0-4021-93d5-b3f724a13ad5_10868x6267.png 424w, https://substackcdn.com/image/fetch/$s_!lWMg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9031edc2-3bd0-4021-93d5-b3f724a13ad5_10868x6267.png 848w, https://substackcdn.com/image/fetch/$s_!lWMg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9031edc2-3bd0-4021-93d5-b3f724a13ad5_10868x6267.png 1272w, https://substackcdn.com/image/fetch/$s_!lWMg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9031edc2-3bd0-4021-93d5-b3f724a13ad5_10868x6267.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lWMg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9031edc2-3bd0-4021-93d5-b3f724a13ad5_10868x6267.png" width="416" height="240" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9031edc2-3bd0-4021-93d5-b3f724a13ad5_10868x6267.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:840,&quot;width&quot;:1456,&quot;resizeWidth&quot;:416,&quot;bytes&quot;:1921585,&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/208543063?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9031edc2-3bd0-4021-93d5-b3f724a13ad5_10868x6267.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_!lWMg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9031edc2-3bd0-4021-93d5-b3f724a13ad5_10868x6267.png 424w, https://substackcdn.com/image/fetch/$s_!lWMg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9031edc2-3bd0-4021-93d5-b3f724a13ad5_10868x6267.png 848w, https://substackcdn.com/image/fetch/$s_!lWMg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9031edc2-3bd0-4021-93d5-b3f724a13ad5_10868x6267.png 1272w, https://substackcdn.com/image/fetch/$s_!lWMg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9031edc2-3bd0-4021-93d5-b3f724a13ad5_10868x6267.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><span>Compression works well for large JSON/binary responses.</span></p><p><span>Some popular compression formats are </span><a href="https://www.gzip.org/"><span>Gzip</span></a><span> and </span><a href="https://www.ietf.org/rfc/rfc7932.txt"><span>Brotli</span></a><span>. Other options are using </span><a href="https://protobuf.dev/"><span>Protobuf</span></a><span> or </span><a href="https://avro.apache.org/"><span>Avro</span></a><span> formats that reduce payload size </span><em><span>by design</span></em><span>.</span></p><h4><span>Downsides of compression</span></h4><ul><li><p><span>CPU cost: each encode/decode cycle consumes processing power</span></p></li><li><p><span>Only helpful for large payloads: best used when responses exceed 1KB</span></p></li><li><p><span>Diminishing returns: for small responses, CPU cost could outweigh network savings</span></p></li></ul><h4><span>Takeaway</span></h4><ul><li><p><span>Caching avoids recomputation and saves processing time, but adds memory cost and invalidation complexity.</span></p></li><li><p><span>Compression reduces payload size and network latency, but increases CPU usage.</span></p></li></ul><p><span>Both speed your API when used selectively &amp; measured against their tradeoffs.</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>2. Load balancing and autoscaling</span></h2><blockquote><p><em><span>How do you keep your API fast as demand grows?</span></em></p></blockquote><p><span>Every request your API gets is a &#8220;job&#8221;.</span></p><p><span>As traffic grows, one machine can&#8217;t do it all. The system slows down, queues form, and users wait. Adding more servers helps, but only if you can share the work and manage them properly.</span></p><p><span>This is what load balancing &amp; autoscaling do.</span></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/api-performance?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/api-performance?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><h3><span>Load balancing explained</span></h3><p><span>If one server is busy, you should route new requests to other servers.</span></p><p><span>That&#8217;s the key idea behind </span><em><span>load balancing</span></em><span>. It spreads incoming traffic across many servers so NO single one gets stuck doing all the work. It&#8217;s like a traffic cop directing cars to open lanes.</span></p><p><span>Here&#8217;s how it works:</span></p><ol><li><p><span>Your API receives a request</span></p></li><li><p><span>The load balancer sits in front of all servers and decides where it goes</span></p></li><li><p><span>It checks which servers are healthy &amp; how busy they are</span></p></li><li><p><span>Load balancer sends the request to the best option</span></p></li><li><p><span>That server handles it and returns the response</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_!6JpP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F592400e0-4244-41a1-af97-16bf056a7595_2297x1013.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6JpP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F592400e0-4244-41a1-af97-16bf056a7595_2297x1013.png 424w, https://substackcdn.com/image/fetch/$s_!6JpP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F592400e0-4244-41a1-af97-16bf056a7595_2297x1013.png 848w, https://substackcdn.com/image/fetch/$s_!6JpP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F592400e0-4244-41a1-af97-16bf056a7595_2297x1013.png 1272w, https://substackcdn.com/image/fetch/$s_!6JpP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F592400e0-4244-41a1-af97-16bf056a7595_2297x1013.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6JpP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F592400e0-4244-41a1-af97-16bf056a7595_2297x1013.png" width="605" height="266.7651098901099" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/592400e0-4244-41a1-af97-16bf056a7595_2297x1013.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:642,&quot;width&quot;:1456,&quot;resizeWidth&quot;:605,&quot;bytes&quot;:157624,&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/208543063?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F592400e0-4244-41a1-af97-16bf056a7595_2297x1013.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_!6JpP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F592400e0-4244-41a1-af97-16bf056a7595_2297x1013.png 424w, https://substackcdn.com/image/fetch/$s_!6JpP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F592400e0-4244-41a1-af97-16bf056a7595_2297x1013.png 848w, https://substackcdn.com/image/fetch/$s_!6JpP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F592400e0-4244-41a1-af97-16bf056a7595_2297x1013.png 1272w, https://substackcdn.com/image/fetch/$s_!6JpP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F592400e0-4244-41a1-af97-16bf056a7595_2297x1013.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 aria-hidden="true" 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><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>Load balancing makes your system faster and more reliable.</span></p><p><span>If one server fails or gets overwhelmed, others take over. Load balancing is great for web APIs, microservices, and high-traffic systems. You rarely build one yourself, but use existing solutions.</span></p><p><span>Some popular implementations are </span><a href="https://aws.amazon.com/elasticloadbalancing/"><span>AWS ELB</span></a><span>, </span><a href="https://www.haproxy.com/documentation/"><span>HAProxy</span></a><span>, and </span><a href="https://nginx.org/"><span>Nginx</span></a><span>.</span></p><h4><span>Downsides of load balancing</span></h4><ul><li><p><span>Setup overhead: adds configuration &amp; management work</span></p></li><li><p><span>Single point of failure: can become one without &#8220;redundancy&#8221;</span></p></li><li><p><span>Session problems: stateful sessions break when requests go to different servers</span></p></li><li><p><span>Extra complexity: sticky sessions/shared storage fix sessions, but add complexity</span></p></li></ul><h3><span>Autoscaling explained</span></h3><p><span>If servers can&#8217;t keep up, you shouldn&#8217;t add more manually; let the system do it for you.</span></p><p><span>This is the idea behind </span><em><span>autoscaling</span></em><span>. It adds/removes servers automatically when the load changes. It&#8217;s like calling in extra chefs when a restaurant gets a rush of orders, then sending them home when it quiets down.</span></p><p><span>Here&#8217;s how it works:</span></p><ol><li><p><span>System tracks metrics such as CPU, memory, and/or request rate</span></p></li><li><p><span>When traffic gets high, it adds more servers based on pre-defined rules</span></p></li><li><p><span>New servers join &amp; start taking requests</span></p></li><li><p><span>When traffic drops, extra servers get shut down</span></p></li><li><p><span>The system stays stable &amp; doesn&#8217;t waste money</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_!eJbz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd14c2fd6-f610-4e6a-8800-32b27bb7af76_1693x929.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eJbz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd14c2fd6-f610-4e6a-8800-32b27bb7af76_1693x929.png 424w, https://substackcdn.com/image/fetch/$s_!eJbz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd14c2fd6-f610-4e6a-8800-32b27bb7af76_1693x929.png 848w, https://substackcdn.com/image/fetch/$s_!eJbz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd14c2fd6-f610-4e6a-8800-32b27bb7af76_1693x929.png 1272w, https://substackcdn.com/image/fetch/$s_!eJbz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd14c2fd6-f610-4e6a-8800-32b27bb7af76_1693x929.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!eJbz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd14c2fd6-f610-4e6a-8800-32b27bb7af76_1693x929.png" width="1456" height="799" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d14c2fd6-f610-4e6a-8800-32b27bb7af76_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;:938699,&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/208543063?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd14c2fd6-f610-4e6a-8800-32b27bb7af76_1693x929.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_!eJbz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd14c2fd6-f610-4e6a-8800-32b27bb7af76_1693x929.png 424w, https://substackcdn.com/image/fetch/$s_!eJbz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd14c2fd6-f610-4e6a-8800-32b27bb7af76_1693x929.png 848w, https://substackcdn.com/image/fetch/$s_!eJbz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd14c2fd6-f610-4e6a-8800-32b27bb7af76_1693x929.png 1272w, https://substackcdn.com/image/fetch/$s_!eJbz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd14c2fd6-f610-4e6a-8800-32b27bb7af76_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 aria-hidden="true" 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><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>Autoscaling is common in systems with unpredictable workloads &amp; traffic spikes.</span></p><p><span>Popular tools are </span><a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/"><span>Kubernetes HPA</span></a><span> &amp; </span><a href="https://docs.aws.amazon.com/autoscaling/ec2/userguide/auto-scaling-groups.html"><span>AWS Auto Scaling Groups</span></a><span>.</span></p><h4><span>Downsides of autoscaling</span></h4><ul><li><p><span>Rule sensitivity: triggering too early wastes resources, while triggering too late hurts performance</span></p></li><li><p><span>Startup delays: slow server startup affects performance during scaling</span></p></li><li><p><span>Configuration work: requires tuning trigger rules &amp; thresholds</span></p></li></ul><h4><span>Takeaway</span></h4><p><span>Load balancing spreads work across servers &amp; prevents overloading.</span></p><p><span>Autoscaling adds/removes servers in the system and manages system capacity. Together, they make APIs faster, stable, and ready for traffic changes.</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>3. Asynchronous processing</span></h2><blockquote><p><em><span>How do you keep your API responsive when some tasks take a long time?</span></em></p></blockquote><p><span>Tasks like sending emails, reading files, or calling services spend a lot of time waiting for input/output (</span><strong><span>IO</span></strong><span>).</span></p><p><span>During the wait, the server isn&#8217;t using the CPU efficiently. If your API waits for these long tasks to finish, users experience slow response time. </span><em><span>Asynchronous processing</span></em><span> solves this problem. It lets the API respond immediately while heavy tasks run in the background.</span></p><p><span>Here&#8217;s how it works:</span></p><ol><li><p><span>API receives a request that triggers an IO-bound task</span></p></li><li><p><span>Instead of processing it right away, it puts a message in a queue</span></p></li><li><p><span>The API responds to the client immediately with a job ID/status</span></p></li><li><p><span>Background workers read from the queue and process tasks independently</span></p></li><li><p><span>Workers notify the client when the job is done </span>(OPTIONAL)</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_!uGFA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524e356a-c6aa-4bdd-bf87-8358c96e0f22_1662x946.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uGFA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524e356a-c6aa-4bdd-bf87-8358c96e0f22_1662x946.png 424w, https://substackcdn.com/image/fetch/$s_!uGFA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524e356a-c6aa-4bdd-bf87-8358c96e0f22_1662x946.png 848w, https://substackcdn.com/image/fetch/$s_!uGFA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524e356a-c6aa-4bdd-bf87-8358c96e0f22_1662x946.png 1272w, https://substackcdn.com/image/fetch/$s_!uGFA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524e356a-c6aa-4bdd-bf87-8358c96e0f22_1662x946.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uGFA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524e356a-c6aa-4bdd-bf87-8358c96e0f22_1662x946.png" width="1456" height="829" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/524e356a-c6aa-4bdd-bf87-8358c96e0f22_1662x946.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:829,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1117308,&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/208543063?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524e356a-c6aa-4bdd-bf87-8358c96e0f22_1662x946.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_!uGFA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524e356a-c6aa-4bdd-bf87-8358c96e0f22_1662x946.png 424w, https://substackcdn.com/image/fetch/$s_!uGFA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524e356a-c6aa-4bdd-bf87-8358c96e0f22_1662x946.png 848w, https://substackcdn.com/image/fetch/$s_!uGFA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524e356a-c6aa-4bdd-bf87-8358c96e0f22_1662x946.png 1272w, https://substackcdn.com/image/fetch/$s_!uGFA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F524e356a-c6aa-4bdd-bf87-8358c96e0f22_1662x946.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 aria-hidden="true" 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><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>It&#8217;s like placing an order at a restaurant and receiving a buzzer:</span></p><p><span>You can keep doing other things while the kitchen finishes your meal, and the restaurant keeps serving new customers.</span></p><p><span>Asynchronous processing is ideal for high-traffic systems, unpredictable workloads, or slow IO tasks. It decouples request handling from heavy work, keeping APIs fast and responsive.</span></p><p><span>Popular tools are </span><a href="https://www.rabbitmq.com/"><span>RabbitMQ</span></a><span>, </span><a href="https://kafka.apache.org/"><span>Kafka</span></a><span> &amp; </span><a href="https://docs.celeryq.dev/en/stable/index.html"><span>Celery</span></a><span>.</span></p><h4><span>Downsides of asynchronous processing</span></h4><ul><li><p><span>Increased complexity: must manage queues, workers, retries, and error tracking</span></p></li><li><p><span>Harder debugging: execution happens outside the main request flow</span></p></li><li><p><span>Failure handling: workers that fail need to retry/re-queue tasks</span></p></li><li><p><span>Limited CPU benefit: offers little help for CPU-bound work where waiting isn&#8217;t the problem</span></p></li></ul><h4><span>Takeaway</span></h4><p><span>Asynchronous processing keeps APIs responsive by offloading slow IO tasks to background workers.</span></p><p><span>It trades simplicity for scalability, making systems faster under load but harder to monitor and debug.</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><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>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>Ready for the best part?</p></div>
      <p>
          <a href="https://newsletter.systemdesign.one/p/api-performance">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[I struggled with "microservices" until I learned these 22 patterns]]></title><description><![CDATA[#164: A field guide to splitting systems, keeping data correct, and surviving failure in production]]></description><link>https://newsletter.systemdesign.one/p/microservices-design-patterns</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/microservices-design-patterns</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Thu, 23 Jul 2026 10:24:07 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/5e7128ea-0519-434d-b858-edf96b60df75_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/microservices-design-patterns/?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>Some of these </span>microservice <span>patterns are </span><em><span>foundational</span></em><span>, and some are quite </span><em><span>advanced</span></em><span>. ALL of them are super useful to software engineers building scalable systems.</span></p><p><span>Curious to know how many were new to you:</span></p><ol><li><p><span>API Gateway,</span></p></li><li><p><span>Database per Service,</span></p></li><li><p><span>Circuit Breaker,</span></p></li><li><p><span>Event-Driven Messaging,</span></p></li><li><p><span>Service Discovery,</span></p></li><li><p><span>Retry with Backoff,</span></p></li><li><p><span>Decompose by Business Capability,</span></p></li><li><p><span>Saga,</span></p></li><li><p><span>Health Check API,</span></p></li><li><p><span>Distributed Tracing,</span></p></li><li><p><span>Service Instance per Container,</span></p></li><li><p><span>API Composition,</span></p></li><li><p><span>Transactional Outbox,</span></p></li><li><p><span>Remote Procedure Invocation (REST/gRPC),</span></p></li><li><p><span>Backends for Frontends (BFF),</span></p></li><li><p><span>Bulkhead,</span></p></li><li><p><span>Idempotent Consumer,</span></p></li><li><p><span>Strangler Fig,</span></p></li><li><p><span>CQRS,</span></p></li><li><p><span>Sidecar/Service Mesh,</span></p></li><li><p><span>Anti-Corruption Layer,</span></p></li><li><p><span>Event Sourcing.</span></p></li></ol><p>For each, I&#8217;ll share:</p><ul><li><p>What it is in plain English &amp; how it works,</p></li><li><p>A real-world analogy (if I found one),</p></li><li><p>Tradeoffs,</p></li><li><p>Why it matters.</p></li></ul><p><span>Let&#8217;s go!</span></p><h4 style="text-align: center;">&#167;</h4><div class="callout-block" data-callout="true"><h3><strong><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></strong></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;:&quot;&quot;,&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 aria-hidden="true" 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><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 number of vibe-coded apps in </span><em>enterprise environments </em><span>has skyrocketed.</span></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><span>INTRODUCING </span><a href="https://superblocks.com/?utm_source=newsletter&amp;utm_medium=influencer&amp;utm_content=neo_kim">SUPERBLOCKS</a><span>&#8230;</span></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><span>(Thanks to </span><a href="https://superblocks.com/?utm_source=newsletter&amp;utm_medium=influencer&amp;utm_content=neo_kim">Superblocks</a><span> for partnering on this post.)</span></p></div><h4 style="text-align: center;">&#167;</h4><h2><strong><span>1. API Gateway</span></strong></h2><blockquote><p><span>An application programming interface (</span><strong><span>API</span></strong><span>) gateway is a single entry point for your services.</span></p></blockquote><p><span>A client must &#8220;never&#8221; call services directly.</span></p><p><span>The gateway gives them a single address and forwards each request to the correct service. Plus, it centralizes the cross-cutting concerns: </span><em><span>authenticates requests, enforces rate limits, terminates Transport Layer Security (</span><strong><span>TLS</span></strong><span>), caches responses, and translates protocols.</span></em></p><p><span>i.e., your services stay focused on business logic instead of repeating </span>cross-cutting logic<span> across the codebase.</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_!jTvA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0f23f5d-c449-4ce6-b373-dc5b56d9a2ec_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jTvA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0f23f5d-c449-4ce6-b373-dc5b56d9a2ec_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!jTvA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0f23f5d-c449-4ce6-b373-dc5b56d9a2ec_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!jTvA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0f23f5d-c449-4ce6-b373-dc5b56d9a2ec_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!jTvA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0f23f5d-c449-4ce6-b373-dc5b56d9a2ec_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jTvA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0f23f5d-c449-4ce6-b373-dc5b56d9a2ec_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e0f23f5d-c449-4ce6-b373-dc5b56d9a2ec_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_!jTvA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0f23f5d-c449-4ce6-b373-dc5b56d9a2ec_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!jTvA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0f23f5d-c449-4ce6-b373-dc5b56d9a2ec_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!jTvA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0f23f5d-c449-4ce6-b373-dc5b56d9a2ec_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!jTvA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe0f23f5d-c449-4ce6-b373-dc5b56d9a2ec_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 aria-hidden="true" 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><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><span>Analogy</span></strong></h3><p><span>A hotel front desk routes guest requests.</span></p><p><span>You never walk into the kitchen or the laundry room yourself. Instead, you ask the desk, and they route your request to the right department.</span></p><p><span>i.e., one point of contact hides a dozen moving parts.</span></p><h3><strong><span>Tradeoff</span></strong></h3><p><span>A gateway simplifies clients</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a><span>, centralizes security and observability, and lets you reshape services behind a stable interface.</span></p><p><span>But it adds a network hop, and could become a single point of failure if you run only one instance. Plus, it can become a development bottleneck when every team must change it, and it risks becoming a mini-monolith if you add business logic inside.</span></p><p><span>So run it behind a load balancer for high availability and keep it thin.</span></p><h3><strong><span>Why it matters</span></strong></h3><p>Use an API gateway when many services sit behind one public API, mobile and web apps need a single endpoint, or you want to handle authentication and rate limits in one place.</p><p>It can also help you move clients from a monolith to microservices without breaking the existing API&#8230;</p><p><span>Some popular implementations are </span>Kong, NGINX, Envoy, AWS API Gateway, and Apigee. </p><p>TIP: <span>Pair it with the Backends for Frontends</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a><span> pattern (more on this in concept 15) when different clients, such as web and mobile apps, need different APIs.</span></p><h2><strong><span>2. Database per Service</span></strong></h2><blockquote><p><span>Each service has a private database that NO other service directly touches.</span></p></blockquote><p><span>A service keeps its own data and exposes data only through its API.</span></p><p><span>Other services ask for what they need instead of directly reaching into the tables. This keeps services loosely coupled: you can change a schema, switch between databases, or add an index, and nothing breaks&#8230;</span></p><p><span>i.e., database becomes an implementation detail hidden behind the service boundary.</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_!Ipym!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30eee14d-4f82-4e77-976e-5001360feaae_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ipym!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30eee14d-4f82-4e77-976e-5001360feaae_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!Ipym!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30eee14d-4f82-4e77-976e-5001360feaae_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!Ipym!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30eee14d-4f82-4e77-976e-5001360feaae_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!Ipym!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30eee14d-4f82-4e77-976e-5001360feaae_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ipym!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30eee14d-4f82-4e77-976e-5001360feaae_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/30eee14d-4f82-4e77-976e-5001360feaae_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_!Ipym!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30eee14d-4f82-4e77-976e-5001360feaae_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!Ipym!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30eee14d-4f82-4e77-976e-5001360feaae_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!Ipym!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30eee14d-4f82-4e77-976e-5001360feaae_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!Ipym!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30eee14d-4f82-4e77-976e-5001360feaae_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 aria-hidden="true" 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><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><span>Analogy</span></strong></h3><p><span>A shop with its own stockroom that only its staff enter.</span></p><p><span>Customers ask at the counter, and the staff fetches what&#8217;s needed. Nobody wanders into the back.</span></p><p><span>Because one team controls the stockroom, it stays organized, and changes surprise nobody.</span></p><h3><strong><span>Tradeoff</span></strong></h3><p><span>Private databases give each team independence, isolate failures, and let each service pick the right storage for its job.</span></p><p><span>But queries that span services get harder, you lose cross-table joins &amp; foreign keys, and keeping data consistent across services needs patterns such as Saga, API Composition, and Transactional Outbox</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a><span>.</span></p><p><span>A </span><em><span>shared database</span></em><span> looks easier on day one but silently couples every service over time.</span></p><h3><strong><span>Why it matters</span></strong></h3><p><span>Every microservices system has independent deploys, or services with very different data shapes &amp; access patterns.</span></p><p><span>This pattern makes microservices independent. So treat a &#8220;shared database&#8221; as a red flag.</span></p><p>Popular data stores are PostgreSQL, MySQL, MongoDB, and DynamoDB.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/microservices-design-patterns?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/microservices-design-patterns?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><h2><strong><span>3. Circuit Breaker</span></strong></h2><blockquote><p><span>A circuit breaker temporarily stops calls to a failing service, giving it time to recover and protecting callers from cascading failures.</span></p></blockquote><p><span>The breaker wraps a remote call &amp; watch failures:</span></p><ul><li><p><span>When calls succeed, it stays closed and traffic flows.</span></p></li><li><p><span>When failures cross a threshold, it opens, and every call fails fast without touching the failed service.</span></p></li><li><p><span>After a cool-down, it goes half-open and lets one trial call through.</span></p></li><li><p><span>If this succeeds, it closes again; if not, it opens &amp; waits longer.</span></p></li></ul><p><span>This turns a slow, resource-draining timeout into an instant, cheap rejection.</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_!gx9K!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe43374d7-46de-43e8-a562-91529aeae2e3_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gx9K!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe43374d7-46de-43e8-a562-91529aeae2e3_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!gx9K!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe43374d7-46de-43e8-a562-91529aeae2e3_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!gx9K!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe43374d7-46de-43e8-a562-91529aeae2e3_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!gx9K!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe43374d7-46de-43e8-a562-91529aeae2e3_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gx9K!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe43374d7-46de-43e8-a562-91529aeae2e3_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e43374d7-46de-43e8-a562-91529aeae2e3_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_!gx9K!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe43374d7-46de-43e8-a562-91529aeae2e3_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!gx9K!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe43374d7-46de-43e8-a562-91529aeae2e3_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!gx9K!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe43374d7-46de-43e8-a562-91529aeae2e3_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!gx9K!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe43374d7-46de-43e8-a562-91529aeae2e3_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 aria-hidden="true" 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><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><span>Analogy</span></strong></h3><p><span>An electrical fuse </span><em><span>trips</span></em><span> when too much current flows.</span></p><p><span>Instead of letting a fault burn down the house, the fuse cuts the circuit. Once the problem is fixed, you reset it and power returns.</span></p><p><span>The breaker does the same for a failing dependency, cutting it off before it drags everything down.</span></p><h3><strong><span>Tradeoff</span></strong></h3><p><span>They add error-handling paths and need careful tuning of thresholds &amp; timeouts.</span></p><p><span>Plus, they can trip on a &#8220;brief&#8221; blip and reject good traffic, and require monitoring so you notice an open circuit.</span></p><h3><strong><span>Why it matters</span></strong></h3><p><span>Calls to a remote/third-party dependency must degrade gracefully, or one slow service must NOT take down the whole request path.</span></p><p><span>Resilience4j (Java), Polly (.NET), and Envoy proxy implement breakers, and a service mesh (more on this in concept 20) such as Istio can apply them without code changes.</span></p><h2><strong><span>4. Event-Driven Messaging</span></strong></h2><blockquote><p><span>Services communicate by publishing &amp; consuming events through a &#8220;message broker&#8221; instead of calling each other directly &amp; wait.</span></p></blockquote><p><span>A direct call couples the caller to the callee in time: </span><em><span>the caller blocks for a reply, and a failure on either side breaks the request.</span></em></p><p><span>Event-driven messaging breaks this link. A service publishes an event to a broker and moves on, and any number of consumers can subscribe &amp; react on their own schedule.</span></p><p><span>This publish-and-subscribe style also lets you add new consumers later </span><em><span>without</span></em><span> touching the producer.</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_!PDZy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5563fe5-22c2-4ed9-aad9-ed47a55bd1bc_1774x887.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PDZy!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5563fe5-22c2-4ed9-aad9-ed47a55bd1bc_1774x887.png 424w, https://substackcdn.com/image/fetch/$s_!PDZy!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5563fe5-22c2-4ed9-aad9-ed47a55bd1bc_1774x887.png 848w, https://substackcdn.com/image/fetch/$s_!PDZy!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5563fe5-22c2-4ed9-aad9-ed47a55bd1bc_1774x887.png 1272w, https://substackcdn.com/image/fetch/$s_!PDZy!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5563fe5-22c2-4ed9-aad9-ed47a55bd1bc_1774x887.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PDZy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5563fe5-22c2-4ed9-aad9-ed47a55bd1bc_1774x887.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e5563fe5-22c2-4ed9-aad9-ed47a55bd1bc_1774x887.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;: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_!PDZy!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5563fe5-22c2-4ed9-aad9-ed47a55bd1bc_1774x887.png 424w, https://substackcdn.com/image/fetch/$s_!PDZy!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5563fe5-22c2-4ed9-aad9-ed47a55bd1bc_1774x887.png 848w, https://substackcdn.com/image/fetch/$s_!PDZy!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5563fe5-22c2-4ed9-aad9-ed47a55bd1bc_1774x887.png 1272w, https://substackcdn.com/image/fetch/$s_!PDZy!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe5563fe5-22c2-4ed9-aad9-ed47a55bd1bc_1774x887.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 aria-hidden="true" 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><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><span>Analogy</span></strong></h3><p><span>A </span>phone call versus a <span>group channel:</span></p><p><span>A </span><em><span>phone call</span></em><span> needs both people free at the same instant. A message posted to a </span><em><span>group channel</span></em><span> waits until each reader is ready, and everyone interested sees it.</span></p><p><span>New people can join the group channel later and still get the updates.</span></p><h3><strong><span>Tradeoff</span></strong></h3><p><span>It trades simple request-reply for eventual consistency.</span></p><p><span>Plus, debugging gets </span>harder<span> across an event chain, and there&#8217;s a need to handle duplicate &amp; out-of-order delivery.</span></p><h3><strong><span>Why it matters</span></strong></h3><p><span>Workflows where steps can happen asynchronously, fanning one event out to many services, decoupling producers from consumers, or smoothing traffic spikes with a buffer.</span></p><p><span>Apache Kafka, RabbitMQ, AWS SNS and SQS, and Google Pub/Sub are popular broker implementations.</span></p><p><span>TIP: Pair it with the Idempotent Consumer pattern</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a> (more on this in concept 17)<span>, because at-least-once delivery means duplicates will happen.</span></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/microservices-design-patterns?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/microservices-design-patterns?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><h2><strong><span>5. Service Discovery</span></strong></h2><blockquote><p><span>Service discovery lets services find each other by name through a registry, which updates itself as instances start, stop &amp; move.</span></p></blockquote><p><span>In microservices architecture, instances come and go, and their addresses change constantly. i.e., hard-coding a location breaks the moment a service moves.</span></p><p><span>Each instance registers its address with a service registry when it starts and de-registers when it stops. Callers query the registry by name to get a current, healthy address.</span></p><p><span>Here are 2 ways to implement service discovery:</span></p><ul><li><p><strong><span>client-side</span></strong><span>, where the caller queries the registry and load-balances itself,</span></p></li><li><p><strong><span>server-side</span></strong><span>, where a load balancer or the platform does it.</span></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_!AbV7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29fb77e6-48a3-482e-b8e2-66f8a46c31fc_1670x942.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AbV7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29fb77e6-48a3-482e-b8e2-66f8a46c31fc_1670x942.png 424w, https://substackcdn.com/image/fetch/$s_!AbV7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29fb77e6-48a3-482e-b8e2-66f8a46c31fc_1670x942.png 848w, https://substackcdn.com/image/fetch/$s_!AbV7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29fb77e6-48a3-482e-b8e2-66f8a46c31fc_1670x942.png 1272w, https://substackcdn.com/image/fetch/$s_!AbV7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29fb77e6-48a3-482e-b8e2-66f8a46c31fc_1670x942.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AbV7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29fb77e6-48a3-482e-b8e2-66f8a46c31fc_1670x942.png" width="1456" height="821" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/29fb77e6-48a3-482e-b8e2-66f8a46c31fc_1670x942.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:821,&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_!AbV7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29fb77e6-48a3-482e-b8e2-66f8a46c31fc_1670x942.png 424w, https://substackcdn.com/image/fetch/$s_!AbV7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29fb77e6-48a3-482e-b8e2-66f8a46c31fc_1670x942.png 848w, https://substackcdn.com/image/fetch/$s_!AbV7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29fb77e6-48a3-482e-b8e2-66f8a46c31fc_1670x942.png 1272w, https://substackcdn.com/image/fetch/$s_!AbV7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F29fb77e6-48a3-482e-b8e2-66f8a46c31fc_1670x942.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 aria-hidden="true" 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><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><span>Analogy</span></strong></h3><p><span>A contacts app instead of numbers scribbled in pen&#8230;</span></p><p><span>When a friend changes their number, the app updates and you can still reach them. The registry keeps every service&#8217;s current contact details, so callers always reach them.</span></p><h3><strong><span>Tradeoff</span></strong></h3><ul><li><p><span>It adds infrastructure,</span></p></li><li><p><span>Makes the registry a critical dependency,</span></p></li><li><p><span>Needs health checks to stay accurate, and a stale cached lookup can still send traffic to a dead instance.</span></p></li></ul><h3><strong><span>Why it matters</span></strong></h3><p>Fixed addresses are NOT practical for auto-scaling fleets, containerized deployments with shifting IPs, blue-green and rolling deploys<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a>.</p><p><span>Consul, etcd, and Netflix&#8217;s Eureka are classic registries, while Kubernetes builds discovery in through DNS and Services.</span></p><p><span>Most service meshes</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a><span> include it, so you often get discovery for free at scale.</span></p><h2><strong><span>6. Retry with Backoff</span></strong></h2><blockquote><p><span>Retry with backoff reattempts a failed call a few times with a </span><em><span>growing</span></em><span> delay, turning brief glitches into successes without hammering a struggling service.</span></p></blockquote><p><span>Networks blip, and a call that fails once often succeeds on the next try.</span></p><p><span>A naive retry loop can stampede a service that&#8217;s already down. Backoff fixes this by waiting longer between each attempt, usually &#8220;doubling&#8221; the delay, and jitter adds randomness so many clients don&#8217;t retry in lockstep.</span></p><p><span>A retry limit and a timeout cap the total effort so a stuck call gives up instead of hanging forever.</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_!Qshw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd97d1aaf-60bb-44fc-8809-8a2380178c8a_1691x930.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Qshw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd97d1aaf-60bb-44fc-8809-8a2380178c8a_1691x930.png 424w, https://substackcdn.com/image/fetch/$s_!Qshw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd97d1aaf-60bb-44fc-8809-8a2380178c8a_1691x930.png 848w, https://substackcdn.com/image/fetch/$s_!Qshw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd97d1aaf-60bb-44fc-8809-8a2380178c8a_1691x930.png 1272w, https://substackcdn.com/image/fetch/$s_!Qshw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd97d1aaf-60bb-44fc-8809-8a2380178c8a_1691x930.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Qshw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd97d1aaf-60bb-44fc-8809-8a2380178c8a_1691x930.png" width="1456" height="801" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d97d1aaf-60bb-44fc-8809-8a2380178c8a_1691x930.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_!Qshw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd97d1aaf-60bb-44fc-8809-8a2380178c8a_1691x930.png 424w, https://substackcdn.com/image/fetch/$s_!Qshw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd97d1aaf-60bb-44fc-8809-8a2380178c8a_1691x930.png 848w, https://substackcdn.com/image/fetch/$s_!Qshw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd97d1aaf-60bb-44fc-8809-8a2380178c8a_1691x930.png 1272w, https://substackcdn.com/image/fetch/$s_!Qshw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd97d1aaf-60bb-44fc-8809-8a2380178c8a_1691x930.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 aria-hidden="true" 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><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><span>Analogy</span></strong></h3><p><span>Redialing a busy phone line.</span></p><p><span>You wait a moment and try again, not forty times in a row, and you give up after a few rings rather than holding the line all day.</span></p><p><span>Each wait is a little longer so you&#8217;re not jamming the line.</span></p><h3><strong><span>Tradeoff</span></strong></h3><p><span>Retrying a non-idempotent call can double-charge or double-write; aggressive retries can amplify an outage into a retry storm, and extra attempts raise tail latency</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-7" href="#footnote-7" target="_self">7</a><span> for the request.</span></p><p><span>TIP: Only retry idempotent operations, always add jitter, and pair retries with a circuit breaker.</span></p><h3><strong><span>Why it matters</span></strong></h3><p><span>Calls to flaky networks/third-party APIs, transient database errors, or any remote operation that&#8217;s safe to repeat.</span></p><p><span>Resilience4j &amp; Polly provide retry with exponential backoff and jitter out of the box.</span></p><p><span>Timeout, retry with backoff, and circuit breaker together are standard resilience mechanisms for remote calls.</span></p><h2><strong><span>7. Decompose by Business Capability</span></strong></h2><blockquote><p><span>Split a system into services along the natural lines of the business, using business capabilities and domain-driven design</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-8" href="#footnote-8" target="_self">8</a><span> to draw the boundaries.</span></p></blockquote><p><span>The HARD part of microservices is deciding where one service ends and the next begins&#8230;</span></p><p><span>Here are two methods to guide you:</span></p><ul><li><p><span>Decomposing by business capability splits the system by what the organization does, such as orders, payments, or shipping. Then gives each capability a service.</span></p></li><li><p><span>Decomposing by subdomain uses domain-driven design (</span><strong><span>DDD</span></strong><span>) to model the business and carve it into subdomains.</span></p></li></ul><p><span>Each becomes a bounded context: </span><em><span>a boundary inside which every term carries one precise meaning.</span></em></p><p><span>Boundaries drawn this way follow the business, which shifts far more slowly than the code.</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_!PEs6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f1637d-06f3-4c77-9370-305a29478c7b_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PEs6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f1637d-06f3-4c77-9370-305a29478c7b_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!PEs6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f1637d-06f3-4c77-9370-305a29478c7b_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!PEs6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f1637d-06f3-4c77-9370-305a29478c7b_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!PEs6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f1637d-06f3-4c77-9370-305a29478c7b_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PEs6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f1637d-06f3-4c77-9370-305a29478c7b_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/37f1637d-06f3-4c77-9370-305a29478c7b_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_!PEs6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f1637d-06f3-4c77-9370-305a29478c7b_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!PEs6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f1637d-06f3-4c77-9370-305a29478c7b_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!PEs6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f1637d-06f3-4c77-9370-305a29478c7b_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!PEs6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f1637d-06f3-4c77-9370-305a29478c7b_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 aria-hidden="true" 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><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><span>Analogy</span></strong></h3><p><span>Think of a company with different departments:</span></p><p><span>Sales handles selling, Shipping handles deliveries, and Payments handles billing. Each department owns its own work. Even the same word can mean different things. For example, a "customer" means an order and delivery address to Shipping, but payment details &amp; invoices to Payments.</span></p><p><span>A bounded context keeps each meaning separate, so teams don't interfere with each other.</span></p><h3><strong><span>Tradeoff</span></strong></h3><p>Choosing the right service boundaries needs a good understanding of the business.</p><p>If you split services the <em>wrong way</em>, they end up constantly calling each other. While changing those boundaries later becomes difficult because each service already owns its own data and responsibilities.</p><h3><strong><span>Why it matters</span></strong></h3><p>Use this pattern when you&#8217;re building a new microservices system, breaking a monolith into smaller services, or giving each team ownership of a specific business area.</p><h4 style="text-align: center;">&#167;</h4><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>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>Ready for the best part?</p></div><h4 style="text-align: center;">&#167;</h4>
      <p>
          <a href="https://newsletter.systemdesign.one/p/microservices-design-patterns">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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 aria-hidden="true" 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><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></channel></rss>