<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[The System Design Newsletter]]></title><description><![CDATA[Download my system design playbook on newsletter signup for FREE]]></description><link>https://newsletter.systemdesign.one</link><image><url>https://substackcdn.com/image/fetch/$s_!W5r-!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa1c8067a-95bb-416b-9114-e0b9fb8821d4_256x256.png</url><title>The System Design Newsletter</title><link>https://newsletter.systemdesign.one</link></image><generator>Substack</generator><lastBuildDate>Wed, 23 Sep 2026 00:32:19 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[One Claude Is Not Enough. I Spawned an AI Team and Let It Manage Itself]]></title><description><![CDATA[#180: Part 3 - Claude Code 24/7]]></description><link>https://newsletter.systemdesign.one/p/claude-code-subagents-vs-agent-teams</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/claude-code-subagents-vs-agent-teams</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Mon, 21 Sep 2026 12:29:22 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/e7e98f34-9872-4671-916d-7c56936ae656_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/claude-code-subagents-vs-agent-teams/?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>You paste your prompt into Claude Code and wait for the answer.</span></p><p><span>i.e., one agent gets one task &amp; you wait for it to finish.</span></p><p><span>But what if your task is more complicated than this?</span></p><p><span>Let&#8217;s say you&#8217;re building a feature that needs both backend &amp; frontend code, connected to each other.</span></p><p><em><span>Did you know you can assign multiple agents with different instructions &amp; have them work in parallel?</span></em></p><p><span>Let&#8217;s get started with the fundamentals&#8230;</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><div class="callout-block" data-callout="true"><h3><strong><a href="https://getunblocked.com/events/how-to-stop-babysitting-your-agents-sep-23/?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary">[Webinar] How to stop babysitting your agents (Partner)</a></strong></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://getunblocked.com/events/how-to-stop-babysitting-your-agents-sep-23/?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_!CmS3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2da6f38b-7eb4-4472-9cb3-3935462ae703_1600x900.png 424w, https://substackcdn.com/image/fetch/$s_!CmS3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2da6f38b-7eb4-4472-9cb3-3935462ae703_1600x900.png 848w, https://substackcdn.com/image/fetch/$s_!CmS3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2da6f38b-7eb4-4472-9cb3-3935462ae703_1600x900.png 1272w, https://substackcdn.com/image/fetch/$s_!CmS3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2da6f38b-7eb4-4472-9cb3-3935462ae703_1600x900.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CmS3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2da6f38b-7eb4-4472-9cb3-3935462ae703_1600x900.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2da6f38b-7eb4-4472-9cb3-3935462ae703_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;:1099878,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://getunblocked.com/events/how-to-stop-babysitting-your-agents-sep-23/?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/215411410?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2da6f38b-7eb4-4472-9cb3-3935462ae703_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_!CmS3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2da6f38b-7eb4-4472-9cb3-3935462ae703_1600x900.png 424w, https://substackcdn.com/image/fetch/$s_!CmS3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2da6f38b-7eb4-4472-9cb3-3935462ae703_1600x900.png 848w, https://substackcdn.com/image/fetch/$s_!CmS3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2da6f38b-7eb4-4472-9cb3-3935462ae703_1600x900.png 1272w, https://substackcdn.com/image/fetch/$s_!CmS3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2da6f38b-7eb4-4472-9cb3-3935462ae703_1600x900.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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Agents can generate code. Getting it right for your system, team conventions, and past decisions is the hard part. You end up wasting time and tokens in correction loops.</p><p>More MCPs give agents access to information but not understanding. The teams pulling ahead use a context layer to give agents exactly what they need.</p><p><strong><a href="https://getunblocked.com/events/how-to-stop-babysitting-your-agents-sep-23/?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary">Join live on Sep 23 (FREE)</a></strong> to see:</p><ul><li><p>Where teams get stuck on the AI maturity curve</p></li><li><p>How a context layer solves for quality, efficiency, and cost</p></li><li><p>Live demo: the same coding task with and without a context layer</p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://getunblocked.com/events/how-to-stop-babysitting-your-agents-sep-23/?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://getunblocked.com/events/how-to-stop-babysitting-your-agents-sep-23/?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary"><span>Register now</span></a></p><p><em>(Thanks to <a href="https://getunblocked.com/events/how-to-stop-babysitting-your-agents-sep-23/?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary">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://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;:&quot;&quot;,&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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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">LearnAIWithMe</a></strong>, every Monday, Wednesday &amp; Friday.</p><p>Not just theory for its own sake. One real build at a time, from idea to running system.</p><h4 style="text-align: center;"><strong>&#167;</strong></h4><p><em>Here&#8217;s what you&#8217;ll find inside this newsletter:</em></p><ul><li><p><strong>The two ways to run more than one Claude at once.</strong> Subagents and agent teams, and why they solve different kinds of problems.</p></li><li><p><strong>What a subagent actually gives you.</strong> An isolated worker with its own context window, plus the report-back model that keeps your main session clean and your token cost low.</p></li><li><p><strong>Why agent teams cost more, and when that&#8217;s worth it.</strong> The tradeoffs around token usage, coordination, and when tasks with real handoffs justify a full team instead of parallel subagents.</p></li><li><p><strong>What changes when agents need to share the same repo.</strong> Git worktrees, a shared CLAUDE.md as the coordination layer, and the enforcement that keeps three agents from stepping on each other&#8217;s files.</p></li><li><p><strong>Where hooks and the Writer/Reviewer pattern fit in.</strong> What they catch, when they fire, and how they compare with relying on CLAUDE.md alone when you need work validated automatically.</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"><em><span data-color="#3a7bf9" style="color: rgb(58, 123, 249);">Golden members get all letters like these!&#8230;</span></em></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>Subagents, isolated workers</span></h2><p><span>A subagent</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a><span> is a second Claude, with its own context window, its own limits, and its own set of instructions</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a><span>.</span></p><p><span>It works independently &amp; returns the results. You can create it when you have a side task and/or when you want more than one specified Claude working in parallel.</span></p><p><span>Let&#8217;s say you&#8217;ll test your website, and you want to check two different things at once. One subagent tests </span><em><span>&#8220;AI Labs,&#8221;</span></em><span> and another tests </span><em><span>&#8220;AI Academy&#8221; </span></em><span>Page.</span></p><p><span>They run in parallel, each in its own window, and you read two short reports instead of one long mess.</span></p><p><span>Let me show you my website;</span> I improve its pages 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_!PPNh!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f1a19d0-cd5b-4bb1-9fc4-2208418c4bca_2048x1078.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PPNh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f1a19d0-cd5b-4bb1-9fc4-2208418c4bca_2048x1078.png 424w, https://substackcdn.com/image/fetch/$s_!PPNh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f1a19d0-cd5b-4bb1-9fc4-2208418c4bca_2048x1078.png 848w, https://substackcdn.com/image/fetch/$s_!PPNh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f1a19d0-cd5b-4bb1-9fc4-2208418c4bca_2048x1078.png 1272w, https://substackcdn.com/image/fetch/$s_!PPNh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f1a19d0-cd5b-4bb1-9fc4-2208418c4bca_2048x1078.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PPNh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f1a19d0-cd5b-4bb1-9fc4-2208418c4bca_2048x1078.png" width="1456" height="766" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7f1a19d0-cd5b-4bb1-9fc4-2208418c4bca_2048x1078.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:766,&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_!PPNh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f1a19d0-cd5b-4bb1-9fc4-2208418c4bca_2048x1078.png 424w, https://substackcdn.com/image/fetch/$s_!PPNh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f1a19d0-cd5b-4bb1-9fc4-2208418c4bca_2048x1078.png 848w, https://substackcdn.com/image/fetch/$s_!PPNh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f1a19d0-cd5b-4bb1-9fc4-2208418c4bca_2048x1078.png 1272w, https://substackcdn.com/image/fetch/$s_!PPNh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f1a19d0-cd5b-4bb1-9fc4-2208418c4bca_2048x1078.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 after every change, I assign two agents, one to each page, using this prompt.</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;a9b074a2-6f60-4ff2-9556-ebb2275e1d30&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Create two subagents and run them in parallel.

One opens the AI Labs page in Chrome and reports layout or console problems,
the other does the same for AI Academy, and each reports its issues separately.</code></pre></div><p><span>After pasting the prompt, it assigns two agents that run in parallel.</span></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lZK_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa74c4ef9-742f-4b55-bca3-136c87f5a89a_2048x216.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lZK_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa74c4ef9-742f-4b55-bca3-136c87f5a89a_2048x216.png 424w, https://substackcdn.com/image/fetch/$s_!lZK_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa74c4ef9-742f-4b55-bca3-136c87f5a89a_2048x216.png 848w, https://substackcdn.com/image/fetch/$s_!lZK_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa74c4ef9-742f-4b55-bca3-136c87f5a89a_2048x216.png 1272w, https://substackcdn.com/image/fetch/$s_!lZK_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa74c4ef9-742f-4b55-bca3-136c87f5a89a_2048x216.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lZK_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa74c4ef9-742f-4b55-bca3-136c87f5a89a_2048x216.png" width="1456" height="154" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a74c4ef9-742f-4b55-bca3-136c87f5a89a_2048x216.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:154,&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_!lZK_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa74c4ef9-742f-4b55-bca3-136c87f5a89a_2048x216.png 424w, https://substackcdn.com/image/fetch/$s_!lZK_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa74c4ef9-742f-4b55-bca3-136c87f5a89a_2048x216.png 848w, https://substackcdn.com/image/fetch/$s_!lZK_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa74c4ef9-742f-4b55-bca3-136c87f5a89a_2048x216.png 1272w, https://substackcdn.com/image/fetch/$s_!lZK_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa74c4ef9-742f-4b55-bca3-136c87f5a89a_2048x216.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><span>They're testing websites as we speak.</span></p><p><span>They took screenshots, found issues, and solved them.</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_!kPXD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F956369e2-1221-4320-bb88-e2f7d39897a6_2048x760.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kPXD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F956369e2-1221-4320-bb88-e2f7d39897a6_2048x760.png 424w, https://substackcdn.com/image/fetch/$s_!kPXD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F956369e2-1221-4320-bb88-e2f7d39897a6_2048x760.png 848w, https://substackcdn.com/image/fetch/$s_!kPXD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F956369e2-1221-4320-bb88-e2f7d39897a6_2048x760.png 1272w, https://substackcdn.com/image/fetch/$s_!kPXD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F956369e2-1221-4320-bb88-e2f7d39897a6_2048x760.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kPXD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F956369e2-1221-4320-bb88-e2f7d39897a6_2048x760.png" width="1456" height="540" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/956369e2-1221-4320-bb88-e2f7d39897a6_2048x760.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;: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_!kPXD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F956369e2-1221-4320-bb88-e2f7d39897a6_2048x760.png 424w, https://substackcdn.com/image/fetch/$s_!kPXD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F956369e2-1221-4320-bb88-e2f7d39897a6_2048x760.png 848w, https://substackcdn.com/image/fetch/$s_!kPXD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F956369e2-1221-4320-bb88-e2f7d39897a6_2048x760.png 1272w, https://substackcdn.com/image/fetch/$s_!kPXD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F956369e2-1221-4320-bb88-e2f7d39897a6_2048x760.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 the final report:</span></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1YDa!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd343d43-0ac6-4142-a6f5-897414066ba8_2048x427.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1YDa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd343d43-0ac6-4142-a6f5-897414066ba8_2048x427.png 424w, https://substackcdn.com/image/fetch/$s_!1YDa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd343d43-0ac6-4142-a6f5-897414066ba8_2048x427.png 848w, https://substackcdn.com/image/fetch/$s_!1YDa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd343d43-0ac6-4142-a6f5-897414066ba8_2048x427.png 1272w, https://substackcdn.com/image/fetch/$s_!1YDa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd343d43-0ac6-4142-a6f5-897414066ba8_2048x427.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1YDa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd343d43-0ac6-4142-a6f5-897414066ba8_2048x427.png" width="1456" height="304" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dd343d43-0ac6-4142-a6f5-897414066ba8_2048x427.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;: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_!1YDa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd343d43-0ac6-4142-a6f5-897414066ba8_2048x427.png 424w, https://substackcdn.com/image/fetch/$s_!1YDa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd343d43-0ac6-4142-a6f5-897414066ba8_2048x427.png 848w, https://substackcdn.com/image/fetch/$s_!1YDa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd343d43-0ac6-4142-a6f5-897414066ba8_2048x427.png 1272w, https://substackcdn.com/image/fetch/$s_!1YDa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd343d43-0ac6-4142-a6f5-897414066ba8_2048x427.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><span>I approved the fixes.</span></p><p><span>But what if I want these agents to work in sequence and pass their work to one another? Then I should use </span><em><span>agent orchestration</span></em><span>&#8230;</span></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/claude-code-subagents-vs-agent-teams?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-code-subagents-vs-agent-teams?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><span>Agent Orchestration</span></h2><p><span>Agent orchestration</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a><span> turns separate Claudes into a team.</span></p><p><span>It turns your Claude into the team, spawns teammates, hands out tasks, and collects the results. And here teammates talk to each other, share tasks, and pass work.</span></p><p><span>Agent teams</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a><span> are experimental and off by default.</span></p><p><span>So if you have not enabled them yet, just tell Claude:</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;64542ed3-a798-4270-827a-1f7b5385fcd8&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Add CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 to my settings.json

if it is not set already, then confirm it is active.</code></pre></div><p><span>After you paste the prompt, Claude asks for your approval to change the file; once you approve it, you can use Claude agent orchestration.</span></p><p><span>Let&#8217;s create one, and a fun one:</span></p><p><span>Boids</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a><span> is the classic flocking algorithm, where three simple rules make hundreds of dots move like a flock of birds. One teammate researches the rules, the second verifies every claim, and the third builds only from what survives.</span></p><p><span>Paste this prompt:</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;70c01651-4bc8-4ca7-b139-b270376a6bb5&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Spawn three teammates working in sequence.

The first researches the boids flocking algorithm
and its three rules from the original sources,
and writes the findings to findings.md.

The second waits,
verifies every claim in the file against the sources,
and marks each one as confirmed or wrong.

The third waits for the review,
then builds a single HTML page where hundreds of boids flock live on screen,
using only the confirmed.</code></pre></div><p><span>Now, Claude assigns the researcher agent first.</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_!fbCN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd50ac037-7a73-49c4-826a-9cf8c990ed53_1614x1396.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fbCN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd50ac037-7a73-49c4-826a-9cf8c990ed53_1614x1396.png 424w, https://substackcdn.com/image/fetch/$s_!fbCN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd50ac037-7a73-49c4-826a-9cf8c990ed53_1614x1396.png 848w, https://substackcdn.com/image/fetch/$s_!fbCN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd50ac037-7a73-49c4-826a-9cf8c990ed53_1614x1396.png 1272w, https://substackcdn.com/image/fetch/$s_!fbCN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd50ac037-7a73-49c4-826a-9cf8c990ed53_1614x1396.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fbCN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd50ac037-7a73-49c4-826a-9cf8c990ed53_1614x1396.png" width="1456" height="1259" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d50ac037-7a73-49c4-826a-9cf8c990ed53_1614x1396.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1259,&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_!fbCN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd50ac037-7a73-49c4-826a-9cf8c990ed53_1614x1396.png 424w, https://substackcdn.com/image/fetch/$s_!fbCN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd50ac037-7a73-49c4-826a-9cf8c990ed53_1614x1396.png 848w, https://substackcdn.com/image/fetch/$s_!fbCN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd50ac037-7a73-49c4-826a-9cf8c990ed53_1614x1396.png 1272w, https://substackcdn.com/image/fetch/$s_!fbCN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd50ac037-7a73-49c4-826a-9cf8c990ed53_1614x1396.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>After approving it, I clicked </span><em><span>&#8220;Research boids algorithm,&#8221;</span></em><span> and it opened a side tab showing this agent&#8217;s instructions.</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_!AkWP!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4512897a-bcc5-4a5a-ac34-dac8dce8fb4e_2048x1009.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AkWP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4512897a-bcc5-4a5a-ac34-dac8dce8fb4e_2048x1009.png 424w, https://substackcdn.com/image/fetch/$s_!AkWP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4512897a-bcc5-4a5a-ac34-dac8dce8fb4e_2048x1009.png 848w, https://substackcdn.com/image/fetch/$s_!AkWP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4512897a-bcc5-4a5a-ac34-dac8dce8fb4e_2048x1009.png 1272w, https://substackcdn.com/image/fetch/$s_!AkWP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4512897a-bcc5-4a5a-ac34-dac8dce8fb4e_2048x1009.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AkWP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4512897a-bcc5-4a5a-ac34-dac8dce8fb4e_2048x1009.png" width="1456" height="717" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4512897a-bcc5-4a5a-ac34-dac8dce8fb4e_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_!AkWP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4512897a-bcc5-4a5a-ac34-dac8dce8fb4e_2048x1009.png 424w, https://substackcdn.com/image/fetch/$s_!AkWP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4512897a-bcc5-4a5a-ac34-dac8dce8fb4e_2048x1009.png 848w, https://substackcdn.com/image/fetch/$s_!AkWP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4512897a-bcc5-4a5a-ac34-dac8dce8fb4e_2048x1009.png 1272w, https://substackcdn.com/image/fetch/$s_!AkWP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4512897a-bcc5-4a5a-ac34-dac8dce8fb4e_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>If you click on </span><em><span>&#8220;Browsed the web, used a tool&#8221;,</span></em><span> it&#8217;ll show you the progress.</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_!dpM7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd899e409-d1a0-450b-b562-4dd379e0091b_2048x1725.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dpM7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd899e409-d1a0-450b-b562-4dd379e0091b_2048x1725.png 424w, https://substackcdn.com/image/fetch/$s_!dpM7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd899e409-d1a0-450b-b562-4dd379e0091b_2048x1725.png 848w, https://substackcdn.com/image/fetch/$s_!dpM7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd899e409-d1a0-450b-b562-4dd379e0091b_2048x1725.png 1272w, https://substackcdn.com/image/fetch/$s_!dpM7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd899e409-d1a0-450b-b562-4dd379e0091b_2048x1725.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dpM7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd899e409-d1a0-450b-b562-4dd379e0091b_2048x1725.png" width="1456" height="1226" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d899e409-d1a0-450b-b562-4dd379e0091b_2048x1725.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1226,&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_!dpM7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd899e409-d1a0-450b-b562-4dd379e0091b_2048x1725.png 424w, https://substackcdn.com/image/fetch/$s_!dpM7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd899e409-d1a0-450b-b562-4dd379e0091b_2048x1725.png 848w, https://substackcdn.com/image/fetch/$s_!dpM7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd899e409-d1a0-450b-b562-4dd379e0091b_2048x1725.png 1272w, https://substackcdn.com/image/fetch/$s_!dpM7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd899e409-d1a0-450b-b562-4dd379e0091b_2048x1725.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>Step 1 is finished, and the research file is being created.</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_!Xw9r!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3cf361a7-5a18-4e53-ac63-a11ada4e06dd_2048x1741.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Xw9r!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3cf361a7-5a18-4e53-ac63-a11ada4e06dd_2048x1741.png 424w, https://substackcdn.com/image/fetch/$s_!Xw9r!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3cf361a7-5a18-4e53-ac63-a11ada4e06dd_2048x1741.png 848w, https://substackcdn.com/image/fetch/$s_!Xw9r!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3cf361a7-5a18-4e53-ac63-a11ada4e06dd_2048x1741.png 1272w, https://substackcdn.com/image/fetch/$s_!Xw9r!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3cf361a7-5a18-4e53-ac63-a11ada4e06dd_2048x1741.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Xw9r!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3cf361a7-5a18-4e53-ac63-a11ada4e06dd_2048x1741.png" width="1456" height="1238" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3cf361a7-5a18-4e53-ac63-a11ada4e06dd_2048x1741.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1238,&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_!Xw9r!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3cf361a7-5a18-4e53-ac63-a11ada4e06dd_2048x1741.png 424w, https://substackcdn.com/image/fetch/$s_!Xw9r!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3cf361a7-5a18-4e53-ac63-a11ada4e06dd_2048x1741.png 848w, https://substackcdn.com/image/fetch/$s_!Xw9r!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3cf361a7-5a18-4e53-ac63-a11ada4e06dd_2048x1741.png 1272w, https://substackcdn.com/image/fetch/$s_!Xw9r!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3cf361a7-5a18-4e53-ac63-a11ada4e06dd_2048x1741.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>And next, the verifier starts working&#8230;</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_!Jetp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329c1f0b-8b75-4299-bfe2-a3d1aa21c98b_2048x1741.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Jetp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329c1f0b-8b75-4299-bfe2-a3d1aa21c98b_2048x1741.png 424w, https://substackcdn.com/image/fetch/$s_!Jetp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329c1f0b-8b75-4299-bfe2-a3d1aa21c98b_2048x1741.png 848w, https://substackcdn.com/image/fetch/$s_!Jetp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329c1f0b-8b75-4299-bfe2-a3d1aa21c98b_2048x1741.png 1272w, https://substackcdn.com/image/fetch/$s_!Jetp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329c1f0b-8b75-4299-bfe2-a3d1aa21c98b_2048x1741.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Jetp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329c1f0b-8b75-4299-bfe2-a3d1aa21c98b_2048x1741.png" width="1456" height="1238" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/329c1f0b-8b75-4299-bfe2-a3d1aa21c98b_2048x1741.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1238,&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_!Jetp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329c1f0b-8b75-4299-bfe2-a3d1aa21c98b_2048x1741.png 424w, https://substackcdn.com/image/fetch/$s_!Jetp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329c1f0b-8b75-4299-bfe2-a3d1aa21c98b_2048x1741.png 848w, https://substackcdn.com/image/fetch/$s_!Jetp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329c1f0b-8b75-4299-bfe2-a3d1aa21c98b_2048x1741.png 1272w, https://substackcdn.com/image/fetch/$s_!Jetp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F329c1f0b-8b75-4299-bfe2-a3d1aa21c98b_2048x1741.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 the builder starts building the app&#8230;</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_!CMVC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aed62c1-6731-4559-84a2-801296e01f04_2048x1741.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CMVC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aed62c1-6731-4559-84a2-801296e01f04_2048x1741.png 424w, https://substackcdn.com/image/fetch/$s_!CMVC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aed62c1-6731-4559-84a2-801296e01f04_2048x1741.png 848w, https://substackcdn.com/image/fetch/$s_!CMVC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aed62c1-6731-4559-84a2-801296e01f04_2048x1741.png 1272w, https://substackcdn.com/image/fetch/$s_!CMVC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aed62c1-6731-4559-84a2-801296e01f04_2048x1741.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CMVC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aed62c1-6731-4559-84a2-801296e01f04_2048x1741.png" width="1456" height="1238" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0aed62c1-6731-4559-84a2-801296e01f04_2048x1741.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1238,&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_!CMVC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aed62c1-6731-4559-84a2-801296e01f04_2048x1741.png 424w, https://substackcdn.com/image/fetch/$s_!CMVC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aed62c1-6731-4559-84a2-801296e01f04_2048x1741.png 848w, https://substackcdn.com/image/fetch/$s_!CMVC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aed62c1-6731-4559-84a2-801296e01f04_2048x1741.png 1272w, https://substackcdn.com/image/fetch/$s_!CMVC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0aed62c1-6731-4559-84a2-801296e01f04_2048x1741.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 the full version of this website, visualizing the boids flocking algorithm:</span></p><div class="native-video-embed" data-component-name="VideoPlaceholder" data-attrs="{&quot;mediaUploadId&quot;:&quot;1586eb33-a98b-4e09-aaa9-621a44316d41&quot;,&quot;duration&quot;:null}"></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>A complete Claude Code setup, from your first session to a fully automated one.</strong></p></li><li><p>Deep dives into how MCP, subagents, agent orchestration &amp; hooks actually work inside Claude Code.</p></li><li><p><strong>How real Claude Code projects handle context, scale &amp; running without you.</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><span>Subagents vs orchestration</span></h2>
      <p>
          <a href="https://newsletter.systemdesign.one/p/claude-code-subagents-vs-agent-teams">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[AI Evals, Guardrails & Security - A Deep Dive]]></title><description><![CDATA[#179: Part 6 - Generative AI Masterclass]]></description><link>https://newsletter.systemdesign.one/p/llm-evaluation-and-guardrails</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/llm-evaluation-and-guardrails</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Sat, 19 Sep 2026 11:41:41 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/00a6dd0d-f07e-41e3-85ce-bb09294ebd80_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/llm-evaluation-and-guardrails/?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>Getting an AI system to work takes about ten minutes with a model API.</span></p><p><span>Yet knowing whether it still works after the next prompt change, model update, and/or retrieval tweak</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a><span> takes months of engineering that most teams never do. A chat assistant has no built-in way to detect that its answers got worse. A RAG pipeline cannot tell you that fixing one edge case broke five others. An agent cannot stop a poisoned document from steering its next action.</span></p><p><span>The system runs&#8230; But whether it runs &#8220;correctly&#8221; is a separate question.</span></p><p><span>That question has 4 parts:</span></p><ol><li><p><em><span>Can you measure quality repeatably before deployment?</span></em></p></li><li><p><em><span>Can you stop a bad request before it reaches the model?</span></em></p></li><li><p><em><span>Can you reconstruct what happened when something goes wrong?</span></em></p></li><li><p><em><span>Can you prove system meets the obligations</span></em><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a><em><span> your deployment carries?</span></em></p></li></ol><p><span>Evaluation, guardrails, security &amp; observability each handle one of those parts.</span></p><p><span>Onward.</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><div class="callout-block" data-callout="true"><h4>I&#8217;m happy to partner with <strong><a href="https://inngest.link/jtH41MP">Inngest</a></strong> on this newsletter.</h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://inngest.link/jtH41MP" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!i9Kg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 424w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 848w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 1272w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!i9Kg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png" width="1200" height="675" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:675,&quot;width&quot;:1200,&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://inngest.link/jtH41MP&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_!i9Kg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 424w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 848w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 1272w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 few weeks back, I wrote a deep dive on how to build AI agents that can recover from failures without starting over.</p><p><strong><a href="https://newsletter.systemdesign.one/p/durable-ai-agents">Read my guide to durable AI agents &#8594;</a></strong></p><p>Agents, like all of us, often need to recover from failure. But they shouldn&#8217;t start from scratch.</p><p>Inngest&#8217;s durable execution checkpoints your agents every step of the way.</p><p>So your agents can pick up where they left off and avoid doubling up on token &amp; compute spend.</p><p><a href="https://inngest.link/jtH41MP">Inngest</a> offers a generous free tier and a sleek local dev server for testing.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://inngest.link/jtH41MP&quot;,&quot;text&quot;:&quot;Build durably with Inngest&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://inngest.link/jtH41MP"><span>Build durably with Inngest</span></a></p></div><h4 style="text-align: center;"><strong>&#167;</strong></h4><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.youtube.com/@whatsai?sub_confirmation=1" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Cu_b!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14cb8599-59a4-4587-932c-fd09ddd0a595_1100x220.png 424w, https://substackcdn.com/image/fetch/$s_!Cu_b!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14cb8599-59a4-4587-932c-fd09ddd0a595_1100x220.png 848w, https://substackcdn.com/image/fetch/$s_!Cu_b!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14cb8599-59a4-4587-932c-fd09ddd0a595_1100x220.png 1272w, https://substackcdn.com/image/fetch/$s_!Cu_b!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14cb8599-59a4-4587-932c-fd09ddd0a595_1100x220.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Cu_b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14cb8599-59a4-4587-932c-fd09ddd0a595_1100x220.png" width="1100" height="220" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/14cb8599-59a4-4587-932c-fd09ddd0a595_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;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.youtube.com/@whatsai?sub_confirmation=1&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_!Cu_b!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14cb8599-59a4-4587-932c-fd09ddd0a595_1100x220.png 424w, https://substackcdn.com/image/fetch/$s_!Cu_b!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14cb8599-59a4-4587-932c-fd09ddd0a595_1100x220.png 848w, https://substackcdn.com/image/fetch/$s_!Cu_b!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14cb8599-59a4-4587-932c-fd09ddd0a595_1100x220.png 1272w, https://substackcdn.com/image/fetch/$s_!Cu_b!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F14cb8599-59a4-4587-932c-fd09ddd0a595_1100x220.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><span>I want to introduce </span><a href="https://louisbouchard.substack.com/"><span>Louis-Fran&#231;ois Bouchard</span></a><span> as a guest author.</span></p><p><span>He&#8217;s a best-selling author (</span><a href="https://amzn.to/4bqYU9b"><span>Building LLMs for Production</span></a><span>), the co-founder of </span><a href="https://academy.towardsai.net/?ref=1f9b29"><span>Towards AI</span></a><span>, and the creator of the YouTube Channel, </span><a href="https://www.youtube.com/@whatsai?sub_confirmation=1"><span>What&#8217;s AI</span></a><span>, where he helps people understand AI and learn how to apply it in the real world. Through his development work with clients, content, teaching, AI training programs, and the new Mentorship program at&nbsp;</span><a href="https://academy.towardsai.net/?ref=1f9b29">Towards AI Academy</a><span>, Louis focuses on making AI practical for builders, engineers, and curious learners alike.</span></p><p><span>At Towards AI, he and his team train AI engineers through courses and mentorship 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.</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><p><em><strong>Here&#8217;s what you&#8217;ll find inside this newsletter:</strong></em></p><ul><li><p><strong>Why an AI system working is different from knowing it still works.</strong> The trust layer around your application, and how evaluation, guardrails, security, and observability work together.</p></li><li><p><strong>How to measure AI quality before shipping a change.</strong> Golden test sets, grader hierarchies, LLM-as-Judge, regression testing, and the metrics that change across RAG, tools, agents, and multimodal systems.</p></li><li><p><strong>How to protect an AI system while it is running.</strong> Input and output guardrails, tool permissions, prompt-injection defenses, data poisoning, agent security, and red teaming.</p></li><li><p><strong>What you need to record when something goes wrong.</strong> End-to-end traces, safe logging, drift detection, alerts, and the feedback loop that turns production failures into future regression tests.</p></li><li><p><strong>How to build an evaluation process around your own failures.</strong> Error analysis, failure taxonomies, metric stacks, validity gates, and controlled experiments for deciding whether a prompt, model, or retrieval change is ready to ship.</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>Why You Cannot Skip This Layer</span></h2><p><span>You can ship without evaluation, guardrails, or tracing&#8230;</span></p><p><span>But you </span><em><span>lose</span></em><span> the ability to tell whether the system still works once its prompts, models, data &amp; users start changing&#8230;</span></p><p><span>Here are five properties of these systems that make that guarantee </span><em><span>impossible</span></em><span> without a dedicated infrastructure:</span></p><ul><li><p><strong><span>The system is non-deterministic.</span></strong><span> The same input produces different outputs on different runs, so an exact assertion cannot distinguish a valid rephrasing from a regression.</span></p></li><li><p><strong><span>Its mistakes look like correct answers.</span></strong><span> A wrong answer arrives as fluently as a right one. Surface quality does not indicate correctness.</span></p></li><li><p><strong><span>Its regressions are silent.</span></strong><span> A prompt change that fixes one case can break five others. Without a repeatable suite, this trade gets never reported.</span></p></li><li><p><strong><span>Its inputs are not all trustworthy.</span></strong><span> Instructions can arrive inside a retrieved document, a fetched web page, or a tool result and steer the model. There is no complete fix, only layered mitigation.</span></p></li><li><p><strong><span>Its legal exposure depends on deployment.</span></strong><span> Duties attach to personal data, generated media, and high-risk decisions based on how the system gets used, not which model powers it.</span></p></li></ul><p><span>How much of this layer to </span><em><span>build</span></em><span> depends on what the &#8220;system&#8221; decides, not on how many people use it.</span></p><p><span>An internal meeting-note helper would need a small test set &amp; basic tracing. Yet an internal hiring screen needs much stronger controls, because a wrong answer affects someone&#8217;s career.</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>Target System Design</span></h2><p><span>The trust layer has four components, each handling a different stage of the system lifecycle:</span></p><ul><li><p><strong><span>Evaluation</span></strong><span> grades the system before deployment, answering whether the current version is good enough to ship.</span></p></li><li><p><strong><span>Guardrails</span></strong><span> check every request &amp; response at runtime.</span></p></li><li><p><strong><span>Observability</span></strong><span> records what happened in production &amp; feeds failures back into the evaluation set.</span></p></li><li><p><strong><span>Security</span></strong><span> cuts across all three &amp; defends against external attackers.</span></p></li></ul><p><span>For these four to work together, the system needs a golden test set, repeatable offline grading, runtime checks</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a><span> with explicit latency budgets, and end-to-end traces that include guardrail decisions.</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_!lGpx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9eaf4884-2b8f-41d7-9590-f94e70d86aff_2048x1079.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lGpx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9eaf4884-2b8f-41d7-9590-f94e70d86aff_2048x1079.png 424w, https://substackcdn.com/image/fetch/$s_!lGpx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9eaf4884-2b8f-41d7-9590-f94e70d86aff_2048x1079.png 848w, https://substackcdn.com/image/fetch/$s_!lGpx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9eaf4884-2b8f-41d7-9590-f94e70d86aff_2048x1079.png 1272w, https://substackcdn.com/image/fetch/$s_!lGpx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9eaf4884-2b8f-41d7-9590-f94e70d86aff_2048x1079.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lGpx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9eaf4884-2b8f-41d7-9590-f94e70d86aff_2048x1079.png" width="1456" height="767" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9eaf4884-2b8f-41d7-9590-f94e70d86aff_2048x1079.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:767,&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_!lGpx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9eaf4884-2b8f-41d7-9590-f94e70d86aff_2048x1079.png 424w, https://substackcdn.com/image/fetch/$s_!lGpx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9eaf4884-2b8f-41d7-9590-f94e70d86aff_2048x1079.png 848w, https://substackcdn.com/image/fetch/$s_!lGpx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9eaf4884-2b8f-41d7-9590-f94e70d86aff_2048x1079.png 1272w, https://substackcdn.com/image/fetch/$s_!lGpx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9eaf4884-2b8f-41d7-9590-f94e70d86aff_2048x1079.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="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">Evaluation gates releases before deployment, guardrails protect each request at runtime, security constrains actions, and tracing records the entire system.</figcaption></figure></div><p><span>The evaluation pipeline also runs in CI, so a quality regression blocks the merge in the same way a failing test does&#8230;</span></p><p><span>This newsletter covers the architecture and how to use it&#8230;</span></p><p><span>All four components assume you can already tell a good answer from a bad one.</span></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/llm-evaluation-and-guardrails?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/llm-evaluation-and-guardrails?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><span>Part 1: Evaluation</span></h2><p>Different AI systems need different metrics.</p><p>A RAG system needs retrieval and faithfulness checks, while an agent needs tool-use and outcome checks.</p><p>A trust layer brings these metrics into one repeatable evaluation stack that answers one question:<em> is the system still good after the latest change?</em></p><h3><span>Why Evaluation Has No Assert Statement</span></h3><p><span>In software testing, a correct output is a known value.</span></p><p><span>In an AI system, </span><em><span>&#8220;is this answer good?&#8221;</span></em><span> depends on who is asking and which standard applies. The same answer can be correct by one rubric</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a><span> and unhelpful by another, so evaluation cannot be reduced to an equality check.</span></p><p><span>The way through is to match the grader to the question, a principle we&#8217;ll call the </span><strong><span>grader hierarchy</span></strong><span>:</span></p><ul><li><p><span>When a correct answer exists, use a deterministic check: Does the JSON parse against the schema? Does the tool call carry valid arguments? Does the code run? Does the response come back under the latency cap?</span></p></li><li><p><span>Where quality is subjective, use a rubric or an LLM grader.</span></p></li><li><p><span>Where the stakes are high, use human review.</span></p></li></ul><p><span>The organizing rule across all three is to use the &#8220;cheapest&#8221; grader that catches the </span><em><span>failure</span></em><span> you care about.</span></p><h3><span>From Vibe Checks to Numbers</span></h3><p><strong><span>Vibe checking</span></strong><span> is the informal starting point: </span><em><span>try prompts, read outputs, form an impression.</span></em></p><p><span>It&#8217;s useful for discovering failures, but an impression cannot compare versions and/or isolate which change moved the result.</span></p><p>Public benchmarks help you choose a starting model&#8230; But they cannot tell you how well it would perform in your specific domain or edge cases.</p><p>A LinkedIn bot<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a> could correctly tell someone they were a terrible fit for a job. But the user needed to know which skills they lacked &amp; how to improve. A correct answer is still a BAD answer if it does not help the user.</p><p><span>The numbers therefore have to come from a test set built around your own product.</span></p><h3><span>Golden Test Sets That Stay Honest</span></h3><p>A golden test set gives you a fixed collection of cases for evaluating your AI system.</p><p>Start with 20 to 50 cases from real failures, then grow the set to around 50 to 100.</p><p>Also split the cases into three groups:</p><ul><li><p><strong>In-scope:</strong> Questions the system should answer.</p></li><li><p><strong>Out-of-scope:</strong> Questions the system should refuse.</p></li><li><p><strong>Adversarial:</strong> Questions designed to break the system.</p></li></ul><p>You can start with synthetic cases generated from your own data.</p><p>Then replace them with real user queries as you collect production traffic, with a domain expert defining the expected behavior for each case.</p><p>Each test case should include the input, expected behavior and/or key points to check, supporting evidence, and prompt &amp; data versions. Review each case for outdated assumptions and broken references before treating it as ground truth.</p><p>Plus a golden test set needs maintenance:</p><ul><li><p><strong>Refresh stale cases:</strong> Add failures &amp; queries from production as the product changes.</p></li><li><p><strong>Keep a holdout set:</strong> If you repeatedly tune prompts against the same tests, you can overfit to them. Keep some cases hidden from the tuning process.</p></li></ul><p>Think of the holdout set as the <em>final exam</em>: you practice with one set of problems, then test yourself on questions you have not seen before.</p><h3><span>Offline and Online Evaluation</span></h3><p><span>Running the golden set before deployment is </span><strong><span>offline evaluation</span></strong><span>.</span></p><p><span>Every version answers the same questions under the same conditions, so the numbers are comparable across versions.</span></p><p><strong><span>Online evaluation</span></strong><span> measures the live system on real traffic, using A/B tests, thumbs up &amp; down, regeneration rate, and citation clicks.</span></p><p><span>Each catches what the other misses:</span></p><ul><li><p><span>Offline catches regressions </span><em><span>before</span></em><span> users see them, but only on the questions you thought to include.</span></p></li><li><p><span>Online catches the cases your test set never imagined, but only </span><em><span>after</span></em><span> real users have hit them.</span></p></li></ul><p><span>Production systems run both&#8230;</span></p><p><span>Some online signals need no grader, since a click, a thumbs-down, or a regeneration is the judgment itself. Offline scoring of anything subjective still runs through an LLM grader, and the grader needs calibrating before its scores mean anything.</span></p><h3><span>LLM-as-Judge, Calibrated</span></h3><p>A large language model (<strong>LLM</strong>)-as-Judge uses a model to grade AI outputs against a written rubric. To make those grades useful, choose a clear grading format.</p><p>For most evaluations:</p><ul><li><p><strong>Use pass/fail:</strong> Define one clear criterion for each check. Numeric scores such as 1 to 5 are harder to calibrate because the boundary between scores could be unclear.</p></li><li><p><strong>Generate the critique first:</strong> Ask the judge to explain its assessment before returning the verdict. This reduces the chance the explanation simply justifies a verdict chosen first.</p></li><li><p><strong>Use pairwise grading for subjective comparisons:</strong> When pass/ fail is too restrictive, ask the judge to compare two answers rather than assign an absolute score.</p></li><li><p><strong>Grade outcomes for multi-step tasks:</strong> Check each required subgoal separately. Inspect the agent&#8217;s trajectory only when a subgoal fails. Different paths could still produce equally valid results.</p></li></ul><p>So choose the format that produces the <em>strongest</em> agreement with your human evaluations.</p><p>Three biases need active mitigation:</p><ul><li><p><strong>Position bias:</strong> The judge favors the answer it reads first. So swap the answer order across runs &amp; average the results.</p></li><li><p><strong>Self-preference:</strong> A model favors outputs that match its own writing style. So use a different model family for the judge than the model you evaluate.</p></li><li><p><strong>Verbosity bias:</strong> Longer answers score higher than equally good shorter answers. So include length-matched pairs in your calibration set.</p></li></ul><p>Calibration is not optional&#8230;</p><p>Before you trust the judge, run it on 30 to 50 human-labeled examples. Compare its verdicts with the human labels &amp; compute agreement. Keep the judge blind to which system version produced each output.</p><p>Use one portion of the labeled examples to shape the rubric, then validate it on a held-out portion. Thirty to fifty labels are enough to start using the judge, but not enough to treat its scores as ground truth<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a>.</p><p>Pick the <em>cheapest</em> model that passes calibration.</p><p>For a judge, consistency matters more than raw capability. Judge inference is cheap; collecting reliable human labels is the real cost.</p><h3><span>Metric Stack</span></h3><p>The metrics you need depend on the components inside your system.</p><p>Each component adds its own evaluation layer, so you measure only what applies.</p><p>A single model call forms the base layer&#8230; Measure:</p><ul><li><p><strong>Correctness:</strong> Did the model produce the right answer?</p></li><li><p><strong>Format compliance:</strong> Did the output follow the required structure?</p></li></ul><p>Retrieval-augmented generation (<strong>RAG</strong>) adds retrieval metrics:</p><ul><li><p><strong>Hit rate:</strong> Did at least one relevant chunk appear in the top K retrieved results?</p></li><li><p><strong>Mean Reciprocal Rank </strong>(<strong>MRR</strong>)<strong>:</strong> How high did the first relevant result rank? Higher positions receive higher scores.</p></li><li><p><strong>Context precision:</strong> How much of the retrieved context was relevant?</p></li><li><p><strong>Context recall:</strong> How much of the relevant information did retrieval find?</p></li><li><p><strong>Faithfulness:</strong> Did the answer stay supported by the retrieved context?</p></li><li><p><strong>Response relevance:</strong> Did the answer address the user&#8217;s question?</p></li></ul><p>These metrics show whether RAG retrieved the right information, ranked it well, and used it to produce a relevant, supported answer.</p><p><strong>Tool use</strong> adds another check: <em>did the model call the correct tool with the correct arguments?</em> This is a &#8220;deterministic&#8221; check, so it belongs in the cheapest tier of the grader hierarchy.</p><p><strong>Agents</strong> need outcome-first evaluation&#8230; So grade the state the agent left behind:</p><ul><li><p><em>Did the refund get issued?</em></p></li><li><p><em>Did the file get written?</em></p></li><li><p><em>Did the test pass?</em></p></li></ul><p>Path-based grading penalizes valid alternative solutions and marks down agents that still reach the correct outcome<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-7" href="#footnote-7" target="_self">7</a>.</p><p>Also use trajectory metrics to diagnose failures:</p><ul><li><p><strong>Step efficiency:</strong> How many steps did the agent need?</p></li><li><p><strong>Loop detection:</strong> Did the agent repeat the same actions without making progress?</p></li><li><p><strong>Tokens per task:</strong> How many tokens did the agent spend to complete the task?</p></li></ul><p>These metrics help explain a <em>bad</em> outcome&#8230;Yet they should not serve as release gates.</p><ul><li><p><strong>Media generation</strong> adds prompt adherence, identity preservation, artifact rates, and unsafe content rates<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-8" href="#footnote-8" target="_self">8</a>.</p></li><li><p><strong>Voice systems</strong> add first-audio latency &amp; interruption success.</p></li></ul><blockquote><p>The rule of thumb: start with the base evaluation layer, then add metrics for each component your system uses.</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_!RgIo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccbef582-e5f9-4294-8fd2-c7f551e2e485_2048x1055.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RgIo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccbef582-e5f9-4294-8fd2-c7f551e2e485_2048x1055.png 424w, https://substackcdn.com/image/fetch/$s_!RgIo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccbef582-e5f9-4294-8fd2-c7f551e2e485_2048x1055.png 848w, https://substackcdn.com/image/fetch/$s_!RgIo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccbef582-e5f9-4294-8fd2-c7f551e2e485_2048x1055.png 1272w, https://substackcdn.com/image/fetch/$s_!RgIo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccbef582-e5f9-4294-8fd2-c7f551e2e485_2048x1055.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RgIo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccbef582-e5f9-4294-8fd2-c7f551e2e485_2048x1055.png" width="1456" height="750" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ccbef582-e5f9-4294-8fd2-c7f551e2e485_2048x1055.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:750,&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_!RgIo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccbef582-e5f9-4294-8fd2-c7f551e2e485_2048x1055.png 424w, https://substackcdn.com/image/fetch/$s_!RgIo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccbef582-e5f9-4294-8fd2-c7f551e2e485_2048x1055.png 848w, https://substackcdn.com/image/fetch/$s_!RgIo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccbef582-e5f9-4294-8fd2-c7f551e2e485_2048x1055.png 1272w, https://substackcdn.com/image/fetch/$s_!RgIo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccbef582-e5f9-4294-8fd2-c7f551e2e485_2048x1055.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="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">Evaluation metrics should match the components a system actually uses, expanding from basic response quality to retrieval, tool, agent, and media-specific behavior.</figcaption></figure></div><p></p><h3><span>Evaluation as CI</span></h3><p>The metric stack defines what to measure.</p><p>Continuous integration (<strong>CI</strong>) determines <em>when</em> to measure it.</p><p>Run the evaluation suite like unit tests:</p><ol><li><p>Change the prompt/model.</p></li><li><p>Run the same evaluation suite.</p></li><li><p>Generate a scorecard.</p></li><li><p>Block the merge if critical scores fall below your release thresholds.</p></li></ol><p>Use two evaluation suites for different goals:</p><ul><li><p><strong>Regression suite:</strong> Contains cases the system already handles correctly. Its pass rate should stay near 100%. A failed case = new version broke something the previous version handled correctly.</p></li><li><p><strong>Capability suite:</strong> Contains hard cases near limits of the system&#8217;s current abilities. Its pass rate should stay below 100%, so the suite continues to expose weaknesses &amp; measure improvements.</p></li></ul><p>As the system improves, more capability tests pass.</p><p>Anthropic calls the point where nearly all tests pass <strong>eval saturation</strong>. Once a suite approaches this ceiling, add harder tasks so the evaluation continues to reveal meaningful differences between system versions.</p><p>Two rules keep the evaluation gate reliable:</p><h4>1. Build most test cases from observed failures </h4><p>Twenty cases from real production traces often represent actual system risks better than 100 hypothetical questions written in advance.</p><p>Yet there are 2 exceptions:</p><ul><li><p><strong>Adversarial cases:</strong> Tests designed to expose attacks/unsafe behavior.</p></li><li><p><strong>Compliance cases:</strong> Tests for requirements the system must follow.</p></li></ul><p>Include these before an incident occurs&#8230; Waiting for a real security and/or compliance failure is too late&#8230;</p><h4>2. Run each evaluation suite three to five times per change</h4><p>Model outputs vary between runs, so a two-point drop in one run could be sampling noise.</p><p>Block a release when the drop persists across repeated runs rather than reacting to a single fluctuation&#8230;</p><p>Also repeated runs produce 2 useful <em>reliability</em> metrics:</p><ul><li><p><strong>pass@k:</strong> At least one of <em>k</em> attempts must succeed. Use this when a person reviews the result, and retries are acceptable.</p></li><li><p><strong>pass^k</strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-9" href="#footnote-9" target="_self">9</a><strong>:</strong> All <em>k</em> attempts must succeed. &#964;-bench, Sierra&#8217;s benchmark for customer-service agent tasks, introduced this metric. Use it when an agent acts without supervision.</p></li></ul><p>If an unsupervised agent fails <em>10% of the time</em>, the probability of at least one failure across eight tasks is roughly <em>57%</em>.</p><p>A strong single-run score could therefore hide inconsistencies that make &#8220;unsupervised&#8221; deployment <em>unreliable</em>&#8230;</p><p>The evaluation harness measures performance on cases you anticipated &amp; tested.</p><p><em>Guardrails</em> cover another part of the problem by checking every input &amp; output at runtime&#8230;</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 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><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>Part 2: Guardrails</span></h2>
      <p>
          <a href="https://newsletter.systemdesign.one/p/llm-evaluation-and-guardrails">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Database Types - A Deep Dive]]></title><description><![CDATA[#178: Relational, document, key-value, and 13 others.]]></description><link>https://newsletter.systemdesign.one/p/types-of-databases-and-when-to-use-them</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/types-of-databases-and-when-to-use-them</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Thu, 17 Sep 2026 18:35:28 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/66f502c9-0a6b-46ea-b5b5-7b900b3f7c4a_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/types-of-databases-and-when-to-use-them/?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>Some of these are everyday databases, and some are quite specialized. ALL of them are super useful to software engineers building production systems.</p><p><span>Curious to know how many were new to you:</span></p><ol><li><p><span>Relational,</span></p></li><li><p><span>Document,</span></p></li><li><p><span>Key value,</span></p></li><li><p><span>Wide column,</span></p></li><li><p><span>Graph,</span></p></li><li><p><span>Time-series,</span></p></li><li><p><span>Geospatial,</span></p></li><li><p><span>Vector,</span></p></li><li><p><span>Search engine,</span></p></li><li><p><span>In-memory,</span></p></li><li><p><span>Distributed SQL,</span></p></li><li><p><span>Embedded,</span></p></li><li><p><span>Columnar,</span></p></li><li><p><span>Data lakehouse,</span></p></li><li><p><span>Object storage,</span></p></li><li><p><span>Ledger.</span></p></li></ol><p><span>For each, I&#8217;ll share:</span></p><ul><li><p><span>What it is &amp; how it works (in simple words),</span></p></li><li><p><span>A real-world analogy,</span></p></li><li><p><span>Tradeoffs,</span></p></li><li><p><span>Why it matters.</span></p></li></ul><p><span>Let&#8217;s go!</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><strong><a href="https://blitzy.com/sandbox?utm_medium=paid_media&amp;utm_source=newsletter_systemdesign&amp;utm_campaign=sandbox">Autonomous Software Development for the Enterprise (Partner)</a></strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://blitzy.com/sandbox?utm_medium=paid_media&amp;utm_source=newsletter_systemdesign&amp;utm_campaign=sandbox" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mEVd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f45b0bf-dbe2-424a-bdc1-a689977a6061_2048x1072.png 424w, https://substackcdn.com/image/fetch/$s_!mEVd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f45b0bf-dbe2-424a-bdc1-a689977a6061_2048x1072.png 848w, https://substackcdn.com/image/fetch/$s_!mEVd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f45b0bf-dbe2-424a-bdc1-a689977a6061_2048x1072.png 1272w, https://substackcdn.com/image/fetch/$s_!mEVd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f45b0bf-dbe2-424a-bdc1-a689977a6061_2048x1072.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mEVd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f45b0bf-dbe2-424a-bdc1-a689977a6061_2048x1072.png" width="1456" height="762" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8f45b0bf-dbe2-424a-bdc1-a689977a6061_2048x1072.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:762,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2058069,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://blitzy.com/sandbox?utm_medium=paid_media&amp;utm_source=newsletter_systemdesign&amp;utm_campaign=sandbox&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/214745547?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f45b0bf-dbe2-424a-bdc1-a689977a6061_2048x1072.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_!mEVd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f45b0bf-dbe2-424a-bdc1-a689977a6061_2048x1072.png 424w, https://substackcdn.com/image/fetch/$s_!mEVd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f45b0bf-dbe2-424a-bdc1-a689977a6061_2048x1072.png 848w, https://substackcdn.com/image/fetch/$s_!mEVd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f45b0bf-dbe2-424a-bdc1-a689977a6061_2048x1072.png 1272w, https://substackcdn.com/image/fetch/$s_!mEVd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f45b0bf-dbe2-424a-bdc1-a689977a6061_2048x1072.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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://blitzy.com/sandbox?utm_medium=paid_media&amp;utm_source=newsletter_systemdesign&amp;utm_campaign=sandbox">Blitzy</a></strong> is built for large, complex software projects that other coding agents cannot handle: new feature development, large-scale refactors, scaled vulnerability remediation, and undocumented legacy systems.</p><p>Blitzy&#8217;s Sandbox lets engineers evaluate Blitzy on their own software estate, at their own pace. Eligible organizations can connect real applications, reverse-engineer up to 1 million lines of code, generate up to 25,000 lines of E2E tested code, and surface prioritized security vulnerabilities across their software estate.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blitzy.com/sandbox?utm_medium=paid_media&amp;utm_source=newsletter_systemdesign&amp;utm_campaign=sandbox&quot;,&quot;text&quot;:&quot;Try Blitzy on your codebase&quot;,&quot;action&quot;:null,&quot;class&quot;:&quot;button-wrapper&quot;}" data-component-name="ButtonCreateButton"><a class="button primary button-wrapper" href="https://blitzy.com/sandbox?utm_medium=paid_media&amp;utm_source=newsletter_systemdesign&amp;utm_campaign=sandbox"><span>Try Blitzy on your codebase</span></a></p><p><em>(Thanks to <strong><a href="https://blitzy.com/sandbox?utm_medium=paid_media&amp;utm_source=newsletter_systemdesign&amp;utm_campaign=sandbox">Blitzy</a></strong> for partnering on this newsletter.)</em></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><strong><span>1. Relational</span></strong></h2><blockquote><p><span>A relational database stores data in tables of rows and columns, and links those tables through shared keys. Every row follows the same shape, and keys tie the tables together.</span></p></blockquote><p><span>You declare the shape upfront in Structured Query Language (</span><strong><span>SQL</span></strong><span>).</span></p><p><span>So a customer row carries an identifier, a name, and an email. Orders live in their own table and carry the customer identifier, and the database matches the two on that column in an operation called a </span><em><span>join</span></em><span>.</span></p><p><span>Transactions group several changes into one unit, so money moves between two accounts completely/both rows stay as they were. This guarantee is atomicity, consistency, isolation, and durability (</span><strong><span>ACID</span></strong><span>), and it is why banks and shops still run on these engines fifty years on. PostgreSQL also reaches beyond the model through extensions, adding geography and vector search to the same database.</span></p><p><span>One schema, one set of rules, and every application connecting to it gets the same 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_!DN4n!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84821d63-5266-45ce-93fb-f2da7ca37a67_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!DN4n!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84821d63-5266-45ce-93fb-f2da7ca37a67_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!DN4n!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84821d63-5266-45ce-93fb-f2da7ca37a67_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!DN4n!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84821d63-5266-45ce-93fb-f2da7ca37a67_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!DN4n!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84821d63-5266-45ce-93fb-f2da7ca37a67_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!DN4n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84821d63-5266-45ce-93fb-f2da7ca37a67_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/84821d63-5266-45ce-93fb-f2da7ca37a67_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_!DN4n!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84821d63-5266-45ce-93fb-f2da7ca37a67_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!DN4n!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84821d63-5266-45ce-93fb-f2da7ca37a67_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!DN4n!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84821d63-5266-45ce-93fb-f2da7ca37a67_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!DN4n!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F84821d63-5266-45ce-93fb-f2da7ca37a67_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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 warehouse with a strict intake form.</span></p><p><span>Every pallet carries the same label fields, so any driver finds any pallet by reading a code. Redesign the form, and you relabel the whole warehouse.</span></p><h3><strong><span>Tradeoff</span></strong></h3><p><span>Relational databases hand you correctness for free, with joins, constraints, and transactions built in.</span></p><p><span>But the fixed schema resists change, and adding a column to a large table can lock it while the change runs. Plus, write throughput hits a ceiling on one machine; lifting that ceiling means sharding by hand</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a><span>.</span></p><h3><strong><span>Why it matters</span></strong></h3><p><span>Orders, payments, inventory, users, and any data with real relationships.</span></p><p><span>PostgreSQL &amp; MySQL cover most of this ground. Pair it with in-memory caching and distributed SQL, which take over once reads and writes outgrow a single box.</span></p><h2><strong><span>2. Document</span></strong></h2><blockquote><p><span>A document database stores each record as one self-contained document, typically in JavaScript Object Notation (</span><strong><span>JSON</span></strong><span>).</span></p></blockquote><p><span>Two documents in the same collection</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a><span> can &#8220;differ&#8221;.</span></p><p><span>One product carries a shoe size, and the next carries a screen resolution &amp; a warranty period. The database keeps each one whole,,, so a single read returns the entire product with every nested field attached and no join runs.</span></p><p><span>Indexes still apply to any field/path you name, including nested fields and array elements, so queries stay fast as collections grow. MongoDB &amp; Couchbase lead here, and support transactions across several documents.</span></p><p><span>The freedom lives in the &#8220;schema&#8221;, and speed still comes from disciplined indexing.</span></p><p><span>Change the fields on one product and the rest of the collection carries on </span><em><span>unchanged</span></em><span>.</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_!SeG9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb52d2317-bdd6-478a-bcab-3b04cce08f25_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SeG9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb52d2317-bdd6-478a-bcab-3b04cce08f25_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!SeG9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb52d2317-bdd6-478a-bcab-3b04cce08f25_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!SeG9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb52d2317-bdd6-478a-bcab-3b04cce08f25_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!SeG9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb52d2317-bdd6-478a-bcab-3b04cce08f25_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SeG9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb52d2317-bdd6-478a-bcab-3b04cce08f25_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b52d2317-bdd6-478a-bcab-3b04cce08f25_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_!SeG9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb52d2317-bdd6-478a-bcab-3b04cce08f25_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!SeG9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb52d2317-bdd6-478a-bcab-3b04cce08f25_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!SeG9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb52d2317-bdd6-478a-bcab-3b04cce08f25_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!SeG9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb52d2317-bdd6-478a-bcab-3b04cce08f25_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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 filing cabinet of case folders.</span></p><p><span>Each folder holds every page for one case, so you answer any question about it by pulling one folder. Nobody checks whether two folders hold the same kind of pages.</span></p><h3><strong><span>Tradeoff</span></strong></h3><p><span>Document stores let each record carry its own shape&#8230; This suits data nobody can pin down in advance.</span></p><p><span>But copies of the same fact spread across documents and drift apart, and relationships between documents fall to your application code. With the schema left open, malformed records reach production quietly &amp; surface months later.</span></p><p><span>So validate the shape in the database, since the flexibility you want in year one becomes the mess you inherit in year three.</span></p><h3><strong><span>Why it matters</span></strong></h3><p><span>Catalogs, user profiles, content, and event payloads, where records vary, and you read them whole.</span></p><p><span>MongoDB and Couchbase are popular picks. Pair it with a search engine for text queries, or move to a key-value store when every read is by identifier anyway.</span></p><h2><strong><span>3. Key-value</span></strong></h2><blockquote><p><span>A key-value store saves a value under a unique key &amp; returns it in a single lookup. </span></p></blockquote><p><span>The &#8220;key&#8221; is the only way in</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>Ask for one key and the store answers in one hop, with no scan &amp; no query planner in the way. The store hashes</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a><span> each key onto one node, so adding nodes splits the keyspace and lifts capacity in a straight line. Plus, many KV stores attach a time-to-live so cached entries expire on their own.</span></p><p><span>Redis &amp; DynamoDB dominate this space.</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_!VfIu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1e9666a-250c-4215-9e73-e81427a30e84_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VfIu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1e9666a-250c-4215-9e73-e81427a30e84_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!VfIu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1e9666a-250c-4215-9e73-e81427a30e84_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!VfIu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1e9666a-250c-4215-9e73-e81427a30e84_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!VfIu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1e9666a-250c-4215-9e73-e81427a30e84_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VfIu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1e9666a-250c-4215-9e73-e81427a30e84_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c1e9666a-250c-4215-9e73-e81427a30e84_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_!VfIu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1e9666a-250c-4215-9e73-e81427a30e84_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!VfIu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1e9666a-250c-4215-9e73-e81427a30e84_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!VfIu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1e9666a-250c-4215-9e73-e81427a30e84_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!VfIu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1e9666a-250c-4215-9e73-e81427a30e84_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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 coat check.</span></p><p><span>You hand over a coat and get a numbered ticket&#8230; the ticket brings the coat back in seconds. The attendant has no other way to find every brown coat in the room.</span></p><h3><strong><span>Tradeoff</span></strong></h3><p><span>Key-value stores give you the fastest read path &amp; scale by adding nodes.</span></p><p><span>But every lookup by something other than the key means a full pass over the data, and secondary indexes stay limited/absent. Also one &#8220;popular&#8221; key sends all its traffic to a single node, so a HOT key overloads one machine while the rest idle.</span></p><p><span>So design the key naming scheme</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a><span> before you write a line of code, because reworking it later means rewriting each caller.</span></p><h3><strong><span>Why it matters</span></strong></h3><p><span>Sessions, shopping carts, feature flags, and rate limit counters, where you know the identifier at read time&#8230;</span></p><p><span>Redis &amp; DynamoDB are the standards. Pair it with a relational database, which holds the truth, while the key-value</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a><span> store holds the fast copy.</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/types-of-databases-and-when-to-use-them?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);">If something resonated with you today, share this letter. Because one idea, one action, can change everything.</span></em></p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/types-of-databases-and-when-to-use-them?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/types-of-databases-and-when-to-use-them?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><strong><span>4. Wide-column</span></strong></h2><blockquote><p><span>A wide-column store spreads rows across many nodes &amp; each row holds only the columns it uses.</span></p></blockquote><p><span>The primary key does double duty</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-7" href="#footnote-7" target="_self">7</a><span>:</span></p><ul><li><p><span>Its first part (</span><strong><span>partition key</span></strong><span>) decides which node stores the row.</span></p></li><li><p><span>Its second part (</span><strong><span>clustering key</span></strong><span>) decides the order of rows inside the partition.</span></p></li></ul><p><span>Pick both well &amp; a query reads one partition on one node&#8230; this is how wide column stores answer in milliseconds while holding petabytes.</span></p><p><span>Writes take a fast path too: they append to a commit log &amp; an in-memory table</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-8" href="#footnote-8" target="_self">8</a><span> before flushing to sorted files on disk. So nothing seeks across the disk to update a row in place.</span></p><p><span>Get the key right &amp; a read touches only one node&#8230; Get it wrong &amp; it touches all of them&#8230;</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_!8avv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b306830-ed93-42da-a476-aed096d0dbcd_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8avv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b306830-ed93-42da-a476-aed096d0dbcd_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!8avv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b306830-ed93-42da-a476-aed096d0dbcd_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!8avv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b306830-ed93-42da-a476-aed096d0dbcd_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!8avv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b306830-ed93-42da-a476-aed096d0dbcd_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8avv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b306830-ed93-42da-a476-aed096d0dbcd_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1b306830-ed93-42da-a476-aed096d0dbcd_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_!8avv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b306830-ed93-42da-a476-aed096d0dbcd_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!8avv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b306830-ed93-42da-a476-aed096d0dbcd_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!8avv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b306830-ed93-42da-a476-aed096d0dbcd_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!8avv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1b306830-ed93-42da-a476-aed096d0dbcd_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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 stadium with numbered gates&#8230;</span></p><p><span>Your ticket names the gate, so you walk straight in while sixty thousand people move at once. Arrive without a gate number, and you circle the building.</span></p><h3><strong><span>Tradeoff</span></strong></h3><p><span>Wide-column stores take write volumes</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-9" href="#footnote-9" target="_self">9</a><span> no single machine survives, and they stay available while nodes fail.</span></p><p><span>But you model queries before you model data, so a question nobody anticipated needs a second table and a second copy</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-10" href="#footnote-10" target="_self">10</a><span>. Plus, deletes leave markers</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-11" href="#footnote-11" target="_self">11</a><span> behind until compaction clears them, and repair, compaction, &amp; node replacement are real operational work.</span></p><p><span>So write down every query you need before you design the key, since the model resists new questions later.</span></p><h3><strong><span>Why it matters</span></strong></h3><p><span>Message history, activity feeds, and device telemetry at write volumes one machine will never take&#8230;</span></p><p><span>Cassandra &amp; HBase lead here. Pair it with a time-series database,,, which gives you the same scale with far less modeling when the data is stamped with a time.</span></p><h2><strong><span>5. Graph</span></strong></h2><blockquote><p><span>A graph database stores data as nodes &amp; edges between them, then answers questions by walking those edges.</span></p></blockquote><p><span>The relationship gets stored</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-12" href="#footnote-12" target="_self">12</a><span>, so following it costs almost nothing.</span></p><p><span>In a relational database, finding friends of your friends means joining a table to itself once per hop, and each hop multiplies the work. A graph database keeps a direct pointer from every node to its neighbors, so a hop is a pointer follow &amp; depth stops mattering</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-13" href="#footnote-13" target="_self">13</a><span>.</span></p><p><span>Query languages like Cypher &amp; Gremlin let you describe the shape you want and the engine traces 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_!4MUK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ba54718-75a1-4ab1-8337-ac28867bd57a_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4MUK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ba54718-75a1-4ab1-8337-ac28867bd57a_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!4MUK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ba54718-75a1-4ab1-8337-ac28867bd57a_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!4MUK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ba54718-75a1-4ab1-8337-ac28867bd57a_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!4MUK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ba54718-75a1-4ab1-8337-ac28867bd57a_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4MUK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ba54718-75a1-4ab1-8337-ac28867bd57a_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5ba54718-75a1-4ab1-8337-ac28867bd57a_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_!4MUK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ba54718-75a1-4ab1-8337-ac28867bd57a_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!4MUK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ba54718-75a1-4ab1-8337-ac28867bd57a_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!4MUK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ba54718-75a1-4ab1-8337-ac28867bd57a_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!4MUK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ba54718-75a1-4ab1-8337-ac28867bd57a_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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 underground map&#8230;</span></p><p><span>You trace the route with your finger without reading a single timetable.</span></p><h3><strong><span>Tradeoff</span></strong></h3><p><span>Graph databases answer questions about connections, and the queries read like the question you asked.</span></p><p><span>But spreading a graph across machines is HARD, since edges cross partitions &amp; traversal then crosses the network</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-14" href="#footnote-14" target="_self">14</a><span>. Also you need to learn a new query language, plus bulk analytics run slower here than in a columnar store.</span></p><p><span>So reach for a graph when the connections are the product.</span></p><h3><strong><span>Why it matters</span></strong></h3><p><span>Fraud rings, recommendations, social graphs, permission chains &amp; network topology.</span></p><p><span>Neo4j &amp; Amazon Neptune are popular picks.</span></p><p><span>Pair it with a relational database, which holds the records while the graph holds the links between them.</span></p><h2><strong><span>6. Time-series</span></strong></h2><blockquote><p><span>A time-series database</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-15" href="#footnote-15" target="_self">15</a><span> stores measurements stamped with time &amp; organizes them by interval.</span></p></blockquote><p>Data typically arrives in time order &amp; old measurements rarely <em>change</em> afterward.</p><p>Each data point contains a timestamp, a value, and a few tags describing where it came from. New measurements get added to the latest chunk instead of updating old data across the disk,,, this makes writes much faster.</p><p>Measurements close together often look similar, so time-series databases can compress them heavily. Also retention rules automatically delete old data, while downsampling replaces detailed data with summaries. i.e., you could keep every measurement for a week, but only hourly averages for a year.</p><p><span>Old data shrinks and/or leaves on a schedule&#8230; so database stays within planned size.</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_!ahGR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81149100-f7ec-49c6-bb7c-9cf9aa28dbf0_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ahGR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81149100-f7ec-49c6-bb7c-9cf9aa28dbf0_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!ahGR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81149100-f7ec-49c6-bb7c-9cf9aa28dbf0_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!ahGR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81149100-f7ec-49c6-bb7c-9cf9aa28dbf0_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!ahGR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81149100-f7ec-49c6-bb7c-9cf9aa28dbf0_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ahGR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81149100-f7ec-49c6-bb7c-9cf9aa28dbf0_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/81149100-f7ec-49c6-bb7c-9cf9aa28dbf0_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_!ahGR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81149100-f7ec-49c6-bb7c-9cf9aa28dbf0_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!ahGR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81149100-f7ec-49c6-bb7c-9cf9aa28dbf0_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!ahGR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81149100-f7ec-49c6-bb7c-9cf9aa28dbf0_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!ahGR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F81149100-f7ec-49c6-bb7c-9cf9aa28dbf0_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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 ship&#8217;s logbook.</span></p><p><span>Each entry goes on the next line with the time beside it &amp; nobody erases yesterday.</span></p><h3><strong><span>Tradeoff</span></strong></h3><p><span>Time-series databases absorb millions of points a second &amp; answer range queries instantly.</span></p><p><span>But editing/deleting single points fights the design, so corrections are awkward. Tags with unbounded values, such as a user identifier on every reading, explode the index and exhaust memory</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-16" href="#footnote-16" target="_self">16</a><span>.</span></p><p><span>So keep tag values few &amp; bounded.</span></p><h3><strong><span>Why it matters</span></strong></h3><p><span>Metrics, sensor readings, prices &amp; anything you plot against time.</span></p><p><span>InfluxDB, TimescaleDB, and Prometheus lead here.</span></p><p><span>Pair it with a columnar database, which handles long-term analysis once the raw points are rolled up.</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>(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><strong><span>7. Geospatial</span></strong></h2>
      <p>
          <a href="https://newsletter.systemdesign.one/p/types-of-databases-and-when-to-use-them">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[You’re Probably Using Claude Code Wrong]]></title><description><![CDATA[#177: Part 2 - Claude Code 24/7]]></description><link>https://newsletter.systemdesign.one/p/claude-code-mcp-vs-cli</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/claude-code-mcp-vs-cli</guid><dc:creator><![CDATA[Gencay]]></dc:creator><pubDate>Mon, 14 Sep 2026 10:37:32 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/ce05d4cb-4bbe-41c7-91b5-706362d14a54_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"><em><span data-color="#3a7bf9" style="color: rgb(58, 123, 249);">Get my system design playbook for FREE on newsletter signup:</span></em></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-code-mcp-vs-cli/?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>Claude Code is powerful from day one.</span></p><p><span>It reads your files, writes your code &amp; runs your commands.</span></p><p><span>But everything it touches lives on your machine. And the real work rarely stays there. Your issues sit on GitHub, your tasks wait on Slack, and your data lives in Postgres.</span></p><p><span>This is why the natural next step is to reach them. And Claude Code gives you four doors into them. MCP servers, CLIs, plugins, and slash commands.</span></p><p><span>Let&#8217;s get started!</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><div class="callout-block" data-callout="true"><h3><a href="https://getunblocked.com/events/how-to-stop-babysitting-your-agents-sep-23/?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary">[Webinar] How to stop babysitting your agents (Partner)</a></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://getunblocked.com/events/how-to-stop-babysitting-your-agents-sep-23/?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_!CmS3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2da6f38b-7eb4-4472-9cb3-3935462ae703_1600x900.png 424w, https://substackcdn.com/image/fetch/$s_!CmS3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2da6f38b-7eb4-4472-9cb3-3935462ae703_1600x900.png 848w, https://substackcdn.com/image/fetch/$s_!CmS3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2da6f38b-7eb4-4472-9cb3-3935462ae703_1600x900.png 1272w, https://substackcdn.com/image/fetch/$s_!CmS3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2da6f38b-7eb4-4472-9cb3-3935462ae703_1600x900.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CmS3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2da6f38b-7eb4-4472-9cb3-3935462ae703_1600x900.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2da6f38b-7eb4-4472-9cb3-3935462ae703_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;:1099878,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://getunblocked.com/events/how-to-stop-babysitting-your-agents-sep-23/?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary&quot;,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/215411410?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2da6f38b-7eb4-4472-9cb3-3935462ae703_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_!CmS3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2da6f38b-7eb4-4472-9cb3-3935462ae703_1600x900.png 424w, https://substackcdn.com/image/fetch/$s_!CmS3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2da6f38b-7eb4-4472-9cb3-3935462ae703_1600x900.png 848w, https://substackcdn.com/image/fetch/$s_!CmS3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2da6f38b-7eb4-4472-9cb3-3935462ae703_1600x900.png 1272w, https://substackcdn.com/image/fetch/$s_!CmS3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2da6f38b-7eb4-4472-9cb3-3935462ae703_1600x900.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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Agents can generate code. Getting it right for your system, team conventions, and past decisions is the hard part. You end up wasting time and tokens in correction loops.</p><p>More MCPs give agents access to information but not understanding. The teams pulling ahead use a context layer to give agents exactly what they need.</p><p><a href="https://getunblocked.com/events/how-to-stop-babysitting-your-agents-sep-23/?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary">Join live on Sep 23 (FREE)</a> to see:</p><ul><li><p>Where teams get stuck on the AI maturity curve</p></li><li><p>How a context layer solves for quality, efficiency, and cost</p></li><li><p>Live demo: the same coding task with and without a context layer</p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://getunblocked.com/events/how-to-stop-babysitting-your-agents-sep-23/?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://getunblocked.com/events/how-to-stop-babysitting-your-agents-sep-23/?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary"><span>Register now</span></a></p><p><em>(Thanks to <a href="https://getunblocked.com/events/how-to-stop-babysitting-your-agents-sep-23/?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary">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://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;:&quot;&quot;,&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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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">LearnAIWithMe</a></strong>, every Monday, Wednesday &amp; Friday.</p><p>Not just theory for its own sake. One real build at a time, from idea to running system.</p><h4 style="text-align: center;"><strong>&#167;</strong></h4><p><em>Here&#8217;s what you&#8217;ll find inside this newsletter:</em></p><ul><li><p><strong>The four ways Claude Code can reach beyond your local machine.</strong> MCP servers, CLIs, plugins, and slash commands, and why they solve different kinds of problems.</p></li><li><p><strong>What MCP actually gives Claude Code access to.</strong> External apps, services, and data sources, plus the security risk that appears when you connect untrusted tools.</p></li><li><p><strong>Why CLIs can sometimes be a better choice than MCP.</strong> The tradeoffs around setup, token usage, reliability, and when a direct command-line connection makes more sense.</p></li><li><p><strong>What changes when Claude Code can use your browser.</strong> Browser automation, authenticated sessions, and a self-correcting workflow that can inspect a page, catch visual bugs, and keep iterating.</p></li><li><p><strong>Where plugins and slash commands fit into the picture.</strong> What they bundle, what they can trigger, and how they compare with MCPs and CLIs when you need to choose the right connection method.</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"><em><span data-color="#3a7bf9" style="color: rgb(58, 123, 249);">Golden members get full access to Claude Code 24/7!&#8230;</span></em></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><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>What MCP actually is</span></h2><p><span>Model Context Protocol (</span><strong>MCP</strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>) <span>lets your AI (ChatGPT, Claude) connect to applications like Notion and/or Google Docs.</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_!MKpC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe890c2fc-85cd-4759-9ae4-02f46b4554fb_1672x941.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!MKpC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe890c2fc-85cd-4759-9ae4-02f46b4554fb_1672x941.png 424w, https://substackcdn.com/image/fetch/$s_!MKpC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe890c2fc-85cd-4759-9ae4-02f46b4554fb_1672x941.png 848w, https://substackcdn.com/image/fetch/$s_!MKpC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe890c2fc-85cd-4759-9ae4-02f46b4554fb_1672x941.png 1272w, https://substackcdn.com/image/fetch/$s_!MKpC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe890c2fc-85cd-4759-9ae4-02f46b4554fb_1672x941.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!MKpC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe890c2fc-85cd-4759-9ae4-02f46b4554fb_1672x941.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e890c2fc-85cd-4759-9ae4-02f46b4554fb_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;: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_!MKpC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe890c2fc-85cd-4759-9ae4-02f46b4554fb_1672x941.png 424w, https://substackcdn.com/image/fetch/$s_!MKpC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe890c2fc-85cd-4759-9ae4-02f46b4554fb_1672x941.png 848w, https://substackcdn.com/image/fetch/$s_!MKpC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe890c2fc-85cd-4759-9ae4-02f46b4554fb_1672x941.png 1272w, https://substackcdn.com/image/fetch/$s_!MKpC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe890c2fc-85cd-4759-9ae4-02f46b4554fb_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>These tools make your AI feel like an assistant: instead of just answering you, it can affect the real world through connections.</span></p><p><span>Let me show you how to install your first MCP server&#8230;</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>Install your first MCP server</span></h2><blockquote><p>WARNING: Untrusted MCP servers &amp; scraped web content can both carry prompt injection<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a>, hidden instructions aimed at your agent.</p></blockquote><p><span>Install only servers you </span><em><span>trust</span></em><span>, keep Manual mode on &amp; read every approval before you click &#8220;yes&#8221;.</span></p><p><span>Once you trust the source:</span></p><ol><li><p>Open your Claude app</p></li><li><p>Click &#8220;+&#8221;</p></li><li><p>Click &#8220;Connectors&#8221;</p></li><li><p>Click &#8220;Add connector&#8221;</p></li><li><p>Click &#8220;Browse Connectors&#8221;</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_!pvZd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa49b5cfb-be01-4bd6-9102-db2777a3ea2d_2048x1346.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pvZd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa49b5cfb-be01-4bd6-9102-db2777a3ea2d_2048x1346.png 424w, https://substackcdn.com/image/fetch/$s_!pvZd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa49b5cfb-be01-4bd6-9102-db2777a3ea2d_2048x1346.png 848w, https://substackcdn.com/image/fetch/$s_!pvZd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa49b5cfb-be01-4bd6-9102-db2777a3ea2d_2048x1346.png 1272w, https://substackcdn.com/image/fetch/$s_!pvZd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa49b5cfb-be01-4bd6-9102-db2777a3ea2d_2048x1346.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pvZd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa49b5cfb-be01-4bd6-9102-db2777a3ea2d_2048x1346.png" width="1456" height="957" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a49b5cfb-be01-4bd6-9102-db2777a3ea2d_2048x1346.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:957,&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_!pvZd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa49b5cfb-be01-4bd6-9102-db2777a3ea2d_2048x1346.png 424w, https://substackcdn.com/image/fetch/$s_!pvZd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa49b5cfb-be01-4bd6-9102-db2777a3ea2d_2048x1346.png 848w, https://substackcdn.com/image/fetch/$s_!pvZd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa49b5cfb-be01-4bd6-9102-db2777a3ea2d_2048x1346.png 1272w, https://substackcdn.com/image/fetch/$s_!pvZd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa49b5cfb-be01-4bd6-9102-db2777a3ea2d_2048x1346.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>Next, choose from the list.</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_!moD_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F217e54ea-7de5-4673-aa7e-3b3917185cb3_2020x1406.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!moD_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F217e54ea-7de5-4673-aa7e-3b3917185cb3_2020x1406.png 424w, https://substackcdn.com/image/fetch/$s_!moD_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F217e54ea-7de5-4673-aa7e-3b3917185cb3_2020x1406.png 848w, https://substackcdn.com/image/fetch/$s_!moD_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F217e54ea-7de5-4673-aa7e-3b3917185cb3_2020x1406.png 1272w, https://substackcdn.com/image/fetch/$s_!moD_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F217e54ea-7de5-4673-aa7e-3b3917185cb3_2020x1406.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!moD_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F217e54ea-7de5-4673-aa7e-3b3917185cb3_2020x1406.png" width="1456" height="1013" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/217e54ea-7de5-4673-aa7e-3b3917185cb3_2020x1406.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1013,&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_!moD_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F217e54ea-7de5-4673-aa7e-3b3917185cb3_2020x1406.png 424w, https://substackcdn.com/image/fetch/$s_!moD_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F217e54ea-7de5-4673-aa7e-3b3917185cb3_2020x1406.png 848w, https://substackcdn.com/image/fetch/$s_!moD_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F217e54ea-7de5-4673-aa7e-3b3917185cb3_2020x1406.png 1272w, https://substackcdn.com/image/fetch/$s_!moD_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F217e54ea-7de5-4673-aa7e-3b3917185cb3_2020x1406.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 people connect Google Drive &amp; Google Docs, which are very useful.</span></p><p><span>But let&#8217;s try something different&#8230;</span></p><p><span>I connected with Firecrawl</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a><span>.</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_!Gwlw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9236b48c-ac8d-4a85-ba0d-48a607f75ea9_2020x1406.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Gwlw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9236b48c-ac8d-4a85-ba0d-48a607f75ea9_2020x1406.png 424w, https://substackcdn.com/image/fetch/$s_!Gwlw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9236b48c-ac8d-4a85-ba0d-48a607f75ea9_2020x1406.png 848w, https://substackcdn.com/image/fetch/$s_!Gwlw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9236b48c-ac8d-4a85-ba0d-48a607f75ea9_2020x1406.png 1272w, https://substackcdn.com/image/fetch/$s_!Gwlw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9236b48c-ac8d-4a85-ba0d-48a607f75ea9_2020x1406.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Gwlw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9236b48c-ac8d-4a85-ba0d-48a607f75ea9_2020x1406.png" width="1456" height="1013" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9236b48c-ac8d-4a85-ba0d-48a607f75ea9_2020x1406.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1013,&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_!Gwlw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9236b48c-ac8d-4a85-ba0d-48a607f75ea9_2020x1406.png 424w, https://substackcdn.com/image/fetch/$s_!Gwlw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9236b48c-ac8d-4a85-ba0d-48a607f75ea9_2020x1406.png 848w, https://substackcdn.com/image/fetch/$s_!Gwlw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9236b48c-ac8d-4a85-ba0d-48a607f75ea9_2020x1406.png 1272w, https://substackcdn.com/image/fetch/$s_!Gwlw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9236b48c-ac8d-4a85-ba0d-48a607f75ea9_2020x1406.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 connect with it, you need an account.</span></p><p><span>You can open it </span><a href="https://www.firecrawl.dev/"><span>here</span></a><span>.</span></p><p><span>(It has 1000 free credits each month.)</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_!Fq4X!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7465027c-6259-46bd-ac4b-3494f9f1b2bf_2048x1388.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Fq4X!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7465027c-6259-46bd-ac4b-3494f9f1b2bf_2048x1388.png 424w, https://substackcdn.com/image/fetch/$s_!Fq4X!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7465027c-6259-46bd-ac4b-3494f9f1b2bf_2048x1388.png 848w, https://substackcdn.com/image/fetch/$s_!Fq4X!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7465027c-6259-46bd-ac4b-3494f9f1b2bf_2048x1388.png 1272w, https://substackcdn.com/image/fetch/$s_!Fq4X!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7465027c-6259-46bd-ac4b-3494f9f1b2bf_2048x1388.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Fq4X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7465027c-6259-46bd-ac4b-3494f9f1b2bf_2048x1388.png" width="1456" height="987" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7465027c-6259-46bd-ac4b-3494f9f1b2bf_2048x1388.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:987,&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_!Fq4X!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7465027c-6259-46bd-ac4b-3494f9f1b2bf_2048x1388.png 424w, https://substackcdn.com/image/fetch/$s_!Fq4X!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7465027c-6259-46bd-ac4b-3494f9f1b2bf_2048x1388.png 848w, https://substackcdn.com/image/fetch/$s_!Fq4X!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7465027c-6259-46bd-ac4b-3494f9f1b2bf_2048x1388.png 1272w, https://substackcdn.com/image/fetch/$s_!Fq4X!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7465027c-6259-46bd-ac4b-3494f9f1b2bf_2048x1388.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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&#8217;d think, why would I need a scraper when Claude can already open a webpage?</span></p><p><span>But Firecrawl does more than visit it. It crawls the entire page with all its elements.</span></p><p><span>Let&#8217;s test it&#8230;</span></p><p><span>Paste this prompt:</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;37cd828d-5b8a-453f-9a44-e46789a25400&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Use Firecrawl to extract everything from this page:
https://www.tesla.com/model3

Study its sections, content hierarchy, headlines, feature blocks, and calls to action.
Then use Claude Code to build a similar one-page landing page for an AI product,
named Grammar Doctor, with original branding, copy, and visuals.</code></pre></div><p><span>By the way, Grammar Doctor is a grammar-fixing skill I built, so it deserves a landing page.</span></p><p><span>After pasting, it asks for my approval because the session runs in Manual mode, and every action waits for a yes.</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_!RvE8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa06f1aab-f127-44d5-9e47-8999d783db51_2048x1362.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RvE8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa06f1aab-f127-44d5-9e47-8999d783db51_2048x1362.png 424w, https://substackcdn.com/image/fetch/$s_!RvE8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa06f1aab-f127-44d5-9e47-8999d783db51_2048x1362.png 848w, https://substackcdn.com/image/fetch/$s_!RvE8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa06f1aab-f127-44d5-9e47-8999d783db51_2048x1362.png 1272w, https://substackcdn.com/image/fetch/$s_!RvE8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa06f1aab-f127-44d5-9e47-8999d783db51_2048x1362.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RvE8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa06f1aab-f127-44d5-9e47-8999d783db51_2048x1362.png" width="1456" height="968" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a06f1aab-f127-44d5-9e47-8999d783db51_2048x1362.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:968,&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_!RvE8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa06f1aab-f127-44d5-9e47-8999d783db51_2048x1362.png 424w, https://substackcdn.com/image/fetch/$s_!RvE8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa06f1aab-f127-44d5-9e47-8999d783db51_2048x1362.png 848w, https://substackcdn.com/image/fetch/$s_!RvE8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa06f1aab-f127-44d5-9e47-8999d783db51_2048x1362.png 1272w, https://substackcdn.com/image/fetch/$s_!RvE8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa06f1aab-f127-44d5-9e47-8999d783db51_2048x1362.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>As you can see from the screenshot above, it started using Firecrawl, and that&#8217;s how it&#8217;ll scrape every element of the website.</span></p><p><span>And it saved the output inside </span><code>tesla_md.txt</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_!ouuD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45f3c6e3-1c88-421e-b0d3-c8625535dac3_1676x804.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ouuD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45f3c6e3-1c88-421e-b0d3-c8625535dac3_1676x804.png 424w, https://substackcdn.com/image/fetch/$s_!ouuD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45f3c6e3-1c88-421e-b0d3-c8625535dac3_1676x804.png 848w, https://substackcdn.com/image/fetch/$s_!ouuD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45f3c6e3-1c88-421e-b0d3-c8625535dac3_1676x804.png 1272w, https://substackcdn.com/image/fetch/$s_!ouuD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45f3c6e3-1c88-421e-b0d3-c8625535dac3_1676x804.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ouuD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45f3c6e3-1c88-421e-b0d3-c8625535dac3_1676x804.png" width="1456" height="698" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/45f3c6e3-1c88-421e-b0d3-c8625535dac3_1676x804.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:698,&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_!ouuD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45f3c6e3-1c88-421e-b0d3-c8625535dac3_1676x804.png 424w, https://substackcdn.com/image/fetch/$s_!ouuD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45f3c6e3-1c88-421e-b0d3-c8625535dac3_1676x804.png 848w, https://substackcdn.com/image/fetch/$s_!ouuD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45f3c6e3-1c88-421e-b0d3-c8625535dac3_1676x804.png 1272w, https://substackcdn.com/image/fetch/$s_!ouuD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45f3c6e3-1c88-421e-b0d3-c8625535dac3_1676x804.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>Next, before building, it reads this file.</span></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!AVW6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F709f7c78-5238-49e6-ba09-3b96ada38578_826x108.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!AVW6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F709f7c78-5238-49e6-ba09-3b96ada38578_826x108.png 424w, https://substackcdn.com/image/fetch/$s_!AVW6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F709f7c78-5238-49e6-ba09-3b96ada38578_826x108.png 848w, https://substackcdn.com/image/fetch/$s_!AVW6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F709f7c78-5238-49e6-ba09-3b96ada38578_826x108.png 1272w, https://substackcdn.com/image/fetch/$s_!AVW6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F709f7c78-5238-49e6-ba09-3b96ada38578_826x108.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!AVW6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F709f7c78-5238-49e6-ba09-3b96ada38578_826x108.png" width="826" height="108" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/709f7c78-5238-49e6-ba09-3b96ada38578_826x108.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:108,&quot;width&quot;:826,&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_!AVW6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F709f7c78-5238-49e6-ba09-3b96ada38578_826x108.png 424w, https://substackcdn.com/image/fetch/$s_!AVW6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F709f7c78-5238-49e6-ba09-3b96ada38578_826x108.png 848w, https://substackcdn.com/image/fetch/$s_!AVW6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F709f7c78-5238-49e6-ba09-3b96ada38578_826x108.png 1272w, https://substackcdn.com/image/fetch/$s_!AVW6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F709f7c78-5238-49e6-ba09-3b96ada38578_826x108.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><span>After a few permission requests to create CSS files &amp; 15 minutes, web page is ready.</span></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!9ooH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4d68e18-515a-41f6-a54b-d3c5ae51e0f1_1252x278.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!9ooH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4d68e18-515a-41f6-a54b-d3c5ae51e0f1_1252x278.png 424w, https://substackcdn.com/image/fetch/$s_!9ooH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4d68e18-515a-41f6-a54b-d3c5ae51e0f1_1252x278.png 848w, https://substackcdn.com/image/fetch/$s_!9ooH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4d68e18-515a-41f6-a54b-d3c5ae51e0f1_1252x278.png 1272w, https://substackcdn.com/image/fetch/$s_!9ooH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4d68e18-515a-41f6-a54b-d3c5ae51e0f1_1252x278.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!9ooH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4d68e18-515a-41f6-a54b-d3c5ae51e0f1_1252x278.png" width="1252" height="278" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b4d68e18-515a-41f6-a54b-d3c5ae51e0f1_1252x278.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:278,&quot;width&quot;:1252,&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_!9ooH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4d68e18-515a-41f6-a54b-d3c5ae51e0f1_1252x278.png 424w, https://substackcdn.com/image/fetch/$s_!9ooH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4d68e18-515a-41f6-a54b-d3c5ae51e0f1_1252x278.png 848w, https://substackcdn.com/image/fetch/$s_!9ooH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4d68e18-515a-41f6-a54b-d3c5ae51e0f1_1252x278.png 1272w, https://substackcdn.com/image/fetch/$s_!9ooH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb4d68e18-515a-41f6-a54b-d3c5ae51e0f1_1252x278.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><span>Let me show you the website it creates:</span></p><div class="native-video-embed" data-component-name="VideoPlaceholder" data-attrs="{&quot;mediaUploadId&quot;:&quot;acaadf59-68bc-428d-8147-439d62b0c5c8&quot;,&quot;duration&quot;:null}"></div><p><span>If you check Tesla&#8217;s website, you&#8217;ll see it looks very similar.</span></p><p><span>You can also try doing this with a regular web search.</span></p><p><span>But the output quality won't be the same.</span></p><p><span>Web search cannot scrape every element from the page and rebuild a website that is simple, effective &amp; similar to Tesla&#8217;s.</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/claude-code-mcp-vs-cli?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);">If something resonated with you today, share this letter. Because one idea, one action, can change everything.</span></em></p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/claude-code-mcp-vs-cli?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/claude-code-mcp-vs-cli?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>CLIs, the faster way in</span></h2><p><span>A command-line interface (</span><strong><span>CLI</span></strong><span>) lets you connect these tools through your command line, instead of connecting via MCP.</span></p><p><span>This is the older way, since engineers were wiring tools this way long before MCP existed. But for some use cases, like &#8220;unofficial&#8221; connections, it came back.</span></p><p><span>Since Claude Code lives in the terminal, it can easily connect to these apps.</span></p><p><span>And since MCP servers can </span><em><span>consume more tokens and be harder to install</span></em><span>, CLIs can offer a faster way in.</span></p><p><span>Let me show you with NotebookLM</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a><span>&#8230;</span></p><p><span>It has no official MCP server/CLI, but an unofficial CLI called </span><code>notebooklm-py</code><span> exists. And it works quite well.</span></p><p><span>To install it, paste this prompt:</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;ee489c2b-188f-42de-9cae-ff84ea5c56ad&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>After you authenticate, you can now connect to your NotebookLM through Claude Code.</span></p><p><span>I have NotebookLM, created using &#8220;Boris Cherny&#8217;s 30-minute tips&#8221;</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a><span> about Claude Code.</span></p><p><span>Now, let&#8217;s use the CLI &amp; turn it into an infographic.</span></p><p><span>Open your Claude app &amp; paste this prompt:</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;6b5cdd3f-2778-4b6a-9eeb-5fa425cfb3e9&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Here is my Notebook: 

&lt;paste your notebook&#8217;s link&gt;

Use the NotebookLM CLI to create a handwritten-style infographic
summarizing these 30 minutes.</code></pre></div><p><span>After pasting this, it connected to NotebookLM and started creating the infographic.</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_!YVDH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c8a5379-8c4e-4123-a94c-41587f58314d_1150x350.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YVDH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c8a5379-8c4e-4123-a94c-41587f58314d_1150x350.png 424w, https://substackcdn.com/image/fetch/$s_!YVDH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c8a5379-8c4e-4123-a94c-41587f58314d_1150x350.png 848w, https://substackcdn.com/image/fetch/$s_!YVDH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c8a5379-8c4e-4123-a94c-41587f58314d_1150x350.png 1272w, https://substackcdn.com/image/fetch/$s_!YVDH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c8a5379-8c4e-4123-a94c-41587f58314d_1150x350.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YVDH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c8a5379-8c4e-4123-a94c-41587f58314d_1150x350.png" width="1150" height="350" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3c8a5379-8c4e-4123-a94c-41587f58314d_1150x350.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:350,&quot;width&quot;:1150,&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_!YVDH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c8a5379-8c4e-4123-a94c-41587f58314d_1150x350.png 424w, https://substackcdn.com/image/fetch/$s_!YVDH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c8a5379-8c4e-4123-a94c-41587f58314d_1150x350.png 848w, https://substackcdn.com/image/fetch/$s_!YVDH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c8a5379-8c4e-4123-a94c-41587f58314d_1150x350.png 1272w, https://substackcdn.com/image/fetch/$s_!YVDH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3c8a5379-8c4e-4123-a94c-41587f58314d_1150x350.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>And now it is ready; let me show you the image:</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_!4cUK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa66a5385-3fc5-45d5-a4ed-46ba9bf3cc1d_2048x1313.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4cUK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa66a5385-3fc5-45d5-a4ed-46ba9bf3cc1d_2048x1313.png 424w, https://substackcdn.com/image/fetch/$s_!4cUK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa66a5385-3fc5-45d5-a4ed-46ba9bf3cc1d_2048x1313.png 848w, https://substackcdn.com/image/fetch/$s_!4cUK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa66a5385-3fc5-45d5-a4ed-46ba9bf3cc1d_2048x1313.png 1272w, https://substackcdn.com/image/fetch/$s_!4cUK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa66a5385-3fc5-45d5-a4ed-46ba9bf3cc1d_2048x1313.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4cUK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa66a5385-3fc5-45d5-a4ed-46ba9bf3cc1d_2048x1313.png" width="1456" height="933" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a66a5385-3fc5-45d5-a4ed-46ba9bf3cc1d_2048x1313.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:933,&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_!4cUK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa66a5385-3fc5-45d5-a4ed-46ba9bf3cc1d_2048x1313.png 424w, https://substackcdn.com/image/fetch/$s_!4cUK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa66a5385-3fc5-45d5-a4ed-46ba9bf3cc1d_2048x1313.png 848w, https://substackcdn.com/image/fetch/$s_!4cUK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa66a5385-3fc5-45d5-a4ed-46ba9bf3cc1d_2048x1313.png 1272w, https://substackcdn.com/image/fetch/$s_!4cUK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa66a5385-3fc5-45d5-a4ed-46ba9bf3cc1d_2048x1313.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>I did not even visit </span><code>https://notebooklm.google/</code> <span>once.</span></p><p><span>NotebookLM created this image after my prompt inside Claude 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_!v5cw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F590b8d3c-a506-4455-a1bd-2e506a628496_2048x1062.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!v5cw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F590b8d3c-a506-4455-a1bd-2e506a628496_2048x1062.png 424w, https://substackcdn.com/image/fetch/$s_!v5cw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F590b8d3c-a506-4455-a1bd-2e506a628496_2048x1062.png 848w, https://substackcdn.com/image/fetch/$s_!v5cw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F590b8d3c-a506-4455-a1bd-2e506a628496_2048x1062.png 1272w, https://substackcdn.com/image/fetch/$s_!v5cw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F590b8d3c-a506-4455-a1bd-2e506a628496_2048x1062.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!v5cw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F590b8d3c-a506-4455-a1bd-2e506a628496_2048x1062.png" width="1456" height="755" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/590b8d3c-a506-4455-a1bd-2e506a628496_2048x1062.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:755,&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_!v5cw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F590b8d3c-a506-4455-a1bd-2e506a628496_2048x1062.png 424w, https://substackcdn.com/image/fetch/$s_!v5cw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F590b8d3c-a506-4455-a1bd-2e506a628496_2048x1062.png 848w, https://substackcdn.com/image/fetch/$s_!v5cw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F590b8d3c-a506-4455-a1bd-2e506a628496_2048x1062.png 1272w, https://substackcdn.com/image/fetch/$s_!v5cw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F590b8d3c-a506-4455-a1bd-2e506a628496_2048x1062.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>When I clicked it in NotebookLM, I saw Claude Code wrote a prompt after my description.</span></p><p><span>So NotebookLM generated the image like this.</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_!1-jl!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f5b0b0-e2af-4cae-a1a6-03c7b3cf8e9e_2048x1062.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1-jl!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f5b0b0-e2af-4cae-a1a6-03c7b3cf8e9e_2048x1062.png 424w, https://substackcdn.com/image/fetch/$s_!1-jl!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f5b0b0-e2af-4cae-a1a6-03c7b3cf8e9e_2048x1062.png 848w, https://substackcdn.com/image/fetch/$s_!1-jl!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f5b0b0-e2af-4cae-a1a6-03c7b3cf8e9e_2048x1062.png 1272w, https://substackcdn.com/image/fetch/$s_!1-jl!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f5b0b0-e2af-4cae-a1a6-03c7b3cf8e9e_2048x1062.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1-jl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f5b0b0-e2af-4cae-a1a6-03c7b3cf8e9e_2048x1062.png" width="1456" height="755" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/37f5b0b0-e2af-4cae-a1a6-03c7b3cf8e9e_2048x1062.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:755,&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_!1-jl!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f5b0b0-e2af-4cae-a1a6-03c7b3cf8e9e_2048x1062.png 424w, https://substackcdn.com/image/fetch/$s_!1-jl!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f5b0b0-e2af-4cae-a1a6-03c7b3cf8e9e_2048x1062.png 848w, https://substackcdn.com/image/fetch/$s_!1-jl!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f5b0b0-e2af-4cae-a1a6-03c7b3cf8e9e_2048x1062.png 1272w, https://substackcdn.com/image/fetch/$s_!1-jl!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37f5b0b0-e2af-4cae-a1a6-03c7b3cf8e9e_2048x1062.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>But do you wonder how NotebookLM authentication works?</span></em></p><p><span>Claude opens the browser, lets me authenticate my account, and saves everything in a JSON file.</span></p><p><span>The next time it connects, it uses that file to access my account again.</span></p><p><span>Claude Code connects to the browser through browser automation</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a><span>.</span></p><p><span>Now, let me show you more about how this works&#8230;</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>A complete Claude Code setup, from your first session to a fully automated one.</strong></p></li><li><p>Deep dives into how MCP, subagents, agent orchestration &amp; hooks actually work inside Claude Code.</p></li><li><p><strong>How real Claude Code projects handle context, scale &amp; running without you.</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><span>Browser automation with /chrome</span></h2>
      <p>
          <a href="https://newsletter.systemdesign.one/p/claude-code-mcp-vs-cli">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[If you want to get started with Claude Code, read this]]></title><description><![CDATA[#176: Part 1 - Claude Code 24/7]]></description><link>https://newsletter.systemdesign.one/p/claude-code-claude-md-best-practices</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/claude-code-claude-md-best-practices</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Thu, 10 Sep 2026 13:47:18 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/5f1251c7-8d38-4d41-8e95-24ea0025a951_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>&#128680; SUPER DUPER BIG ANNOUNCEMENT &#128680;</p><p>One of the best ways to get ahead of most software engineers is to become good at Claude Code&#8230;</p><p>So today we&#8217;re excited to announce that doors are officially open for our brand spanking new newsletter series...</p><p><strong>INTRODUCING: Claude Code 24/7</strong></p><p>This 5-part newsletter series (running through the end of October) will elevate your software engineering career.</p><p>If you&#8217;ve ever thought:</p><blockquote><p><em>&#8220;I want to understand Claude Code, but don&#8217;t know where to start.&#8221;</em></p><p><em>&#8220;I want to master Claude Code so I can get more out of it at work.&#8221;</em></p><p><em>&#8220;It&#8217;s time. I should learn how to set up subagents, hooks &amp; scheduled automation.&#8221;</em></p></blockquote><p>Then this is for you&#8230;</p><p><em>Here&#8217;s what you&#8217;ll get inside Claude Code 24/7:</em></p><ul><li><p><strong>A complete setup, from your first session to a fully automated one.</strong></p></li><li><p>Deep dives into how MCP, subagents, agent orchestration &amp; hooks work.</p></li><li><p><strong>How real projects handle context, scale, and running without you.</strong></p></li></ul><p>And here&#8217;s the best part:</p><p><em>You&#8217;ll get 10x the results you currently get with 1/10th of your time, energy &amp; effort.</em></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><h4 style="text-align: center;"><strong><a href="https://blitzy.com/sandbox?utm_medium=paid_media&amp;utm_source=newsletter_systemdesign&amp;utm_campaign=sandbox">&#167;</a></strong></h4><h2><strong><a href="https://blitzy.com/sandbox?utm_medium=paid_media&amp;utm_source=newsletter_systemdesign&amp;utm_campaign=sandbox"><span>Autonomous Software Development for the Enterprise (Partner)</span></a></strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://blitzy.com/sandbox?utm_medium=paid_media&amp;utm_source=newsletter_systemdesign&amp;utm_campaign=sandbox" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mEVd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f45b0bf-dbe2-424a-bdc1-a689977a6061_2048x1072.png 424w, https://substackcdn.com/image/fetch/$s_!mEVd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f45b0bf-dbe2-424a-bdc1-a689977a6061_2048x1072.png 848w, https://substackcdn.com/image/fetch/$s_!mEVd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f45b0bf-dbe2-424a-bdc1-a689977a6061_2048x1072.png 1272w, https://substackcdn.com/image/fetch/$s_!mEVd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f45b0bf-dbe2-424a-bdc1-a689977a6061_2048x1072.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mEVd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f45b0bf-dbe2-424a-bdc1-a689977a6061_2048x1072.png" width="1456" height="762" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8f45b0bf-dbe2-424a-bdc1-a689977a6061_2048x1072.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:762,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2058069,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://blitzy.com/sandbox?utm_medium=paid_media&amp;utm_source=newsletter_systemdesign&amp;utm_campaign=sandbox&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/214745547?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f45b0bf-dbe2-424a-bdc1-a689977a6061_2048x1072.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_!mEVd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f45b0bf-dbe2-424a-bdc1-a689977a6061_2048x1072.png 424w, https://substackcdn.com/image/fetch/$s_!mEVd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f45b0bf-dbe2-424a-bdc1-a689977a6061_2048x1072.png 848w, https://substackcdn.com/image/fetch/$s_!mEVd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f45b0bf-dbe2-424a-bdc1-a689977a6061_2048x1072.png 1272w, https://substackcdn.com/image/fetch/$s_!mEVd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8f45b0bf-dbe2-424a-bdc1-a689977a6061_2048x1072.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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://blitzy.com/sandbox?utm_medium=paid_media&amp;utm_source=newsletter_systemdesign&amp;utm_campaign=sandbox"><span>Blitzy</span></a></strong><span> is built for large, complex software projects that other coding agents cannot handle: new feature development, large-scale refactors, scaled vulnerability remediation, and undocumented legacy systems.</span></p><p><span>Blitzy&#8217;s Sandbox lets engineers evaluate Blitzy on their own software estate, at their own pace. Eligible organizations can connect real applications, reverse-engineer up to 1 million lines of code, generate up to 25,000 lines of E2E tested code, and surface prioritized security vulnerabilities across their software estate.</span></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://blitzy.com/sandbox?utm_medium=paid_media&amp;utm_source=newsletter_systemdesign&amp;utm_campaign=sandbox&quot;,&quot;text&quot;:&quot;Try Blitzy on your codebase&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://blitzy.com/sandbox?utm_medium=paid_media&amp;utm_source=newsletter_systemdesign&amp;utm_campaign=sandbox"><span>Try Blitzy on your codebase</span></a></p><p><em>(Thanks to <strong><a href="https://blitzy.com/sandbox?utm_medium=paid_media&amp;utm_source=newsletter_systemdesign&amp;utm_campaign=sandbox">Blitzy</a></strong> for partnering on this newsletter.)</em></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><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;:&quot;&quot;,&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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>LearnAIWithMe</span></a></strong>, every Monday, Wednesday &amp; Friday.</p><p>Not just theory for its own sake. One real build at a time, from idea to running system.</p><h4 style="text-align: center;"><strong>&#167;</strong></h4><p>Claude Code is in every feed right now&#8230;</p><p>YouTube videos, Substack posts, tutorials, screenshots of an app someone built in a single prompt.</p><p>But when I sit down with clients, I keep seeing the same install.</p><p>Three commands, maybe one skill, that&#8217;s it.</p><p>So there&#8217;s a massive gap between what Claude Code can do &amp; how most people use it.</p><p>Let&#8217;s get started!</p><h4 style="text-align: center;"><strong>&#167;</strong></h4><p><em>Here&#8217;s what you&#8217;ll find inside this newsletter:</em></p><ul><li><p><strong>What Claude Code is actually doing after you give it a task.</strong> The agentic loop behind how it gathers context, takes action, verifies its work, and uses tools to work directly with your codebase.</p></li><li><p><strong>The setup mistake that can give Claude far more control than you intended.</strong> How permission modes work, when to use Manual, Plan, Auto, or Accept Edits, and why bypassing permissions can become dangerous as your workflow grows.</p></li><li><p><strong>How to hand Claude a codebase you&#8217;ve never seen before.</strong> A practical workflow for mapping an unfamiliar repository before touching the code, plus how effort levels change how much thinking Claude spends on harder tasks.</p></li><li><p><strong>How to stop re-explaining your project every time you open Claude Code.</strong> What belongs in CLAUDE.md, what should stay out, and how to make your project rules and preferences survive across sessions.</p></li><li><p><strong>How to turn something you repeatedly do by hand into a reusable Claude Code skill.</strong> You&#8217;ll build one from scratch, give it a trigger, test it on real input, teach it from its mistakes, and make those corrections permanent so the workflow improves over time.</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"><em><span data-color="#3a7bf9" style="color: rgb(58, 123, 249);">Golden members get full access to Claude Code 24/7!&#8230;</span></em></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>What Claude Code actually is</span></h2><p><span>Claude Code</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a><span> is an agent running in your terminal</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a><span> that can do anything you could do from the command line.</span></p><p><span>When you give Claude Code a task, it collects context, takes action, and verifies the results; this is called an Agentic loop</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a><span>.</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_!lUZD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d978f15-d102-48d8-bb51-cfc4d75148f7_1916x821.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lUZD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d978f15-d102-48d8-bb51-cfc4d75148f7_1916x821.png 424w, https://substackcdn.com/image/fetch/$s_!lUZD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d978f15-d102-48d8-bb51-cfc4d75148f7_1916x821.png 848w, https://substackcdn.com/image/fetch/$s_!lUZD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d978f15-d102-48d8-bb51-cfc4d75148f7_1916x821.png 1272w, https://substackcdn.com/image/fetch/$s_!lUZD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d978f15-d102-48d8-bb51-cfc4d75148f7_1916x821.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lUZD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d978f15-d102-48d8-bb51-cfc4d75148f7_1916x821.png" width="1456" height="624" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1d978f15-d102-48d8-bb51-cfc4d75148f7_1916x821.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:624,&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_!lUZD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d978f15-d102-48d8-bb51-cfc4d75148f7_1916x821.png 424w, https://substackcdn.com/image/fetch/$s_!lUZD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d978f15-d102-48d8-bb51-cfc4d75148f7_1916x821.png 848w, https://substackcdn.com/image/fetch/$s_!lUZD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d978f15-d102-48d8-bb51-cfc4d75148f7_1916x821.png 1272w, https://substackcdn.com/image/fetch/$s_!lUZD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1d978f15-d102-48d8-bb51-cfc4d75148f7_1916x821.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>But that doesn&#8217;t mean all three stages run every time you give it a task&#8230;</span></p><p><span>Let&#8217;s say you ask a question about the codebase.</span></p><p><span>In this case, gathering context could be enough, while fixing a bug would require all three stages of the agentic loop.</span></p><h3><span>Models</span></h3><p><span>You can change the model during the conversation.</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_!5R6j!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f3b7bd4-fbd8-4138-9adb-a7bc2cf8979a_1640x560.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5R6j!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f3b7bd4-fbd8-4138-9adb-a7bc2cf8979a_1640x560.png 424w, https://substackcdn.com/image/fetch/$s_!5R6j!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f3b7bd4-fbd8-4138-9adb-a7bc2cf8979a_1640x560.png 848w, https://substackcdn.com/image/fetch/$s_!5R6j!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f3b7bd4-fbd8-4138-9adb-a7bc2cf8979a_1640x560.png 1272w, https://substackcdn.com/image/fetch/$s_!5R6j!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f3b7bd4-fbd8-4138-9adb-a7bc2cf8979a_1640x560.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5R6j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f3b7bd4-fbd8-4138-9adb-a7bc2cf8979a_1640x560.png" width="1456" height="497" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6f3b7bd4-fbd8-4138-9adb-a7bc2cf8979a_1640x560.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:497,&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_!5R6j!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f3b7bd4-fbd8-4138-9adb-a7bc2cf8979a_1640x560.png 424w, https://substackcdn.com/image/fetch/$s_!5R6j!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f3b7bd4-fbd8-4138-9adb-a7bc2cf8979a_1640x560.png 848w, https://substackcdn.com/image/fetch/$s_!5R6j!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f3b7bd4-fbd8-4138-9adb-a7bc2cf8979a_1640x560.png 1272w, https://substackcdn.com/image/fetch/$s_!5R6j!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6f3b7bd4-fbd8-4138-9adb-a7bc2cf8979a_1640x560.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>Each model serves a different purpose.</span></p><p><span>For instance, Fable 5 is the most &#8220;intelligent&#8221; model, but you should NOT reach for it on every task</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a><span>.</span></p><p><span>We&#8217;ll return to this in the next parts as we explore subagents&#8230;</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_!7uoV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F330ca319-c474-4e38-979f-559f764bb0da_1622x560.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7uoV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F330ca319-c474-4e38-979f-559f764bb0da_1622x560.png 424w, https://substackcdn.com/image/fetch/$s_!7uoV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F330ca319-c474-4e38-979f-559f764bb0da_1622x560.png 848w, https://substackcdn.com/image/fetch/$s_!7uoV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F330ca319-c474-4e38-979f-559f764bb0da_1622x560.png 1272w, https://substackcdn.com/image/fetch/$s_!7uoV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F330ca319-c474-4e38-979f-559f764bb0da_1622x560.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7uoV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F330ca319-c474-4e38-979f-559f764bb0da_1622x560.png" width="1456" height="503" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/330ca319-c474-4e38-979f-559f764bb0da_1622x560.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:503,&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_!7uoV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F330ca319-c474-4e38-979f-559f764bb0da_1622x560.png 424w, https://substackcdn.com/image/fetch/$s_!7uoV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F330ca319-c474-4e38-979f-559f764bb0da_1622x560.png 848w, https://substackcdn.com/image/fetch/$s_!7uoV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F330ca319-c474-4e38-979f-559f764bb0da_1622x560.png 1272w, https://substackcdn.com/image/fetch/$s_!7uoV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F330ca319-c474-4e38-979f-559f764bb0da_1622x560.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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><span>Tools</span></h3><p><span>An agent takes all actions through tools</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a><span>.</span></p><p><span>And tools are what separate Claude Code from a simple LLM.</span></p><p><span>It reads your files, searches through them, and executes commands.</span></p><p><span>Sometimes it asks for your approval first, sometimes not, and permission modes decide which. (We will cover those later in this newsletter.)</span></p><p><span>It can search the web too.</span></p><p><span>And code intelligence means Claude sees its own mistakes right after it writes them, without running 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_!Ut2P!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F504ee0fd-f84e-49ee-aba1-b96c45ced61e_1672x941.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Ut2P!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F504ee0fd-f84e-49ee-aba1-b96c45ced61e_1672x941.png 424w, https://substackcdn.com/image/fetch/$s_!Ut2P!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F504ee0fd-f84e-49ee-aba1-b96c45ced61e_1672x941.png 848w, https://substackcdn.com/image/fetch/$s_!Ut2P!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F504ee0fd-f84e-49ee-aba1-b96c45ced61e_1672x941.png 1272w, https://substackcdn.com/image/fetch/$s_!Ut2P!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F504ee0fd-f84e-49ee-aba1-b96c45ced61e_1672x941.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Ut2P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F504ee0fd-f84e-49ee-aba1-b96c45ced61e_1672x941.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/504ee0fd-f84e-49ee-aba1-b96c45ced61e_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;: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_!Ut2P!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F504ee0fd-f84e-49ee-aba1-b96c45ced61e_1672x941.png 424w, https://substackcdn.com/image/fetch/$s_!Ut2P!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F504ee0fd-f84e-49ee-aba1-b96c45ced61e_1672x941.png 848w, https://substackcdn.com/image/fetch/$s_!Ut2P!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F504ee0fd-f84e-49ee-aba1-b96c45ced61e_1672x941.png 1272w, https://substackcdn.com/image/fetch/$s_!Ut2P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F504ee0fd-f84e-49ee-aba1-b96c45ced61e_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 you know how it works.</span></p><p><span>So let&#8217;s install it &amp; run your first session&#8230;</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/claude-code-claude-md-best-practices?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);">If something resonated with you today, share this letter. Because one idea, one action, can change everything.</span></em></p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/claude-code-claude-md-best-practices?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/claude-code-claude-md-best-practices?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>Install it and run your first session</span></h2><p><span>To install Claude Code, you should use the terminal.</span></p><p><span>If you have never used one, here are the basics.</span></p><p><span>It takes two steps:</span></p><p><strong><span>Step 1: Paste one of the following commands.</span></strong></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;9462e2ae-6fa8-4b4a-9641-80d8cab3298b&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">macOS/Linux:
curl -fsSL https://claude.ai/install.sh | bash

===

Windows(powershell):
irm https://claude.ai/install.ps1 | iex

===

Windows(CMD):
curl -fsSL https://claude.ai/install.cmd -o install.cmd
&amp;&amp; install.cmd &amp;&amp; del install.cmd</code></pre></div><p><strong><span>Step 2: Log in</span></strong></p><p><span>After Step 1 is finished successfully, paste the following command.</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;148b5e73-8096-4daa-942c-ffde9c8de84a&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">claude</code></pre></div><p><span>Next, Claude asks you to log in, and you can authenticate with your account/API key.</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_!pyzi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac371ba-84ae-45c9-80d8-5629dd17cba1_1144x762.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pyzi!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac371ba-84ae-45c9-80d8-5629dd17cba1_1144x762.png 424w, https://substackcdn.com/image/fetch/$s_!pyzi!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac371ba-84ae-45c9-80d8-5629dd17cba1_1144x762.png 848w, https://substackcdn.com/image/fetch/$s_!pyzi!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac371ba-84ae-45c9-80d8-5629dd17cba1_1144x762.png 1272w, https://substackcdn.com/image/fetch/$s_!pyzi!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac371ba-84ae-45c9-80d8-5629dd17cba1_1144x762.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pyzi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac371ba-84ae-45c9-80d8-5629dd17cba1_1144x762.png" width="1144" height="762" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5ac371ba-84ae-45c9-80d8-5629dd17cba1_1144x762.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:762,&quot;width&quot;:1144,&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_!pyzi!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac371ba-84ae-45c9-80d8-5629dd17cba1_1144x762.png 424w, https://substackcdn.com/image/fetch/$s_!pyzi!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac371ba-84ae-45c9-80d8-5629dd17cba1_1144x762.png 848w, https://substackcdn.com/image/fetch/$s_!pyzi!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac371ba-84ae-45c9-80d8-5629dd17cba1_1144x762.png 1272w, https://substackcdn.com/image/fetch/$s_!pyzi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ac371ba-84ae-45c9-80d8-5629dd17cba1_1144x762.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>Also, let&#8217;s talk about three more shortcuts before you start.</span></p><ul><li><p><code>Esc</code><span> interrupts Claude mid-task, so you can redirect it without losing the work.</span></p></li><li><p><code>Esc</code><span> twice opens the rewind menu, which restores your code to an earlier point.</span></p></li><li><p><code>Ctrl+C</code><span> kills the current input when you change your mind.</span></p></li></ul><p><span>Now everything is ready, but the Claude team has also released an app.</span></p><p><span>For a better experience, you can download it </span><a href="https://claude.com/download"><span>here</span></a><span>.</span></p><p><span>Here&#8217;s what it looks like:</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_!lteT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b1fcf85-94ee-404d-a00e-591010056ad6_2048x1363.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lteT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b1fcf85-94ee-404d-a00e-591010056ad6_2048x1363.png 424w, https://substackcdn.com/image/fetch/$s_!lteT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b1fcf85-94ee-404d-a00e-591010056ad6_2048x1363.png 848w, https://substackcdn.com/image/fetch/$s_!lteT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b1fcf85-94ee-404d-a00e-591010056ad6_2048x1363.png 1272w, https://substackcdn.com/image/fetch/$s_!lteT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b1fcf85-94ee-404d-a00e-591010056ad6_2048x1363.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lteT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b1fcf85-94ee-404d-a00e-591010056ad6_2048x1363.png" width="1456" height="969" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4b1fcf85-94ee-404d-a00e-591010056ad6_2048x1363.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:969,&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_!lteT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b1fcf85-94ee-404d-a00e-591010056ad6_2048x1363.png 424w, https://substackcdn.com/image/fetch/$s_!lteT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b1fcf85-94ee-404d-a00e-591010056ad6_2048x1363.png 848w, https://substackcdn.com/image/fetch/$s_!lteT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b1fcf85-94ee-404d-a00e-591010056ad6_2048x1363.png 1272w, https://substackcdn.com/image/fetch/$s_!lteT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4b1fcf85-94ee-404d-a00e-591010056ad6_2048x1363.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>Did you notice the mistake I made?</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_!SA1I!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7687d385-17ae-4652-bda3-88608cc51613_1910x662.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!SA1I!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7687d385-17ae-4652-bda3-88608cc51613_1910x662.png 424w, https://substackcdn.com/image/fetch/$s_!SA1I!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7687d385-17ae-4652-bda3-88608cc51613_1910x662.png 848w, https://substackcdn.com/image/fetch/$s_!SA1I!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7687d385-17ae-4652-bda3-88608cc51613_1910x662.png 1272w, https://substackcdn.com/image/fetch/$s_!SA1I!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7687d385-17ae-4652-bda3-88608cc51613_1910x662.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!SA1I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7687d385-17ae-4652-bda3-88608cc51613_1910x662.png" width="1456" height="505" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7687d385-17ae-4652-bda3-88608cc51613_1910x662.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:505,&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_!SA1I!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7687d385-17ae-4652-bda3-88608cc51613_1910x662.png 424w, https://substackcdn.com/image/fetch/$s_!SA1I!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7687d385-17ae-4652-bda3-88608cc51613_1910x662.png 848w, https://substackcdn.com/image/fetch/$s_!SA1I!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7687d385-17ae-4652-bda3-88608cc51613_1910x662.png 1272w, https://substackcdn.com/image/fetch/$s_!SA1I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7687d385-17ae-4652-bda3-88608cc51613_1910x662.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>Yes, I bypassed permissions and let Claude do anything </span><em><span>without</span></em><span> my approval.</span></p><p><span>It is a serious &#8220;mistake&#8221;, and it gets worse the longer you work that way.</span></p><p><span>Let&#8217;s explore the permission modes&#8230;</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>Permission modes and which one to pick</span></h2><p><span>When you work with Claude, it asks for your approval between tasks.</span></p><p><span>The permission modes control how often Claude asks.</span></p><p><span>Press </span><code>shift+tab</code><span> or click the mode label to see the list.</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_!yJIw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f416bb-b47a-49fa-b2a1-080bb430bc00_1674x482.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yJIw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f416bb-b47a-49fa-b2a1-080bb430bc00_1674x482.png 424w, https://substackcdn.com/image/fetch/$s_!yJIw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f416bb-b47a-49fa-b2a1-080bb430bc00_1674x482.png 848w, https://substackcdn.com/image/fetch/$s_!yJIw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f416bb-b47a-49fa-b2a1-080bb430bc00_1674x482.png 1272w, https://substackcdn.com/image/fetch/$s_!yJIw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f416bb-b47a-49fa-b2a1-080bb430bc00_1674x482.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yJIw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f416bb-b47a-49fa-b2a1-080bb430bc00_1674x482.png" width="1456" height="419" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/83f416bb-b47a-49fa-b2a1-080bb430bc00_1674x482.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:419,&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_!yJIw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f416bb-b47a-49fa-b2a1-080bb430bc00_1674x482.png 424w, https://substackcdn.com/image/fetch/$s_!yJIw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f416bb-b47a-49fa-b2a1-080bb430bc00_1674x482.png 848w, https://substackcdn.com/image/fetch/$s_!yJIw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f416bb-b47a-49fa-b2a1-080bb430bc00_1674x482.png 1272w, https://substackcdn.com/image/fetch/$s_!yJIw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F83f416bb-b47a-49fa-b2a1-080bb430bc00_1674x482.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>At the top of the list, you&#8217;ll see your current default.</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_!Xbmx!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26c50054-23f7-46cf-9c8f-30a79d5602b1_596x482.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Xbmx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26c50054-23f7-46cf-9c8f-30a79d5602b1_596x482.png 424w, https://substackcdn.com/image/fetch/$s_!Xbmx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26c50054-23f7-46cf-9c8f-30a79d5602b1_596x482.png 848w, https://substackcdn.com/image/fetch/$s_!Xbmx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26c50054-23f7-46cf-9c8f-30a79d5602b1_596x482.png 1272w, https://substackcdn.com/image/fetch/$s_!Xbmx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26c50054-23f7-46cf-9c8f-30a79d5602b1_596x482.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Xbmx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26c50054-23f7-46cf-9c8f-30a79d5602b1_596x482.png" width="596" height="482" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/26c50054-23f7-46cf-9c8f-30a79d5602b1_596x482.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:482,&quot;width&quot;:596,&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_!Xbmx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26c50054-23f7-46cf-9c8f-30a79d5602b1_596x482.png 424w, https://substackcdn.com/image/fetch/$s_!Xbmx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26c50054-23f7-46cf-9c8f-30a79d5602b1_596x482.png 848w, https://substackcdn.com/image/fetch/$s_!Xbmx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26c50054-23f7-46cf-9c8f-30a79d5602b1_596x482.png 1272w, https://substackcdn.com/image/fetch/$s_!Xbmx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F26c50054-23f7-46cf-9c8f-30a79d5602b1_596x482.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 change it, click on Settings/Claude Code.</span></p><p><span>You can toggle </span><em><span>&#8220;Allow bypass permission mode&#8221;</span></em><span> on &amp; off.</span></p><p><span>If you&#8217;re still learning, leave this option off.</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_!esWR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01600301-3406-4645-987b-8514b715898d_1900x1320.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!esWR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01600301-3406-4645-987b-8514b715898d_1900x1320.png 424w, https://substackcdn.com/image/fetch/$s_!esWR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01600301-3406-4645-987b-8514b715898d_1900x1320.png 848w, https://substackcdn.com/image/fetch/$s_!esWR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01600301-3406-4645-987b-8514b715898d_1900x1320.png 1272w, https://substackcdn.com/image/fetch/$s_!esWR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01600301-3406-4645-987b-8514b715898d_1900x1320.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!esWR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01600301-3406-4645-987b-8514b715898d_1900x1320.png" width="1456" height="1012" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/01600301-3406-4645-987b-8514b715898d_1900x1320.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1012,&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_!esWR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01600301-3406-4645-987b-8514b715898d_1900x1320.png 424w, https://substackcdn.com/image/fetch/$s_!esWR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01600301-3406-4645-987b-8514b715898d_1900x1320.png 848w, https://substackcdn.com/image/fetch/$s_!esWR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01600301-3406-4645-987b-8514b715898d_1900x1320.png 1272w, https://substackcdn.com/image/fetch/$s_!esWR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F01600301-3406-4645-987b-8514b715898d_1900x1320.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 are all five options and a single-sentence explanation for each of them:</span></p><ul><li><p><strong><span>Manual</span></strong><span>: Always ask before making any changes.</span></p></li><li><p><strong><span>Accept edits</span></strong><span>: Automatically accept all file edits.</span></p></li><li><p><strong><span>Plan</span></strong><span>: Create a plan before making any changes.</span></p></li><li><p><strong><span>Auto</span></strong><span>: Claude decides the permissions.</span></p></li><li><p><strong><span>Bypass permission</span></strong><span>: Claude runs everything without asking.</span></p></li></ul><p><span>Now you know how much freedom Claude has.</span></p><p><span>So let&#8217;s put it to work on a codebase you have never seen&#8230;</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>Read an unfamiliar codebase before you touch it</span></h2><p><span>A Claude project usually holds your skills and a Claude.md file</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a><span>.</span></p><p><span>(We&#8217;ll go through these later in this newsletter&#8230;)</span></p><p><span>But first, let me show you mine, using VS Code, because it also shows the files.</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_!uEDm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a9b6520-7f5f-4fbf-86be-6ba4dc0b1222_2048x1273.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!uEDm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a9b6520-7f5f-4fbf-86be-6ba4dc0b1222_2048x1273.png 424w, https://substackcdn.com/image/fetch/$s_!uEDm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a9b6520-7f5f-4fbf-86be-6ba4dc0b1222_2048x1273.png 848w, https://substackcdn.com/image/fetch/$s_!uEDm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a9b6520-7f5f-4fbf-86be-6ba4dc0b1222_2048x1273.png 1272w, https://substackcdn.com/image/fetch/$s_!uEDm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a9b6520-7f5f-4fbf-86be-6ba4dc0b1222_2048x1273.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!uEDm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a9b6520-7f5f-4fbf-86be-6ba4dc0b1222_2048x1273.png" width="1456" height="905" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0a9b6520-7f5f-4fbf-86be-6ba4dc0b1222_2048x1273.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:905,&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_!uEDm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a9b6520-7f5f-4fbf-86be-6ba4dc0b1222_2048x1273.png 424w, https://substackcdn.com/image/fetch/$s_!uEDm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a9b6520-7f5f-4fbf-86be-6ba4dc0b1222_2048x1273.png 848w, https://substackcdn.com/image/fetch/$s_!uEDm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a9b6520-7f5f-4fbf-86be-6ba4dc0b1222_2048x1273.png 1272w, https://substackcdn.com/image/fetch/$s_!uEDm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0a9b6520-7f5f-4fbf-86be-6ba4dc0b1222_2048x1273.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Before publishing articles for my newsletter, I use my Claude project to test the code in them.</p><p><span>You can see my project name from the Claude app too.</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_!mphk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F227efe09-73f8-458b-bb5c-635ad285fb2f_2048x1362.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!mphk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F227efe09-73f8-458b-bb5c-635ad285fb2f_2048x1362.png 424w, https://substackcdn.com/image/fetch/$s_!mphk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F227efe09-73f8-458b-bb5c-635ad285fb2f_2048x1362.png 848w, https://substackcdn.com/image/fetch/$s_!mphk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F227efe09-73f8-458b-bb5c-635ad285fb2f_2048x1362.png 1272w, https://substackcdn.com/image/fetch/$s_!mphk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F227efe09-73f8-458b-bb5c-635ad285fb2f_2048x1362.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!mphk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F227efe09-73f8-458b-bb5c-635ad285fb2f_2048x1362.png" width="1456" height="968" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/227efe09-73f8-458b-bb5c-635ad285fb2f_2048x1362.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:968,&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_!mphk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F227efe09-73f8-458b-bb5c-635ad285fb2f_2048x1362.png 424w, https://substackcdn.com/image/fetch/$s_!mphk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F227efe09-73f8-458b-bb5c-635ad285fb2f_2048x1362.png 848w, https://substackcdn.com/image/fetch/$s_!mphk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F227efe09-73f8-458b-bb5c-635ad285fb2f_2048x1362.png 1272w, https://substackcdn.com/image/fetch/$s_!mphk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F227efe09-73f8-458b-bb5c-635ad285fb2f_2048x1362.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>Let&#8217;s turn the permission mode from &#8220;Manual&#8221; to &#8220;Plan&#8221; by pressing </span><code>shift + tab</code><span>.</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_!71aj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F934cde2c-4c0c-49fe-8df2-00d72af37225_1716x466.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!71aj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F934cde2c-4c0c-49fe-8df2-00d72af37225_1716x466.png 424w, https://substackcdn.com/image/fetch/$s_!71aj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F934cde2c-4c0c-49fe-8df2-00d72af37225_1716x466.png 848w, https://substackcdn.com/image/fetch/$s_!71aj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F934cde2c-4c0c-49fe-8df2-00d72af37225_1716x466.png 1272w, https://substackcdn.com/image/fetch/$s_!71aj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F934cde2c-4c0c-49fe-8df2-00d72af37225_1716x466.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!71aj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F934cde2c-4c0c-49fe-8df2-00d72af37225_1716x466.png" width="1456" height="395" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/934cde2c-4c0c-49fe-8df2-00d72af37225_1716x466.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:395,&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_!71aj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F934cde2c-4c0c-49fe-8df2-00d72af37225_1716x466.png 424w, https://substackcdn.com/image/fetch/$s_!71aj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F934cde2c-4c0c-49fe-8df2-00d72af37225_1716x466.png 848w, https://substackcdn.com/image/fetch/$s_!71aj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F934cde2c-4c0c-49fe-8df2-00d72af37225_1716x466.png 1272w, https://substackcdn.com/image/fetch/$s_!71aj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F934cde2c-4c0c-49fe-8df2-00d72af37225_1716x466.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>(I&#8217;ve been building different projects and creating separate folders, which has made my codebase a bit messy.)</span></p><p><span>Let&#8217;s explore those files by creating an artifact</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-7" href="#footnote-7" target="_self">7</a><span>.</span></p><p><span>Here is the prompt to paste:</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;85cd6262-07e5-4e0e-a6f2-6d2e614c6255&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Read this project and map its structure.

Show every folder and the projects in it.

Return it as an artifact.</code></pre></div><p><span>After pasting it, Claude maps the project &amp; starts writing the plan.</span></p><p><span>Remember, we&#8217;re in &#8220;plan&#8221; mode.</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_!aX8Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e6c74e6-f142-4e3d-b02f-068bb9727934_924x364.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aX8Z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e6c74e6-f142-4e3d-b02f-068bb9727934_924x364.png 424w, https://substackcdn.com/image/fetch/$s_!aX8Z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e6c74e6-f142-4e3d-b02f-068bb9727934_924x364.png 848w, https://substackcdn.com/image/fetch/$s_!aX8Z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e6c74e6-f142-4e3d-b02f-068bb9727934_924x364.png 1272w, https://substackcdn.com/image/fetch/$s_!aX8Z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e6c74e6-f142-4e3d-b02f-068bb9727934_924x364.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aX8Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e6c74e6-f142-4e3d-b02f-068bb9727934_924x364.png" width="924" height="364" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9e6c74e6-f142-4e3d-b02f-068bb9727934_924x364.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:364,&quot;width&quot;:924,&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_!aX8Z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e6c74e6-f142-4e3d-b02f-068bb9727934_924x364.png 424w, https://substackcdn.com/image/fetch/$s_!aX8Z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e6c74e6-f142-4e3d-b02f-068bb9727934_924x364.png 848w, https://substackcdn.com/image/fetch/$s_!aX8Z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e6c74e6-f142-4e3d-b02f-068bb9727934_924x364.png 1272w, https://substackcdn.com/image/fetch/$s_!aX8Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e6c74e6-f142-4e3d-b02f-068bb9727934_924x364.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>After the plan, it asks for your approval.</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_!924p!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37059fe9-8810-48b2-9e2b-252e5c0bf0e3_1520x1312.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!924p!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37059fe9-8810-48b2-9e2b-252e5c0bf0e3_1520x1312.png 424w, https://substackcdn.com/image/fetch/$s_!924p!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37059fe9-8810-48b2-9e2b-252e5c0bf0e3_1520x1312.png 848w, https://substackcdn.com/image/fetch/$s_!924p!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37059fe9-8810-48b2-9e2b-252e5c0bf0e3_1520x1312.png 1272w, https://substackcdn.com/image/fetch/$s_!924p!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37059fe9-8810-48b2-9e2b-252e5c0bf0e3_1520x1312.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!924p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37059fe9-8810-48b2-9e2b-252e5c0bf0e3_1520x1312.png" width="1456" height="1257" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/37059fe9-8810-48b2-9e2b-252e5c0bf0e3_1520x1312.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1257,&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_!924p!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37059fe9-8810-48b2-9e2b-252e5c0bf0e3_1520x1312.png 424w, https://substackcdn.com/image/fetch/$s_!924p!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37059fe9-8810-48b2-9e2b-252e5c0bf0e3_1520x1312.png 848w, https://substackcdn.com/image/fetch/$s_!924p!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37059fe9-8810-48b2-9e2b-252e5c0bf0e3_1520x1312.png 1272w, https://substackcdn.com/image/fetch/$s_!924p!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F37059fe9-8810-48b2-9e2b-252e5c0bf0e3_1520x1312.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>I clicked on </span><em><span>&#8220;Accept and auto mode,&#8221;</span></em><span> so it continues building for me.</span></p><p><span>Here is the artifact in 6 minutes:</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_!eMRM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef6d0846-dc1d-485c-97ce-8dc884b2eea3_1976x1576.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eMRM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef6d0846-dc1d-485c-97ce-8dc884b2eea3_1976x1576.png 424w, https://substackcdn.com/image/fetch/$s_!eMRM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef6d0846-dc1d-485c-97ce-8dc884b2eea3_1976x1576.png 848w, https://substackcdn.com/image/fetch/$s_!eMRM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef6d0846-dc1d-485c-97ce-8dc884b2eea3_1976x1576.png 1272w, https://substackcdn.com/image/fetch/$s_!eMRM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef6d0846-dc1d-485c-97ce-8dc884b2eea3_1976x1576.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!eMRM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef6d0846-dc1d-485c-97ce-8dc884b2eea3_1976x1576.png" width="1456" height="1161" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ef6d0846-dc1d-485c-97ce-8dc884b2eea3_1976x1576.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1161,&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_!eMRM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef6d0846-dc1d-485c-97ce-8dc884b2eea3_1976x1576.png 424w, https://substackcdn.com/image/fetch/$s_!eMRM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef6d0846-dc1d-485c-97ce-8dc884b2eea3_1976x1576.png 848w, https://substackcdn.com/image/fetch/$s_!eMRM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef6d0846-dc1d-485c-97ce-8dc884b2eea3_1976x1576.png 1272w, https://substackcdn.com/image/fetch/$s_!eMRM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef6d0846-dc1d-485c-97ce-8dc884b2eea3_1976x1576.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>I know my repo, but you don&#8217;t.</span></p><p><span>If I show you the report from top to bottom, you&#8217;ll understand what was going on.</span></p><p><span>So this flow also works on a repository you&#8217;ve never opened before.</span></p><p><span>I pointed it at my own messy folder, but it works the same way with a stranger&#8217;s codebase.</span></p><p><span>Now you get the idea&#8230;</span></p><p><span>But what if the job needs &#8220;deeper thinking&#8221; than this one did?</span></p><p><span>Then you need to adjust the effort level.</span></p><p><span>Let&#8217;s explore different levels&#8230;</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>Effort levels</span></h2><p><span>Effort levels adjust how much Claude </span><em><span>thinks</span></em><span> before doing a task.</span></p><p><span>You set it by clicking here:</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_!_3Wu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd5607b1-2bfa-4ccf-845d-25d093671724_1790x1530.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_3Wu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd5607b1-2bfa-4ccf-845d-25d093671724_1790x1530.png 424w, https://substackcdn.com/image/fetch/$s_!_3Wu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd5607b1-2bfa-4ccf-845d-25d093671724_1790x1530.png 848w, https://substackcdn.com/image/fetch/$s_!_3Wu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd5607b1-2bfa-4ccf-845d-25d093671724_1790x1530.png 1272w, https://substackcdn.com/image/fetch/$s_!_3Wu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd5607b1-2bfa-4ccf-845d-25d093671724_1790x1530.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_3Wu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd5607b1-2bfa-4ccf-845d-25d093671724_1790x1530.png" width="1456" height="1245" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dd5607b1-2bfa-4ccf-845d-25d093671724_1790x1530.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1245,&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_!_3Wu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd5607b1-2bfa-4ccf-845d-25d093671724_1790x1530.png 424w, https://substackcdn.com/image/fetch/$s_!_3Wu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd5607b1-2bfa-4ccf-845d-25d093671724_1790x1530.png 848w, https://substackcdn.com/image/fetch/$s_!_3Wu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd5607b1-2bfa-4ccf-845d-25d093671724_1790x1530.png 1272w, https://substackcdn.com/image/fetch/$s_!_3Wu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdd5607b1-2bfa-4ccf-845d-25d093671724_1790x1530.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>Effort is directly related to token usage</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-8" href="#footnote-8" target="_self">8</a><span>.</span></p><p><span>The default level is </span><strong><span>High</span></strong><span> for every model, which is </span><em><span>best</span></em><span> for most tasks.</span></p><p><span>If your Claude token limit is low and the task does not require maximum intelligence, you can set it to </span><strong><span>Medium</span></strong><span>.</span></p><p><span>But if the task is critical and you do not care how many tokens it takes, the highest setting is </span><strong><span>Ultracode</span></strong><span>.</span></p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VEn7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25227b76-2594-4fd9-a36d-8389c27a9236_1664x344.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VEn7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25227b76-2594-4fd9-a36d-8389c27a9236_1664x344.png 424w, https://substackcdn.com/image/fetch/$s_!VEn7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25227b76-2594-4fd9-a36d-8389c27a9236_1664x344.png 848w, https://substackcdn.com/image/fetch/$s_!VEn7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25227b76-2594-4fd9-a36d-8389c27a9236_1664x344.png 1272w, https://substackcdn.com/image/fetch/$s_!VEn7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25227b76-2594-4fd9-a36d-8389c27a9236_1664x344.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VEn7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25227b76-2594-4fd9-a36d-8389c27a9236_1664x344.png" width="1456" height="301" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/25227b76-2594-4fd9-a36d-8389c27a9236_1664x344.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:301,&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_!VEn7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25227b76-2594-4fd9-a36d-8389c27a9236_1664x344.png 424w, https://substackcdn.com/image/fetch/$s_!VEn7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25227b76-2594-4fd9-a36d-8389c27a9236_1664x344.png 848w, https://substackcdn.com/image/fetch/$s_!VEn7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25227b76-2594-4fd9-a36d-8389c27a9236_1664x344.png 1272w, https://substackcdn.com/image/fetch/$s_!VEn7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F25227b76-2594-4fd9-a36d-8389c27a9236_1664x344.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p><span>But what if you don&#8217;t want your project to forget your settings &amp; you don&#8217;t want to repeat them in every session?</span></p><p><span>Then you should set up your Claude.md file.</span></p><p><span>Let me show you how&#8230;</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>Your project&#8217;s memory</span></h2><p><span>Let&#8217;s say you have a client project/personal project.</span></p><p><span>Each day brings a new challenge, and sometimes you realize that you keep copying and pasting the same prompts and/or repeating the same settings.</span></p><p><span>Starting from scratch every time is wasted work.</span></p><p><span>With just one command/prompt, your project can gain &#8220;permanent memory&#8221; of your preferences.</span></p><p><span>To test it, I created a new folder named </span><em><strong><span>Your First Day with Claude Code.</span></strong></em></p><p><span>The official way to create </span><a href="http://claude.md"><span>Claude.md</span></a><span> is using this command:</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;8a6548a4-816c-4a4c-856e-a1da2cf8ea92&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">/init</code></pre></div><p><span>This will </span><em><span>automatically</span></em><span> create a Claude.md in your folder.</span></p><p><span>Let&#8217;s create it together </span>only<span> by prompting&#8230;</span></p><p><span>Create a new folder &amp; open a new Claude Code session inside your Claude 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_!hhPt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34f41f15-ad2f-497a-a311-8b7305f6cc81_1736x1492.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!hhPt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34f41f15-ad2f-497a-a311-8b7305f6cc81_1736x1492.png 424w, https://substackcdn.com/image/fetch/$s_!hhPt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34f41f15-ad2f-497a-a311-8b7305f6cc81_1736x1492.png 848w, https://substackcdn.com/image/fetch/$s_!hhPt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34f41f15-ad2f-497a-a311-8b7305f6cc81_1736x1492.png 1272w, https://substackcdn.com/image/fetch/$s_!hhPt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34f41f15-ad2f-497a-a311-8b7305f6cc81_1736x1492.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!hhPt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34f41f15-ad2f-497a-a311-8b7305f6cc81_1736x1492.png" width="1456" height="1251" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/34f41f15-ad2f-497a-a311-8b7305f6cc81_1736x1492.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1251,&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_!hhPt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34f41f15-ad2f-497a-a311-8b7305f6cc81_1736x1492.png 424w, https://substackcdn.com/image/fetch/$s_!hhPt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34f41f15-ad2f-497a-a311-8b7305f6cc81_1736x1492.png 848w, https://substackcdn.com/image/fetch/$s_!hhPt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34f41f15-ad2f-497a-a311-8b7305f6cc81_1736x1492.png 1272w, https://substackcdn.com/image/fetch/$s_!hhPt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F34f41f15-ad2f-497a-a311-8b7305f6cc81_1736x1492.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>Next, copy everything you have read in this newsletter so far.</span></p><p><span>And paste this prompt:</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;7a69360f-0cde-45f2-a99b-60972d4df4d5&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Turn this into a Claude.md file.
Assume I&#8217;m a beginner, add these as instructions,
and follow them whenever I ask you to do something.</code></pre></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_!CSxp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16ded7d4-e354-425d-9ab1-768c2b8bed45_2048x1324.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CSxp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16ded7d4-e354-425d-9ab1-768c2b8bed45_2048x1324.png 424w, https://substackcdn.com/image/fetch/$s_!CSxp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16ded7d4-e354-425d-9ab1-768c2b8bed45_2048x1324.png 848w, https://substackcdn.com/image/fetch/$s_!CSxp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16ded7d4-e354-425d-9ab1-768c2b8bed45_2048x1324.png 1272w, https://substackcdn.com/image/fetch/$s_!CSxp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16ded7d4-e354-425d-9ab1-768c2b8bed45_2048x1324.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CSxp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16ded7d4-e354-425d-9ab1-768c2b8bed45_2048x1324.png" width="1456" height="941" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/16ded7d4-e354-425d-9ab1-768c2b8bed45_2048x1324.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:941,&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_!CSxp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16ded7d4-e354-425d-9ab1-768c2b8bed45_2048x1324.png 424w, https://substackcdn.com/image/fetch/$s_!CSxp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16ded7d4-e354-425d-9ab1-768c2b8bed45_2048x1324.png 848w, https://substackcdn.com/image/fetch/$s_!CSxp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16ded7d4-e354-425d-9ab1-768c2b8bed45_2048x1324.png 1272w, https://substackcdn.com/image/fetch/$s_!CSxp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F16ded7d4-e354-425d-9ab1-768c2b8bed45_2048x1324.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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, whenever you start a new conversation inside this project, the context stays.</span></p><p><span>i.e., your setup travels with you session after session.</span></p><p>But <span>you must follow a few rules when creating a&nbsp;Claude.md.</span></p><p><span>Let&#8217;s</span> talk about that&#8230;</p><h3><span>What goes in and what stays out</span></h3><p><span>The </span><code>CLAUDE.md</code><span> you create should not run too long/too thin.</span></p><p><span>Claude reads the entire file every time your project starts, so every line either earns its place/wastes it.</span></p><p><em><span>So what earns a place?</span></em></p><ul><li><p><span>Write down what you would otherwise re-explain.</span></p></li><li><p><span>Build commands, naming conventions, and the rules you keep repeating.</span></p></li></ul><p><em><span>What stays out matters just as much:</span></em></p><ul><li><p><span>Skip anything Claude can read from the code itself, like folder layouts and dependency lists, since they only burn context on every session.</span></p></li><li><p><span>Long procedures stay out, too, because those belong in a skill.</span></p></li></ul><p><span>And two habits from the Claude team keep the file healthy.</span></p><ul><li><p><span>Keep it under 200 lines, since longer files get followed less, not more.</span></p></li><li><p><span>Then run </span><code>/context</code><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-9" href="#footnote-9" target="_self">9</a><span> now &amp; then, and check that your file is listed under memory files. If it is missing there, Claude never saw it.</span></p></li></ul><p><span>Now think about the most repetitive task you do&#8230; How would it change if you used this?</span></p><p><code>Claude.md</code><span> is only half of it.</span></p><p><span>You can also use Skills alongside Claude.md, which lets you hand each job to a specialist.</span></p><p><span>Let me show you how&#8230;</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 get:</p><ul><li><p><strong>A complete Claude Code setup, from your first session to a fully automated one.</strong></p></li><li><p>Deep dives into how MCP, subagents, agent orchestration &amp; hooks actually work inside Claude Code.</p></li><li><p><strong>How real Claude Code projects handle context, scale &amp; running without you.</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><span>Skills</span></h2>
      <p>
          <a href="https://newsletter.systemdesign.one/p/claude-code-claude-md-best-practices">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[API testing was “hard” until I learned these 53 techniques]]></title><description><![CDATA[#175: Part 2 - fuzz testing, penetration testing, injection attack testing, and 25 others.]]></description><link>https://newsletter.systemdesign.one/p/types-of-api-testing</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/types-of-api-testing</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Mon, 07 Sep 2026 16:59:35 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/09d796b2-d6a4-48b6-be48-8ff7baba6703_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p style="text-align: center;"></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/types-of-api-testing/?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>Onwards &#8216;n downwards:</p><p>Following is the second of a premium 2-part<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a> newsletter series&#8230;</p><p><span>Some of these are foundational, and some are quite advanced. ALL of them are super useful to engineers building production-ready systems.</span></p><p><span>Curious to know how many were new to you:</span></p><ol start="26"><li><p><span>Fuzz Testing</span></p></li><li><p><span>Penetration Testing</span></p></li><li><p><span>Injection Attack Testing</span></p></li><li><p><span>Encryption/TLS Testing</span></p></li><li><p><span>Policy/Compliance Testing</span></p></li><li><p><span>Reliability Testing</span></p></li><li><p><span>Chaos Testing</span></p></li><li><p><span>Circuit Breaker Testing</span></p></li><li><p><span>Backpressure Testing</span></p></li><li><p><span>Fault Injection Testing</span></p></li><li><p><span>Failover Testing</span></p></li><li><p><span>Recovery Testing</span></p></li><li><p><span>Idempotency Testing</span></p></li><li><p><span>Timeout and Retry Testing</span></p></li><li><p><span>Caching Testing</span></p></li><li><p><span>Data Integrity Testing</span></p></li><li><p><span>Data Consistency Testing</span></p></li><li><p><span>State Transition Testing</span></p></li><li><p><span>UI-Level API Testing</span></p></li><li><p><span>Developer Experience Testing</span></p></li><li><p><span>Documentation Testing</span></p></li><li><p><span>Rate Limiting Testing</span></p></li><li><p><span>Backward Compatibility Testing</span></p></li><li><p><span>Mutation Testing</span></p></li><li><p><span>Mock/Stub Testing</span></p></li><li><p><span>Synthetic Monitoring</span></p></li><li><p><span>Scenario/Workflow Testing</span></p></li><li><p><span>Component Testing</span></p></li></ol><p><span>For each, I&#8217;ll share:</span></p><ul><li><p><span>What it is and how it works (in simple words)</span></p></li><li><p><span>A real-world analogy</span></p></li><li><p><span>Tradeoffs</span></p></li><li><p><span>Why it matters</span></p></li></ul><p><span>Let&#8217;s go!</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><div class="callout-block" data-callout="true"><h2><strong><a href="https://link.svix.com/system-01">Make your agents realtime (Partner)</a></strong></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://link.svix.com/system-01" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!v-ZP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde8a87d9-0b90-4a74-857c-be37bba398f2_2000x1047.png 424w, https://substackcdn.com/image/fetch/$s_!v-ZP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde8a87d9-0b90-4a74-857c-be37bba398f2_2000x1047.png 848w, https://substackcdn.com/image/fetch/$s_!v-ZP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde8a87d9-0b90-4a74-857c-be37bba398f2_2000x1047.png 1272w, https://substackcdn.com/image/fetch/$s_!v-ZP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde8a87d9-0b90-4a74-857c-be37bba398f2_2000x1047.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!v-ZP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde8a87d9-0b90-4a74-857c-be37bba398f2_2000x1047.png" width="1456" height="762" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/de8a87d9-0b90-4a74-857c-be37bba398f2_2000x1047.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:762,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:212365,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://link.svix.com/system-01&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/211217193?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde8a87d9-0b90-4a74-857c-be37bba398f2_2000x1047.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_!v-ZP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde8a87d9-0b90-4a74-857c-be37bba398f2_2000x1047.png 424w, https://substackcdn.com/image/fetch/$s_!v-ZP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde8a87d9-0b90-4a74-857c-be37bba398f2_2000x1047.png 848w, https://substackcdn.com/image/fetch/$s_!v-ZP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde8a87d9-0b90-4a74-857c-be37bba398f2_2000x1047.png 1272w, https://substackcdn.com/image/fetch/$s_!v-ZP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde8a87d9-0b90-4a74-857c-be37bba398f2_2000x1047.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Agents are killing your apps with compounding latency across workflows.</p><p>Your customers want their agent workflows to be efficient, so you&#8217;re losing deals if you don&#8217;t make them event-driven. Webhooks solve this issue, but implementing them is harder than it looks.</p><p>If you homebrewed your webhooks and are getting pinged at 4 in the morning for failed deliveries, this is for you.</p><p><strong><a href="https://link.svix.com/system-01">Svix</a></strong> handles everything: retries, idempotency, security, and compliance. Qualified startups get $12,000 in free credits.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://link.svix.com/system-01&quot;,&quot;text&quot;:&quot;Get started 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://link.svix.com/system-01"><span>Get started for free</span></a></p><p><em>(Thanks to <strong><a href="https://link.svix.com/system-01">Svix</a></strong> for partnering on this newsletter.)</em></p></div><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><strong><span>26. Fuzz Testing</span></strong></h2><blockquote><p><span>Fuzz testing sends randomized, malformed, unexpected data to API endpoints to discover crashes, memory leaks, unhandled exceptions, and/or security vulnerabilities.</span></p></blockquote><p><span>A human does NOT design the inputs. Instead, they&#8217;re generated algorithmically, mutated from valid inputs, pulled from known attack pattern libraries.</span></p><p><span>Tools such as AFL, Burp Suite &amp; Restler automate this process at scale.</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_!18Li!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7a8c3a3-933c-4a67-bd2a-aa5d284b3e7a_2048x1027.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!18Li!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7a8c3a3-933c-4a67-bd2a-aa5d284b3e7a_2048x1027.png 424w, https://substackcdn.com/image/fetch/$s_!18Li!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7a8c3a3-933c-4a67-bd2a-aa5d284b3e7a_2048x1027.png 848w, https://substackcdn.com/image/fetch/$s_!18Li!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7a8c3a3-933c-4a67-bd2a-aa5d284b3e7a_2048x1027.png 1272w, https://substackcdn.com/image/fetch/$s_!18Li!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7a8c3a3-933c-4a67-bd2a-aa5d284b3e7a_2048x1027.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!18Li!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7a8c3a3-933c-4a67-bd2a-aa5d284b3e7a_2048x1027.png" width="1456" height="730" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d7a8c3a3-933c-4a67-bd2a-aa5d284b3e7a_2048x1027.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:730,&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_!18Li!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7a8c3a3-933c-4a67-bd2a-aa5d284b3e7a_2048x1027.png 424w, https://substackcdn.com/image/fetch/$s_!18Li!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7a8c3a3-933c-4a67-bd2a-aa5d284b3e7a_2048x1027.png 848w, https://substackcdn.com/image/fetch/$s_!18Li!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7a8c3a3-933c-4a67-bd2a-aa5d284b3e7a_2048x1027.png 1272w, https://substackcdn.com/image/fetch/$s_!18Li!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7a8c3a3-933c-4a67-bd2a-aa5d284b3e7a_2048x1027.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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><span>Analogy</span></h3><p><span>A locksmith testing a new lock does not just use the </span><em><span>correct</span></em><span> key.</span></p><p><span>They jam random objects into the keyhole, apply unusual force, insert keys from other locks, and try every unexpected interaction to find weaknesses the designer did not anticipate.</span></p><h3><span>Tradeoff</span></h3><p><span>Fuzz testing finds bugs that NO human tester would think to look for.</span></p><p><span>It excels at discovering edge cases in input parsing, deserialization, &amp; memory management. Yet results are often noisy. Many crashes are duplicates/low-severity.</span></p><p><span>Triaging fuzz results requires effort &amp; expertise.</span></p><h3><span>Why it matters</span></h3><p><span>Buffer overflows, injection vulnerabilities, and crash bugs</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a><span> in production often come from inputs no developer imagined.</span></p><p><span>Fuzz testing imagines them at machine speed. Run fuzz tests continuously against input-parsing endpoints, and treat every crash as a potential security issue.</span></p><h2><strong><span>27. Penetration Testing</span></strong></h2><blockquote><p><span>Penetration testing is a simulated real-world attack against the API, performed by a skilled security professional/team.</span></p></blockquote><p><span>It involves creative, context-aware exploitation: </span><em><span>chaining vulnerabilities, exploiting business logic flaws, and using social engineering vectors that tools cannot detect</span></em><span>.</span></p><p><span>The goal is not a checklist&#8230;it&#8217;s to find out whether a motivated attacker can break in.</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_!S4js!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febed6687-8a7c-411d-9dd9-e0e9219b5fde_2048x588.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!S4js!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febed6687-8a7c-411d-9dd9-e0e9219b5fde_2048x588.png 424w, https://substackcdn.com/image/fetch/$s_!S4js!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febed6687-8a7c-411d-9dd9-e0e9219b5fde_2048x588.png 848w, https://substackcdn.com/image/fetch/$s_!S4js!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febed6687-8a7c-411d-9dd9-e0e9219b5fde_2048x588.png 1272w, https://substackcdn.com/image/fetch/$s_!S4js!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febed6687-8a7c-411d-9dd9-e0e9219b5fde_2048x588.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!S4js!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febed6687-8a7c-411d-9dd9-e0e9219b5fde_2048x588.png" width="1456" height="418" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ebed6687-8a7c-411d-9dd9-e0e9219b5fde_2048x588.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:418,&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_!S4js!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febed6687-8a7c-411d-9dd9-e0e9219b5fde_2048x588.png 424w, https://substackcdn.com/image/fetch/$s_!S4js!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febed6687-8a7c-411d-9dd9-e0e9219b5fde_2048x588.png 848w, https://substackcdn.com/image/fetch/$s_!S4js!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febed6687-8a7c-411d-9dd9-e0e9219b5fde_2048x588.png 1272w, https://substackcdn.com/image/fetch/$s_!S4js!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Febed6687-8a7c-411d-9dd9-e0e9219b5fde_2048x588.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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><span>Analogy</span></h3><p><span>A museum hires a professional thief to attempt a heist under controlled conditions.</span></p><p><span>Not to check the alarm sensors one by one, but to see whether someone clever enough can get past them all together.</span></p><p><span>The thief thinks like a thief,,, not like an alarm technician.</span></p><h3><span>Tradeoff</span></h3><p><span>Penetration testing provides the most realistic assessment of your API&#8217;s security posture.</span></p><p><span>It finds vulnerabilities automated tools miss by combining technical exploitation with creative thinking. Yet it&#8217;s expensive, time-consuming, and only as good as the tester.</span></p><p><span>Plus results are a snapshot&#8230;not continuous coverage.</span></p><h3><span>Why it matters</span></h3><p><span>Automated scans find known vulnerability patterns.</span></p><p><span>Pen testing finds the unknown ones: </span><em><span>a business logic flaw that lets an attacker manipulate pricing, or a chained exploit that bypasses auth entirely.</span></em></p><p><span>So schedule pen tests before major launches &amp; at least annually for production APIs.</span></p><h2><strong><span>28. Injection Attack Testing</span></strong></h2><blockquote><p><span>Injection attack testing verifies if the API is immune to attacks when malicious code gets embedded in input data: </span><em><span>SQL injection, NoSQL injection, command injection, LDAP injection, and header injection</span></em><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a><span>.</span></p></blockquote><p><span>You craft payloads designed to escape the intended input context &amp; execute as code on the server. If any payload succeeds,,, the API has a critical vulnerability.</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_!PjTv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb03f50e-14b6-456c-b295-ebdc8efe06aa_2048x1172.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PjTv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb03f50e-14b6-456c-b295-ebdc8efe06aa_2048x1172.png 424w, https://substackcdn.com/image/fetch/$s_!PjTv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb03f50e-14b6-456c-b295-ebdc8efe06aa_2048x1172.png 848w, https://substackcdn.com/image/fetch/$s_!PjTv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb03f50e-14b6-456c-b295-ebdc8efe06aa_2048x1172.png 1272w, https://substackcdn.com/image/fetch/$s_!PjTv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb03f50e-14b6-456c-b295-ebdc8efe06aa_2048x1172.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PjTv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb03f50e-14b6-456c-b295-ebdc8efe06aa_2048x1172.png" width="1456" height="833" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/db03f50e-14b6-456c-b295-ebdc8efe06aa_2048x1172.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:833,&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_!PjTv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb03f50e-14b6-456c-b295-ebdc8efe06aa_2048x1172.png 424w, https://substackcdn.com/image/fetch/$s_!PjTv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb03f50e-14b6-456c-b295-ebdc8efe06aa_2048x1172.png 848w, https://substackcdn.com/image/fetch/$s_!PjTv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb03f50e-14b6-456c-b295-ebdc8efe06aa_2048x1172.png 1272w, https://substackcdn.com/image/fetch/$s_!PjTv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb03f50e-14b6-456c-b295-ebdc8efe06aa_2048x1172.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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><span>Analogy</span></h3><p><span>A customs officer checks a package labeled &#8220;books&#8221; to make sure it contains books and not something dangerous hidden inside&#8230;</span></p><p><span>Injection testing confirms that data labeled as &#8220;user input&#8221; stays as data &amp; never becomes executable instructions.</span></p><h3><span>Tradeoff</span></h3><p><span>Injection testing catches the most exploitable class of API vulnerabilities.</span></p><p><span>A single successful injection can expose an entire database or grant shell access. Yet the test surface is wide. Every input field, header, query parameter &amp; path segment is a potential injection point.</span></p><p><span>Thoroughness requires systematic coverage.</span></p><h3><span>Why it matters</span></h3><p><span>Injection attacks remain among the most common and damaging API exploits.</span></p><p><span>They are well understood &amp; well documented, and still happen because most people skip it&#8230;</span></p><p><span>So test every input vector with known injection patterns. Use parameterized queries and input sanitization as defenses, then verify those defenses hold</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a><span>.</span></p><h2><strong><span>29. Encryption/TLS Testing</span></strong></h2><blockquote><p><span>Encryption &amp; TLS testing verifies if data in transit is protected.</span></p></blockquote><p><span>You confirm the API enforces HTTPS, rejects HTTP connections, uses strong TLS versions, and avoids weak cipher suites</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a><span>. You also verify that certificates are valid, not expired, and correctly chained.</span></p><p><span>Tools such as testssl.sh, sslyze &amp; nmap automate these checks.</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_!7Lax!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec25e5df-250a-40e7-a13a-c3e50f5ab42d_2048x1492.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7Lax!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec25e5df-250a-40e7-a13a-c3e50f5ab42d_2048x1492.png 424w, https://substackcdn.com/image/fetch/$s_!7Lax!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec25e5df-250a-40e7-a13a-c3e50f5ab42d_2048x1492.png 848w, https://substackcdn.com/image/fetch/$s_!7Lax!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec25e5df-250a-40e7-a13a-c3e50f5ab42d_2048x1492.png 1272w, https://substackcdn.com/image/fetch/$s_!7Lax!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec25e5df-250a-40e7-a13a-c3e50f5ab42d_2048x1492.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7Lax!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec25e5df-250a-40e7-a13a-c3e50f5ab42d_2048x1492.png" width="1456" height="1061" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ec25e5df-250a-40e7-a13a-c3e50f5ab42d_2048x1492.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1061,&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_!7Lax!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec25e5df-250a-40e7-a13a-c3e50f5ab42d_2048x1492.png 424w, https://substackcdn.com/image/fetch/$s_!7Lax!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec25e5df-250a-40e7-a13a-c3e50f5ab42d_2048x1492.png 848w, https://substackcdn.com/image/fetch/$s_!7Lax!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec25e5df-250a-40e7-a13a-c3e50f5ab42d_2048x1492.png 1272w, https://substackcdn.com/image/fetch/$s_!7Lax!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fec25e5df-250a-40e7-a13a-c3e50f5ab42d_2048x1492.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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><span>Analogy</span></h3><p><span>A courier service guarantees tamper-proof delivery.</span></p><p><span>Encryption testing verifies every envelope is sealed, the seals cannot be broken without detection, and no courier is secretly delivering in transparent bags.</span></p><h3><span>Tradeoff</span></h3><p><span>TLS testing catches misconfigurations that leave data exposed in transit.</span></p><p><span>A single misconfigured endpoint serving HTTP can leak credentials/session tokens. Although tests are straightforward, they&#8217;re easy to forget.</span></p><p><span>Plus, TLS configurations degrade over time as certificates expire &amp; protocols get deprecated.</span></p><h3><span>Why it matters</span></h3><p><span>Unencrypted API traffic is readable by anyone on the network path.</span></p><p><span>This includes credentials, tokens, PII &amp; business data. Therefore:</span></p><ul><li><p><span>Enforce TLS 1.2+ on every endpoint.</span></p></li><li><p><span>Automate certificate expiry monitoring.</span></p></li><li><p><span>Run TLS configuration scans on every deployment.</span></p></li></ul><h4 style="text-align: center;"><strong>&#167;</strong></h4><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/types-of-api-testing?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);">If something resonated with you today, share this letter. Because one idea, one action, can change everything.</span></em></p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/types-of-api-testing?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/types-of-api-testing?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><strong><span>30. Policy/Compliance Testing</span></strong></h2><blockquote><p><span>Policy &amp; compliance testing verifies if the API adheres to regulatory requirements and organizational security policies.</span></p></blockquote><p><span>This includes GDPR data handling rules, HIPAA protections for health data, PCI-DSS requirements for payment data, and SOC 2</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a><span> controls for service organizations.</span></p><p><span>You test personal data is encrypted, audit logs get generated, data retention policies are enforced &amp; consent mechanisms work correctly.</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_!RBxq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c69b18f-61c6-463e-94c0-fef1132dcbc1_1922x2048.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RBxq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c69b18f-61c6-463e-94c0-fef1132dcbc1_1922x2048.png 424w, https://substackcdn.com/image/fetch/$s_!RBxq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c69b18f-61c6-463e-94c0-fef1132dcbc1_1922x2048.png 848w, https://substackcdn.com/image/fetch/$s_!RBxq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c69b18f-61c6-463e-94c0-fef1132dcbc1_1922x2048.png 1272w, https://substackcdn.com/image/fetch/$s_!RBxq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c69b18f-61c6-463e-94c0-fef1132dcbc1_1922x2048.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RBxq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c69b18f-61c6-463e-94c0-fef1132dcbc1_1922x2048.png" width="1456" height="1551" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0c69b18f-61c6-463e-94c0-fef1132dcbc1_1922x2048.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1551,&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_!RBxq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c69b18f-61c6-463e-94c0-fef1132dcbc1_1922x2048.png 424w, https://substackcdn.com/image/fetch/$s_!RBxq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c69b18f-61c6-463e-94c0-fef1132dcbc1_1922x2048.png 848w, https://substackcdn.com/image/fetch/$s_!RBxq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c69b18f-61c6-463e-94c0-fef1132dcbc1_1922x2048.png 1272w, https://substackcdn.com/image/fetch/$s_!RBxq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0c69b18f-61c6-463e-94c0-fef1132dcbc1_1922x2048.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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><span>Analogy</span></h3><p><span>A restaurant does not just cook good food.</span></p><p><span>It must also pass health inspections: </span><em><span>proper food storage temperatures, handwashing stations, pest control records.</span></em><span> The food could taste great, but if it fails the inspection, it shuts the doors.</span></p><p><span>Compliance testing is like a health inspection for your API.</span></p><h3><span>Tradeoff</span></h3><p><span>Compliance testing protects the organization from regulatory fines, legal liability &amp; loss of certifications.</span></p><p><span>It is non-negotiable for APIs handling sensitive data. Yet the tradeoff is rigidity&#8230; Compliance requirements change slowly &amp; are often more prescriptive than practical.</span></p><p><span>Tests must be updated whenever regulations change.</span></p><h3><span>Why it matters</span></h3><ul><li><p><span>GDPR violation could cost up to 4% of global annual revenue.</span></p></li><li><p><span>HIPAA breach triggers mandatory reporting &amp; potential criminal charges.</span></p></li></ul><p><span>i.e., compliance is not optional.</span></p><p><span>So map every regulatory requirement to a specific test. Automate compliance checks and run them on every release.</span></p><h2><strong><span>31. Reliability Testing</span></strong></h2><blockquote><p><span>Reliability testing measures how consistently an API performs its intended function over time &amp; under varying conditions.</span></p></blockquote><p><span>You are not testing a single response.</span></p><p><span>Instead, you&#8217;re testing whether the API delivers the right response reliably across thousands of requests, network disruptions &amp; partial system failures.</span></p><p><span>This includes uptime measurement, error rate tracking, and mean time between failures (</span><strong><span>MTBF</span></strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-7" href="#footnote-7" target="_self">7</a><span>).</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_!4udM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F051cf66c-ed90-4981-82af-eae3fb1b66e9_2048x548.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!4udM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F051cf66c-ed90-4981-82af-eae3fb1b66e9_2048x548.png 424w, https://substackcdn.com/image/fetch/$s_!4udM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F051cf66c-ed90-4981-82af-eae3fb1b66e9_2048x548.png 848w, https://substackcdn.com/image/fetch/$s_!4udM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F051cf66c-ed90-4981-82af-eae3fb1b66e9_2048x548.png 1272w, https://substackcdn.com/image/fetch/$s_!4udM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F051cf66c-ed90-4981-82af-eae3fb1b66e9_2048x548.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!4udM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F051cf66c-ed90-4981-82af-eae3fb1b66e9_2048x548.png" width="1456" height="390" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/051cf66c-ed90-4981-82af-eae3fb1b66e9_2048x548.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:390,&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_!4udM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F051cf66c-ed90-4981-82af-eae3fb1b66e9_2048x548.png 424w, https://substackcdn.com/image/fetch/$s_!4udM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F051cf66c-ed90-4981-82af-eae3fb1b66e9_2048x548.png 848w, https://substackcdn.com/image/fetch/$s_!4udM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F051cf66c-ed90-4981-82af-eae3fb1b66e9_2048x548.png 1272w, https://substackcdn.com/image/fetch/$s_!4udM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F051cf66c-ed90-4981-82af-eae3fb1b66e9_2048x548.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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><span>Analogy</span></h3><p><span>A light switch that works 99 times out of 100 is not reliable&#8230;</span></p><p><span>You need to know the exact failure rate, the failure pattern, and how quickly the light recovers after a failure.</span></p><p><span>Reliability testing is counting every flicker.</span></p><h3><span>Tradeoff</span></h3><p><span>Reliability testing gives you hard numbers on system dependability.</span></p><p><span>These numbers drive SLAs, SLOs</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-8" href="#footnote-8" target="_self">8</a><span>, and architecture decisions. But it requires sustained observation over time, not a single test run.</span></p><p><span>True reliability data comes from weeks of monitoring, not minutes of testing.</span></p><h3><span>Why it matters</span></h3><p><span>Users tolerate slow APIs.</span></p><p><span>Yet they do not tolerate unreliable ones. An API that works perfectly 95% of the time &amp; fails randomly 5% of the time will drive users away faster than a consistently slow one.</span></p><p><span>So define SLOs for error rate &amp; availability&#8230; Then measure continuously &amp; alert on degradation.</span></p><h2><strong><span>32. Chaos Testing</span></strong></h2><blockquote><p><span>Chaos testing deliberately introduces failures into the system to verify if the API handles them gracefully.</span></p></blockquote><p><span>You kill server instances, inject network latency, corrupt DNS responses, and fill disks, all while monitoring whether the API continues serving requests/degrades predictably.</span></p><p><span>Netflix&#8217;s Chaos Monkey is the most well-known tool in this space:</span></p><p><span>It randomly terminates production instances during business hours.</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_!ZPYd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ead335-ac9b-4be1-9c6a-10eb42409bff_2048x764.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZPYd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ead335-ac9b-4be1-9c6a-10eb42409bff_2048x764.png 424w, https://substackcdn.com/image/fetch/$s_!ZPYd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ead335-ac9b-4be1-9c6a-10eb42409bff_2048x764.png 848w, https://substackcdn.com/image/fetch/$s_!ZPYd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ead335-ac9b-4be1-9c6a-10eb42409bff_2048x764.png 1272w, https://substackcdn.com/image/fetch/$s_!ZPYd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ead335-ac9b-4be1-9c6a-10eb42409bff_2048x764.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZPYd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ead335-ac9b-4be1-9c6a-10eb42409bff_2048x764.png" width="1456" height="543" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/63ead335-ac9b-4be1-9c6a-10eb42409bff_2048x764.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:543,&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_!ZPYd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ead335-ac9b-4be1-9c6a-10eb42409bff_2048x764.png 424w, https://substackcdn.com/image/fetch/$s_!ZPYd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ead335-ac9b-4be1-9c6a-10eb42409bff_2048x764.png 848w, https://substackcdn.com/image/fetch/$s_!ZPYd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ead335-ac9b-4be1-9c6a-10eb42409bff_2048x764.png 1272w, https://substackcdn.com/image/fetch/$s_!ZPYd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F63ead335-ac9b-4be1-9c6a-10eb42409bff_2048x764.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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><span>Analogy</span></h3><p><span>A fire drill does not wait for a real fire:</span></p><p><span>You pull the alarm during a normal workday &amp; observe whether people follow the evacuation plan/panic.</span></p><p><span>Chaos testing is the fire drill for your API infrastructure.</span></p><h3><span>Tradeoff</span></h3><p><span>Chaos testing reveals resilience gaps that no other testing approach can find.</span></p><p><span>It builds confidence that the system survives real-world failures, not just theoretical ones. Yet the risk is real. Poorly scoped chaos experiments can cause actual outages.</span></p><p><span>So start small, in staging, with a clear blast radius.</span></p><h3><span>Why it matters</span></h3><p><span>In distributed systems, failure is not a possibility&#8230;it is a certainty.</span></p><p><span>The question is not whether a service will go down, but whether the system handles it when it does&#8230;</span></p><p><span>Start with simple experiments: </span><em><span>kill one instance, add 200ms latency to one dependency</span></em><span>. Expand the scope as confidence grows.</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>(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><strong><span>33. Circuit Breaker Testing</span></strong></h2>
      <p>
          <a href="https://newsletter.systemdesign.one/p/types-of-api-testing">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[50 shades of system design]]></title><description><![CDATA[#174: tradeoffs behind designing scalable, reliable systems]]></description><link>https://newsletter.systemdesign.one/p/system-design-tradeoffs</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/system-design-tradeoffs</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Thu, 03 Sep 2026 12:17:25 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/ebd09cb3-4018-458d-bb31-771585e67abc_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p></p><div class="callout-block" data-callout="true"><h2><a href="http://a0.to/1t9">Built for vibecoders, trusted by enterprises, priced for all &#128640; (Partner)</a></h2><div class="native-video-embed" data-component-name="VideoPlaceholder" data-attrs="{&quot;mediaUploadId&quot;:&quot;5f44a55e-ceae-445c-ad81-786e37d5eefb&quot;,&quot;duration&quot;:null}"></div><p>AI has made it ridiculously easy to go from &#8220;I have an idea&#8221; to &#8220;wait&#8230; I actually built this&#8221;.</p><p>You prompt your coding agent, get the app running, and move on. But as soon as real users, sensitive data, or AI agents enter the picture, auth becomes one of those things you really don&#8217;t want to &#8220;vibe code&#8221; your way through.</p><p>That&#8217;s why Auth0 is worth a look.</p><p><strong><a href="http://a0.to/1t9">Auth0</a></strong> has long been a go-to identity platform for enterprises, but it&#8217;s now making the economics a lot more interesting for developers and startups, too&#8212;including a $0 free plan and new B2B plans designed to make it easier to start small and scale up.</p><p>If you&#8217;re shipping an app, SaaS product, or AI agent and need authentication without slowing down your build, check out Auth0.</p><p>Same Auth0. Better math. Try it for free.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;http://a0.to/1t9&quot;,&quot;text&quot;:&quot;Try it 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="http://a0.to/1t9"><span>Try it for free</span></a></p><p>(Thanks to <strong><a href="http://a0.to/1t9">Auth0</a></strong> for partnering on this post.)</p></div><h4 style="text-align: center;"><strong>&#167;</strong></h4><p>Most people think system design is about building the &#8220;best&#8221; architecture.</p><p>It&#8217;s not... instead it&#8217;s about making the right <em>tradeoffs</em> for a given workload &amp; constraints.</p><p>Here are 50 tradeoffs you should understand:</p><ol><li><p><strong>Latency vs throughput.</strong> Batching many requests together can reduce network, serialization &amp; processing overhead and increase throughput<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a>. Yet the downside is individual requests wait longer while a batch forms. So use batching when throughput matters and individual requests when low latency matters.</p></li><li><p><strong>Latency vs tail latency.</strong> A system can have excellent median latency while a tiny number of slow requests create poor p95 and/or p99 latency<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a>. Redundant/hedged requests<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a> can reduce these long tails, but they consume extra capacity. So use hedged requests when low tail latency matters &amp; normal requests when conserving capacity matters.</p></li><li><p><strong>Compression vs CPU usage.</strong> Compressing data reduces network bandwidth &amp; storage requirements. Yet compression and decompression require CPU and could add processing latency<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a>. So use compression when bandwidth &amp; storage matters and <em>uncompressed</em> data when low CPU usage &amp; processing latency matter.</p></li><li><p><strong>Telemetry fidelity vs observability cost.</strong> Recording ALL distributed traces gives you information for debugging production issues. Sampling<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a> reduces processing and storage costs, but you&#8217;d miss occasional traces you later need. So use full tracing when maximum debugging visibility matters &amp; use sampling when observability costs matter.</p></li><li><p><strong>Cache freshness vs cache hit rate.</strong> Longer TTLs increase cache hits<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a> and reduce requests to the origin. But they also keep stale data cached longer. So use longer TTLs when a high cache hit rate matters &amp; shorter TTLs when data freshness matters.</p></li><li><p><strong>Local cache vs shared cache.</strong> An in-process cache avoids a network request and can provide extremely fast reads. A shared remote cache makes data easier to share across instances, but adds network latency &amp; dependency. So use a local cache when low read latency matters, and a shared cache when many instances need shared cached data.</p></li><li><p><strong>Database indexes vs cheaper writes.</strong> Database indexes<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-7" href="#footnote-7" target="_self">7</a> can boost query performance. But they consume storage &amp; add work when rows get inserted, updated, and/or deleted. So use indexes when query performance matters and keep them low when write performance matters.</p></li><li><p><strong>High utilization vs capacity headroom.</strong> Running infrastructure close to maximum utilization can reduce cost per unit of work. While extra headroom<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-8" href="#footnote-8" target="_self">8</a> allows the system to better absorb traffic bursts &amp; latency spikes. So use high utilization when cost efficiency matters, and extra headroom when handling traffic bursts matters.</p></li></ol><h4 style="text-align: center;"><strong>&#167;</strong></h4><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-tradeoffs/?action=share">Share this lette</a><span>r &amp; I&#8217;ll send you some rewards for the referrals.</span></em></p></li></ul><h4 style="text-align: center;"><strong>&#167;</strong></h4><ol start="9"><li><p><strong>Consistency vs availability during network partitions. </strong><span>Replicas&nbsp;</span><em><span>cannot</span></em><span>&nbsp;coordinate when requests arrive during a partition.</span> Maintaining strong consistency requires &#8220;rejecting&#8221; some operations, while remaining available replicas can temporarily diverge<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-9" href="#footnote-9" target="_self">9</a>. Prioritize consistency when stale/conflicting data is unacceptable, and prioritize availability when serving requests during partitions matters.</p></li><li><p><strong>Cross-region consistency vs write latency</strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-10" href="#footnote-10" target="_self">10</a><strong>.</strong> Synchronously coordinating data across distant regions provides stronger consistency guarantees. Yet the network round trips between regions increase write and/or transaction latency. So use synchronous cross-region replication when strong consistency matters &amp; asynchronous replication when low write latency matters.</p></li><li><p><strong>Read quorum vs write quorum.</strong> Replicated systems contact many replicas during reads/writes<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-11" href="#footnote-11" target="_self">11</a>. This approach provides stronger guarantees, but increases latency &amp; use extra resources. Use a larger read quorum when stronger read guarantees matter, and a larger write quorum when stronger write guarantees matter.</p></li><li><p><strong>Synchronous vs asynchronous replication.</strong> Synchronous replication waits for another replica before acknowledging a write to reduce the risk of losing acknowledged data. Asynchronous replication<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-12" href="#footnote-12" target="_self">12</a> gives faster writes, but replicas can lag behind. So use synchronous replication when <em>protecting</em> acknowledged writes matters, and asynchronous replication when faster writes matter.</p></li><li><p><strong>Single-region vs multi-region deployment.</strong> Keeping data in one region typically lowers write latency<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-13" href="#footnote-13" target="_self">13</a> &amp; has less infrastructure complexity. Multi-region setup improves geographic resilience and brings reads closer to users, but replication becomes expensive &amp; complicated. So use a single region when simplicity and low write latency matter, and multiple regions when geographic resilience matters.</p></li><li><p><strong>Replica reads vs primary reads.</strong> Reading from a nearby replica reduces latency and improves read capacity. Yet if the replica is behind the primary, the application would read <em>stale</em> data<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-14" href="#footnote-14" target="_self">14</a>. Use local replica reads when read latency matters, and use primary/strongly consistent reads when data freshness matters.</p></li><li><p><strong>Serializable vs weaker transaction isolation.</strong> Serializable isolation makes concurrent transactions behave as though they executed serially. Stronger isolation causes more transaction aborts &amp; retries under contention, while weaker isolation allows more anomalies<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-15" href="#footnote-15" target="_self">15</a>. Use serializable isolation when preventing concurrency anomalies matters, and use weaker isolation when higher concurrency matters<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-16" href="#footnote-16" target="_self">16</a>.</p></li><li><p><strong>Optimistic vs pessimistic concurrency control.</strong> Optimistic concurrency allows operations to proceed &amp; check for conflicts later. This works well when conflicts are rare. Pessimistic locking prevents conflicts earlier but can increase blocking<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-17" href="#footnote-17" target="_self">17</a>. Use optimistic concurrency when conflicts are rare, and pessimistic concurrency when conflicts are frequent/costly<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-18" href="#footnote-18" target="_self">18</a>.</p></li><li><p><strong>Last-write-wins vs concurrent updates.</strong> Last-write-wins <em>automatically</em> resolves conflicting values &amp; keeps conflict handling simple. Version tracking &amp; explicit merging preserve more concurrent updates, but require extra metadata and application logic<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-19" href="#footnote-19" target="_self">19</a>. Use last-write-wins when simple conflict resolution matters, and versioning &amp; merging when preserving concurrent updates matters<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-20" href="#footnote-20" target="_self">20</a>.</p></li><li><p><strong>Normalization vs denormalization.</strong> Normalized data reduces duplication and makes updates easier to stay consistent. Denormalization makes reads faster and avoids expensive joins, but you must keep duplicate data synchronized<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-21" href="#footnote-21" target="_self">21</a>. Use normalization when reducing duplication &amp; consistency matter, and denormalization when faster reads matter<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-22" href="#footnote-22" target="_self">22</a>.</p></li><li><p><strong>Relational databases vs NoSQL.</strong> Relational databases<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-23" href="#footnote-23" target="_self">23</a> make it easy to query data in different ways and connect related data across tables. NoSQL databases can scale across many machines for known access patterns, but adding new query patterns can be harder. So use relational databases when flexible queries and relationships matter, and NoSQL when horizontal scaling around <em>known</em> access patterns matters.</p></li><li><p><strong>B-tree storage vs LSM-style storage.</strong> B-trees<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-24" href="#footnote-24" target="_self">24</a> organize data so reads are fast, including looking up one value/range of values. LSM trees optimize for heavy writes by writing data efficiently &amp; reorganizing it later, but reads &amp; background compaction can require extra work. Use B-trees when fast point &amp; range reads matter, and LSM trees<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-25" href="#footnote-25" target="_self">25</a> when high write throughput matters.</p></li><li><p><strong>Leveled vs universal LSM compaction.</strong> LSM databases periodically merge stored files to clean up &amp; reorganize data. <em>Leveled compaction</em> does more rewrites to keep data neatly organized, thus making reads more efficient. <em>Universal compaction</em> does less rewrites, making writes more efficient, but reads require checking more data. So use leveled compaction when read performance matters &amp; universal compaction when write performance matters<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-26" href="#footnote-26" target="_self">26</a>.</p></li><li><p><strong>Range partitioning vs hash partitioning.</strong> Range partitioning<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-27" href="#footnote-27" target="_self">27</a> keeps nearby keys together; this is useful for range queries. Hashing spreads writes more evenly across partitions, but sacrifices natural key locality. Use range partitioning when range queries &amp; key locality matter, and hash partitioning when evenly distributing writes matters<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-28" href="#footnote-28" target="_self">28</a>.</p></li><li><p><strong>Replication vs sharding.</strong> Replication copies the same data to many nodes, thus improving redundancy &amp; read capacity. Sharding divides &#8220;different&#8221; data across nodes. This increases aggregate storage &amp; write capacity while making routing &amp; cross-shard operations harder<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-29" href="#footnote-29" target="_self">29</a>. Use replication when redundancy &amp; read scaling matter, and sharding when storage &amp; write scaling matter.</p></li><li><p><strong>Event sourcing vs state-based persistence.</strong> Event sourcing stores every change as an event &amp; rebuilds the current state by replaying those events. State-based storage stores the latest state directly, thus making reads and updates simpler, but it does NOT preserve every historical change<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-30" href="#footnote-30" target="_self">30</a>. Use event sourcing when audit history &amp; replay matter, and state-based storage when simpler reads &amp; updates matter<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-31" href="#footnote-31" target="_self">31</a>.</p></li><li><p><strong>Vertical vs horizontal scaling.</strong> Vertical scaling increases a server&#8217;s CPU, memory, and/or storage capacity without distributing the workload across many machines. Horizontal scaling adds more machines &amp; offers better scalability, but requires the system to distribute requests/data across them<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-32" href="#footnote-32" target="_self">32</a>. Use vertical scaling when simplicity matters, and horizontal scaling when you need to scale beyond one machine.</p></li><li><p><strong>Stateful vs stateless compute.</strong> Keeping state inside an application server makes operations simpler &amp; faster. Yet stateless servers are easy to replace, rebalance, and autoscale because durable state lives elsewhere<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-33" href="#footnote-33" target="_self">33</a>. Use stateful compute to simplify operations, and stateless compute when scaling &amp; replacement matter.</p></li></ol><div class="twitter-embed" data-attrs="{&quot;url&quot;:&quot;https://x.com/systemdesignone/status/2093394593677029879?s=20&quot;,&quot;full_text&quot;:&quot;1 big monolith = low cortisol &quot;,&quot;username&quot;:&quot;systemdesignone&quot;,&quot;name&quot;:&quot;Neo Kim&quot;,&quot;profile_image_url&quot;:&quot;https://pbs.substack.com/profile_images/1715471366835556352/zuMLBgAQ_normal.jpg&quot;,&quot;date&quot;:&quot;2026-08-28T17:45:39.000Z&quot;,&quot;photos&quot;:[{&quot;img_url&quot;:&quot;https://pbs.substack.com/media/HQ07SYjWcAAbJFd.jpg&quot;,&quot;link_url&quot;:&quot;https://t.co/t8PJPYphjU&quot;}],&quot;quoted_tweet&quot;:{},&quot;reply_count&quot;:47,&quot;retweet_count&quot;:354,&quot;like_count&quot;:6568,&quot;impression_count&quot;:305218,&quot;expanded_url&quot;:null,&quot;video_url&quot;:null,&quot;video_preview_media_key&quot;:null,&quot;belowTheFold&quot;:true}" data-component-name="Twitter2ToDOM"></div><ol start="27"><li><p><strong>Monolith vs microservices.</strong> A monolith keeps calls, transactions, deployments, and debugging inside a <em>smaller</em> operational boundary. Microservices split the application into independent services that can be deployed and scaled separately, but add network calls, distributed data, &amp; operational complexity. Use a monolith when simplicity matters, and microservices when independent deployment &amp; scaling matter<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-34" href="#footnote-34" target="_self">34</a>.</p></li><li><p><strong>Coarse-grained vs fine-grained services.</strong> Coarse-grained services handle larger parts of the application, resulting in fewer service boundaries &amp; network calls. Fine-grained services<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-35" href="#footnote-35" target="_self">35</a> handle tiny, focused functions and can be deployed &amp; scaled independently, but require extra network communication &amp; distributed coordination<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-36" href="#footnote-36" target="_self">36</a>.</p></li><li><p><strong>Shared database vs database per service.</strong> A shared database makes joins &amp; transactions between services straightforward. Giving each service its own database increases autonomy and independent evolution, but makes cross-service queries and transactions hard<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-37" href="#footnote-37" target="_self">37</a>. Use a shared database when cross-service joins and transactions matter, and use a database per service when service autonomy matters<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-38" href="#footnote-38" target="_self">38</a>.</p></li><li><p><strong>Single model vs CQRS.</strong> A single model handles both reads &amp; writes, thus keeping the application simpler. CQRS<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-39" href="#footnote-39" target="_self">39</a> separates read &amp; write models so each can be optimized and scaled independently, but adds infrastructure &amp; synchronization between them. Use a single model<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-40" href="#footnote-40" target="_self">40</a> when simplicity matters, and use CQRS when reads &amp; writes need independent optimization/scaling.</p></li><li><p><strong>Synchronous calls vs asynchronous messaging.</strong> Synchronous calls<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-41" href="#footnote-41" target="_self">41</a> provide immediate success/failure and are straightforward for short operations. Queues<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-42" href="#footnote-42" target="_self">42</a> decouple services and absorb traffic bursts, but introduce delayed execution, duplicate handling &amp; workflow-state complexity.</p></li><li><p><strong>Saga</strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-43" href="#footnote-43" target="_self">43</a><strong> choreography vs saga orchestration.</strong> With choreography, each service reacts to events and triggers the next step without a central controller. With orchestration, a central orchestrator tells each service what to do and tracks the overall workflow. Use choreography for simpler, loosely coupled workflows, and use orchestration for complex workflows<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-44" href="#footnote-44" target="_self">44</a> that need centralized coordination &amp; recovery.</p></li><li><p><strong>Two-Phase Commit (2PC) vs Saga.</strong> 2PC coordinates transactions across many services/databases so they either ALL commit or ALL roll back. But coordination can increase latency &amp; reduce availability during failures. A Saga<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-45" href="#footnote-45" target="_self">45</a> breaks the workflow into separate local transactions and uses compensating actions when a later step fails. Use 2PC when &#8220;strict&#8221; atomicity matters<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-46" href="#footnote-46" target="_self">46</a> and Sagas for long-running distributed workflows where services need more autonomy.</p></li><li><p><strong>Message queue vs event log.</strong> A message queue distributes tasks across workers, with each task typically processed by one worker. An event log<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-47" href="#footnote-47" target="_self">47</a> stores events for a retention period, allowing many consumers to read the same events &amp; replay them later. Use message queues<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-48" href="#footnote-48" target="_self">48</a> for distributing background tasks and event logs when replay &amp; many independent consumers matter.</p></li><li><p><strong>At-least-once vs exactly-once processing.</strong> At-least-once processing retries messages after failures, so the same message would be processed more than once. Exactly-once processing prevents the same operation from producing duplicate effects, but needs extra coordination, transactions, and/or deduplication<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-49" href="#footnote-49" target="_self">49</a>. Use at-least-once when consumers can safely handle duplicates, and exactly-once<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-50" href="#footnote-50" target="_self">50</a> when prevention of duplicate effects matters.</p></li><li><p><strong>Total ordering vs partitioned ordering.</strong> Total ordering processes all events in the same order, but limits how much work can run in parallel. Partitioned ordering<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-51" href="#footnote-51" target="_self">51</a> guarantees order only for events with the <em>same</em> partition key, allowing different partitions to process events in parallel. Use total ordering when strict ordering across all events matters, and partitioned ordering when high throughput matters<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-52" href="#footnote-52" target="_self">52</a>.</p></li><li><p><strong>Push-based vs pull-based messaging.</strong> With push-based messaging, the broker sends messages to consumers as they arrive. With pull-based messaging, consumers request messages from the broker when they are ready<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-53" href="#footnote-53" target="_self">53</a>, thus giving them more control over batching &amp; processing rate. Use push when immediate delivery matters, and pull<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-54" href="#footnote-54" target="_self">54</a> when consumers need more control over how fast they process messages.</p></li><li><p><strong>Batch processing vs stream processing</strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-55" href="#footnote-55" target="_self">55</a><strong>.</strong> Batch processing<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-56" href="#footnote-56" target="_self">56</a> collects data &amp; processes it together at scheduled intervals, thus making it efficient for BIG datasets. Stream processing processes data continuously as it arrives, providing lower-latency results but adds unbounded data, state, time, and fault recovery complexity.</p></li><li><p><strong>REST vs GraphQL.</strong> REST exposes predefined endpoints that return fixed data structures. GraphQL lets clients request exactly the fields they need through a query<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-57" href="#footnote-57" target="_self">57</a>, but adds complexity for query execution, caching, &amp; performance control. Use REST for simpler, resource-based APIs, and GraphQL when clients need flexible data access<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-58" href="#footnote-58" target="_self">58</a>.</p></li><li><p><strong>Unary RPC vs streaming RPC.</strong> Unary RPC sends one request &amp; receives one response. Streaming RPC keeps the connection open so the client and/or server can continuously send many messages<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-59" href="#footnote-59" target="_self">59</a> but makes load balancing &amp; debugging complex<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-60" href="#footnote-60" target="_self">60</a>. Use unary RPC for simple request-response operations, and streaming RPC<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-61" href="#footnote-61" target="_self">61</a> for continuous/real-time communication.</p></li></ol><h4 style="text-align: center;"><strong>&#167;</strong></h4><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/system-design-tradeoffs?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);">If something resonated with you today, share this letter. Because one idea, one action, can change everything.</span></em></p></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/system-design-tradeoffs?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/system-design-tradeoffs?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><h4 style="text-align: center;"><strong>&#167;</strong></h4><ol start="41"><li><p><strong>Synchronous APIs vs asynchronous APIs.</strong> A synchronous API waits for the operation to finish before returning a result, but consumes connection &amp; timeout budgets<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-62" href="#footnote-62" target="_self">62</a>. An asynchronous API starts the work and returns immediately, usually with an ID you can use to check its status later. Yet it requires explicit state for status, completion &amp; cancellation. Use synchronous APIs for quick operations, and asynchronous APIs for long-running operations<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-63" href="#footnote-63" target="_self">63</a> that take too long for a single request.</p></li><li><p><strong>Acknowledgment latency vs durability.</strong> A messaging system can confirm a write after fewer replicas store it. This reduces latency but increases the risk of losing the message if the server fails. Waiting for more replicas before confirming the write improves durability but increases latency. Use fewer acknowledgments when low latency matters, and more acknowledgments when stronger durability matters<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-64" href="#footnote-64" target="_self">64</a>.</p></li><li><p><strong>Retries vs load amplification.</strong> Retries can recover from temporary failures by resending a failed request. But if a service is already overloaded<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-65" href="#footnote-65" target="_self">65</a>, retries create even more requests and can worsen the overload. Use retries for temporary failures, and limit retries when a service gets overloaded.</p></li><li><p><strong>Short vs long timeouts.</strong> Short timeouts release resources quickly when dependencies are slow. Yet setting them too aggressively can abandon requests that would have completed successfully a moment later. Use short timeouts when fast failure and resource protection matter, and long timeouts<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-66" href="#footnote-66" target="_self">66</a> when operations legitimately need more time.</p></li><li><p><strong>Idempotency vs implementation complexity.</strong> Idempotency<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-67" href="#footnote-67" target="_self">67</a> makes retries safer because sending the same request many times produces the same intended effect as sending it once. But implementing it requires extra logic to detect &amp; handle duplicate requests. Use idempotency when requests would be retried, and duplicate actions could cause problems. Use simpler non-idempotent operations when duplicates are harmless/impossible.</p></li><li><p><strong>Aggressive vs conservative circuit breakers.</strong> An aggressive circuit breaker stops sending requests to a failing service quickly, protecting it from more traffic but potentially blocking requests during a temporary problem. A conservative circuit breaker<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-68" href="#footnote-68" target="_self">68</a> waits for more failures before stopping requests, reducing unnecessary circuit openings but sending more traffic to a struggling service. </p></li><li><p><strong>Load shedding vs graceful degradation.</strong> Load shedding<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-69" href="#footnote-69" target="_self">69</a> rejects requests when a system is overloaded, thus freeing up capacity to handle the remaining requests successfully. Accepting more requests increases the chance of serving everyone, but during overload it can slow the entire system/cause failures. Use load shedding when system stability matters, and accept more requests when enough capacity is available.</p></li><li><p><strong>Deep queues vs backpressure.</strong> Deep queues<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-70" href="#footnote-70" target="_self">70</a> store more work when producers send data faster than consumers can process it, thus helping to absorb <em>temporary</em> traffic spikes. But if the queue gets too large, requests can sit there for a long time &amp; become stale. Backpressure slows down/rejects producers when consumers cannot keep up, thus preventing the backlog from growing too large. Use deep queues to absorb temporary traffic spikes and backpressure to prevent large backlogs.</p></li><li><p><strong>Active-active vs active-passive.</strong> Active-active runs the application in many regions at the same time, so another region can continue serving traffic if one fails. Active-passive<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-71" href="#footnote-71" target="_self">71</a> keeps a secondary region on standby &amp; switches traffic to it only when the primary region fails. This makes coordination simpler but increases failover time. Use active-active when high availability across regions matters, and active-passive when simpler multi-region operation matters.</p></li><li><p><strong>Low RTO/RPO vs cost &amp; complexity. </strong>A lower Recovery Time Objective<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-72" href="#footnote-72" target="_self">72</a> (<strong>RTO</strong>) means recovering faster after a failure, while lower Recovery Point Objective (<strong>RPO</strong>) means losing less data. Achieving both requires more replication, backup infrastructure, automation &amp; testing,,, this increases cost &amp; complexity. Use low RTO/RPO when minimizing downtime &amp; data loss matters, and higher RTO/RPO when reducing cost &amp; complexity matters.</p></li></ol><p>I started by telling you system design is about tradeoffs&#8230;</p><p>After 50 of them, the pattern is clear: every architecture choice gives you something &amp; costs you something.</p><p>The skill is knowing which tradeoff your workload can afford.</p><blockquote><p><em>&#8220;There are no solutions. There are only trade-offs.&#8221;<br>- Thomas Sowell</em></p></blockquote><h4 style="text-align: center;"><strong>&#167;</strong></h4><p style="text-align: center;"><em><span data-color="#3a7bf9" style="color: rgb(58, 123, 249);">If you are serious about system design, you really can&#8217;t miss out on the footnotes about these 50 tradeoffs:</span></em></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/subscribe&quot;,&quot;text&quot;:&quot;Get Instant 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>Get Instant Access 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_!68aQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4eab3a0-fda8-4df8-b651-0f976b223e9a_320x320.png 424w, https://substackcdn.com/image/fetch/$s_!68aQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4eab3a0-fda8-4df8-b651-0f976b223e9a_320x320.png 848w, https://substackcdn.com/image/fetch/$s_!68aQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4eab3a0-fda8-4df8-b651-0f976b223e9a_320x320.png 1272w, https://substackcdn.com/image/fetch/$s_!68aQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4eab3a0-fda8-4df8-b651-0f976b223e9a_320x320.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!68aQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4eab3a0-fda8-4df8-b651-0f976b223e9a_320x320.png" width="160" height="160" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e4eab3a0-fda8-4df8-b651-0f976b223e9a_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;:160,&quot;bytes&quot;:121414,&quot;alt&quot;:&quot;&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;:&quot;https://newsletter.systemdesign.one/i/136161496?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4eab3a0-fda8-4df8-b651-0f976b223e9a_320x320.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_!68aQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4eab3a0-fda8-4df8-b651-0f976b223e9a_320x320.png 424w, https://substackcdn.com/image/fetch/$s_!68aQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4eab3a0-fda8-4df8-b651-0f976b223e9a_320x320.png 848w, https://substackcdn.com/image/fetch/$s_!68aQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4eab3a0-fda8-4df8-b651-0f976b223e9a_320x320.png 1272w, https://substackcdn.com/image/fetch/$s_!68aQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe4eab3a0-fda8-4df8-b651-0f976b223e9a_320x320.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a><figcaption class="image-caption"><strong>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.instagram.com/systemdesignone/">Instagram</a></strong></figcaption></figure></div><div><hr></div><p><strong>Want to reach 250K+ tech professionals at scale? </strong>&#128240;</p><p>If your company wants to reach 250K+ 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 250,001+ readers strong, very close to 251k. Let&#8217;s try to get 251k readers by 7 September. Consider sharing this letter 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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/system-design-tradeoffs?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-tradeoffs?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p>
      <p>
          <a href="https://newsletter.systemdesign.one/p/system-design-tradeoffs">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[I struggled with “API testing” until I learned these 53 techniques]]></title><description><![CDATA[#173: Part 1 - smoke testing, functional testing, unit testing, and 22 others.]]></description><link>https://newsletter.systemdesign.one/p/api-testing-types</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/api-testing-types</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Mon, 31 Aug 2026 11:19:11 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/025eb7c5-9f3f-4bcf-95f6-84b5f213730f_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-testing-types/?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 are foundational, and some are quite advanced. ALL of them are super useful to engineers building production-ready systems.</span></p><p><span>Curious to know how many were new to you:</span></p><ol><li><p><span>Smoke Testing</span></p></li><li><p><span>Functional Testing</span></p></li><li><p><span>Unit Testing</span></p></li><li><p><span>Integration Testing</span></p></li><li><p><span>End-to-end testing</span></p></li><li><p><span>Regression Testing</span></p></li><li><p><span>Acceptance Testing</span></p></li><li><p><span>Negative Testing</span></p></li><li><p><span>Boundary Testing</span></p></li><li><p><span>Validation Testing</span></p></li><li><p><span>Exploratory Testing</span></p></li><li><p><span>Contract Testing</span></p></li><li><p><span>Consumer-Driven Contract Testing</span></p></li><li><p><span>API Contract Mocking</span></p></li><li><p><span>Load Testing</span></p></li><li><p><span>Stress Testing</span></p></li><li><p><span>Performance Testing</span></p></li><li><p><span>Spike Testing</span></p></li><li><p><span>Soak/Endurance Testing</span></p></li><li><p><span>Scalability Testing</span></p></li><li><p><span>Latency Testing</span></p></li><li><p><span>Concurrency Testing</span></p></li><li><p><span>Security Testing</span></p></li><li><p><span>Authentication Testing</span></p></li><li><p><span>Authorization Testing</span></p></li></ol><p><span>For each, I&#8217;ll share:</span></p><ul><li><p><span>What it is &amp; how it works in simple words</span></p></li><li><p><span>A real-world analogy</span></p></li><li><p><span>Tradeoffs</span></p></li><li><p><span>Why it matters</span></p></li></ul><p><span>Let&#8217;s go!</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><div class="callout-block" data-callout="true"><h2><a href="https://link.svix.com/system-01">Make your agents realtime (Partner)</a></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://link.svix.com/system-01" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!v-ZP!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde8a87d9-0b90-4a74-857c-be37bba398f2_2000x1047.png 424w, https://substackcdn.com/image/fetch/$s_!v-ZP!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde8a87d9-0b90-4a74-857c-be37bba398f2_2000x1047.png 848w, https://substackcdn.com/image/fetch/$s_!v-ZP!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde8a87d9-0b90-4a74-857c-be37bba398f2_2000x1047.png 1272w, https://substackcdn.com/image/fetch/$s_!v-ZP!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde8a87d9-0b90-4a74-857c-be37bba398f2_2000x1047.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!v-ZP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde8a87d9-0b90-4a74-857c-be37bba398f2_2000x1047.png" width="1456" height="762" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/de8a87d9-0b90-4a74-857c-be37bba398f2_2000x1047.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:762,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:212365,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://link.svix.com/system-01&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/211217193?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde8a87d9-0b90-4a74-857c-be37bba398f2_2000x1047.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_!v-ZP!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde8a87d9-0b90-4a74-857c-be37bba398f2_2000x1047.png 424w, https://substackcdn.com/image/fetch/$s_!v-ZP!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde8a87d9-0b90-4a74-857c-be37bba398f2_2000x1047.png 848w, https://substackcdn.com/image/fetch/$s_!v-ZP!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde8a87d9-0b90-4a74-857c-be37bba398f2_2000x1047.png 1272w, https://substackcdn.com/image/fetch/$s_!v-ZP!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde8a87d9-0b90-4a74-857c-be37bba398f2_2000x1047.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Agents are killing your apps with compounding latency across workflows.</p><p>Your customers want their agent workflows to be efficient, so you&#8217;re losing deals if you don&#8217;t make them event-driven. Webhooks solve this issue, but implementing them is harder than it looks.</p><p>If you homebrewed your webhooks and are getting pinged at 4 in the morning for failed deliveries, this is for you.</p><p><strong><a href="https://link.svix.com/system-01">Svix</a></strong> handles everything: retries, idempotency, security, and compliance. Qualified startups get $12,000 in free credits.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://link.svix.com/system-01&quot;,&quot;text&quot;:&quot;Get started 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://link.svix.com/system-01"><span>Get started for free</span></a></p><p><em>(Thanks to <a href="https://link.svix.com/system-01">Svix</a> for partnering on this newsletter.)</em></p></div><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><strong><span>1. Smoke Testing</span></strong></h2><blockquote><p><span>Smoke testing is the first sanity check you run after a new build/deployment. You pick the most critical endpoints: a health check, a login, a basic read, and confirm the API responds at all.</span></p></blockquote><p><span>It runs first in your CI pipeline.</span></p><p><span>If it fails, everything else stops. No point running 500 detailed tests on a broken build. A passing smoke test only means the API responded, NOT that it responded correctly.</span></p><p><span>So you cannot rely on smoke tests alone &amp; call it safe.</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_!5ao1!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdae27d4-68ee-44db-b389-63d71ac6b033_2048x878.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5ao1!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdae27d4-68ee-44db-b389-63d71ac6b033_2048x878.png 424w, https://substackcdn.com/image/fetch/$s_!5ao1!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdae27d4-68ee-44db-b389-63d71ac6b033_2048x878.png 848w, https://substackcdn.com/image/fetch/$s_!5ao1!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdae27d4-68ee-44db-b389-63d71ac6b033_2048x878.png 1272w, https://substackcdn.com/image/fetch/$s_!5ao1!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdae27d4-68ee-44db-b389-63d71ac6b033_2048x878.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5ao1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdae27d4-68ee-44db-b389-63d71ac6b033_2048x878.png" width="1456" height="624" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bdae27d4-68ee-44db-b389-63d71ac6b033_2048x878.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:624,&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_!5ao1!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdae27d4-68ee-44db-b389-63d71ac6b033_2048x878.png 424w, https://substackcdn.com/image/fetch/$s_!5ao1!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdae27d4-68ee-44db-b389-63d71ac6b033_2048x878.png 848w, https://substackcdn.com/image/fetch/$s_!5ao1!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdae27d4-68ee-44db-b389-63d71ac6b033_2048x878.png 1272w, https://substackcdn.com/image/fetch/$s_!5ao1!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbdae27d4-68ee-44db-b389-63d71ac6b033_2048x878.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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><span>Analogy</span></h3><p><span>Before a surgeon begins a 6-hour operation, they confirm the patient&#8217;s vitals are stable&#8230;Not a full diagnosis, but is the patient ready to proceed?</span></p><p><span>Smoke testing is that vital check before you invest deeper.</span></p><h3><span>Tradeoff</span></h3><p><span>Smoke tests are lightning fast and simple. They give instant feedback on failures before they ripple through a QA pipeline.</span></p><p><span>But simplicity is also their limitation. They are a first gate, not a full safety net.</span></p><h3><span>Why it matters</span></h3><p><span>Every minute a broken build spends in a QA pipeline wastes someone&#8217;s time.</span></p><p><span>Smoke testing is the cheapest guard you can put at the gate.</span></p><p><span>Run them first in every CI pipeline. If they fail, stop everything else immediately!</span></p><h2><strong><span>2. Functional Testing</span></strong></h2><blockquote><p><span>Functional testing holds the API accountable to its specification. For every endpoint, you define what valid input looks like, what the response must contain, and what status code should come back. Then you verify if the API delivers it.</span></p></blockquote><p><span>This includes happy paths and unhappy paths.</span></p><ul><li><p><em><span>What happens when required fields are missing?</span></em></p></li><li><p><em><span>&#8230;When the auth token is invalid?</span></em></p></li><li><p><em><span>&#8230;When the payload is structurally wrong?</span></em></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_!zmdm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce2ddae9-112f-4222-999b-c87a1d0550c6_2048x692.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zmdm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce2ddae9-112f-4222-999b-c87a1d0550c6_2048x692.png 424w, https://substackcdn.com/image/fetch/$s_!zmdm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce2ddae9-112f-4222-999b-c87a1d0550c6_2048x692.png 848w, https://substackcdn.com/image/fetch/$s_!zmdm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce2ddae9-112f-4222-999b-c87a1d0550c6_2048x692.png 1272w, https://substackcdn.com/image/fetch/$s_!zmdm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce2ddae9-112f-4222-999b-c87a1d0550c6_2048x692.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zmdm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce2ddae9-112f-4222-999b-c87a1d0550c6_2048x692.png" width="1456" height="492" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ce2ddae9-112f-4222-999b-c87a1d0550c6_2048x692.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:492,&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_!zmdm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce2ddae9-112f-4222-999b-c87a1d0550c6_2048x692.png 424w, https://substackcdn.com/image/fetch/$s_!zmdm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce2ddae9-112f-4222-999b-c87a1d0550c6_2048x692.png 848w, https://substackcdn.com/image/fetch/$s_!zmdm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce2ddae9-112f-4222-999b-c87a1d0550c6_2048x692.png 1272w, https://substackcdn.com/image/fetch/$s_!zmdm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce2ddae9-112f-4222-999b-c87a1d0550c6_2048x692.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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><span>Analogy</span></h3><p><span>Imagine a vending machine:</span></p><p><span>Functional testing is inserting the right coins, pressing the right button, and confirming the right snack drops.</span></p><p><span>Then inserting too few coins, pressing a sold-out item, and confirming the machine rejects it cleanly without eating your money.</span></p><h3><span>Tradeoff</span></h3><p><span>Functional tests give you direct, verifiable confidence in your API&#8217;s behavior.</span></p><p><span>They&#8217;re the key safety net for catching broken contracts before a consumer sees them. Yet the catch is the maintenance costs. Poorly written functional tests become a tax: </span><em><span>fragile, brittle, and constantly breaking on harmless changes.</span></em></p><h3><span>Why it matters</span></h3><p><span>Consumers build products on top of your API, trusting it behaves as documented.</span></p><p><span>Functional tests enforce trust internally every time code changes. Assert what truly matters to clients, not every incidental implementation detail.</span></p><h2><strong><span>3. Unit Testing</span></strong></h2><blockquote><p><span>Unit testing isolates the pieces of your API logic: single handler, validation function, data transformer, and verifies them independently.</span></p></blockquote><p><span>No real database, no real network&#8230; Just the logic, tested in a controlled environment with </span><em><span>mocked</span></em><span> dependencies.</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_!pLaN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd69ec3ef-3a7a-47c3-a4ea-dc7666a27561_1782x1796.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pLaN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd69ec3ef-3a7a-47c3-a4ea-dc7666a27561_1782x1796.png 424w, https://substackcdn.com/image/fetch/$s_!pLaN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd69ec3ef-3a7a-47c3-a4ea-dc7666a27561_1782x1796.png 848w, https://substackcdn.com/image/fetch/$s_!pLaN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd69ec3ef-3a7a-47c3-a4ea-dc7666a27561_1782x1796.png 1272w, https://substackcdn.com/image/fetch/$s_!pLaN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd69ec3ef-3a7a-47c3-a4ea-dc7666a27561_1782x1796.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pLaN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd69ec3ef-3a7a-47c3-a4ea-dc7666a27561_1782x1796.png" width="572" height="576.3214285714286" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d69ec3ef-3a7a-47c3-a4ea-dc7666a27561_1782x1796.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1467,&quot;width&quot;:1456,&quot;resizeWidth&quot;:572,&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_!pLaN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd69ec3ef-3a7a-47c3-a4ea-dc7666a27561_1782x1796.png 424w, https://substackcdn.com/image/fetch/$s_!pLaN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd69ec3ef-3a7a-47c3-a4ea-dc7666a27561_1782x1796.png 848w, https://substackcdn.com/image/fetch/$s_!pLaN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd69ec3ef-3a7a-47c3-a4ea-dc7666a27561_1782x1796.png 1272w, https://substackcdn.com/image/fetch/$s_!pLaN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd69ec3ef-3a7a-47c3-a4ea-dc7666a27561_1782x1796.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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><span>Analogy</span></h3><p><span>Before assembling a watch, a craftsman tests each gear wheel individually on a flat surface.</span></p><p><span>You cannot judge the full watch until you trust the components individually.</span></p><h3><span>Tradeoff</span></h3><p><span>Unit tests are the fastest tests you will ever write.</span></p><p><span>They run in milliseconds and give instant feedback during development, enabling fearless refactoring. Yet the risk is over-reliance.</span></p><p><span>Mocks do not always reflect reality, and a codebase with 100% unit test coverage can still fail catastrophically when components interact.</span></p><h3><span>Why it matters</span></h3><p><span>Unit tests form the foundation of the testing pyramid.</span></p><p><span>They catch logic bugs before they compound into harder-to-debug integration failures.</span></p><p><span>Use them for all pure logic:</span><em><span> validators, transformers, calculators, and business rules.</span></em></p><h2><strong><span>4. Integration Testing</span></strong></h2><blockquote><p><span>Integration testing verifies if different parts of the system work correctly &#8220;together&#8221;. </span></p></blockquote><p>Instead of testing a single endpoint in isolation, you chain a sequence of API calls that reflect a real workflow: <em>create a resource, read it back, update it, and delete it</em>.</p><p>Then you confirm the entire sequence produces correct state. <span>These tests touch realistic versions of your databases, queues, and dependent services.</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_!zbL3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52915095-08f6-4280-a10c-03bebd2cb320_1540x706.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zbL3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52915095-08f6-4280-a10c-03bebd2cb320_1540x706.png 424w, https://substackcdn.com/image/fetch/$s_!zbL3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52915095-08f6-4280-a10c-03bebd2cb320_1540x706.png 848w, https://substackcdn.com/image/fetch/$s_!zbL3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52915095-08f6-4280-a10c-03bebd2cb320_1540x706.png 1272w, https://substackcdn.com/image/fetch/$s_!zbL3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52915095-08f6-4280-a10c-03bebd2cb320_1540x706.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zbL3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52915095-08f6-4280-a10c-03bebd2cb320_1540x706.png" width="1456" height="667" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/52915095-08f6-4280-a10c-03bebd2cb320_1540x706.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:667,&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_!zbL3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52915095-08f6-4280-a10c-03bebd2cb320_1540x706.png 424w, https://substackcdn.com/image/fetch/$s_!zbL3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52915095-08f6-4280-a10c-03bebd2cb320_1540x706.png 848w, https://substackcdn.com/image/fetch/$s_!zbL3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52915095-08f6-4280-a10c-03bebd2cb320_1540x706.png 1272w, https://substackcdn.com/image/fetch/$s_!zbL3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52915095-08f6-4280-a10c-03bebd2cb320_1540x706.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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><span>Analogy</span></h3><p><span>A chef does not just taste each ingredient separately&#8230;</span></p><p><span>Before serving a dish, they cook the full recipe, taste the result, and confirm the combined flavors work together.</span></p><p><span>Integration testing is that final cook-and-taste step before the plate leaves the kitchen.</span></p><h3><span>Tradeoff</span></h3><p><span>Integration tests catch an entire class of bugs that unit tests are structurally incapable of finding: </span><em><span>serialization mismatches, transaction failures, auth token propagation errors.</span></em></p><p><span>But they are slower, need more infrastructure, and sensitive to environmental issues. One &#8220;flaky&#8221; dependency can make the entire suite unreliable.</span></p><h3><span>Why it matters</span></h3><p><span>In distributed systems, the bugs that cause the worst incidents rarely live inside a single function.</span></p><p><span>They live in the seams between systems. So keep a small, critical integration suite per workflow and run heavier scenarios on a nightly schedule.</span></p><h2><strong><span>5. End-to-End (E2E) Testing</span></strong></h2><blockquote><p><span>End-to-end testing validates a complete user journey through the entire system, exactly as a real user would experience it.</span></p></blockquote><p>Unlike integration tests, you hit the &#8220;real&#8221; API, which calls real services, writes to a real database, and returns a real response.</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_ff!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf4f0d25-f17f-4c85-8de3-b4492676e1c8_2048x886.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!L_ff!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf4f0d25-f17f-4c85-8de3-b4492676e1c8_2048x886.png 424w, https://substackcdn.com/image/fetch/$s_!L_ff!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf4f0d25-f17f-4c85-8de3-b4492676e1c8_2048x886.png 848w, https://substackcdn.com/image/fetch/$s_!L_ff!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf4f0d25-f17f-4c85-8de3-b4492676e1c8_2048x886.png 1272w, https://substackcdn.com/image/fetch/$s_!L_ff!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf4f0d25-f17f-4c85-8de3-b4492676e1c8_2048x886.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!L_ff!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf4f0d25-f17f-4c85-8de3-b4492676e1c8_2048x886.png" width="1456" height="630" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/af4f0d25-f17f-4c85-8de3-b4492676e1c8_2048x886.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:630,&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_ff!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf4f0d25-f17f-4c85-8de3-b4492676e1c8_2048x886.png 424w, https://substackcdn.com/image/fetch/$s_!L_ff!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf4f0d25-f17f-4c85-8de3-b4492676e1c8_2048x886.png 848w, https://substackcdn.com/image/fetch/$s_!L_ff!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf4f0d25-f17f-4c85-8de3-b4492676e1c8_2048x886.png 1272w, https://substackcdn.com/image/fetch/$s_!L_ff!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faf4f0d25-f17f-4c85-8de3-b4492676e1c8_2048x886.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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><span>Analogy</span></h3><p><span>A car manufacturer does not just test the engine on a stand and/or the brakes on a rig.</span></p><p><span>Before shipping a vehicle, a test driver takes it on the road, through traffic, over speed bumps, at highway speed, to confirm the whole car behaves as designed in the real world.</span></p><h3><span>Tradeoff</span></h3><p><span>E2E tests are the most realistic tests you can run, which makes them the most trustworthy signal before a release.</span></p><p><span>But they are the most expensive to maintain. Flaky environments, test data management &amp; </span><em><span>slow</span></em><span> execution times make large E2E suites painful.</span></p><h3><span>Why it matters</span></h3><p><span>Individual services can all pass their own tests while the complete user journey still fails.</span></p><p><span>E2E tests are the last line of defense before users become your testers. Keep the suite small and focused on the most </span><em><span>critical</span></em><span> business journeys only.</span></p><h2><strong><span>6. Regression Testing</span></strong></h2><blockquote><p><span>Regression testing reruns a set of existing tests every time new code gets merged. This confirm nothing previously working has been </span><em><span>broken</span></em><span>.</span></p></blockquote><p><span>It&#8217;s less about testing new functionality &amp; more about protecting what </span><em><span>already</span></em><span> works.</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_!IdWu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb406cf3a-1b83-4989-8a6d-f4243c090fe2_2048x1212.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!IdWu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb406cf3a-1b83-4989-8a6d-f4243c090fe2_2048x1212.png 424w, https://substackcdn.com/image/fetch/$s_!IdWu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb406cf3a-1b83-4989-8a6d-f4243c090fe2_2048x1212.png 848w, https://substackcdn.com/image/fetch/$s_!IdWu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb406cf3a-1b83-4989-8a6d-f4243c090fe2_2048x1212.png 1272w, https://substackcdn.com/image/fetch/$s_!IdWu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb406cf3a-1b83-4989-8a6d-f4243c090fe2_2048x1212.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!IdWu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb406cf3a-1b83-4989-8a6d-f4243c090fe2_2048x1212.png" width="1456" height="862" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b406cf3a-1b83-4989-8a6d-f4243c090fe2_2048x1212.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:862,&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_!IdWu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb406cf3a-1b83-4989-8a6d-f4243c090fe2_2048x1212.png 424w, https://substackcdn.com/image/fetch/$s_!IdWu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb406cf3a-1b83-4989-8a6d-f4243c090fe2_2048x1212.png 848w, https://substackcdn.com/image/fetch/$s_!IdWu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb406cf3a-1b83-4989-8a6d-f4243c090fe2_2048x1212.png 1272w, https://substackcdn.com/image/fetch/$s_!IdWu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb406cf3a-1b83-4989-8a6d-f4243c090fe2_2048x1212.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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><span>Analogy</span></h3><p><span>A musician who mastered a repertoire runs through it before every performance.</span></p><p><span>This is not to learn the pieces, but to catch any drift/forgotten fingering that crept in during recent practice of new material.</span></p><h3><span>Tradeoff</span></h3><p><span>Regression tests are the institutional memory of your API.</span></p><p><span>They compound in value over time, catching the </span><em><span>&#8220;should not have touched that&#8221; </span></em><span>changes.</span></p><p><span>Without discipline, a regression suite becomes slow &amp; unmaintainable.</span></p><h3><span>Why it matters</span></h3><p><span>The most common source of production bugs is not new features&#8230;but unintended side effects of changes to existing code.</span></p><p><span>Run regression tests automatically on every merge request &amp; block merges on failures.</span></p><h2><strong><span>7. Acceptance Testing</span></strong></h2><blockquote><p><span>Acceptance testing is the final verification the API delivers what was agreed upon before development began.</span></p></blockquote><p><span>It tests against business criteria &amp; user requirements, not just technical specifications.</span></p><p><span>The question is not </span><em><span>&#8220;does it work?&#8221;</span></em><span> but </span><em><span>&#8220;does it do what we promised?&#8221;</span></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_!zGBq!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F390fcd8c-dfa3-4c12-a5f2-02d7ad357008_2048x1177.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zGBq!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F390fcd8c-dfa3-4c12-a5f2-02d7ad357008_2048x1177.png 424w, https://substackcdn.com/image/fetch/$s_!zGBq!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F390fcd8c-dfa3-4c12-a5f2-02d7ad357008_2048x1177.png 848w, https://substackcdn.com/image/fetch/$s_!zGBq!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F390fcd8c-dfa3-4c12-a5f2-02d7ad357008_2048x1177.png 1272w, https://substackcdn.com/image/fetch/$s_!zGBq!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F390fcd8c-dfa3-4c12-a5f2-02d7ad357008_2048x1177.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zGBq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F390fcd8c-dfa3-4c12-a5f2-02d7ad357008_2048x1177.png" width="1456" height="837" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/390fcd8c-dfa3-4c12-a5f2-02d7ad357008_2048x1177.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:837,&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_!zGBq!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F390fcd8c-dfa3-4c12-a5f2-02d7ad357008_2048x1177.png 424w, https://substackcdn.com/image/fetch/$s_!zGBq!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F390fcd8c-dfa3-4c12-a5f2-02d7ad357008_2048x1177.png 848w, https://substackcdn.com/image/fetch/$s_!zGBq!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F390fcd8c-dfa3-4c12-a5f2-02d7ad357008_2048x1177.png 1272w, https://substackcdn.com/image/fetch/$s_!zGBq!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F390fcd8c-dfa3-4c12-a5f2-02d7ad357008_2048x1177.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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><span>Analogy</span></h3><p><span>A tailor finishing a bespoke suit does not just check the stitching.</span></p><p><span>They have the client try it on against the original measurements &amp; requirements.</span></p><p><span>The technical craft could be perfect, but if the suit does not fit the client&#8217;s needs,,, the job is not done.</span></p><h3><span>Tradeoff</span></h3><p><span>Acceptance tests provide the highest level of business confidence of any testing type.</span></p><p><span>They close the gap between a technical specification &amp; a business requirement.</span></p><p><span>But they require close collaboration between technical &amp; non-technical stakeholders. Plus, they are too slow and coarse to run on every commit.</span></p><h3><span>Why it matters</span></h3><p><span>Teams can spend weeks building an API that works perfectly from a technical standpoint but completely misses the actual business need&#8230;</span></p><p><span>Use acceptance tests as the final sign-off before a feature ships to production.</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>(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><strong><span>8. Negative Testing</span></strong></h2>
      <p>
          <a href="https://newsletter.systemdesign.one/p/api-testing-types">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[How CI/CD Works - A Deep Dive]]></title><description><![CDATA[#172: Part 4 - DevOps Mastermind]]></description><link>https://newsletter.systemdesign.one/p/how-does-a-ci-cd-pipeline-work</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/how-does-a-ci-cd-pipeline-work</guid><dc:creator><![CDATA[Ayaan]]></dc:creator><pubDate>Fri, 28 Aug 2026 14:40:22 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/68279ba3-7546-414f-aa94-dcf219004831_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/how-does-a-ci-cd-pipeline-work/?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>Engineers still joke about not deploying on Fridays for a reason.</span></p><p><span>For a long time, deployments were one of the riskiest parts of software delivery. They were mostly manual. Engineers logged into production servers, made the required changes &amp; restarted services.</span></p><p><span>A tiny mistake could easily cause problems.</span></p><p><span>If a deployment failed, finding the cause meant retracing every step by hand. There was hardly an audit trail, a rollback plan, or even a clear record of what had changed.</span></p><p><span>For tiny teams, this was usually enough&#8230;</span></p><p><span>Deployments were infrequent, infrastructure was relatively simple, and a single engineer </span><em><span>often</span></em><span> understood the entire process from start to finish.</span></p><p><span>But as software teams grew, release cycles got shorter, and deployment frequency increased. What used to happen once a month started happening weekly, then daily, and eventually many times a day. The more often teams released software, the more opportunities for human error emerged.</span></p><p><span>Tiny mistakes could bring production down:</span></p><p><span>A missed command, a forgotten environment variable, or a deployment differing slightly from the previous one was often enough.</span></p><p><span>Teams reduced this risk through runbooks, deployment checklists, and planned release windows. Those practices helped. Yet they did not solve the underlying problem. The process was still manual, and manual processes become harder to manage as systems and teams grow.</span></p><p><span>CI/CD emerged as a response to these challenges &amp; became a </span><em><span>fundamental</span></em><span> part of modern software delivery.</span></p><p><span>Instead of relying on engineers to repeat the same sequence of steps, CI/CD turns those steps into an automated pipeline. Every change follows the same path. Code gets built, tested, packaged &amp; deployed the same way every time. This reduces the risk of deployment errors and makes releases more predictable.</span></p><p><span>The goal is simple:</span></p><p><em><span>Move changes from a developer&#8217;s machine to production quickly and safely.</span></em></p><p><span>But CI/CD is not a single tool/single process&#8230;It&#8217;s a collection of systems working together:</span></p><ul><li><p><span>Source control systems trigger pipelines.</span></p></li><li><p><span>Build stages create deployable artifacts</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a><span>.</span></p></li><li><p><span>Deployment stages promote those artifacts across environments.</span></p></li><li><p><span>And safe deployments depend on more than automation.</span></p></li></ul><p><span>They also require security checks, approval gates, rollback</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a><span> mechanisms, and monitoring.</span></p><p><span>Most engineers interact with CI/CD every day. They push code, wait for checks to pass, and watch deployments complete. What they rarely see is everything happening underneath&#8230;</span></p><p><span>Onward.</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><div class="callout-block" data-callout="true"><h3><strong><a href="https://getunblocked.com/events/how-to-stop-babysitting-your-agents/?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary">[Webinar] How to stop babysitting your agents (Partner)</a></strong></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://getunblocked.com/events/how-to-stop-babysitting-your-agents/?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_!6-MH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3f24c4-3b04-4fed-a672-96dc40e8b12b_1600x900.png 424w, https://substackcdn.com/image/fetch/$s_!6-MH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3f24c4-3b04-4fed-a672-96dc40e8b12b_1600x900.png 848w, https://substackcdn.com/image/fetch/$s_!6-MH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3f24c4-3b04-4fed-a672-96dc40e8b12b_1600x900.png 1272w, https://substackcdn.com/image/fetch/$s_!6-MH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3f24c4-3b04-4fed-a672-96dc40e8b12b_1600x900.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6-MH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3f24c4-3b04-4fed-a672-96dc40e8b12b_1600x900.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9c3f24c4-3b04-4fed-a672-96dc40e8b12b_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;:272266,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:&quot;&quot;,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://getunblocked.com/events/how-to-stop-babysitting-your-agents/?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/209258689?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3f24c4-3b04-4fed-a672-96dc40e8b12b_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_!6-MH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3f24c4-3b04-4fed-a672-96dc40e8b12b_1600x900.png 424w, https://substackcdn.com/image/fetch/$s_!6-MH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3f24c4-3b04-4fed-a672-96dc40e8b12b_1600x900.png 848w, https://substackcdn.com/image/fetch/$s_!6-MH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3f24c4-3b04-4fed-a672-96dc40e8b12b_1600x900.png 1272w, https://substackcdn.com/image/fetch/$s_!6-MH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3f24c4-3b04-4fed-a672-96dc40e8b12b_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Agents can generate code. Getting it right for your system, team conventions, and past decisions is the hard part. You end up wasting time and tokens in correction loops.</p><p>More MCPs give agents access to information, but not understanding. The teams pulling ahead use a context layer to give agents exactly what they need.</p><p><a href="https://getunblocked.com/events/how-to-stop-babysitting-your-agents/?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary">Join live on Sep 2 (FREE)</a><span> to see:</span></p><ul><li><p>Where teams get stuck on the AI maturity curve</p></li><li><p>How a context layer solves for quality, efficiency, and cost</p></li><li><p>Live demo: the same coding task with and without a context layer</p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://getunblocked.com/events/how-to-stop-babysitting-your-agents/?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://getunblocked.com/events/how-to-stop-babysitting-your-agents/?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary"><span>Register Now</span></a></p><p><em><span>(Thanks to </span><a href="https://getunblocked.com/events/how-to-stop-babysitting-your-agents/?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary">Unblocked</a><span> for partnering on this newsletter.)</span></em></p></div><h4 style="text-align: center;"><strong>&#167;</strong></h4><p><span>I want to introduce </span><strong><a href="https://x.com/twtayaan">Ayaan</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/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;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://x.com/twtayaan&quot;,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 </span><strong>Certified Kubernetes Administrator (CKA)</strong><span> 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.</span></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><h4 style="text-align: center;"><strong>&#167;</strong></h4><p><em><strong>Here&#8217;s what you&#8217;ll find inside this newsletter:</strong></em></p><ul><li><p><strong>What actually happens after you push code.</strong> The full path from a Git commit to the build, test, release, and deployment stages that eventually put your application in front of real users.</p></li><li><p><strong>Why the same release can survive staging and still break production.</strong> How artifacts, environment parity, deployment strategies, and rollback decisions determine whether a release is repeatable or becomes an incident.</p></li><li><p><strong>The machinery underneath every pipeline run.</strong> What runners, triggers, registries, approval gates, Pipeline as Code, secrets, and software supply-chain controls are doing while you wait for that green checkmark.</p></li><li><p><strong>A successful deployment can still be a failed release.</strong> Health checks, smoke tests, latency and error signals, business metrics, and SLOs that reveal what happened after real traffic reached the new version.</p></li><li><p><strong>Why mature CI/CD pipelines eventually lead to GitOps.</strong> Where traditional pipelines stop, how production drift appears after deployment, and the architectural problem GitOps is designed to solve next.</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>What CI/CD Actually Means</span></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-SZB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faec45b68-d1b3-4203-b86a-85e353a1c3ab_1693x929.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-SZB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faec45b68-d1b3-4203-b86a-85e353a1c3ab_1693x929.png 424w, https://substackcdn.com/image/fetch/$s_!-SZB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faec45b68-d1b3-4203-b86a-85e353a1c3ab_1693x929.png 848w, https://substackcdn.com/image/fetch/$s_!-SZB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faec45b68-d1b3-4203-b86a-85e353a1c3ab_1693x929.png 1272w, https://substackcdn.com/image/fetch/$s_!-SZB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faec45b68-d1b3-4203-b86a-85e353a1c3ab_1693x929.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-SZB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faec45b68-d1b3-4203-b86a-85e353a1c3ab_1693x929.png" width="1456" height="799" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aec45b68-d1b3-4203-b86a-85e353a1c3ab_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;: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_!-SZB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faec45b68-d1b3-4203-b86a-85e353a1c3ab_1693x929.png 424w, https://substackcdn.com/image/fetch/$s_!-SZB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faec45b68-d1b3-4203-b86a-85e353a1c3ab_1693x929.png 848w, https://substackcdn.com/image/fetch/$s_!-SZB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faec45b68-d1b3-4203-b86a-85e353a1c3ab_1693x929.png 1272w, https://substackcdn.com/image/fetch/$s_!-SZB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faec45b68-d1b3-4203-b86a-85e353a1c3ab_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>CI/CD is often used as a single term, but it refers to three distinct practices&#8230;</span></p><p><span>Each one solves a &#8220;different&#8221; problem&#8230;Treating them as one concept makes it harder to understand why pipelines are designed the way they are.</span></p><h3><span>Continuous Integration</span></h3><p><span>Continuous Integration (</span><strong><span>CI</span></strong><span>) is the practice of frequently merging code changes into a shared branch, often many times a day.</span></p><p><span>Each merge triggers an automated build &amp; a test suite. If the build breaks/tests fail, the team knows immediately.</span></p><p><span>Before CI, developers often worked on separate branches for days/weeks before merging. When they finally did, the differences had grown large enough to cause serious conflict. Integration became its own painful phase at the end of development.</span></p><p><span>This is called </span><em><span>merge hell</span></em><span>.</span></p><p><span>CI eliminates this phase by keeping integration &#8220;continuous&#8221;.</span></p><p><span>Small, frequent merges mean smaller conflicts. Automated checks catch broken code before it reaches anyone else. The branch stays stable, and the team can always see what is actually working.</span></p><h3><span>Continuous Delivery</span></h3><p><span>Continuous Delivery (</span><strong><span>CD</span></strong><span>) extends CI one step further:</span></p><p><span>It ensures every change passing through the pipeline is in a </span><em><span>releasable</span></em><span> state. Not eventually releasable but releasable right now.</span></p><p><span>A passing test suite alone is NOT enough. The code must be built into a deployable artifact. It must also be tested in a production-like environment and pass quality and security checks. Every stage gates the next one. A failure at any point stops the change from moving forward.</span></p><p><span>The keyword here is delivery, not deployment.</span></p><p><span>The pipeline brings the change to the production door, but a human still decides when to open it. This final approval step is intentional. Some teams need it for compliance, change management, and/or business coordination.</span></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/how-does-a-ci-cd-pipeline-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-does-a-ci-cd-pipeline-work?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><h3><span>Continuous Deployment</span></h3><p><span>Continuous Deployment removes the final manual step from the process.</span></p><p><span>Every change passing through the pipeline goes to production automatically. No human approval is required!</span></p><p><span>This is the furthest point on the spectrum, and not every team reaches it/needs to. It requires a high degree of confidence in the pipeline itself.</span></p><ul><li><p><span>Tests must be comprehensive.</span></p></li><li><p><span>Rollback mechanisms must be fast &amp; reliable.</span></p></li><li><p><span>Monitoring must catch regressions</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a><span> quickly after release.</span></p></li></ul><p><span>Most organizations operate somewhere between Delivery &amp; Deployment rather than at either extreme.</span></p><p><span>Teams operating at this level often deploy dozens/hundreds of times a day. The pipeline becomes the gating mechanism entirely.</span></p><p><span>The distinction between Delivery and Deployment comes down to this final approval step. Delivery keeps a human in the loop before production. Deployment automates the decision entirely. Both approaches are valid.</span></p><p><span>Now we understand the terminology, let&#8217;s look at the anatomy of the pipeline itself&#8230;</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>Anatomy of a Pipeline</span></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!bPIz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3bf1a82-f26b-44de-b4d6-51a2ff66cb0f_1774x887.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!bPIz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3bf1a82-f26b-44de-b4d6-51a2ff66cb0f_1774x887.png 424w, https://substackcdn.com/image/fetch/$s_!bPIz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3bf1a82-f26b-44de-b4d6-51a2ff66cb0f_1774x887.png 848w, https://substackcdn.com/image/fetch/$s_!bPIz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3bf1a82-f26b-44de-b4d6-51a2ff66cb0f_1774x887.png 1272w, https://substackcdn.com/image/fetch/$s_!bPIz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3bf1a82-f26b-44de-b4d6-51a2ff66cb0f_1774x887.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!bPIz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3bf1a82-f26b-44de-b4d6-51a2ff66cb0f_1774x887.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e3bf1a82-f26b-44de-b4d6-51a2ff66cb0f_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_!bPIz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3bf1a82-f26b-44de-b4d6-51a2ff66cb0f_1774x887.png 424w, https://substackcdn.com/image/fetch/$s_!bPIz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3bf1a82-f26b-44de-b4d6-51a2ff66cb0f_1774x887.png 848w, https://substackcdn.com/image/fetch/$s_!bPIz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3bf1a82-f26b-44de-b4d6-51a2ff66cb0f_1774x887.png 1272w, https://substackcdn.com/image/fetch/$s_!bPIz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3bf1a82-f26b-44de-b4d6-51a2ff66cb0f_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 pipeline is a series of automated stages that a code change must pass through before it reaches production.</span></p><p><span>Each stage is a gate. Fail one, and the change stops there. Pass all of them, and you'll have a verified, deployable artifact ready for users.</span></p><p><span>Most pipelines follow the same fundamental sequence regardless of the tool. The stages have different names across GitHub Actions, GitLab CI, and Jenkins, but the underlying structure is always the same&#8230;</span></p><p><span>Let&#8217;s walk through each stage:</span></p><h3><span>1. Source Stage</span></h3><p><span>Everything starts with a commit.</span></p><p><span>When you push code to a branch, a webhook</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a><span> fires and the pipeline starts automatically. No manual trigger needed. This push signals that something has changed &amp; needs to be validated.</span></p><p><span>Git is the universal standard here.</span></p><p><span>But the branch strategy your team uses shapes how the pipeline behaves:</span></p><ul><li><p><strong><span>Trunk-based development</span></strong><span>: Everyone commits directly to a single main branch, often many times a day. Pipelines run on every push. Problems surface fast, but this approach requires strong test coverage and feature flags</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a><span> to hide incomplete work.</span></p></li><li><p><strong><span>Feature branches</span></strong><span>: Developers work in isolation and merge when ready. The pipeline runs on the branch first, then again after the merge. Safer, but long-lived branches delay integration.</span></p></li><li><p><strong><span>GitFlow</span></strong><span>: Long-lived branches for features, releases, and hotfixes. Each type triggers different pipeline behavior. Strong structure, but slower path to production.</span></p></li></ul><h3><span>2. Build Stage</span></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3w7o!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f78a925-7ff9-4fba-8f12-697abf2e3aa7_1774x887.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3w7o!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f78a925-7ff9-4fba-8f12-697abf2e3aa7_1774x887.png 424w, https://substackcdn.com/image/fetch/$s_!3w7o!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f78a925-7ff9-4fba-8f12-697abf2e3aa7_1774x887.png 848w, https://substackcdn.com/image/fetch/$s_!3w7o!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f78a925-7ff9-4fba-8f12-697abf2e3aa7_1774x887.png 1272w, https://substackcdn.com/image/fetch/$s_!3w7o!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f78a925-7ff9-4fba-8f12-697abf2e3aa7_1774x887.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3w7o!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f78a925-7ff9-4fba-8f12-697abf2e3aa7_1774x887.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7f78a925-7ff9-4fba-8f12-697abf2e3aa7_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_!3w7o!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f78a925-7ff9-4fba-8f12-697abf2e3aa7_1774x887.png 424w, https://substackcdn.com/image/fetch/$s_!3w7o!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f78a925-7ff9-4fba-8f12-697abf2e3aa7_1774x887.png 848w, https://substackcdn.com/image/fetch/$s_!3w7o!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f78a925-7ff9-4fba-8f12-697abf2e3aa7_1774x887.png 1272w, https://substackcdn.com/image/fetch/$s_!3w7o!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f78a925-7ff9-4fba-8f12-697abf2e3aa7_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 build stage turns source code into something deployable.</span></p><p><span>Dependencies are resolved, code is compiled, and an artifact is produced. This artifact is the immutable output of the build. It could be a Docker image, a JAR file, or a compiled binary. The exact form depends on the stack, but the principle never changes.</span></p><p><span>Build once, deploy everywhere&#8230;</span></p><p><span>The artifact produced here moves through every environment unchanged. Nothing gets rebuilt for staging, and nothing gets rebuilt for production. Rebuilding introduces drift, and drift means what you tested is no longer what you shipped. The same artifact passing the tests in CI must be the exact artifact running in production.</span></p><p><span>Build speed matters too&#8230;A slow build is one that developers start routing around.</span></p><p><span>Here are two ways to keep it fast:</span></p><ul><li><p><strong><span>Dependency caching</span></strong><span>: Stores resolved packages between runs. Dependencies change far less often than source code, so caching them cuts significant time off every build.</span></p></li><li><p><strong><span>Docker layer caching</span></strong><span>: Reuses unchanged image layers. If the base image and dependency steps haven&#8217;t changed, the build skips straight to copying the new source. The key is to order your Dockerfile from least to most frequently changed.</span></p></li></ul><p><span>The build stage ends when a versioned, immutable artifact exists and is ready to be tested&#8230;</span></p><h3><span>3. Test Stage</span></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!LqTY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72dbd627-da33-4140-a631-6c6fa24eca32_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!LqTY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72dbd627-da33-4140-a631-6c6fa24eca32_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!LqTY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72dbd627-da33-4140-a631-6c6fa24eca32_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!LqTY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72dbd627-da33-4140-a631-6c6fa24eca32_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!LqTY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72dbd627-da33-4140-a631-6c6fa24eca32_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!LqTY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72dbd627-da33-4140-a631-6c6fa24eca32_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/72dbd627-da33-4140-a631-6c6fa24eca32_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_!LqTY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72dbd627-da33-4140-a631-6c6fa24eca32_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!LqTY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72dbd627-da33-4140-a631-6c6fa24eca32_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!LqTY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72dbd627-da33-4140-a631-6c6fa24eca32_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!LqTY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F72dbd627-da33-4140-a631-6c6fa24eca32_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 test stage validates whether the artifact actually works.</span></p><p><span>Automated tests run against it to catch problems before they reach users. The goal is not to run every possible test. But to run the right tests in the right order so obvious problems fail fast, and expensive checks come later.</span></p><p><span>The test pyramid describes how to think about this:</span></p><ul><li><p><strong><span>Unit tests</span></strong><span> sit at the base. They are fast, isolated, and numerous. A suite of a thousand unit tests can be completed in a minute or less. They catch logic errors at the function level and should make up the majority of your test coverage.</span></p></li><li><p><strong><span>Integration tests</span></strong><span> sit in the middle. They test how components interact with each other, with services, and with databases. Slower and more expensive to maintain, but they catch problems undetected by unit tests.</span></p></li><li><p><strong><span>End-to-end tests</span></strong><span> sit at the top. They simulate real user behavior through the full system. Use them sparingly, focused only on the most critical paths.</span></p></li></ul><p><span>Fast feedback is not optional&#8230;</span></p><p><span>A pipeline taking 45 minutes to report a failure is the one developers stop trusting. They push &amp; move on. By the time it reports back, they have lost the context to fix it. Most teams target a feedback window of 10 minutes or less for the core suite.</span></p><p><span>Here are two techniques to keep test time manageable as the codebase grows:</span></p><ul><li><p><strong><span>Parallel jobs</span></strong><span>: Splits the suite across different runners executing at the same time. Instead of 500 tests running sequentially on one machine, 100 tests run on five machines simultaneously.</span></p></li><li><p><strong><span>Test sharding</span></strong><span>: Partitions the suite so each runner covers a different subset. Combined with parallel runners, this scales well even for large codebases.</span></p></li></ul><p><span>Test failures are intentional gates.</span></p><p><span>They exist to stop bad changes. A pipeline not failing doesn&#8217;t mean it&#8217;s a healthy pipeline. It just means it is not catching anything&#8230;</span></p><h3><span>4. Release Stage</span></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QPZE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feec698a3-6ae6-4574-8907-d8bbf394fd31_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QPZE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feec698a3-6ae6-4574-8907-d8bbf394fd31_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!QPZE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feec698a3-6ae6-4574-8907-d8bbf394fd31_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!QPZE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feec698a3-6ae6-4574-8907-d8bbf394fd31_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!QPZE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feec698a3-6ae6-4574-8907-d8bbf394fd31_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QPZE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feec698a3-6ae6-4574-8907-d8bbf394fd31_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/eec698a3-6ae6-4574-8907-d8bbf394fd31_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_!QPZE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feec698a3-6ae6-4574-8907-d8bbf394fd31_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!QPZE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feec698a3-6ae6-4574-8907-d8bbf394fd31_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!QPZE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feec698a3-6ae6-4574-8907-d8bbf394fd31_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!QPZE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feec698a3-6ae6-4574-8907-d8bbf394fd31_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>Once the artifact is tested, it needs to be stored and versioned before it can be deployed anywhere&#8230; The artifact is pushed to a registry. </span></p><p><span>Here are some popular </span>registries:</p><ul><li><p><span>Docker Hub</span></p></li><li><p><span>Amazon Elastic Container Registry (</span><strong><span>ECR</span></strong><span>)</span></p></li><li><p><span>Google Artifact Registry</span></p></li><li><p><span>JFrog Artifactory</span></p></li></ul><p><span>The registry is the central store from which every environment pulls.</span></p><p><span>Without it, there is no consistent source of truth for what gets deployed&#8230;</span></p><p><span>Here are two versioning practices that matter here:</span></p><ul><li><p><strong><span>Semantic versioning</span></strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a><span>. Major, minor, and patch numbers give each artifact a meaningful identifier. Teams can see at a glance what kind of change they are deploying.</span></p></li><li><p><strong><span>Immutable tags</span></strong><span>. A given tag should always point to the same artifact. Never use the latest in production pipelines. latest is a mutable pointer. It moves every time you push. A deployment pinned to latest six months ago would pull a completely different image today. Pin to a specific version tag, or a content digest</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-7" href="#footnote-7" target="_self">7</a><span>.</span></p></li></ul><p><span>At the end of this stage, the artifact is deployment-ready&#8230; versioned, stored, verified. </span></p><p><span>But it has not reached any environment yet&#8230;</span></p><h3><span>5. Deploy Stage</span></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!C_5H!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cb9f4de-b41d-4e37-9427-70acbdc8e7f8_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!C_5H!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cb9f4de-b41d-4e37-9427-70acbdc8e7f8_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!C_5H!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cb9f4de-b41d-4e37-9427-70acbdc8e7f8_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!C_5H!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cb9f4de-b41d-4e37-9427-70acbdc8e7f8_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!C_5H!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cb9f4de-b41d-4e37-9427-70acbdc8e7f8_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!C_5H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cb9f4de-b41d-4e37-9427-70acbdc8e7f8_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7cb9f4de-b41d-4e37-9427-70acbdc8e7f8_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_!C_5H!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cb9f4de-b41d-4e37-9427-70acbdc8e7f8_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!C_5H!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cb9f4de-b41d-4e37-9427-70acbdc8e7f8_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!C_5H!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cb9f4de-b41d-4e37-9427-70acbdc8e7f8_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!C_5H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7cb9f4de-b41d-4e37-9427-70acbdc8e7f8_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 deploy stage takes the verified artifact &amp; makes it available to users.</span></p><p><span>By this point, the artifact has already been built, tested &amp; stored in a registry. The deploy stage takes that artifact and releases it into a target environment.</span></p><p><span>This stage often includes approval gates, deployment policies, and infrastructure-specific tasks. Some teams deploy automatically&#8230;others require manual approval before production changes can proceed.</span></p><p><span>Deployments can also involve additional work beyond simply starting a new application version:</span></p><ul><li><p><span>Database migrations</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-8" href="#footnote-8" target="_self">8</a><span> would need to run first.</span></p></li><li><p><span>Configuration changes </span>would<span> need to be applied.</span></p></li><li><p><span>Infrastructure resources </span>would<span> need to be updated.</span></p></li></ul><p><span>The deploy stage is where the pipeline stops validating the artifact &amp; starts delivering it.</span></p><h3><span>Pipeline Runners</span></h3><p><span>The pipeline defines the work, and runners execute it.</span></p><p><span>A </span><em><span>runner</span></em><span> is the compute environment where pipeline jobs run. GitHub Actions runners, GitLab runners, and Jenkins agents all serve this role. When a stage is triggered, the platform schedules its jobs onto available runners. Each job runs in an isolated environment, completes its steps, and reports the result back.</span></p><p><span>Runners come in two forms:</span></p><ul><li><p><strong><span>Platform-managed runners</span></strong><span>: These get provisioned by the CI/CD provider. You define the job, and the platform handles the infrastructure. Less control over the environment, but no infrastructure to maintain.</span></p></li><li><p><strong><span>Self-hosted runners</span></strong><span>: They run on your own machines. Teams use them when they need specific hardware, internal network access, and/or more control over the build environment. The tradeoff is you have to own the maintenance &amp; scaling.</span></p></li></ul><p><span>Every build, every test run, and every deployment runs on a runner somewhere.</span></p><p><span>Slow/overloaded runners are a common cause of slow pipelines, even when the rest of the system works as expected.</span></p><p><span>Each stage serves a purpose. Together, they turn a code change into a tested, versioned, and deployable release.</span></p><p><span>But a pipeline is more than a collection of stages. Teams also need a reliable way to define how those stages work &amp; evolve over time&#8230;</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>(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><span>Pipeline as Code</span></h2>
      <p>
          <a href="https://newsletter.systemdesign.one/p/how-does-a-ci-cd-pipeline-work">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Fine Tuning: A Deep Dive]]></title><description><![CDATA[#171: The Fine-Tuning Guide That Will Change How You Build With LLMs]]></description><link>https://newsletter.systemdesign.one/p/llm-fine-tuning-guide-with-lora-and-qlora</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/llm-fine-tuning-guide-with-lora-and-qlora</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Mon, 24 Aug 2026 16:23:10 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/20656540-12f5-4256-8425-a56889a2a723_1280x720.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p style="text-align: center;"></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/llm-fine-tuning-guide-with-lora-and-qlora/?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>You&#8217;ve rewritten the prompt five times, but the AI model still </span><em><span>ignores</span></em><span> your format&#8230;</span></p><p><span>It returns clean JSON on one request but &#8220;broken&#8221; JSON on the next. The tone you asked for doesn&#8217;t last either&#8230; No matter how you write the instructions, the model won&#8217;t follow them "reliably&#8221;.</span></p><p><em><span>So how do you make the behavior stick?</span></em></p><p><span>Getting there takes a series of judgment calls, each one yours to make&#8230;</span></p><p><span>Onward.</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><div class="callout-block" data-callout="true"><h3><a href="https://getunblocked.com/events/how-to-stop-babysitting-your-agents/?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary">[Webinar] How to stop babysitting your agents (Partner)</a></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://getunblocked.com/events/how-to-stop-babysitting-your-agents/?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_!6-MH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3f24c4-3b04-4fed-a672-96dc40e8b12b_1600x900.png 424w, https://substackcdn.com/image/fetch/$s_!6-MH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3f24c4-3b04-4fed-a672-96dc40e8b12b_1600x900.png 848w, https://substackcdn.com/image/fetch/$s_!6-MH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3f24c4-3b04-4fed-a672-96dc40e8b12b_1600x900.png 1272w, https://substackcdn.com/image/fetch/$s_!6-MH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3f24c4-3b04-4fed-a672-96dc40e8b12b_1600x900.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6-MH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3f24c4-3b04-4fed-a672-96dc40e8b12b_1600x900.png" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9c3f24c4-3b04-4fed-a672-96dc40e8b12b_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;:272266,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:&quot;https://getunblocked.com/events/how-to-stop-babysitting-your-agents/?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/209258689?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3f24c4-3b04-4fed-a672-96dc40e8b12b_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_!6-MH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3f24c4-3b04-4fed-a672-96dc40e8b12b_1600x900.png 424w, https://substackcdn.com/image/fetch/$s_!6-MH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3f24c4-3b04-4fed-a672-96dc40e8b12b_1600x900.png 848w, https://substackcdn.com/image/fetch/$s_!6-MH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3f24c4-3b04-4fed-a672-96dc40e8b12b_1600x900.png 1272w, https://substackcdn.com/image/fetch/$s_!6-MH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3f24c4-3b04-4fed-a672-96dc40e8b12b_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Agents can generate code. Getting it right for your system, team conventions, and past decisions is the hard part. You end up wasting time and tokens in correction loops.</p><p>More MCPs give agents access to information, but not understanding. The teams pulling ahead use a context layer to give agents exactly what they need.</p><p><a href="https://getunblocked.com/events/how-to-stop-babysitting-your-agents/?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary">Join live on Sep 2 (FREE)</a> to see:</p><ul><li><p>Where teams get stuck on the AI maturity curve</p></li><li><p>How a context layer solves for quality, efficiency, and cost</p></li><li><p>Live demo: the same coding task with and without a context layer</p></li></ul><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://getunblocked.com/events/how-to-stop-babysitting-your-agents/?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://getunblocked.com/events/how-to-stop-babysitting-your-agents/?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary"><span>Register Now</span></a></p><p><em>(Thanks to <a href="https://getunblocked.com/events/how-to-stop-babysitting-your-agents/?utm_source=systemdesign&amp;utm_medium=email&amp;utm_campaign=primary">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://www.linkedin.com/in/dimplesharma21">Dimple Sharma</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://www.linkedin.com/in/dimplesharma21" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WTzx!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd524d526-2fc8-490f-a226-b9a3d7e02203_991x495.png 424w, https://substackcdn.com/image/fetch/$s_!WTzx!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd524d526-2fc8-490f-a226-b9a3d7e02203_991x495.png 848w, https://substackcdn.com/image/fetch/$s_!WTzx!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd524d526-2fc8-490f-a226-b9a3d7e02203_991x495.png 1272w, https://substackcdn.com/image/fetch/$s_!WTzx!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd524d526-2fc8-490f-a226-b9a3d7e02203_991x495.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WTzx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd524d526-2fc8-490f-a226-b9a3d7e02203_991x495.png" width="991" height="495" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d524d526-2fc8-490f-a226-b9a3d7e02203_991x495.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:495,&quot;width&quot;:991,&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/dimplesharma21&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_!WTzx!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd524d526-2fc8-490f-a226-b9a3d7e02203_991x495.png 424w, https://substackcdn.com/image/fetch/$s_!WTzx!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd524d526-2fc8-490f-a226-b9a3d7e02203_991x495.png 848w, https://substackcdn.com/image/fetch/$s_!WTzx!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd524d526-2fc8-490f-a226-b9a3d7e02203_991x495.png 1272w, https://substackcdn.com/image/fetch/$s_!WTzx!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd524d526-2fc8-490f-a226-b9a3d7e02203_991x495.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Dimple is an AI engineer. Previously, she worked as a software engineer at Microsoft &amp; Samsung.</p><p>At Microsoft, she built security infrastructure for SharePoint Online, serving millions of users. At Samsung, she developed a reinforcement-learning system for real-time video streaming, shipped in Samsung HD Displays.</p><p>She also holds two patents &amp; a published research paper.</p><p>Today she builds applied AI systems and writes about how they work. She has a knack for taking a complex topic apart until it clicks into a clear mental model, with the precision of an engineer who has built production systems at scale.</p><p>You can follow her on:</p><ul><li><p><a href="https://www.linkedin.com/in/dimplesharma21">LinkedIn</a></p></li><li><p><a href="https://substack.com/@dimplesharma21">Substack</a></p></li></ul><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>Fine-tuning is probably not where you should start.</strong> The decision framework for when fine-tuning makes sense, when prompting/RAG is enough, and red flags that tell you to stop before spending money on training.</p></li><li><p><strong>LoRA changed the economics of fine-tuning.</strong> Why updating a tiny fraction of a model&#8217;s parameters can be enough to specialize an LLM, and how QLoRA pushes hardware requirements even lower.</p></li><li><p><strong>SFT, RLHF, DPO, ORPO, KTO, GRPO.</strong> The modern fine-tuning landscape, what these techniques are designed to teach a model, and where each one fits.</p></li><li><p><strong>Fine-tuning now goes far beyond better text responses.</strong> Reasoning, reliable tool use, function calling, and multimodal models can all require specialized training approaches.</p></li><li><p><strong>Getting a better benchmark score can hide a worse model.</strong> Production failure modes that can appear after training, including overfitting, catastrophic forgetting, and safety degradation.</p></li><li><p><strong>The complete path from base model to production.</strong> Model selection, dataset preparation, training, evaluation, deployment, monitoring, and continual fine-tuning, including what to watch at each stage.</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><strong><span>What Fine-Tuning Is</span></strong></h2><p><span>Fine-tuning never starts from scratch&#8230;</span></p><p><span>You take a model that already works &amp; train it a little more on a small, curated dataset of your own examples showing the exact behavior you want. Each example nudges the model&#8217;s weights</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a><span>, the billions of numbers shaping its output. Run enough of them, &amp; the behavior becomes the model&#8217;s new default.</span></p><p><span>It&#8217;s a &#8220;permanent&#8221; physical edit to the model.</span></p><p><span>But it&#8217;s NOT always the best choice&#8230;</span></p><p><span>It&#8217;s expensive in data, compute &amp; maintenance. So don&#8217;t reach for it by reflex when a sharper prompt/retrieval step would have solved your problem for far less.</span></p><p><span>Before you train anything, learn fine-tuning&#8217;s capabilities &amp; limits. Plus learn how it differs from prompting, retrieval &amp; agents&#8230;</span></p><h3><strong><span>What Fine-Tuning Can and Cannot Do</span></strong></h3><p><span>Fine-tuning changes model behavior reliably&#8230;</span></p><p><span>It shapes tone, voice, response style, format compliance (JSON, templates), domain-specific reasoning patterns, response persona, and consistent structured outputs.</span></p><p><span>Consider a support team&#8217;s resolved tickets:</span></p><p><span>Feed the model thousands of (ticket, ideal response) pairs, and it stops sounding like generic internet text. Instead, it starts responding in the team&#8217;s voice, consistently. Escalation paths, tone with a difficult customer, phrasing refined over years--the model learns all of it.</span></p><p><span>The change lives in the weights, NOT in a system prompt.</span></p><p><span>Yet adding new factual knowledge is where it becomes &#8220;unreliable&#8221;&#8230;</span></p><p><span>Forcing new facts through fine-tuning can make the model hallucinate. This is called the </span><em><span>Superficial Alignment Hypothesis</span></em><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a><span>. Pretraining builds knowledge; fine-tuning shapes &#8220;how&#8221; the knowledge comes out by default.</span></p><p><span>When the gap is knowledge instead of behavior, fine-tuning is often NOT the best fix.</span></p><h3><strong><span>Fine-Tuning vs RAG vs Agents</span></strong></h3><p><span>So which tool a problem needs depends on what&#8217;s actually broken&#8230;</span></p><p><span>Imagine your model gives solid answers to some questions but </span><em><span>hallucinates</span></em><span> on others. It follows your format instructions one moment &amp; ignores them the next.</span></p><p><span>So what do you fix: </span><em><span>prompt, data, model, or workflow?</span></em></p><p><span>Think of your LLM as a new hire at your company:</span></p><ul><li><p><strong><span>Prompt engineering</span></strong><span> is how you give instructions: format, tone, constraints. Like writing your new hire a detailed brief before every assignment. It&#8217;s cheap, fast, and often enough. But you can&#8217;t instruct someone to know things they were never taught.</span></p></li><li><p><strong><span>Retrieval-Augmented Generation (RAG)</span></strong><span> is how you supply knowledge. You pull relevant documents from a database &amp; feed them into the prompt, so the model stays &#8220;current&#8221; without retraining. Like handing your hire the company&#8217;s latest documentation before they answer a client.</span></p></li><li><p><strong><span>Agents</span></strong><span> are how you enable action. You give the model access to tools, APIs, and external systems, and then let it decide how to complete a goal. Like giving your hire access to the company&#8217;s CRM, email, and databases, then trusting them to pick the right tool.</span></p></li><li><p><strong><span>Fine-tuning</span></strong><span> is how you teach behavior. You train the model on curated examples of what you want it to do, and the change lasts. Like sending your hire through a specialized training program--they come back with a skill baked into how they work.</span></p></li></ul><p><span>Now notice what actually changed in each case&#8230;</span></p><p><span>Prompt engineering, RAG, and agents work &#8220;</span><em><span>around</span></em><span>&#8221; the model: they shape what goes in/what the model can access, but the model itself stays identical. Not a single weight moves.</span></p><p><span>While fine-tuning &#8220;works&#8221; </span><em><span>on</span></em><span> the model.</span></p><p><span>i.e., the model comes out different from what went in.</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_!F2Uz!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96c518d4-c928-4abc-bdd0-230d317b3e48_2048x1143.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!F2Uz!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96c518d4-c928-4abc-bdd0-230d317b3e48_2048x1143.png 424w, https://substackcdn.com/image/fetch/$s_!F2Uz!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96c518d4-c928-4abc-bdd0-230d317b3e48_2048x1143.png 848w, https://substackcdn.com/image/fetch/$s_!F2Uz!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96c518d4-c928-4abc-bdd0-230d317b3e48_2048x1143.png 1272w, https://substackcdn.com/image/fetch/$s_!F2Uz!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96c518d4-c928-4abc-bdd0-230d317b3e48_2048x1143.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!F2Uz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96c518d4-c928-4abc-bdd0-230d317b3e48_2048x1143.png" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/96c518d4-c928-4abc-bdd0-230d317b3e48_2048x1143.png&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;: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_!F2Uz!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96c518d4-c928-4abc-bdd0-230d317b3e48_2048x1143.png 424w, https://substackcdn.com/image/fetch/$s_!F2Uz!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96c518d4-c928-4abc-bdd0-230d317b3e48_2048x1143.png 848w, https://substackcdn.com/image/fetch/$s_!F2Uz!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96c518d4-c928-4abc-bdd0-230d317b3e48_2048x1143.png 1272w, https://substackcdn.com/image/fetch/$s_!F2Uz!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F96c518d4-c928-4abc-bdd0-230d317b3e48_2048x1143.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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><span>Prompt engineering costs tokens.</span></p></li><li><p><span>RAG adds retrieval infrastructure: a vector database, an embedding model, a pipeline.</span></p></li><li><p><span>Agents multiply LLM calls per task and add orchestration overhead.</span></p></li><li><p><span>Fine-tuning demands GPU compute, curated data, and iteration cycles.</span></p></li></ul><p><span>Start with the cheapest option; in production, these often combine&#8230;</span></p><p><span>So should you fine-tune?</span></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/llm-fine-tuning-guide-with-lora-and-qlora?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/llm-fine-tuning-guide-with-lora-and-qlora?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><strong><span>When (and When Not) to Fine-Tune</span></strong></h2><p><span>Whether to fine-tune comes down to a few clear signals--some say stop, some say go:</span></p><h3><strong><span>Red Flags</span></strong></h3><ul><li><p><strong><span>Prompting still works.</span></strong><span> Try using a detailed system prompt, few-shot examples</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a><span>, and clear format instructions first. Only then think about fine-tuning.</span></p></li><li><p><strong><span>Your data changes frequently.</span></strong><span> Fine-tuning bakes a snapshot into weights. Live data goes stale at deployment; this is what RAG is for.</span></p></li><li><p><strong><span>You don&#8217;t have enough quality data.</span></strong><span> Quality &amp; representativeness of training data matter more than volume. If your examples don&#8217;t cover edge cases, the count doesn&#8217;t save you.</span></p></li><li><p><strong><span>Your requirements keep changing.</span></strong><span> Fine-tuning cycles take days to weeks. If requirements are still shifting, the spec will have changed by the time your training run finishes.</span></p></li><li><p><strong><span>You need instant rollback.</span></strong><span> Fine-tuning encodes behavior. If something goes wrong, there&#8217;s no quick patch; fixing it means retraining and redeploying.</span></p></li></ul><h3><strong><span>Green Flags</span></strong></h3><ul><li><p><strong><span>Your structured output keeps breaking.</span></strong><span> The model handles familiar inputs but breaks on &#8220;edge cases&#8221; even with explicit formatting instructions. Fine-tuning bakes the format into behavior.</span></p></li><li><p><strong><span>You need a specific voice/persona.</span></strong><span> Prompting cannot reliably hold a distinctive tone at scale. Fine-tuning makes it the model&#8217;s default, not a request.</span></p></li><li><p><strong><span>Your inference costs are unsustainable.</span></strong><span> Fine-tuning a smaller open-source model on your specific task can match the same performance at a fraction of the cost. You pay for generality only when you need it.</span></p></li><li><p><strong><span>You have a well-defined, narrow task.</span></strong><span> When the problem is bounded (classification, extraction, structured generation</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a><span>), a fine-tuned small model consistently outperforms a large general one. The narrower the task, the bigger the advantage.</span></p></li><li><p><strong><span>Your data can&#8217;t leave your infrastructure.</span></strong><span> GDPR, HIPAA</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a><span>, and/or internal policy blocks you from sending training data to a third-party API. Self-hosted open-source fine-tuning keeps everything on-premises.</span></p></li></ul><h3><strong><span>What Fine-Tuning Costs</span></strong></h3><p><span>If the </span><em><span>green</span></em><span> flags fit, one question remains before you commit: </span><em><span>what are you taking on?</span></em></p><p><span>Fine-tuning costs money to build &amp; saves money to run.</span></p><p><span>The build cost is higher than it looks; per-call savings are larger than the GPU bill alone suggests.</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_!o9Kt!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07e7a668-b971-48c6-a13e-784338667bd8_2048x1143.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!o9Kt!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07e7a668-b971-48c6-a13e-784338667bd8_2048x1143.png 424w, https://substackcdn.com/image/fetch/$s_!o9Kt!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07e7a668-b971-48c6-a13e-784338667bd8_2048x1143.png 848w, https://substackcdn.com/image/fetch/$s_!o9Kt!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07e7a668-b971-48c6-a13e-784338667bd8_2048x1143.png 1272w, https://substackcdn.com/image/fetch/$s_!o9Kt!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07e7a668-b971-48c6-a13e-784338667bd8_2048x1143.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!o9Kt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07e7a668-b971-48c6-a13e-784338667bd8_2048x1143.png" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/07e7a668-b971-48c6-a13e-784338667bd8_2048x1143.png&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;: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_!o9Kt!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07e7a668-b971-48c6-a13e-784338667bd8_2048x1143.png 424w, https://substackcdn.com/image/fetch/$s_!o9Kt!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07e7a668-b971-48c6-a13e-784338667bd8_2048x1143.png 848w, https://substackcdn.com/image/fetch/$s_!o9Kt!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07e7a668-b971-48c6-a13e-784338667bd8_2048x1143.png 1272w, https://substackcdn.com/image/fetch/$s_!o9Kt!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F07e7a668-b971-48c6-a13e-784338667bd8_2048x1143.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 investment pays off in three cases:</span></p><ul><li><p><span>You have high &amp; steady inference volume.</span></p></li><li><p>You&#8217;re replacing a costly frontier model API.</p></li><li><p><span>Your data must stay within your infrastructure.</span></p></li></ul><p><span>Task fine-tuning carries one more cost not shown above: </span><em><span>it can &#8220;erase&#8221; the model&#8217;s built-in safety behaviors</span></em><span>. So budget for safety evaluation as part of every training cycle.</span></p><p><span>First, the groundwork&#8230;</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><strong><span>Foundations You Need First</span></strong></h2><p><span>So you&#8217;ve decided to fine-tune&#8230; but first you need to know where fine-tuning fits in a model&#8217;s lifecycle &amp; which kind of model you start from.</span></p><h3><strong><span>From pretraining to fine-tuning</span></strong></h3><p><span>When you fine-tune a model, you&#8217;re changing one thing: </span><em><span>numbers inside</span></em><span>.</span></p><p><span>Those numbers are parameters: weights packed into every layer. Your text enters as tokens; attention connects them across context. Each layer transforms the representation using those weights. Fine-tuning updates them on your data</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a><span>.</span></p><p><span>Everything else stays fixed&#8230;</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_!fCTU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9448eac5-214a-4984-865b-ed1f8152e8ef_2048x1143.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fCTU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9448eac5-214a-4984-865b-ed1f8152e8ef_2048x1143.png 424w, https://substackcdn.com/image/fetch/$s_!fCTU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9448eac5-214a-4984-865b-ed1f8152e8ef_2048x1143.png 848w, https://substackcdn.com/image/fetch/$s_!fCTU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9448eac5-214a-4984-865b-ed1f8152e8ef_2048x1143.png 1272w, https://substackcdn.com/image/fetch/$s_!fCTU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9448eac5-214a-4984-865b-ed1f8152e8ef_2048x1143.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fCTU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9448eac5-214a-4984-865b-ed1f8152e8ef_2048x1143.png" width="1456" height="813" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9448eac5-214a-4984-865b-ed1f8152e8ef_2048x1143.png&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;: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_!fCTU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9448eac5-214a-4984-865b-ed1f8152e8ef_2048x1143.png 424w, https://substackcdn.com/image/fetch/$s_!fCTU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9448eac5-214a-4984-865b-ed1f8152e8ef_2048x1143.png 848w, https://substackcdn.com/image/fetch/$s_!fCTU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9448eac5-214a-4984-865b-ed1f8152e8ef_2048x1143.png 1272w, https://substackcdn.com/image/fetch/$s_!fCTU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9448eac5-214a-4984-865b-ed1f8152e8ef_2048x1143.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>Think of it as three stages of education:</span></p><ul><li><p><span>Pre-training is twelve years of general schooling: trillions of tokens, language, reasoning.</span></p></li><li><p><span>Continued Pre-Training (</span><strong><span>CPT</span></strong><span>) is a specialty degree: more training on a domain corpus when the base model needs it.</span></p></li><li><p><span>Fine-tuning is an apprenticeship: a curated dataset teaching the model exactly how to behave in your context.</span></p></li></ul><p><span>Each stage builds on the previous one.</span></p><p><span>Here&#8217;s how to think about CPT &amp; fine-tuning:</span></p><ul><li><p><span>CPT is for knowing your domain: raw text at scale, absorbed into the weights.</span></p></li><li><p><span>Fine-tuning is for acting in your domain: labeled examples teaching specific task behavior, format &amp; style.</span></p></li></ul><p><span>CPT demands far more data &amp; compute; fine-tuning is cheaper &amp; faster.</span></p><p><span>Strong domain systems often sequence both.</span></p><h3><strong><span>Base Models vs Chat Models</span></strong></h3><p><span>Before you fine-tune, pick the right starting point&#8230;</span></p><ul><li><p><strong><span>Base model</span></strong><span> is a raw next-token predictor: it has read everything but held no job. Ask it a question, and it would continue writing the question.</span></p></li></ul><ul><li><p><strong><span>Chat model (aka instruct)</span></strong><span> is a base plus supervised fine-tuning (</span><strong><span>SFT</span></strong><span>) and alignment. It knows how to respond, follow instructions &amp; converse.</span></p></li></ul><p><span>So start from </span><em><span>base</span></em><span> for full control; and start from </span><em><span>chat</span></em><span> to preserve instruction-following &amp; specialize on top.</span></p><p><span>Chat models carry one piece of hidden structure: </span><em><span>a chat template</span></em><span>.</span></p><p><span>These models are built around a specific conversation format: control tokens marking the system, user, and assistant roles. The format varies by model family: Llama 3, Mistral, and Gemma each use different tokens.</span></p><p><span>Use the wrong template &amp; the model loses track of who&#8217;s speaking&#8230;and responses degrade without warning</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-7" href="#footnote-7" target="_self">7</a><span>.</span></p><p><span>So how&#8217;s it actually done?&#8230;</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 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/business</p></li><li><p><strong>Proven systems behind ChatGPT, Perplexity &amp; 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>
      <p>
          <a href="https://newsletter.systemdesign.one/p/llm-fine-tuning-guide-with-lora-and-qlora">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[How to Build AI Agents That Don’t Start Over When They Fail]]></title><description><![CDATA[#170: The Infrastructure AI Agents Actually Need]]></description><link>https://newsletter.systemdesign.one/p/durable-ai-agents</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/durable-ai-agents</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Thu, 20 Aug 2026 17:26:04 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/86a1aa75-49dc-4f2f-8b37-f99daa770e14_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/durable-ai-agents/?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>You know that feeling when a job runs for ten minutes, gets closer to the end, and then fails?</span></p><p><span>You check the logs &amp; one API timed out!</span></p><p><span>So you run it again&#8230;</span></p><p><span>And now you wait another ten minutes for the &#8220;same work&#8221; to start all over again.</span></p><p><span>This is annoying enough for a tiny background job. But imagine the job was a &#8220;long-running&#8221; AI agent workflow</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a><span>. It searched through dozens of documents, called an LLM several times, extracted the necessary information, and prepared most of the final answer.</span></p><p><span>And then all the work is </span><em><span>gone</span></em><span> because one step failed near the end.</span></p><p><span>It could get worse&#8230;</span></p><p><em><span>What if the agent had already sent an email before it failed? Or updated a database?</span></em><span> Running the whole workflow again could &#8220;repeat&#8221; those actions as well.</span></p><p><span>Plus, an AI agent could call a model, search a database, call an external API, wait for someone to approve something, and then continue later. The longer the workflow gets,,, the more </span><em><span>painful</span></em><span> it becomes to start over whenever something goes wrong.</span></p><p><span>So workflow needs to &#8220;remember&#8221; what has already happened&#8230;</span></p><p><span>If the first five steps succeeded, but the sixth failed, then you want to pick up from step six. (i.e., you don&#8217;t want to run the first five steps again!)</span></p><p><span>This is the problem </span><em><span>durable execution</span></em><span> is designed to solve&#8230;</span></p><p><span>It tracks progress as the workflow runs, so a failure does NOT have to erase everything before it.</span></p><p><em><span>But how does it actually work? What happens when a workflow needs to retry a failed step, wait for a person, or recover after the process running it disappears?</span></em></p><p>I&#8217;ll use <strong><a href="https://inngest.link/jtH41MP">Inngest</a></strong> as the case study for this newsletter.</p><p>(It&#8217;s a durable execution platform for background functions, workflows, and AI agents.)</p><p><span>Onward.</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>What Is an AI Agent</span></h2><p><span>You already know what an AI chatbot looks like&#8230;</span></p><p><span>You probably use it every day to ask questions, write something, summarize a document, and/or help you solve a problem. In a typical interaction, you ask for something &amp; the model gives you an answer. Period.</span></p><p><span>An AI agent takes this idea one step further&#8230;</span></p><p><span>Instead of stopping after one response, it keeps working toward a goal, deciding what it needs to do next as the work unfolds. Give a research agent a topic, and it can work through the research before coming back with the final answer.</span></p><p><span>The catch is this work does NOT always finish in </span><em><span>one</span></em><span> simple request.</span></p><p><span>It can take several steps, involve external systems, wait for something to happen, and/or fail midway. And once an AI agent starts working like a real workflow, simply retrying the request is NOT enough.</span></p><p><span>So let&#8217;s see what happens when these workflows have to deal with &#8220;real&#8221; failures &amp; how to make them reliable&#8230;</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>Why AI Agents Need Durable Execution</span></h2><p><span>A simple &amp; self-contained background job is &#8220;easy&#8221; to retry from the start.</span></p><p><span>Yet a single agent run chains together LLM calls, tool calls, database reads, and external API requests. And any of those can fail on its own.</span></p><p><span>Let&#8217;s look at what actually makes &#8220;agents&#8221; different&#8230;</span></p><h3><span>What Makes Agent Workflows Different</span></h3><p><span>Here&#8217;s what:</span></p><h4><span>1. Individual steps are slow and expensive</span></h4><p><span>A single LLM call can take several seconds &amp; cost real money.</span></p><p><span>Repeating five completed steps to get back to the one that failed is never a rounding error. Instead, wasted time &amp; tokens on work already done.</span></p><h4><span>2. Outputs are not deterministic</span></h4><p><span>LLM outputs can vary between executions.</span></p><p><span>Rerunning a completed step does not &#8220;guarantee&#8221; the same result, so restarting from the beginning can change the workflow&#8217;s outcome.</span></p><h4><span>3. Some steps create real side effects</span></h4><p><span>If the agent already sent an email, updated a record, and/or charged a card before the failure, restarting the workflow will repeat those actions&#8230;</span></p><p><span>A duplicate charge is NOT a retry problem, but a </span><em><span>correctness</span></em><span> problem.</span></p><h4><span>4. Some steps wait on people</span></h4><p><span>A workflow pausing for editor approval would stay paused for hours/days.</span></p><p><span>And holding a worker process open the entire time does not &#8220;scale&#8221;. A basic job queue is NOT designed to track where a multi-step workflow was waiting &amp; resume it later.</span></p><h3><span>When an Agent Fails Mid-Workflow</span></h3><p>Think of a research agent:</p><p>It retrieves sources, extracts evidence, generates a draft, waits for editor approval, &amp; publishes the result.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!70A4!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F185f3feb-cf07-4131-9beb-8c287aba46d5_1774x887.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!70A4!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F185f3feb-cf07-4131-9beb-8c287aba46d5_1774x887.png 424w, https://substackcdn.com/image/fetch/$s_!70A4!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F185f3feb-cf07-4131-9beb-8c287aba46d5_1774x887.png 848w, https://substackcdn.com/image/fetch/$s_!70A4!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F185f3feb-cf07-4131-9beb-8c287aba46d5_1774x887.png 1272w, https://substackcdn.com/image/fetch/$s_!70A4!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F185f3feb-cf07-4131-9beb-8c287aba46d5_1774x887.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!70A4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F185f3feb-cf07-4131-9beb-8c287aba46d5_1774x887.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/185f3feb-cf07-4131-9beb-8c287aba46d5_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_!70A4!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F185f3feb-cf07-4131-9beb-8c287aba46d5_1774x887.png 424w, https://substackcdn.com/image/fetch/$s_!70A4!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F185f3feb-cf07-4131-9beb-8c287aba46d5_1774x887.png 848w, https://substackcdn.com/image/fetch/$s_!70A4!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F185f3feb-cf07-4131-9beb-8c287aba46d5_1774x887.png 1272w, https://substackcdn.com/image/fetch/$s_!70A4!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F185f3feb-cf07-4131-9beb-8c287aba46d5_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>Say the model provider </span><em><span>times out</span></em><span> during the drafting step:</span></p><p><span>Retrieval &amp; extraction already finished. In a system with NO memory of progress, the entire workflow must restart. And the completed steps have to </span><em><span>rerun</span></em><span> for no reason.</span></p><p><span>So if any &#8220;side effects&#8221; fired before the failure, those repeat too&#8230;</span></p><p><span>Reliability is not just a property of the model/agent framework. It also depends on the </span><em><span>execution layer</span></em><span> running underneath them.</span></p><p><span>Now we understand what makes agent workflows different; let&#8217;s look at where the traditional queue &amp; worker model starts to fall short&#8230;</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><div class="callout-block" data-callout="true"><p>I&#8217;m happy to partner with <strong><a href="https://inngest.link/jtH41MP">Inngest</a></strong> on this newsletter.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://inngest.link/jtH41MP" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!i9Kg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 424w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 848w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 1272w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!i9Kg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png" width="1200" height="675" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:675,&quot;width&quot;:1200,&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://inngest.link/jtH41MP&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_!i9Kg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 424w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 848w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 1272w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Agents, like all of us, often need to recover from failure. But they shouldn&#8217;t start from scratch.</p><p>Inngest&#8217;s durable execution checkpoints your agents every step of the way.</p><p>So your agents can pick up where they left off and avoid doubling up on token &amp; compute spend.</p><p><a href="https://inngest.link/jtH41MP">Inngest</a> offers a generous free tier and a sleek local dev server for testing.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://inngest.link/jtH41MP&quot;,&quot;text&quot;:&quot;Build durably with Inngest&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://inngest.link/jtH41MP"><span>Build durably with Inngest</span></a></p></div><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>Why Traditional Job Queues Are NOT Enough</span></h2><p>The basic idea is simple:</p><p>An event creates a job, the job enters a queue, and a worker processes it. If something goes wrong, the job gets retried&#8230;</p><p>For simple, self-contained work, such as sending an email/resizing an image, retrying the entire job from the beginning is reasonable.</p><p>Yet the problem becomes DIFFICULT when the job represents a long-running workflow. Instead of one piece of work, you now have several steps, each depending on results from earlier steps.</p><p>AI agent workflows &#8220;amplify&#8221; this problem<a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a> because a single run could involve many LLM calls, tool calls, external APIs, intermediate results &amp; side effects&#8230;</p><h3><span>Queue vs Workflow</span></h3><p><span>This is where the difference between a queue &amp; a workflow matters:</span></p><ul><li><p><span>A queue mainly focuses on getting work to a worker &amp; making sure </span><em><span>failed</span></em><span> work gets another chance.</span></p></li><li><p><span>A workflow needs to remember what happened along the way, including which steps finished, which ones failed, and what needs to happen next.</span></p></li></ul><p><span>BullMQ, Celery &amp; SQS</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a><span> give you useful building blocks for queues.</span></p><p><span>You get workers, retries, rate limiting, job dependencies, and parent-child flows. But once you need checkpointing, resumability, human-in-the-loop coordination, and/or a complete history of every step, you&#8217;ve more work to do&#8230;</span></p><p><span>You can build those pieces yourself,,, but now the queue is no longer the whole solution. You&#8217;re starting to build a </span><em><span>workflow</span></em><span> </span><em><span>system</span></em><span> around it&#8230;</span></p><p><span>So what does it take to make these workflows recover properly?</span></p><p><span>Let&#8217;s take a look&#8230;</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/durable-ai-agents?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/durable-ai-agents?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/durable-ai-agents?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>What Durable Execution Actually Means</span></h2><p><em><span>Durable execution</span></em><span> is a simple idea with a ton of work happening underneath it&#8230;</span></p><p><span>The system remembers what has already been completed. So when something fails, execution can resume from the </span><em><span>last</span></em><span> </span><em><span>successful step</span></em><span> instead of starting from zero.</span></p><p><span>Let&#8217;s dive in!</span></p><h3><span>Checkpointing</span></h3><p><span>A checkpoint records a &#8220;completed&#8221; unit of work.</span></p><p><span>When a step finishes successfully, it saves the result. If the process crashes, restarts, or a deployment occurs mid-workflow, the result is still available when execution continues&#8230;</span></p><p><span>The workflow can then reuse the completed result instead of running the same step again.</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_!8rix!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4067e0d6-59a0-4421-ae89-f76c53641dd4_1895x830.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8rix!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4067e0d6-59a0-4421-ae89-f76c53641dd4_1895x830.png 424w, https://substackcdn.com/image/fetch/$s_!8rix!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4067e0d6-59a0-4421-ae89-f76c53641dd4_1895x830.png 848w, https://substackcdn.com/image/fetch/$s_!8rix!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4067e0d6-59a0-4421-ae89-f76c53641dd4_1895x830.png 1272w, https://substackcdn.com/image/fetch/$s_!8rix!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4067e0d6-59a0-4421-ae89-f76c53641dd4_1895x830.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8rix!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4067e0d6-59a0-4421-ae89-f76c53641dd4_1895x830.png" width="1456" height="638" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4067e0d6-59a0-4421-ae89-f76c53641dd4_1895x830.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:638,&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_!8rix!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4067e0d6-59a0-4421-ae89-f76c53641dd4_1895x830.png 424w, https://substackcdn.com/image/fetch/$s_!8rix!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4067e0d6-59a0-4421-ae89-f76c53641dd4_1895x830.png 848w, https://substackcdn.com/image/fetch/$s_!8rix!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4067e0d6-59a0-4421-ae89-f76c53641dd4_1895x830.png 1272w, https://substackcdn.com/image/fetch/$s_!8rix!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4067e0d6-59a0-4421-ae89-f76c53641dd4_1895x830.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>Each step can also be retried independently, so a later failure does NOT undo the work already completed.</span></p><p><span>Inngest memoizes</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-4" href="#footnote-4" target="_self">4</a><span> </span>completed steps <span>in the function&#8217;s stored state and skips on later executions.</span></p><h3><span>Resumability</span></h3><p>You can resume a workflow after an &#8220;interruption&#8221; with checkpointing.</p><p><span>The workflow does not need to stay tied to the same process/machine while it runs. If the process disappears, execution can continue using the progress already saved.</span></p><p><span>This matters even more for long-running tasks&#8230;</span></p><p><span>A workflow could run for hours, pause for an external event, or survive a deployment mid-execution. The workflow keeps its progress even while the process running it changes.</span></p><p><span>i.e., the workflow is the full job; the process is just what runs it.</span></p><h3><span>Why Retries Are NOT Enough</span></h3><p><span>Retries &amp; checkpoints solve different problems&#8230;</span></p><p><span>A </span><em><span>retry</span></em><span> reruns a failed task, while a </span><em><span>checkpoint</span></em><span> remembers completed tasks.</span></p><p>Think of a research agent:</p><p>It already retrieved the documents &amp; extracted useful information. Then <em>times out</em> on the drafting step &#8230;</p><p>With a <em>retry</em>, the whole workflow must run again from the beginning, repeating the retrieval &amp; extraction work.</p><p>With <em>durable execution</em>, those completed steps get saved. And their results can be reused, so only the failed drafting step needs to run again.</p><p><span>For an agent workflow, this can save a lot of time &amp; reduce LLM usage costs. This is the difference between retrying a job &amp; recovering a workflow.</span></p><p><span>Now we understand what durable execution means&#8230;But what does it take to build it yourself?</span></p><p><span>Let&#8217;s keep going!</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>How to Build Durable Execution Yourself</span></h2><p><span>You need a way to track progress &amp; recover from failures.</span></p><p><span>The workflow must handle retries and long waits without causing duplicate actions. Also, it needs traffic controls &amp; history to explain what happened.</span></p><p>Let&#8217;s get into it!</p><h3><span>1. Persisting Workflow State</span></h3><p><span>You need a place to store the &#8220;workflow&#8217;s progress&#8221;.</span></p><p><span>Plus, you need to save the &#8220;result&#8221; outside the process running the workflow </span>when a step finishes<span>. Otherwise, a crash/deployment can take the progress with it.</span></p><p><span>You also need to connect each result to the right workflow &amp; step, so execution knows where to continue later&#8230;</span></p><h3><span>2. Retries and Recovery</span></h3><p><span>Once progress is persisted, the next problem is handling failures&#8230;</span></p><p><span>Some failures are worth retrying, while others are not. So you need retry rules, backoff between attempts, and a defined path once those attempts run out.</span></p><p><span>And when a retry occurs, workflow needs to know which work has already finished.</span></p><h3><span>3. Idempotency</span></h3><p><span>Then there is the problem of doing something </span><em><span>twice</span></em><span>.</span></p><p><span>Imagine an agent sends an email &amp; fails immediately afterward. When the step runs again, the application needs to know whether sending the email again is &#8220;safe&#8221;.</span></p><p><span>Idempotency keys, upserts, existence checks, and deterministic identifiers can help. The exact approach depends on the system, but protecting the side effect is still the application&#8217;s job.</span></p><h3><span>4. Waiting and Scheduling</span></h3><p><span>Long-running workflows should </span>wait <span>somewhere.</span></p><p><span>An agent could finish a draft &amp; sit for days while an editor decides what to do. Keeping a worker alive during the entire wait &#8220;wastes&#8221; resources. Instead, the workflow should save its state &amp; release the compute. It resumes when the event arrives.</span></p><p><span>Also it needs a defined path if the approval never comes, arrives too late, and/or gets rejected.</span></p><h3><span>5. Flow Control</span></h3><p><span>A workflow recovering correctly can cause problems when too much work arrives at once&#8230;</span></p><p><span>A single customer could trigger thousands of agent runs, consuming shared capacity &amp; hitting an LLM provider&#8217;s limits. The resulting failures can then create even more retries.</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_!NMjW!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cbbdd84-786c-4d01-aabe-718f0a5867fe_1774x887.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NMjW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cbbdd84-786c-4d01-aabe-718f0a5867fe_1774x887.png 424w, https://substackcdn.com/image/fetch/$s_!NMjW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cbbdd84-786c-4d01-aabe-718f0a5867fe_1774x887.png 848w, https://substackcdn.com/image/fetch/$s_!NMjW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cbbdd84-786c-4d01-aabe-718f0a5867fe_1774x887.png 1272w, https://substackcdn.com/image/fetch/$s_!NMjW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cbbdd84-786c-4d01-aabe-718f0a5867fe_1774x887.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NMjW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cbbdd84-786c-4d01-aabe-718f0a5867fe_1774x887.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9cbbdd84-786c-4d01-aabe-718f0a5867fe_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_!NMjW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cbbdd84-786c-4d01-aabe-718f0a5867fe_1774x887.png 424w, https://substackcdn.com/image/fetch/$s_!NMjW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cbbdd84-786c-4d01-aabe-718f0a5867fe_1774x887.png 848w, https://substackcdn.com/image/fetch/$s_!NMjW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cbbdd84-786c-4d01-aabe-718f0a5867fe_1774x887.png 1272w, https://substackcdn.com/image/fetch/$s_!NMjW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9cbbdd84-786c-4d01-aabe-718f0a5867fe_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 the necessary controls:</p><ol><li><p><strong><span>Concurrency</span></strong><span>: Controls how much work can run at the &#8220;same time&#8221;, so one workflow/customer cannot consume all available capacity.</span></p></li><li><p><strong><span>Throttling</span></strong><span>: Spreads work over time when a sudden burst would overwhelm downstream services.</span></p></li><li><p><strong><span>Rate limiting</span></strong><span>: Keeps requests within the limits imposed by external providers.</span></p></li><li><p><strong><span>Per-tenant isolation</span></strong><span>: Stops one customer&#8217;s traffic from consuming capacity needed by others.</span></p></li></ol><h3><span>6. Observability</span></h3><p><span>Finally, you need enough history to understand what happened when something goes wrong&#8230;</span></p><p><span>A basic queue can tell you a job failed. A long-running workflow needs more context around the steps, retries, results &amp; failures.</span></p><p><span>Without this history, you have to piece together what happened from queue logs, application logs &amp; tracing tools.</span></p><p><span>Now let&#8217;s see how </span><a href="https://inngest.link/jtH41MP"><span>Inngest</span></a><span> handles all of this&#8230;so you don&#8217;t have to build this yourself&#8230;</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/durable-ai-agents?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/durable-ai-agents?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/durable-ai-agents?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>What Inngest Is</span></h2><p><a href="https://inngest.link/jtH41MP"><span>Inngest</span></a><span> is a </span><em><span>durable execution platform</span></em><span> for background functions, workflows &amp; AI agents.</span></p><p><span>It sits between your application logic &amp; infrastructure running underneath it. Your model handles generation, while your agent code handles tools &amp; workflow logic.</span></p><p><span>And Inngest takes care of the execution around them, including retries, pauses, recovery &amp; observability.</span></p><p><span>Your functions still run on your own compute &amp; can run in environments such as serverless platforms.</span></p><p><span>i.e., Inngest provides the execution layer without requiring you to build all the workflow infrastructure yourself.</span></p><p><span>Ready for the best part?</span></p><h3><span>step.run() as the Core Primitive</span></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3w5T!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7c8847-36a2-4511-96c3-045325f61beb_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3w5T!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7c8847-36a2-4511-96c3-045325f61beb_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!3w5T!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7c8847-36a2-4511-96c3-045325f61beb_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!3w5T!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7c8847-36a2-4511-96c3-045325f61beb_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!3w5T!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7c8847-36a2-4511-96c3-045325f61beb_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3w5T!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7c8847-36a2-4511-96c3-045325f61beb_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7f7c8847-36a2-4511-96c3-045325f61beb_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_!3w5T!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7c8847-36a2-4511-96c3-045325f61beb_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!3w5T!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7c8847-36a2-4511-96c3-045325f61beb_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!3w5T!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7c8847-36a2-4511-96c3-045325f61beb_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!3w5T!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7f7c8847-36a2-4511-96c3-045325f61beb_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>Everything in Inngest starts with </span><code>step.run()</code><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-5" href="#footnote-5" target="_self">5</a><span>.</span></p><p><span>It wraps a unit of work &amp; gives Inngest a point where it can save the result. Once the step finishes, its result is stored &amp; can be reused if the workflow runs again.</span></p><p><span>So if a later step fails, Inngest does NOT need to rerun earlier steps. Instead, completed results can be reused &amp; execution can continue from the step that still needs to run.</span></p><p><span>Your workflow logic stays in your application code. And Inngest handles the execution around it, while </span><code>step.run()</code><span> gives the runtime a clear &#8220;boundary&#8221; for each piece of work.</span></p><h3><span>Long-Running and Waiting Workflows</span></h3><p><span>Not every workflow finishes in one go.</span></p><p><span>Some need to </span><em><span>pause</span></em><span> for a while before they can continue&#8230;</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_!ILYK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7661741-145f-4335-86c0-71fbef5e3cb0_1774x887.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ILYK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7661741-145f-4335-86c0-71fbef5e3cb0_1774x887.png 424w, https://substackcdn.com/image/fetch/$s_!ILYK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7661741-145f-4335-86c0-71fbef5e3cb0_1774x887.png 848w, https://substackcdn.com/image/fetch/$s_!ILYK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7661741-145f-4335-86c0-71fbef5e3cb0_1774x887.png 1272w, https://substackcdn.com/image/fetch/$s_!ILYK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7661741-145f-4335-86c0-71fbef5e3cb0_1774x887.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ILYK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7661741-145f-4335-86c0-71fbef5e3cb0_1774x887.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d7661741-145f-4335-86c0-71fbef5e3cb0_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_!ILYK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7661741-145f-4335-86c0-71fbef5e3cb0_1774x887.png 424w, https://substackcdn.com/image/fetch/$s_!ILYK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7661741-145f-4335-86c0-71fbef5e3cb0_1774x887.png 848w, https://substackcdn.com/image/fetch/$s_!ILYK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7661741-145f-4335-86c0-71fbef5e3cb0_1774x887.png 1272w, https://substackcdn.com/image/fetch/$s_!ILYK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7661741-145f-4335-86c0-71fbef5e3cb0_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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><code>step.sleep()</code><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-6" href="#footnote-6" target="_self">6</a><span> lets a workflow wait until a specific time.</span></p></li><li><p><code>step.waitForEvent()</code><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-7" href="#footnote-7" target="_self">7</a><code> </code><span>lets it wait for an event, such as an editor approving a draft or a payment webhook arriving.</span></p></li></ul><p><span>The crucial part is what happens during the wait&#8230;</span></p><p><span>A worker does NOT need to sit there doing nothing. The workflow can pause, keep its state, and continue when the required time/event arrives.</span></p><p><span>This becomes extremely useful for workflows involving human approval and/or external systems, where the next step would not happen for hours/days.</span></p><h3><span>Durable Functions and Durable Endpoints</span></h3><p><span>Inngest supports two ways to run these workflows based on how they are triggered:</span></p><ul><li><p><em><span>Durable functions</span></em><span> run &#8220;asynchronously&#8221; in the background. They can start from an event, schedule, or webhook and continue until the workflow finishes. This fits research agents, ingestion pipelines, and other work where the result does not need to come back immediately.</span></p></li><li><p><em><span>Durable endpoints</span></em><span> are designed for &#8220;user-facing calls&#8221; where the response needs to come back to the user, while the steps inside the request still need durable execution.</span></p></li></ul><p><span>The entry point is different, but both use the same underlying execution model.</span></p><p><span>Now let&#8217;s see how Inngest compares with other ways to build durable workflows&#8230;</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>BullMQ vs Temporal vs Inngest</span></h2><p><span>Here are three ways to solve the same problem (along with their tradeoffs):</span></p><h3><span>BullMQ: Queue-First</span></h3><p><span>BullMQ makes sense if you need </span><em><span>fine-grained control</span></em><span> over background work.</span></p><p><span>Also it works well when your team already has the expertise to operate the required infrastructure. You get queues, workers, retries, rate limiting &amp; job dependencies out of the box. Your team controls how those pieces are configured &amp; how the workflow is built around them.</span></p><p><span>Yet the tradeoff is the &#8220;operational&#8221; work.</span></p><p><span>Someone has to own the infrastructure, tune the system &amp; deal with the cost when a configuration does not behave as expected in production.</span></p><p><span>So this fits well for organizations with a </span><em><span>dedicated</span></em><span> infrastructure team seeking that level of control.</span></p><h3><span>Temporal: Workflow-First</span></h3><p><span>Temporal takes a more </span><em><span>workflow-centric</span></em><span> approach&#8230;</span></p><p><span>Its biggest advantage shows up when workflows become very complex &amp; depends on/call many other workflows. A dedicated workflow model can make a large web of dependencies easier to keep straight.</span></p><p><span>Yet the tradeoff is &#8220;complexity&#8221;.</span></p><p><span>Temporal is more involved for developers &amp; operators. The extra machinery makes sense when workflows actually need it.</span></p><h3><span>Inngest: Application-Code-First</span></h3><p><span>Inngest takes a </span><em><span>simpler</span></em><span> approach&#8230;</span></p><p><span>The workflow stays in your application code, with steps as the basic units of durable work. Completed steps are saved &amp; reused during recovery, while failed steps can retry independently.</span></p><p><span>Your functions run on your existing compute, while Inngest handles the orchestration around them. You get durable execution without building the workflow infrastructure yourself.</span></p><p>So you take on less infrastructure &amp; workflow complexity.</p><p><span>Yet the tradeoff is </span><em><span>less</span></em><span> low-level control than BullMQ. </span></p><h3><span>Choosing Between Them</span></h3><p><span>There is NO one right choice.</span></p><ul><li><p><span>BullMQ works well when you have the infrastructure team &amp; want to control the system yourself.</span></p></li><li><p><span>Temporal becomes more compelling as the workflow graph grows more complex.</span></p></li><li><p><span>Inngest fits when you want durable execution around application code. It avoids much of the infrastructure &amp; workflow complexity.</span></p></li></ul><p><span>So the question is not which tool has the most features&#8230;.Instead, how much control &amp; complexity your workflow actually needs&#8230;.</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_!3WFD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e62a8b4-997b-4c95-a161-e5debaae25ef_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3WFD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e62a8b4-997b-4c95-a161-e5debaae25ef_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!3WFD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e62a8b4-997b-4c95-a161-e5debaae25ef_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!3WFD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e62a8b4-997b-4c95-a161-e5debaae25ef_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!3WFD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e62a8b4-997b-4c95-a161-e5debaae25ef_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3WFD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e62a8b4-997b-4c95-a161-e5debaae25ef_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7e62a8b4-997b-4c95-a161-e5debaae25ef_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_!3WFD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e62a8b4-997b-4c95-a161-e5debaae25ef_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!3WFD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e62a8b4-997b-4c95-a161-e5debaae25ef_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!3WFD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e62a8b4-997b-4c95-a161-e5debaae25ef_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!3WFD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7e62a8b4-997b-4c95-a161-e5debaae25ef_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 keep going!</p><h4 style="text-align: center;"><strong>&#167;</strong></h4><div class="callout-block" data-callout="true"><h3><a href="https://inngest.link/jtH41MP">Don&#8217;t let agent failures blow the budget (Partner)</a></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://inngest.link/jtH41MP" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!i9Kg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 424w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 848w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 1272w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!i9Kg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png" width="1200" height="675" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:675,&quot;width&quot;:1200,&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://inngest.link/jtH41MP&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_!i9Kg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 424w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 848w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 1272w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Agents, like all of us, often need to recover from failure. But they shouldn&#8217;t start from scratch.</p><p>Inngest&#8217;s durable execution checkpoints your agents every step of the way.</p><p>So your agents can pick up where they left off and avoid doubling up on token &amp; compute spend.</p><p><strong><a href="https://inngest.link/jtH41MP"><span>Build durably with Inngest</span></a></strong><span> - includes a generous free tier and a sleek local dev server.</span></p></div><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>Under the Hood: How Inngest Executes a Function</span></h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!0aex!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2792a82-bfbf-4e86-a878-9f0b4aa1fa40_1774x887.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0aex!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2792a82-bfbf-4e86-a878-9f0b4aa1fa40_1774x887.png 424w, https://substackcdn.com/image/fetch/$s_!0aex!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2792a82-bfbf-4e86-a878-9f0b4aa1fa40_1774x887.png 848w, https://substackcdn.com/image/fetch/$s_!0aex!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2792a82-bfbf-4e86-a878-9f0b4aa1fa40_1774x887.png 1272w, https://substackcdn.com/image/fetch/$s_!0aex!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2792a82-bfbf-4e86-a878-9f0b4aa1fa40_1774x887.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0aex!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2792a82-bfbf-4e86-a878-9f0b4aa1fa40_1774x887.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b2792a82-bfbf-4e86-a878-9f0b4aa1fa40_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_!0aex!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2792a82-bfbf-4e86-a878-9f0b4aa1fa40_1774x887.png 424w, https://substackcdn.com/image/fetch/$s_!0aex!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2792a82-bfbf-4e86-a878-9f0b4aa1fa40_1774x887.png 848w, https://substackcdn.com/image/fetch/$s_!0aex!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2792a82-bfbf-4e86-a878-9f0b4aa1fa40_1774x887.png 1272w, https://substackcdn.com/image/fetch/$s_!0aex!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb2792a82-bfbf-4e86-a878-9f0b4aa1fa40_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>Every Inngest function follows the same basic execution pattern:</span></p><p><span>A trigger starts the run, steps execute one by one, their results get saved, and later executions reuse the work already completed.</span></p><p><span>Once you see this flow, the recovery behavior becomes much easier to understand&#8230;</span></p><h3><span>Step 1: Starting an Execution</span></h3><p><span>A run can start from an event, a schedule, or a webhook.</span></p><p><span>When the trigger fires, Inngest invokes your function over HTTP. Your function still runs on your own compute. You could be using a serverless platform, a container, or a traditional server.</span></p><p><span>There is NO separate worker process sitting there waiting for your function.</span></p><p><span>Inngest coordinates the execution, while your existing application environment runs the code.</span></p><h3><span>Step 2: Discovering Completed Steps</span></h3><p><span>The interesting part starts when the function should rerun...</span></p><p><span>The function begins from the top, but Inngest already knows which steps have been completed. Before running a step, the SDK checks its saved state.</span></p><p><span>If the step has a recorded result, the SDK returns this result instead of running the code again.</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_!QWDY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cefdf17-77a5-4232-8526-36f2cdd9f6a1_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QWDY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cefdf17-77a5-4232-8526-36f2cdd9f6a1_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!QWDY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cefdf17-77a5-4232-8526-36f2cdd9f6a1_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!QWDY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cefdf17-77a5-4232-8526-36f2cdd9f6a1_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!QWDY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cefdf17-77a5-4232-8526-36f2cdd9f6a1_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QWDY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cefdf17-77a5-4232-8526-36f2cdd9f6a1_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1cefdf17-77a5-4232-8526-36f2cdd9f6a1_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_!QWDY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cefdf17-77a5-4232-8526-36f2cdd9f6a1_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!QWDY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cefdf17-77a5-4232-8526-36f2cdd9f6a1_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!QWDY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cefdf17-77a5-4232-8526-36f2cdd9f6a1_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!QWDY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cefdf17-77a5-4232-8526-36f2cdd9f6a1_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>Each step has its own ID, and Inngest uses the step ID to identify its stored state.</span></p><p><span>SDK hashes the ID &amp; use it to look up the previous result. This is also why completed steps can be reused across later executions &amp; deployments.</span></p><p><span>So the function would run from the start again, but the completed work does not.</span></p><h3><span>Step 3: Executing New Steps</span></h3><p><span>Any step </span><em><span>without</span></em><span> a saved result still needs to run.</span></p><p><span>Inngest executes each step separately &amp; records the result when it finishes. The result then becomes available to the next part of the workflow.</span></p><p><span>If the function runs again later, Inngest can use the recorded result instead of re-executing the same step. This lets a workflow move forward </span><em><span>without</span></em><span> repeating everything it has already finished.</span></p><h3><span>Step 4: Checkpointing</span></h3><p><span>Inngest can checkpoint progress as the function runs instead of waiting for the full workflow to finish.</span></p><p><span>With checkpointing enabled, the SDK can execute steps immediately and send progress back to Inngest as those steps complete. This reduces extra latency between steps while still recording the workflow&#8217;s progress.</span></p><p><span>This is especially useful for AI workflows, where a function could contain many small steps and even tiny extra latency between each one can add up.</span></p><p><span>If a step fails &amp; needs to retry, Inngest can fall back to its standard orchestration path to handle the failure safely. So you get faster execution when things go well, without losing recovery behavior when they don&#8217;t.</span></p><h3><span>Step 5: Waiting Without Holding Compute</span></h3><p><span>Some workflows reach a point where they simply need to wait&#8230;</span></p><ul><li><p><code>step.sleep()</code><span> can pause execution until a specific time.</span></p></li><li><p><span>While </span><code>step.waitForEvent() </code><span>waits for an external event, such as an editor approving a draft or another system confirming a payment.</span></p></li></ul><p><span>Also you can configure a timeout for an event wait.</span></p><p><span>Your function does NOT need to keep a worker process running just to sit there while waiting. Inngest tracks the workflow, and when the required time/event arrives, execution can continue with the </span>recorded <span>progress.</span></p><p><span>So a workflow can start on one machine, pause for hours/days, and continue later </span><em><span>without</span></em><span> keeping compute occupied the entire time.</span></p><p><span>Everything looks pretty smooth so far&#8230;But real workflows rarely stay this way.</span></p><p><span>Let&#8217;s see what happens when something goes wrong&#8230;</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>How Inngest Handles Failures</span></h2><p><span>Once a workflow runs for a while, things can go wrong in different ways.</span></p><p><span>A retry is useful in some cases but not in others&#8230;</span></p><p><span>A temporary failure can usually be retried, while a process crash requires the workflow to recover its previous progress. Duplicate execution brings its own problems, and some workflows simply need to wait for a person before they can continue.</span></p><p><span>There is also one more case to consider:</span></p><p><span>The workflow can finish </span><em><span>without</span></em><span> technical errors and still produce a BAD result.</span></p><p><span>So instead of treating each failure the same way, let&#8217;s look at what each one requires...</span></p><h3><span>Transient and Permanent Failures</span></h3><p><span>An LLM request could time out, or the provider could return a </span><code>429 HTTP status</code><span> because you have hit a rate limit.</span></p><p><span>In either case, the problem could disappear on the next attempt, so retrying the step makes sense.</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_!Zjys!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F516bd17e-cfd6-440b-9707-9e884031fc73_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Zjys!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F516bd17e-cfd6-440b-9707-9e884031fc73_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!Zjys!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F516bd17e-cfd6-440b-9707-9e884031fc73_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!Zjys!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F516bd17e-cfd6-440b-9707-9e884031fc73_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!Zjys!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F516bd17e-cfd6-440b-9707-9e884031fc73_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Zjys!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F516bd17e-cfd6-440b-9707-9e884031fc73_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/516bd17e-cfd6-440b-9707-9e884031fc73_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_!Zjys!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F516bd17e-cfd6-440b-9707-9e884031fc73_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!Zjys!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F516bd17e-cfd6-440b-9707-9e884031fc73_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!Zjys!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F516bd17e-cfd6-440b-9707-9e884031fc73_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!Zjys!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F516bd17e-cfd6-440b-9707-9e884031fc73_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>Inngest retries steps independently.</span></p><p><span>i.e., a failed drafting step can run again without repeating the retrieval &amp; extraction steps.</span></p><p><span>If you configure </span><code>retries: 5</code><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-8" href="#footnote-8" target="_self">8</a><span>, the step gets five retries after its initial attempt, while the completed steps keep their recorded results.</span></p><p><span>But some errors won't fix themselves&#8230;</span></p><p><span>If the request is invalid/API key is wrong, running the same step again will most likely produce the same error. Inngest lets you mark an error as non-retriable, so it skips the remaining attempts &amp; moves the run toward its failure path.</span></p><p><span>Once all retries have been used, </span><code>onFailure</code><span> can handle the failed run.</span></p><p><span>It can send an alert, notify a user, trigger a fallback, or pass the problem to another part of the system.</span></p><h3><span>Infrastructure Failures</span></h3><p><span>Retries are NO help when the process running the workflow </span><em><span>disappears</span></em><span>&#8230;</span></p><p><span>Suppose several steps have already completed but the process restarted before the next step finished. When the function reruns, it needs to know which work has already been done.</span></p><p><span>Inngest keeps the results of completed steps; so those results can be reused when execution starts again. The workflow can then continue from its saved progress instead of rerunning all the earlier steps.</span></p><p><span>So even though the process itself did not survive, the work it had already completed does.</span></p><h3><span>Duplicate Execution</span></h3><p><span>Recovery can also create a different problem:</span></p><p><span>If the same operation runs again, you need to make sure it does NOT accidentally perform the same action &#8220;twice&#8221;.</span></p><p><span>A webhook could arrive more than once, or a function could get re-triggered after a failure. Inngest provides event IDs &amp; function-level idempotency keys to prevent duplicate function executions for the same operation.</span></p><p><span>Yet the external action still needs its own protection.</span></p><p><span>If the workflow sends emails and/or writes to a database, you&#8217;d need an idempotency key, an upsert, an existence check, or a deterministic identifier so the operation remains safe to reattempt.</span></p><p><span>Inngest can help prevent the function from running twice, but &#8220;your&#8221; application still needs to make its side effects safe.</span></p><h3><span>Human Delays</span></h3><p><span>Think of a research agent&#8230;</span></p><p><span>Once the draft is ready, an editor would need to approve it before publishing. Approval could arrive in a few minutes/days, so keeping compute running the entire time wouldn't make much sense.</span></p><p><span>Instead, the workflow can wait for the required event </span>with <code>step.waitForEvent()</code><span>. Also you can set a timeout for cases where the event never arrives. Once the matching event arrives, the workflow continues with its previous progress intact.</span></p><p><span>From there, you can handle the result normally&#8230;</span></p><p><span>An approval can continue the workflow, a rejection can stop it, and a timeout can trigger an escalation/fallback.</span></p><h3><span>Disconnected Clients</span></h3><p><span>Sometimes the workflow is fine, but the connection to the user breaks.</span></p><p><span>Token streaming is a good example:</span></p><p><span>An agent can be in the middle of a model turn/tool call when the browser closes or the connection drops. The agent can keep running in the background, while the browser simply reconnects later &amp; catches up with the stream.</span></p><p><span>This separates the agent&#8217;s execution from the connection delivering its output.</span></p><p><span>i.e., the browser can disappear without taking the workflow with it, and when the user comes back, the result is still there.</span></p><h3><span>Outcome Failures</span></h3><p><span>The workflow can finish successfully but still give you a BAD result.</span></p><p><span>An agent could choose the wrong tool, miss an important source, or produce an answer a reviewer rejects. Technically, everything worked because every step completed without an error.</span></p><p><span>But completing the workflow is NOT the same as producing a good outcome.</span></p><p><span>The execution system can tell you whether the work finished&#8230; yet it cannot decide by itself whether the result was actually good&#8230;</span></p><p><span>For this, you need scoring and evaluation; let&#8217;s look at it next&#8230;</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><div class="captioned-button-wrap" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/durable-ai-agents?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/durable-ai-agents?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/durable-ai-agents?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p></div><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>Other Pieces That Matter in Production</span></h2><p>Let&#8217;s dive in!</p><h3><span>Handling Traffic and Concurrency</span></h3><p><span>A workflow recovering correctly can cause problems if </span><em><span>too much work</span></em><span> arrives at once.</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_!2Uoo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66ef2e4e-8c28-4386-b3ab-9d042b3df20e_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2Uoo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66ef2e4e-8c28-4386-b3ab-9d042b3df20e_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!2Uoo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66ef2e4e-8c28-4386-b3ab-9d042b3df20e_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!2Uoo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66ef2e4e-8c28-4386-b3ab-9d042b3df20e_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!2Uoo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66ef2e4e-8c28-4386-b3ab-9d042b3df20e_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2Uoo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66ef2e4e-8c28-4386-b3ab-9d042b3df20e_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/66ef2e4e-8c28-4386-b3ab-9d042b3df20e_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_!2Uoo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66ef2e4e-8c28-4386-b3ab-9d042b3df20e_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!2Uoo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66ef2e4e-8c28-4386-b3ab-9d042b3df20e_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!2Uoo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66ef2e4e-8c28-4386-b3ab-9d042b3df20e_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!2Uoo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F66ef2e4e-8c28-4386-b3ab-9d042b3df20e_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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 burst from one customer can fill the queue, hit a shared LLM provider&#8217;s rate limit, and &#8220;slow down&#8221; everyone else. So the system needs ways to control how much work runs &amp; how quickly new work starts.</span></p><p><span>Here are the flow-control tools used by Inngest:</span></p><ol><li><p><strong><span>Concurrency</span></strong><span>: Controls how much work can run at the same time. If a database struggles beyond 20 concurrent writes, a concurrency limit keeps the workflow from overwhelming it.</span></p></li><li><p><strong><span>Throttling</span></strong><span>: Controls how quickly new work starts. If an API allows 100 requests per minute, throttling spreads the work out instead of sending everything at once.</span></p></li><li><p><strong><span>Rate limiting</span></strong><span>: Instead of holding excess work for later, it skips events once the configured limit is reached. This is pretty useful when some events are better dropped than processed later.</span></p></li><li><p><strong><span>Debouncing</span></strong><span>: Helps when many events arrive within a short period, but only the final state matters. Instead of running the function for every event, the system waits until the burst settles before starting it.</span></p></li><li><p><strong><span>Priority</span></strong><span>: Lets more important work move ahead when capacity is limited. A critical workflow does not have to sit behind a large amount of lower-priority work.</span></p></li></ol><p><span>These controls sit alongside the execution&#8230;so traffic management does not become another layer around the workflow.</span></p><h3><span>Seeing What Happened</span></h3><p><span>Once something fails, you need to see what happened before you can fix it.</span></p><p><span>A basic queue usually gives you the job &amp; its final status. For a long-running workflow,,, you need more. You need to see where the run spent its time, which steps completed, what retried &amp; where execution stopped.</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_!N-hv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F375bf6f0-bbf7-4aef-b312-ad5f41893ec8_1686x933.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!N-hv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F375bf6f0-bbf7-4aef-b312-ad5f41893ec8_1686x933.png 424w, https://substackcdn.com/image/fetch/$s_!N-hv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F375bf6f0-bbf7-4aef-b312-ad5f41893ec8_1686x933.png 848w, https://substackcdn.com/image/fetch/$s_!N-hv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F375bf6f0-bbf7-4aef-b312-ad5f41893ec8_1686x933.png 1272w, https://substackcdn.com/image/fetch/$s_!N-hv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F375bf6f0-bbf7-4aef-b312-ad5f41893ec8_1686x933.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!N-hv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F375bf6f0-bbf7-4aef-b312-ad5f41893ec8_1686x933.png" width="1456" height="806" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/375bf6f0-bbf7-4aef-b312-ad5f41893ec8_1686x933.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:806,&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_!N-hv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F375bf6f0-bbf7-4aef-b312-ad5f41893ec8_1686x933.png 424w, https://substackcdn.com/image/fetch/$s_!N-hv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F375bf6f0-bbf7-4aef-b312-ad5f41893ec8_1686x933.png 848w, https://substackcdn.com/image/fetch/$s_!N-hv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F375bf6f0-bbf7-4aef-b312-ad5f41893ec8_1686x933.png 1272w, https://substackcdn.com/image/fetch/$s_!N-hv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F375bf6f0-bbf7-4aef-b312-ad5f41893ec8_1686x933.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>Inngest automatically traces function runs.</span></p><p><span>The trace shows step timing, queue delays, retries, and the data going into &amp; coming out of each step. You can follow the whole workflow in one place instead of piecing it together from queue logs, application logs &amp; separate tracing tools.</span></p><p><span>And when you fix the problem, you can replay the affected runs instead of rebuilding them manually. Inngest lets you select runs by time range and status and replay them in bulk.</span></p><p><span>Plus, replays are spread over time so a large recovery does NOT overwhelm the application.</span></p><h3><span>Execution Success vs Outcome Success</span></h3><p><span>Execution tells you whether the workflow finished&#8230;but it does NOT tell you whether the result was good.</span></p><p><span>Inngest lets you attach scores to a run/step.</span></p><p><span>This keeps user feedback, human review, or business outcomes connected to the execution that produced them. The score can also arrive after the workflow has finished. This is extremely useful when a result's quality only becomes clear later.</span></p><p><span>It gives you two different things to look at:</span></p><ul><li><p><span>You can see whether the workflow completed.</span></p></li><li><p><span>And you can see whether it actually did the right thing.</span></p></li></ul><p><span>But you still need to handle a few pieces yourself.</span></p><p><span>Let&#8217;s have a look at what they are&#8230;</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>What You Still Have to Handle</span></h2><p><span>Here are some responsibilities that still belong to your application:</span></p><h3><span>Idempotent Side Effects</span></h3><p><span>A step can rerun after an error, so the code inside it needs to be &#8220;safe&#8221;.</span></p><p><span>For example, inserting a new user twice can create two records if the first write succeeded, but the response never reached the application. An upsert/deterministic identifier can make the second attempt harmless.</span></p><p><span>The same applies to emails, payments, API calls, or/and other external actions.</span></p><p><span>Inngest can control when a step runs again, but the application still needs to decide what happens when the external operation is attempted again.</span></p><h3><span>Good Step Boundaries and Stable Step Identities</span></h3><p><span>How you split the workflow into steps is still a design decision&#8230;</span></p><p><span>A step should represent a meaningful &#8220;unit of work&#8221;. Put too much inside one step, and a retry could repeat more work than necessary. Split everything into tiny steps, and the workflow becomes harder to reason about.</span></p><p><span>Step IDs matter for the same reason&#8230;</span></p><p><span>Inngest uses them to memoize completed work, so changing an existing step&#8217;s ID makes Inngest treat it as a different step. The SDK also uses a counter when the same step runs inside a loop, so the ID can stay stable across iterations.</span></p><p><span>The execution layer can preserve the state, but it cannot decide where your workflow should draw its boundaries.</span></p><h3><span>Retry and Failure Policies</span></h3><p><span>Inngest handles retries automatically,,, but the application still needs to decide when a retry makes sense.</span></p><p><span>A network timeout is usually worth another attempt, but an invalid API key is not. You can mark permanent errors as non-retriable, while </span><code>onFailure</code><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-9" href="#footnote-9" target="_self">9</a><span> gives the workflow a place to go once its retries are exhausted. The default is four retries after the initial attempt, and you can configure this per function.</span></p><p><span>The right response after failure depends on the workflow:</span></p><p><span>Sometimes you need an alert, and sometimes you need a fallback. In other cases, the user needs to be told that the operation could not finish.</span></p><h3><span>Data Consistency Across External Systems</span></h3><p><span>Durable execution keeps the workflow&#8217;s progress.</span></p><p><span>Yet it does NOT combine several external systems into one transaction.</span></p><p><span>Suppose a workflow records a payment &amp; then creates an order. If the payment succeeds but the process fails before the order gets created, retrying the workflow does not automatically undo the payment.</span></p><p><span>The application still needs a way to make the two operations work &#8220;safely&#8221; together. Idempotency, compensating actions, and careful ordering can help based on the systems involved.</span></p><p><span>This becomes highly crucial when a workflow touches many external systems.</span></p><p><span>The execution layer can keep the workflow moving, but the application still owns the consistency of the data it changes.</span></p><p><span>Let&#8217;s put all of this into one workflow &amp; see how it works together&#8230;</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>Putting It All Together: A Durable Research Agent</span></h2><p><span>Let&#8217;s see what all of it looks like in a real workflow using a research agent:</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_!pLUA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22757d5a-88c6-4760-bb1f-4993c5dd6c36_1916x821.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pLUA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22757d5a-88c6-4760-bb1f-4993c5dd6c36_1916x821.png 424w, https://substackcdn.com/image/fetch/$s_!pLUA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22757d5a-88c6-4760-bb1f-4993c5dd6c36_1916x821.png 848w, https://substackcdn.com/image/fetch/$s_!pLUA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22757d5a-88c6-4760-bb1f-4993c5dd6c36_1916x821.png 1272w, https://substackcdn.com/image/fetch/$s_!pLUA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22757d5a-88c6-4760-bb1f-4993c5dd6c36_1916x821.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pLUA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22757d5a-88c6-4760-bb1f-4993c5dd6c36_1916x821.png" width="1456" height="624" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/22757d5a-88c6-4760-bb1f-4993c5dd6c36_1916x821.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:624,&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_!pLUA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22757d5a-88c6-4760-bb1f-4993c5dd6c36_1916x821.png 424w, https://substackcdn.com/image/fetch/$s_!pLUA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22757d5a-88c6-4760-bb1f-4993c5dd6c36_1916x821.png 848w, https://substackcdn.com/image/fetch/$s_!pLUA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22757d5a-88c6-4760-bb1f-4993c5dd6c36_1916x821.png 1272w, https://substackcdn.com/image/fetch/$s_!pLUA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F22757d5a-88c6-4760-bb1f-4993c5dd6c36_1916x821.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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><span>Workflow Starts</span></h3><p><span>The agent first retrieves its sources &amp; extracts the evidence it needs.</span></p><p><span>Each part runs as its own step, and once a step finishes, its result is saved.</span></p><p><span>So when retrieval &amp; extraction are done, the workflow already has two completed pieces of work it can reuse later.</span></p><h3><span>Failure and Recovery</span></h3><p><span>The agent moves on to drafting, but the model provider </span><em><span>times out </span></em><span>halfway through the step&#8230;</span></p><p><span>Yet the workflow does NOT start over. The drafting step retries, while the retrieval &amp; extraction results stay </span><em><span>untouched</span></em><span>. Once the draft succeeds, its result is saved &amp; the workflow can move on.</span></p><p><span>This is where checkpointing becomes very useful&#8230;</span></p><p><span>The workflow does NOT need to remember everything in the worker process because the completed work is already persisted.</span></p><h3><span>Waiting for Human Input</span></h3><p><span>The draft now needs editor approval&#8230;</span></p><p><span>So the workflow calls </span><code>step.waitForEvent() </code><span>and pauses.</span></p><p><span>Nothing needs to keep running while the editor decides. Two days later, the approval event arrives, and the workflow continues with the publishing step.</span></p><p><span>The same workflow has now survived a model failure &amp; a two-day wait without losing its progress.</span></p><h3><span>Execution History and Replay</span></h3><p><span>Once publishing finishes, the run still has a complete execution history.</span></p><p><span>You can see how the workflow progressed, where it retried, and how long each part took.</span></p><p><span>If the final answer turns out to be poor, a score can be attached to the run later. And if a fix needs to be tested against previous executions, the affected runs can be replayed instead of rebuilding them manually.</span></p><p><span>By the end, the workflow has done more than simply finish.</span></p><p><span>It has recovered from a failure, waited for a human without holding compute, preserved its progress, and left behind a history of what happened along the way.</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><h2><span>Closing Thoughts</span></h2><p><span>Reliable AI agents need more than a model that produces good answers&#8230;</span></p><p><span>Once an agent runs long workflows, calls external tools, waits for people, and handles real traffic, the </span><em><span>execution layer</span></em><span> becomes just as important.</span></p><p><span>Here are the key takeaways for you:</span></p><ul><li><p><span>Durable execution saves progress. Completed steps can be reused after a failure instead of rerunning the whole workflow.</span></p></li><li><p><span>Retries need protection. Idempotency, backoff &amp; clear failure paths keep retries from creating bigger problems.</span></p></li><li><p><span>Waiting is part of the workflow. Human approvals and external events can take hours/days without keeping compute running.</span></p></li><li><p><span>Flow control is part of reliability. Concurrency, throttling, and rate limits keep one traffic spike from affecting everyone else.</span></p></li><li><p><span>Execution history matters. Knowing what ran, what failed, and what retried makes debugging much easier.</span></p></li><li><p><span>A successful run is not always a good run. Scoring and evaluation help measure result quality.</span></p></li></ul><p><span>BullMQ gives you queue primitives. Temporal gives you a workflow model. </span><strong><a href="https://inngest.link/jtH41MP"><span>Inngest</span></a></strong><span> puts durable execution around the application code you already write.</span></p><p><span>For AI agents, that application-centric approach is what makes Inngest particularly compelling.</span></p><h4 style="text-align: center;"><strong>&#167;</strong></h4><div class="callout-block" data-callout="true"><h3><a href="https://inngest.link/jtH41MP">Don&#8217;t let agent failures blow the budget (Partner)</a></h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://inngest.link/jtH41MP" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!i9Kg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 424w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 848w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 1272w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!i9Kg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png" width="1200" height="675" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:675,&quot;width&quot;:1200,&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://inngest.link/jtH41MP&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_!i9Kg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 424w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 848w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 1272w, https://substackcdn.com/image/fetch/$s_!i9Kg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1e7c0083-b0b6-4069-af0c-afdaf57a25ec_1200x675.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Agents, like all of us, often need to recover from failure. But they shouldn&#8217;t start from scratch.</p><p>Inngest&#8217;s durable execution checkpoints your agents every step of the way.</p><p>So your agents can pick up where they left off and avoid doubling up on token &amp; compute spend.</p><p><a href="https://inngest.link/jtH41MP">Inngest</a> offers a generous free tier and a sleek local dev server for testing.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://inngest.link/jtH41MP&quot;,&quot;text&quot;:&quot;Build durably with Inngest&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://inngest.link/jtH41MP"><span>Build durably with Inngest</span></a></p></div><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>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.instagram.com/systemdesignone/">Instagram</a></strong></figcaption></figure></div><div><hr></div><p><strong>Want to reach 241K+ tech professionals at scale? </strong>&#128240;</p><p>If your company wants to reach 241K+ tech professionals, <a href="https://newsletter.systemdesign.one/p/sponsorship">partner with me</a>.</p><div><hr></div><p>Thank you for supporting this newsletter.</p><p>You are now 240,001+ readers strong, very close to 241k. Let&#8217;s try to get 241k readers by 27 August. Consider sharing this letter 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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/durable-ai-agents?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/durable-ai-agents?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><a href="https://www.inngest.com/docs">Inngest Documentation</a></p></li><li><p><a href="https://www.inngest.com/docs/learn/how-functions-are-executed">How Inngest Functions Execute</a></p></li><li><p><a href="https://www.inngest.com/docs/learn/inngest-steps">Inngest Steps</a></p></li><li><p><a href="https://www.inngest.com/docs/reference/typescript/v4/functions/step-run">Step Execution and step.run()</a></p></li><li><p><a href="https://www.inngest.com/docs/guides/error-handling">Error Handling and Retries</a></p></li><li><p><a href="https://www.inngest.com/docs/guides/handling-idempotency">Handling Idempotency</a></p></li><li><p><a href="https://www.inngest.com/docs/learn/durable-endpoints">Durable Endpoints</a></p></li><li><p><a href="https://www.inngest.com/docs/reference/typescript/v4/functions/step-wait-for-event">Waiting for Events</a></p></li><li><p><a href="https://www.inngest.com/docs/guides/concurrency">Concurrency and Flow Control</a></p></li><li><p><a href="https://www.inngest.com/docs/guides/throttling">Throttling</a></p></li><li><p><a href="https://www.inngest.com/docs/platform/monitor/observability-metrics">Observability and Metrics</a></p></li><li><p><a href="https://www.inngest.com/docs/features/inngest-functions/steps-workflows/scoring">Scoring Function Runs</a></p></li><li><p><a href="https://www.inngest.com/docs/patterns/durable/durable-token-streaming">Durable Token Streaming</a></p></li><li><p><a href="https://www.inngest.com/docs/learn/durable-endpoints/streaming">Durable Endpoints Streaming</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>An <strong>AI agent workflow</strong> is the sequence of steps an AI agent follows to complete a task.</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>You can build an AI agent workflow as a chain of queue-worker jobs, but as the workflow becomes longer &amp; more dynamic, you also need to build the state, recovery, coordination, and observability that connect those jobs into a durable workflow. This can become very complex.</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>BullMQ and Celery are job queue systems for running background work, while Amazon SQS is a managed message queue service used to send messages between distributed components.</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><span>Memoization:</span></strong><span> A technique where the result of a previously completed computation is stored and reused when the same computation is encountered again, avoiding unnecessary repeated work.</span></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><span>step.run():</span></strong><span> Inngest SDK function that wraps a unit of workflow work and gives Inngest a durable execution boundary. When the step completes, its result can be persisted and reused during later executions instead of re-running the same work.</span></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><span>step.sleep():</span></strong><span> Inngest SDK function that pauses a workflow until a specified amount of time or a specified point in time. The workflow does not need to keep a worker process running while it waits.</span></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><span>step.waitForEvent():</span></strong><span> Inngest SDK function that pauses a workflow until a matching event is received. It can be used for workflows that need to wait for external events such as human approval, payment confirmation, or another application's response.</span></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><span>retries:</span></strong><span> An Inngest function or step configuration that determines how many additional attempts are made after an execution fails before the failure is considered exhausted.</span></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><span>onFailure:</span></strong><span> An Inngest failure-handling mechanism that runs when a function's retries have been exhausted, allowing the application to perform actions such as sending alerts or triggering fallback logic.</span></p></div></div>]]></content:encoded></item><item><title><![CDATA[Prompt Engineering - A Deep Dive]]></title><description><![CDATA[#169: From Tokens to Production-Ready AI Systems]]></description><link>https://newsletter.systemdesign.one/p/prompt-engineering-guide</link><guid isPermaLink="false">https://newsletter.systemdesign.one/p/prompt-engineering-guide</guid><dc:creator><![CDATA[Neo Kim]]></dc:creator><pubDate>Fri, 14 Aug 2026 16:39:25 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/6cbc1a83-e8f0-4f2f-9269-8db9233652fa_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/prompt-engineering-guide/?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>I used to treat large language models like &#8220;search engines&#8221;&#8230;</span></p><p><span>I wrote a tiny prompt, pressed Enter, and expected a </span><em><span>good</span></em><span> answer.</span></p><p><span>But the model often ignored my constraints and/or solved a different problem. I didn&#8217;t realize until now that my prompt left too much open to &#8220;interpretation.&#8221;</span></p><p><span>A prompt tells the task, provides context, defines constraints, and makes the expected outcome clear. When the prompt is CLEAR, the model has </span><em>less</em><span> to guess.</span></p><p><span>But prompts are only one part of the story&#8230;</span></p><p><span>Modern AI systems do much more than respond to prompts. They retrieve documents, call external tools, remember useful information, and validate the outputs before responding.</span></p><p><span>They work well because they deliver the right &#8220;context&#8221; at the right time.</span></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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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><span>I want to introduce </span><strong><a href="https://www.linkedin.com/in/itinasharma/">Tina</a></strong><span> as the 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/itinasharma/" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!plVZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e048602-d434-4d16-9675-b8429a5ec616_985x487.png 424w, https://substackcdn.com/image/fetch/$s_!plVZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e048602-d434-4d16-9675-b8429a5ec616_985x487.png 848w, https://substackcdn.com/image/fetch/$s_!plVZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e048602-d434-4d16-9675-b8429a5ec616_985x487.png 1272w, https://substackcdn.com/image/fetch/$s_!plVZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e048602-d434-4d16-9675-b8429a5ec616_985x487.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!plVZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e048602-d434-4d16-9675-b8429a5ec616_985x487.png" width="985" height="487" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0e048602-d434-4d16-9675-b8429a5ec616_985x487.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:487,&quot;width&quot;:985,&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://www.linkedin.com/in/itinasharma/&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_!plVZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e048602-d434-4d16-9675-b8429a5ec616_985x487.png 424w, https://substackcdn.com/image/fetch/$s_!plVZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e048602-d434-4d16-9675-b8429a5ec616_985x487.png 848w, https://substackcdn.com/image/fetch/$s_!plVZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e048602-d434-4d16-9675-b8429a5ec616_985x487.png 1272w, https://substackcdn.com/image/fetch/$s_!plVZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0e048602-d434-4d16-9675-b8429a5ec616_985x487.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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>She&#8217;s a data engineer specializing in AI, machine learning, and large language models. She explains the </span><em><span>why</span></em><span> behind AI and data engineering concepts. Her work has been featured through Medium&#8217;s Boost program, and she also publishes </span><a href="https://theaicartographer.substack.com/welcome"><span>the AI Cartographer</span></a><span>.</span></p><p><span>You can follow her on:</span></p><ul><li><p><a href="https://medium.com/@itinasharma"><span>Medium</span></a></p></li><li><p><a href="https://theaicartographer.substack.com/welcome"><span>Substack</span></a></p></li><li><p><a href="https://www.linkedin.com/in/itinasharma/"><span>LinkedIn</span></a></p></li><li><p><a href="https://x.com/itinasharma"><span>X</span></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 good prompts still produce weak answers.</strong> How tokenization, context windows, attention, and in-context learning shape every response, and why relevance matters more than stuffing more text into the prompt.</p></li><li><p><strong>The prompting techniques behind reliable outputs.</strong> What zero-shot, few-shot, chain-of-thought, ReAct, reflection, structured outputs, and function calling each solve, and when adding more reasoning only increases cost.</p></li><li><p><strong>Prompting is only one layer of the system.</strong> How context engineering, Retrieval-Augmented Generation, memory, reranking, compression, and long-context design determine what the model knows before it answers.</p></li><li><p><strong>Every AI workflow has a failure mode.</strong> Why tool loops, retrieval overload, prompt injection, stale memory, invalid JSON, benchmark gaming, and weak evaluation can break an application even when the prompt looks correct.</p></li><li><p><strong>Eight prompts and a production checklist you can reuse.</strong> Classify, extract, summarize, ground answers in documents, control tool use, improve reasoning, revise drafts, and review customer replies before shipping them into a real system.</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 Prompt Engineering Matters</span></h2><p><span>If you ask a language model to &#8220;write something,&#8221; the model has to make several decisions on its own&#8230;</span></p><p><em>Should the response be a story, an email, or a poem? Who is the audience? How long should the response be?</em></p><blockquote><p><strong><span>Prompt engineering</span></strong><span> is the process of designing prompts to help a language model produce better responses.</span></p></blockquote><p><span>A language model cannot ask follow-up questions.</span></p><p><span>And the response depends entirely on the information available in its context window. So clear prompts typically lead to better results.</span></p><p><span>Still, a &#8220;good&#8221; prompt has its limitations:</span></p><p><span>When the required information is missing, no prompt can fill the gap. Modern AI systems also rely on retrieval, memory, tool use, and safety mechanisms to produce reliable responses.</span></p><p><span>Before learning how to write better prompts, let&#8217;s understand how a language model reads a prompt&#8230;</span></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/prompt-engineering-guide?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/prompt-engineering-guide?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div><hr></div><h2><span>How Large Language Models Read a Prompt</span></h2><p><span>A prompt does NOT go directly into a language model.</span></p><p><span>Instead, text gets broken into smaller pieces before processing begins. This representation makes it easier for the model to work with text of any length/language.</span></p><p><span>A </span><strong><span>token</span></strong><span> is the basic unit of text the language model processes, representing a word, part of a word, punctuation mark, or other text fragment. The model then works with a sequence of tokens instead of complete words/sentences.</span></p><div class="native-video-embed" data-component-name="VideoPlaceholder" data-attrs="{&quot;mediaUploadId&quot;:&quot;42196a1b-f938-4574-b61d-b69f3aadbc51&quot;,&quot;duration&quot;:null}"></div><p><span>Those tokens become part of the model&#8217;s </span><strong><span>context window</span></strong><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a><span>, its workspace for the current request.</span></p><p><span>It contains everything the model can use to generate a response, such as the system prompt, instructions, examples, retrieved documents, conversation history, and your current prompt. As the model generates new tokens, they also become part of the same context</span><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-2" href="#footnote-2" target="_self">2</a><span>. Yet the context window has a &#8220;fixed&#8221; size, so the prompt &amp; the response share the </span><em><span>same</span></em><span> token budget.</span></p><p><span>The model does NOT treat every token equally&#8230;</span></p><p><span>It decides which part(s) of the context deserve the most focus </span>before generating the next token<span>. This process is called </span><strong><span>attention</span></strong><span>. i.e., the model focuses more on the information most useful for predicting the next token.</span></p><p><span>Imagine listening to several conversations at once&#8230;</span></p><p><span>You hear every voice, but you pay more attention to the most important one.</span></p><p>You&#8217;d expect more context could improve the response. But this is NOT <em>always</em> true. Once the model has the information it needs, extra details can compete for attention instead of helping.</p><p>i.e., relevance matters more than quantity.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3GTC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49240f76-4bb7-42c9-8289-09688540de2d_1286x1041.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3GTC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49240f76-4bb7-42c9-8289-09688540de2d_1286x1041.png 424w, https://substackcdn.com/image/fetch/$s_!3GTC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49240f76-4bb7-42c9-8289-09688540de2d_1286x1041.png 848w, https://substackcdn.com/image/fetch/$s_!3GTC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49240f76-4bb7-42c9-8289-09688540de2d_1286x1041.png 1272w, https://substackcdn.com/image/fetch/$s_!3GTC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49240f76-4bb7-42c9-8289-09688540de2d_1286x1041.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3GTC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49240f76-4bb7-42c9-8289-09688540de2d_1286x1041.png" width="1286" height="1041" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/49240f76-4bb7-42c9-8289-09688540de2d_1286x1041.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1041,&quot;width&quot;:1286,&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_!3GTC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49240f76-4bb7-42c9-8289-09688540de2d_1286x1041.png 424w, https://substackcdn.com/image/fetch/$s_!3GTC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49240f76-4bb7-42c9-8289-09688540de2d_1286x1041.png 848w, https://substackcdn.com/image/fetch/$s_!3GTC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49240f76-4bb7-42c9-8289-09688540de2d_1286x1041.png 1272w, https://substackcdn.com/image/fetch/$s_!3GTC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49240f76-4bb7-42c9-8289-09688540de2d_1286x1041.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="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">Prompt tokenization and context assembly before next-token prediction.</figcaption></figure></div><p><span>Let&#8217;s return to this idea later to discuss Retrieval-Augmented Generation (</span><strong><span>RAG</span></strong><span>) and long-context systems&#8230;</span></p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/prompt-engineering-guide?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/prompt-engineering-guide?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div><hr></div><h2><span>What is In-Context Learning</span></h2><p><span>Spend a little time using </span><em><span>different</span></em><span> AI assistants, and you&#8217;ll notice something&#8230;</span></p><p><span>We often upload images to Gemini, ask ChatGPT general questions, and use Claude for coding. You&#8217;d also notice something else. After rewriting the same prompt a few times, many people try a different approach&#8230; They add an example of what they want, and the response often &#8220;improves&#8221; immediately.</span></p><p><span>The model has NOT learned a new skill.</span></p><p><span>Instead, it uses the </span><em><span>examples</span></em><span> in the prompt to figure out the </span><em><span>pattern</span></em><span> and applies it to the next input. Larger instruction-tuned models usually do this more reliably than smaller ones.</span></p><p><span>This ability is called </span><strong><span>in-context learning</span></strong><span>.</span></p><p><span>One explanation is the model recognizes patterns similar to those encountered during training. Another comes from </span><em><span>Bayesian inference</span></em><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-3" href="#footnote-3" target="_self">3</a><span>, where each example provides another clue about the current task.</span></p><p><span>Yet this works </span>only <span>if the examples represent the task well.</span></p><p><span>If a customer support prompt contains only straightforward complaints &amp; praise, the model will struggle with a review like </span><em><span>&#8220;The package finally arrived. Better late than never.&#8221;</span></em><span> The prompt never showed sarcasm, so the model has to infer the missing pattern&#8230;</span></p><p><span>i.e., a few carefully &#8220;chosen&#8221; examples usually work better than </span><em><span>many</span></em><span> similar ones.</span></p><p>Next, let&#8217;s look at how to design effective prompts&#8230;</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/prompt-engineering-guide?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/prompt-engineering-guide?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div><hr></div><h2><span>Design Effective Prompts</span></h2><p>Many people treat a prompt as one long block of text&#8230;</p><p>When the response isn't what they expected, they rewrite the entire prompt &amp; hope for a better result. Instead, think of a prompt as a &#8220;collection of components&#8221; and not ONE long instruction.</p><p><span>Each component has a specific purpose.</span></p><p><span>Some tell the model what to do, while others provide background information, examples, retrieved documents, conversation history, and/or the desired output format.</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_!cDzA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f4a74b1-b97b-40d2-acfd-b32d7e10f73f_1484x605.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cDzA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f4a74b1-b97b-40d2-acfd-b32d7e10f73f_1484x605.png 424w, https://substackcdn.com/image/fetch/$s_!cDzA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f4a74b1-b97b-40d2-acfd-b32d7e10f73f_1484x605.png 848w, https://substackcdn.com/image/fetch/$s_!cDzA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f4a74b1-b97b-40d2-acfd-b32d7e10f73f_1484x605.png 1272w, https://substackcdn.com/image/fetch/$s_!cDzA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f4a74b1-b97b-40d2-acfd-b32d7e10f73f_1484x605.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cDzA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f4a74b1-b97b-40d2-acfd-b32d7e10f73f_1484x605.png" width="1456" height="594" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0f4a74b1-b97b-40d2-acfd-b32d7e10f73f_1484x605.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:594,&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_!cDzA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f4a74b1-b97b-40d2-acfd-b32d7e10f73f_1484x605.png 424w, https://substackcdn.com/image/fetch/$s_!cDzA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f4a74b1-b97b-40d2-acfd-b32d7e10f73f_1484x605.png 848w, https://substackcdn.com/image/fetch/$s_!cDzA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f4a74b1-b97b-40d2-acfd-b32d7e10f73f_1484x605.png 1272w, https://substackcdn.com/image/fetch/$s_!cDzA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0f4a74b1-b97b-40d2-acfd-b32d7e10f73f_1484x605.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="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">Six principles for designing effective prompts.</figcaption></figure></div><p><span>You do NOT need every component for </span><em><span>each</span></em><span> prompt.</span></p><p><span>A simple question only requires clear instructions, while a more complex application combines several components to give the model the context it needs. This way of thinking also makes it easier to improve the prompts.</span></p><p><span>And when a prompt produces poor results, the issue is often a missing/unclear component rather than the entire prompt. i.e., don&#8217;t rewrite everything when a problem occurs, but</span> identify the component &amp; then refine it.</p><p>Let&#8217;s take an example<em>&#8230;</em>You want to generate a project status update for your team&#8230;</p><p><span>You could write:</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;477e36c0-6636-4dff-aa14-9c1fa5dd7578&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Write a project update.</code></pre></div><p>The model can certainly generate a response, but it has to guess the project, the audience, the level of detail, and the desired format&#8230;</p><p>Now check this:</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;d0c15041-2aa3-4ab5-83b8-210421b20767&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Write a weekly project update for the engineering team.
Summarize the progress of the authentication service,
mention that API integration is complete,
database migration is in progress, and testing begins next week.
Keep the tone professional and format the response as three bullet points.</code></pre></div><p>The second prompt is better because it provides the components the model needs:<em> a clear instruction, relevant context, specific information to include, and the expected output format.</em></p><h3>Prompt <span>Diagnosis Matrix</span></h3><p>Some tasks need more than clear instructions&#8230;</p><p><span>Here&#8217;s a quick diagnostic guide: </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_!piwE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb52eb28-ed1c-42f8-8da2-ff3af6cdddcf_929x739.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!piwE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb52eb28-ed1c-42f8-8da2-ff3af6cdddcf_929x739.png 424w, https://substackcdn.com/image/fetch/$s_!piwE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb52eb28-ed1c-42f8-8da2-ff3af6cdddcf_929x739.png 848w, https://substackcdn.com/image/fetch/$s_!piwE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb52eb28-ed1c-42f8-8da2-ff3af6cdddcf_929x739.png 1272w, https://substackcdn.com/image/fetch/$s_!piwE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb52eb28-ed1c-42f8-8da2-ff3af6cdddcf_929x739.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!piwE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb52eb28-ed1c-42f8-8da2-ff3af6cdddcf_929x739.png" width="404" height="321.3735199138859" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/db52eb28-ed1c-42f8-8da2-ff3af6cdddcf_929x739.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:739,&quot;width&quot;:929,&quot;resizeWidth&quot;:404,&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_!piwE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb52eb28-ed1c-42f8-8da2-ff3af6cdddcf_929x739.png 424w, https://substackcdn.com/image/fetch/$s_!piwE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb52eb28-ed1c-42f8-8da2-ff3af6cdddcf_929x739.png 848w, https://substackcdn.com/image/fetch/$s_!piwE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb52eb28-ed1c-42f8-8da2-ff3af6cdddcf_929x739.png 1272w, https://substackcdn.com/image/fetch/$s_!piwE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdb52eb28-ed1c-42f8-8da2-ff3af6cdddcf_929x739.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="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">Diagnosing common prompt failures.</figcaption></figure></div><p><span>So far, we have focused on the building blocks of a prompt&#8230;</span></p><p><span>The next question is: </span><em><span>How many examples should you include?</span></em></p><div><hr></div><h2><span>Prompting Strategies and Reasoning Techniques</span></h2><p><span>You ask a model to classify customer reviews as positive, negative, or neutral.</span></p><p><span>Sometimes a simple instruction is enough. But for trickier tasks, especially when you care about a specific style, format, or way of reasoning, just telling the model what to do is NOT sufficient. In those cases, giving one or more examples usually helps it perform more reliably.</span></p><p><span>The amount of guidance you provide gives rise to different prompting strategies&#8230;</span></p><p><span>Here are the common prompting strategies based on the number of examples they use:</span></p><ul><li><p><strong>Zero-shot prompting</strong>: you provide only the instruction and the task.</p></li><li><p><strong><span>One-shot prompting:</span></strong><span> you add a single example to show the expected behavior.</span></p></li><li><p><strong><span>Few-shot prompting: </span></strong><span>you include several examples so the model can recognize the underlying pattern.</span></p></li><li><p><strong><span>Many-shot prompting:</span></strong><span> extends few-shot prompting by using dozens or even hundreds of examples.</span></p></li></ul><p>It could be tempting to keep adding examples when the model makes mistakes&#8230;</p><p>Yet more examples are NOT always better. Every example consumes part of the context window. A small set of diverse examples often works better than a long list of similar ones.</p><p>Plus, a tiny instruction such as <em>&#8220;Let&#8217;s think step by step&#8221;</em> can improve performance on many reasoning tasks.</p><p>You do not need to provide examples. Instead, you ask the model to work through the problem step by step before answering. This technique is called <em>zero-shot chain-of-thought prompting</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_!ugTr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad34dd8-1489-4baa-a020-86b090721cc0_1353x833.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ugTr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad34dd8-1489-4baa-a020-86b090721cc0_1353x833.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ugTr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad34dd8-1489-4baa-a020-86b090721cc0_1353x833.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ugTr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad34dd8-1489-4baa-a020-86b090721cc0_1353x833.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ugTr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad34dd8-1489-4baa-a020-86b090721cc0_1353x833.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ugTr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad34dd8-1489-4baa-a020-86b090721cc0_1353x833.jpeg" width="1353" height="833" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2ad34dd8-1489-4baa-a020-86b090721cc0_1353x833.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:833,&quot;width&quot;:1353,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:252928,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://newsletter.systemdesign.one/i/208539859?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad34dd8-1489-4baa-a020-86b090721cc0_1353x833.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ugTr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad34dd8-1489-4baa-a020-86b090721cc0_1353x833.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ugTr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad34dd8-1489-4baa-a020-86b090721cc0_1353x833.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ugTr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad34dd8-1489-4baa-a020-86b090721cc0_1353x833.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ugTr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2ad34dd8-1489-4baa-a020-86b090721cc0_1353x833.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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="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">Comparison of zero-shot, one-shot, few-shot, and many-shot prompting.</figcaption></figure></div><p>Different tasks benefit from different prompting strategies.</p><p>A prompt that works well for factual questions may struggle with complex reasoning.</p><p>Let&#8217;s explore the most widely used techniques and when to apply each one in coming sections&#8230;</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://newsletter.systemdesign.one/p/prompt-engineering-guide?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/prompt-engineering-guide?utm_source=substack&utm_medium=email&utm_content=share&action=share"><span>Share</span></a></p><div><hr></div><h2><span>ReAct and Tool: Augmented Reasoning</span></h2><p><span>Ask ChatGPT, &#8220;</span><em><span>What was your company&#8217;s revenue for last quarter?</span></em><span>&#8220;</span></p><p><span>The answer already exists, but it&#8217;s stored in the company&#8217;s database and NOT in the model&#8217;s memory. If ChatGPT can access the database, it first retrieves the relevant information, then uses it to answer the question.</span></p><p><span>Good </span><em><span>reasoning</span></em><span> is only part of the solution&#8230;The model also needs the right </span><em><span>information</span></em><span>. Without it, even perfect reasoning cannot produce the correct answer&#8230;</span></p><p><span>This is the idea behind Reason &amp; Act (</span><strong>ReAct</strong>)<span>.</span></p><p><span>The model can decide when to use an external tool, retrieve the information it needs, and then continue reasoning with the new evidence.</span></p><div class="native-video-embed" data-component-name="VideoPlaceholder" data-attrs="{&quot;mediaUploadId&quot;:&quot;c7a636c4-410f-4a19-ae43-a8cbbf554307&quot;,&quot;duration&quot;:null}"></div><p><span>This is similar to how we solve problems:</span></p><p><span>When you realize you&#8217;re missing a piece of information, you stop, look it up, and then continue. ReAct follows the same pattern&#8230; The model alternates between reasoning and using tools, with each result becoming part of the context for the next step.</span></p><p><span>Language models can use different tools for different tasks:</span></p><p><span>They could search the web, retrieve documents from a company database, perform calculations, and/or interact with external systems.</span></p><p><span>So the model is no longer limited to the information already in its context b</span>y combining these tools with reasoning<span>&#8230;</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_!PjG2!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4ed9976-325b-4fe2-a60b-e905aa4cbb47_1170x773.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!PjG2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4ed9976-325b-4fe2-a60b-e905aa4cbb47_1170x773.png 424w, https://substackcdn.com/image/fetch/$s_!PjG2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4ed9976-325b-4fe2-a60b-e905aa4cbb47_1170x773.png 848w, https://substackcdn.com/image/fetch/$s_!PjG2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4ed9976-325b-4fe2-a60b-e905aa4cbb47_1170x773.png 1272w, https://substackcdn.com/image/fetch/$s_!PjG2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4ed9976-325b-4fe2-a60b-e905aa4cbb47_1170x773.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!PjG2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4ed9976-325b-4fe2-a60b-e905aa4cbb47_1170x773.png" width="600" height="396.4102564102564" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d4ed9976-325b-4fe2-a60b-e905aa4cbb47_1170x773.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:773,&quot;width&quot;:1170,&quot;resizeWidth&quot;:600,&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_!PjG2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4ed9976-325b-4fe2-a60b-e905aa4cbb47_1170x773.png 424w, https://substackcdn.com/image/fetch/$s_!PjG2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4ed9976-325b-4fe2-a60b-e905aa4cbb47_1170x773.png 848w, https://substackcdn.com/image/fetch/$s_!PjG2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4ed9976-325b-4fe2-a60b-e905aa4cbb47_1170x773.png 1272w, https://substackcdn.com/image/fetch/$s_!PjG2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd4ed9976-325b-4fe2-a60b-e905aa4cbb47_1170x773.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="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">Tool-augmented reasoning workflow.</figcaption></figure></div><p><span>It can gather what it needs before producing an answer&#8230;</span></p><p><span>And this typically leads to accurate &amp; reliable responses.</span></p><h4><span>Worked Example: Stopping a Tool Use Loop From Repeating Itself</span></h4><p><span>Imagine you&#8217;re building an assistant with access to a search tool&#8230;</span></p><p><span>Your first prompt could look like this:</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;c18b8fa6-7ea1-489d-b456-25d181ce981a&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">BEFORE

You have access to a search tool.
Use it to answer the user&#8217;s question.</code></pre></div><p style="text-align: justify;"><span>This seems reasonable&#8230;the model knows it has a tool &amp; knows its objective.</span></p><p style="text-align: justify;"><span>But nothing tells it when to stop searching or how to decide whether a search was &#8220;successful&#8221;. If the search results are incomplete/irrelevant, the model would repeat the same query several times or continue searching unnecessarily.</span></p><p><span>A better prompt adds explicit decision rules:</span></p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;e49a739f-e5c3-4060-bff0-da7211fa49a3&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">AFTER

You have access to a search tool.
Use it when the answer requires current 
or specific information you do not already have.
Before each search, briefly state what you still need to find out.
After each search result, state explicitly whether it answered
what you needed or not; if it did not, try a different query
rather than repeating the same one. You may search up to 3 times.

If you still cannot answer after 3 searches, say so directly instead of guessing.</code></pre></div><p style="text-align: justify;"><span>Notice what changed&#8230;</span></p><p style="text-align: justify;"><span>The revised prompt doesn't simply tell the model to use a tool. It defines </span><em><span>when</span></em><span> to use the tool, </span><em><span>how</span></em><span> to evaluate the result, </span><em><span>when</span></em><span> to try a different strategy, and </span><em><span>when</span></em><span> to stop.</span></p><p style="text-align: justify;"><span>These tiny additions reduce unnecessary tool calls &amp; make the model's behavior more predictable.</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, 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><div><hr></div><h2><strong><span>Verification and Reflection Loops</span></strong></h2>
      <p>
          <a href="https://newsletter.systemdesign.one/p/prompt-engineering-guide">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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 buttonBase-GK1x3M"><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" class="icon-noB79L"><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 buttonBase-GK1x3M"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2 icon-noB79L"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" 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></channel></rss>