<?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[AI by Hand ✍️]]></title><description><![CDATA[Math, Algorithms, Architectures, by hand]]></description><link>https://www.byhand.ai</link><image><url>https://substackcdn.com/image/fetch/$s_!fOmN!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F618d59fa-9b8f-4814-8d16-f29c2f23ae53_371x371.png</url><title>AI by Hand ✍️</title><link>https://www.byhand.ai</link></image><generator>Substack</generator><lastBuildDate>Sun, 13 Sep 2026 18:06:43 GMT</lastBuildDate><atom:link href="https://www.byhand.ai/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Tom Yeh]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[aibyhand@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[aibyhand@substack.com]]></itunes:email><itunes:name><![CDATA[Prof. Tom Yeh]]></itunes:name></itunes:owner><itunes:author><![CDATA[Prof. Tom Yeh]]></itunes:author><googleplay:owner><![CDATA[aibyhand@substack.com]]></googleplay:owner><googleplay:email><![CDATA[aibyhand@substack.com]]></googleplay:email><googleplay:author><![CDATA[Prof. Tom Yeh]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[AI by Hand ✍️ Yantra Jnana Award]]></title><description><![CDATA[Teach AI by Hand in India&#8217;s Languages]]></description><link>https://www.byhand.ai/p/library-newsletter-challenges-yantra-jnana-challenge</link><guid isPermaLink="false">https://www.byhand.ai/p/library-newsletter-challenges-yantra-jnana-challenge</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Fri, 04 Sep 2026 19:32:28 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!RddY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Yantra Jnana means "Machine Knowledge" in Sanskrit. I learned this from Prof. Narendra Karamangala, who is leading a research effort at RV University to build a language model for India's languages.</p><p>September 5th is India&#8217;s Teachers' Day. We are pleased to announce the AI By Hand &#9997;&#65039;  Yantra Jnana Award, which is to recognize extraordinary work teaching AI in an Indian language, by hand, without relying on expensive technologies.</p><p>Please share this announcement with people you know who may be interested in this award!</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!RddY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!RddY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg 424w, https://substackcdn.com/image/fetch/$s_!RddY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg 848w, https://substackcdn.com/image/fetch/$s_!RddY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!RddY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!RddY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg" width="728" height="683.233870967742" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:931,&quot;width&quot;:992,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:213593,&quot;alt&quot;:&quot;Handwriting in several Indian scripts on a notepad, beside a pen and a pair of Channapatna wooden toys&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Handwriting in several Indian scripts on a notepad, beside a pen and a pair of Channapatna wooden toys" title="Handwriting in several Indian scripts on a notepad, beside a pen and a pair of Channapatna wooden toys" srcset="https://substackcdn.com/image/fetch/$s_!RddY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg 424w, https://substackcdn.com/image/fetch/$s_!RddY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg 848w, https://substackcdn.com/image/fetch/$s_!RddY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!RddY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F17fa1a6e-6ded-42f5-85eb-d3b59a8936bc_992x931.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Prof. Narendra&#8217;s hand writing in many Indian languages.</figcaption></figure></div><p>To enter the award, record a video of you teaching AI by hand in one of the following languages:</p><ul><li><p>Hindi</p></li><li><p>Punjabi</p></li><li><p>Marathi</p></li><li><p>Gujarati</p></li><li><p>Kannada</p></li><li><p>Tamil</p></li><li><p>Telugu</p></li><li><p>Malayalam</p></li></ul><p>We know there are a lot more languages in India. But please allow us to start with this initial round of 8 languages, which I believe have the most number of native speakers. If this round is well-received, we will definitely give more awards for cover other languages in the future.</p><h2>Awards</h2><p>We currently have funding to give 10 awards: one in each of the eight languages, and two more to the strongest entries remaining, in any language.</p><p>Each award carries:</p><ul><li><p>A fellowship of &#8377;40,000 (to support you to teach AI by hand to more people)</p></li><li><p>An award certificate (you can hang on the wall)</p></li><li><p>A year of Packt subscription</p></li><li><p>A year of paid subscription for my AI by Hand newsletter</p></li><li><p>Your video featured on my social media channels and YouTube</p></li></ul><h2>Format Requirements</h2><p>These requirements are what make this an AI By Hand &#9997;&#65039; award, so please read it closely.</p><ol><li><p>Print the material for your topic on paper, and work from it.</p></li><li><p>Or use a blackboard or a whiteboard. No iPad, no tablet, no digital ink.</p></li><li><p>Keep your hand in the frame for the entire video.</p></li></ol><h2>Judging Criteria</h2><p>Every entry is read by a panel of expert reviewer who work in your language.</p><p>Every entry is read by an expert reviewer who works in your language, and scored on five things:</p><ul><li><p><strong>Conceptual accuracy</strong> (35%): is the idea exactly right, however you chose to explain it?</p></li><li><p><strong>Pedagogical value</strong> (25%): does it build real intuition, or only state facts?</p></li><li><p><strong>Language quality</strong> (20%): is the language fluent and natural?</p></li><li><p><strong>Originality of approach</strong> (15%): is the teaching style your own, rather than a copy of the source&#8217;s framing?</p></li><li><p><strong>Production quality</strong> (5%): is it clear enough to watch and hear?</p></li></ul><p>These criteria and weights are subject to change until the submission window opens on September 12.</p><h2>Timeline</h2><ul><li><p>Saturday, September 5: Registration opens</p></li><li><p>Friday, September 18: Registration closes</p></li><li><p>Friday, October 16: Videos are due</p></li><li><p>Friday, October 30: Awards are announced</p></li></ul><h2>Register</h2><p>Registering is the only step to take right now. Once you have registered, we will email you the submission instructions.</p><p>Register by Friday, September 18: <a href="https://byhand.ai/yantra/register">byhand.ai/yantra/register</a></p><div><hr></div><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://byhand.ai/yantra/register&quot;,&quot;text&quot;:&quot;Register&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://byhand.ai/yantra/register"><span>Register</span></a></p><p></p>]]></content:encoded></item><item><title><![CDATA[Counting AI by Hand ✍️ ~ Recordings]]></title><description><![CDATA[Mohsena Ashraf on measuring what AI costs, in Excel]]></description><link>https://www.byhand.ai/p/library-series-videos-counting-ai-by-hand</link><guid isPermaLink="false">https://www.byhand.ai/p/library-series-videos-counting-ai-by-hand</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Sat, 22 Aug 2026 13:21:17 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ebNU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Mohsena Ashraf, my PhD student at CU Boulder, leads this series on how to count AI by hand &#9997;&#65039;. Her research is in explainable AI, and her particular interest is cost. How much memory does a transformer layer need? How many tokens are sitting in an agent's memory? Where do the computational costs of AI actually come from?</p><p>The method is the same in every lecture. Instead of equations and Greek symbols, operations and tokens become 2D rectangles in a spreadsheet, and the area of a rectangle is the cost. Once you can see it, you can measure it, compare it, and count it by hand. Everything happens in Excel, so every formula is visible and every workbook is yours to keep and to modify.</p><ol><li><p>Transformer Ops</p></li><li><p>Agent Tokens</p></li><li><p>Loop Engineering [coming Sep 3]</p></li></ol><p>This series is sponsored by By Hand Research.</p><h3><a href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-transformer-ops">1. Transformer Ops (Jun 23, 2026)</a> <sup><span data-color="#bf9000" style="color: rgb(191, 144, 0);">(free)</span></sup></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-transformer-ops" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ebNU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ebNU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Transformer Ops (Jun 23, 2026)&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-videos-counting-ai-by-hand-transformer-ops&quot;,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Transformer Ops (Jun 23, 2026)" title="Transformer Ops (Jun 23, 2026)" srcset="https://substackcdn.com/image/fetch/$s_!ebNU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-agent-tokens">2. Agent Tokens (Jul 14, 2026)</a> <sup><span data-color="#bf9000" style="color: rgb(191, 144, 0);">(free)</span></sup></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-agent-tokens" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8Rno!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 424w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 848w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8Rno!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Agent Tokens (Jul 14, 2026)&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-videos-counting-ai-by-hand-agent-tokens&quot;,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Agent Tokens (Jul 14, 2026)" title="Agent Tokens (Jul 14, 2026)" srcset="https://substackcdn.com/image/fetch/$s_!8Rno!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 424w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 848w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-loop-engineering">3. Loop Engineering (coming soon, Sep 3, 2026)</a> <sup><span data-color="#bf9000" style="color: rgb(191, 144, 0);">(free)</span></sup></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-loop-engineering" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!vC9t!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f9e47d3-df9e-4e07-92c8-aa378391ae3f_1076x1080.jpeg 424w, https://substackcdn.com/image/fetch/$s_!vC9t!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f9e47d3-df9e-4e07-92c8-aa378391ae3f_1076x1080.jpeg 848w, https://substackcdn.com/image/fetch/$s_!vC9t!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f9e47d3-df9e-4e07-92c8-aa378391ae3f_1076x1080.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!vC9t!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f9e47d3-df9e-4e07-92c8-aa378391ae3f_1076x1080.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!vC9t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f9e47d3-df9e-4e07-92c8-aa378391ae3f_1076x1080.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9f9e47d3-df9e-4e07-92c8-aa378391ae3f_1076x1080.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Loop Engineering (coming soon, Sep 3, 2026)&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-videos-counting-ai-by-hand-loop-engineering&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="Loop Engineering (coming soon, Sep 3, 2026)" title="Loop Engineering (coming soon, Sep 3, 2026)" srcset="https://substackcdn.com/image/fetch/$s_!vC9t!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f9e47d3-df9e-4e07-92c8-aa378391ae3f_1076x1080.jpeg 424w, https://substackcdn.com/image/fetch/$s_!vC9t!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f9e47d3-df9e-4e07-92c8-aa378391ae3f_1076x1080.jpeg 848w, https://substackcdn.com/image/fetch/$s_!vC9t!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f9e47d3-df9e-4e07-92c8-aa378391ae3f_1076x1080.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!vC9t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9f9e47d3-df9e-4e07-92c8-aa378391ae3f_1076x1080.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div>]]></content:encoded></item><item><title><![CDATA[Loop Engineering (coming soon, Sep 3, 2026)]]></title><description><![CDATA[Counting AI by Hand &#9997;&#65039; Lecture Series by Mohsena]]></description><link>https://www.byhand.ai/p/library-videos-counting-ai-by-hand-loop-engineering</link><guid isPermaLink="false">https://www.byhand.ai/p/library-videos-counting-ai-by-hand-loop-engineering</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Sat, 22 Aug 2026 13:20:31 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!fOmN!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F618d59fa-9b8f-4814-8d16-f29c2f23ae53_371x371.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-videos-counting-ai-by-hand">Counting AI by Hand &#9997;&#65039;</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-transformer-ops">Transformer Ops (Jun 23, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-agent-tokens">Agent Tokens (Jul 14, 2026)</a></p></li><li><p><strong>Loop Engineering (coming soon, Sep 3, 2026)</strong></p></li></ol></div><p>The third lecture of Counting AI by Hand &#9997;&#65039; is on September 3.</p><p>The first lecture counted the operations inside the model, and the second counted the tokens moving through an application. This one counts what happens when nobody is re-prompting: the agent reads the goal, picks an action, checks whether it is done, and goes around again. You used to be the loop. Now the loop runs on its own, and every turn of it is billed.</p><p>Here is a preview of the workbook.</p><h2>About the instructor</h2><p>Mohsena Ashraf is a PhD student in computer science at CU Boulder, with a research focus in HCI. Her work is on explainable AI, and specifically on making AI's cost legible to people who are not engineers.</p><h2>Workbook</h2><p>Three exercises, all of them the same job search agent looping until it collects five good opportunities.</p><ol><li><p><strong>Loop Cost.</strong> Eight opportunities have to be checked before five turn out to be eligible, so how many LLM calls is that, and what do the input tokens, the output tokens and the bill come to?</p></li><li><p><strong>Expected Loops and Context Growth.</strong> Each opportunity has only a 50% chance of being eligible, so how many loops should you expect to run, and how much of what you pay for is the context that grows with every one of them?</p></li><li><p><strong>Loop Optimization.</strong> The same three steps in two different orders, priced side by side. One order is cheaper, and the reason is that the expensive step runs fewer times.</p></li></ol><p>There is a Solution sheet with every answer worked out, so you can fill the tables in yourself first or read straight through.</p><p><a href="https://library.byhand.ai/files/videos/counting-ai-by-hand/loop-engineering/LoopEngineering.xlsx">&#11015; Excel Workbook</a></p><p>The recording will be posted here after the lecture.</p>]]></content:encoded></item><item><title><![CDATA[Agent Tokens (Jul 14, 2026)]]></title><description><![CDATA[Counting AI by Hand &#9997;&#65039; Lecture Series by Mohsena]]></description><link>https://www.byhand.ai/p/library-videos-counting-ai-by-hand-agent-tokens</link><guid isPermaLink="false">https://www.byhand.ai/p/library-videos-counting-ai-by-hand-agent-tokens</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Sat, 22 Aug 2026 13:19:44 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!8Rno!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; Counting AI by Hand &#9997;&#65039;</h3><ol><li><p><a href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-transformer-ops">Transformer Ops (Jun 23, 2026)</a></p></li><li><p><strong>Agent Tokens (Jul 14, 2026)</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-loop-engineering">Loop Engineering (coming soon, Sep 3, 2026)</a></p></li></ol></div><p>Thank you for attending the second lecture of Counting AI by Hand &#9997;&#65039;, and for those who could not join us live, here is the recording.</p><p>The first lecture counted the operations inside the model. This one counts the tokens moving through an application, which is where the question that started the series finally gets a direct answer.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8Rno!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8Rno!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 424w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 848w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8Rno!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8Rno!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 424w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 848w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!8Rno!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe437af92-fe67-439a-b5b5-127a6b67b849_2409x872.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>Here are some of the counting questions from this lecture.</p><ul><li><p><strong>[Input vs Output]</strong> Why does the text the model writes cost more than the text you typed?</p></li><li><p><strong>[Conversation History]</strong> What makes the same short question cost more late in a chat than at the start?</p></li><li><p><strong>[Tool Calls]</strong> Which costs more, three turns of plain chat or two turns that call a tool?</p></li><li><p><strong>[RAG]</strong> How many times do you pay for a chunk your retriever keeps finding?</p></li><li><p><strong>[Multi-Agent]</strong> What does it cost when every agent in a system keeps its own conversation?</p></li></ul><p>Mohsena works through every one of them in Excel, counting by hand. The cells hold tokens this time, and the total is your bill.</p><h2>Outline</h2><ol><li><p>Introduction (00:00)</p></li><li><p>Tokens basics, and why output costs more (01:51)</p><ol><li><p>FLOPs vs tokens</p></li><li><p>What a user sees</p></li><li><p>What actually happens: system prompt + history + tool results = input</p></li></ol></li><li><p>Chat history token counting (08:01)</p><ol><li><p>Basic chat, priced per turn</p></li></ol></li><li><p>Tool calls and token billing (18:07)</p><ol><li><p>Tool definitions, the call, the output</p></li><li><p>Why tool calls cost more (30:24)</p></li></ol></li><li><p>RAG workflow and token math (32:15)</p><ol><li><p>The same chunk, retrieved twice and paid for twice</p></li><li><p>Naive vs optimized: what has to be in the next request</p></li></ol></li><li><p>RAG variations and other inputs (47:15)</p><ol><li><p>Image + text</p></li></ol></li><li><p>Memory and multi-agent costs (48:27)</p><ol><li><p>Two sessions, and what the application stores between them</p></li><li><p>Planner and specialists, each with their own conversation</p></li></ol></li></ol><h2>About the instructor</h2><p>Mohsena Ashraf is a PhD student in computer science at CU Boulder, with a research focus in HCI. Her work is on explainable AI, and specifically on making AI's cost legible to people who are not engineers.</p><h2>Recording &amp; Workbook</h2><div id="youtube2-3chlg_dl_yA" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;3chlg_dl_yA&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/3chlg_dl_yA?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><p><a href="https://library.byhand.ai/files/videos/counting-ai-by-hand/agent-tokens/AgentTokens.xlsx">&#11015; Excel Workbook</a></p><div><hr></div><p>Next:<br><strong><a href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-loop-engineering">3. Loop Engineering (coming soon, Sep 3, 2026)</a></strong></p>]]></content:encoded></item><item><title><![CDATA[Transformer Ops (Jun 23, 2026)]]></title><description><![CDATA[Counting AI by Hand &#9997;&#65039; Lecture Series by Mohsena]]></description><link>https://www.byhand.ai/p/library-videos-counting-ai-by-hand-transformer-ops</link><guid isPermaLink="false">https://www.byhand.ai/p/library-videos-counting-ai-by-hand-transformer-ops</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Sat, 22 Aug 2026 13:18:56 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ebNU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; Counting AI by Hand &#9997;&#65039;</h3><ol><li><p><strong>Transformer Ops (Jun 23, 2026)</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-agent-tokens">Agent Tokens (Jul 14, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-loop-engineering">Loop Engineering (coming soon, Sep 3, 2026)</a></p></li></ol></div><p>Thank you for attending the first lecture of Counting AI by Hand &#9997;&#65039;. Mohsena and I have been working on this series for months, and I am genuinely surprised by how many of you turned up for a topic like this one. This recording is for those who could not join us live.</p><p>Although the series is motivated by questions like "why are tokens costing so much?", we decided to go back and start from the foundational layer of counting the FLOPs, or the operations of the transformer architecture behind every model we are using today.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ebNU!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ebNU!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ebNU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ebNU!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ebNU!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c3a92ce-da27-4497-af16-5ba4ecb51b14_2409x872.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>Here are some of the counting questions Mohsena works through in this lecture.</p><ul><li><p><strong>[Dot Product]</strong> Why does a single dot product cost more operations than the vectors have numbers?</p></li><li><p><strong>[Context Length]</strong> What happens to the cost of attention when you double the length of your prompt?</p></li><li><p><strong>[Concatenation]</strong> How many operations does it take to concatenate the outputs of six attention heads?</p></li><li><p><strong>[Attention vs MLP]</strong> Which costs more, attention or the MLP, and does that flip as models get bigger?</p></li><li><p><strong>[Backpropagation]</strong> How much more does it cost to train a block than to run it once?</p></li></ul><p>She built Excel worksheets to go over how you can "count" by hand to answer these questions. A matrix is a block of cells, and counting the operations is just counting the cells.</p><h2>Outline</h2><ol><li><p>What are FLOPs (00:00)</p><ol><li><p>Why FLOP matters</p></li></ol></li><li><p>Visualizing simple FLOP costs (03:09)</p><ol><li><p>Vector dot product</p></li><li><p>Matrix-vector product</p></li><li><p>Matrix-matrix product</p></li><li><p>FLOPs get huge</p></li></ol></li><li><p>Flow of the transformer architecture (11:51)</p><ol><li><p>Sequence length (n), embedding size (d), heads (h), layers (L)</p></li></ol></li><li><p>Counting attention FLOPs (17:27)</p><ol><li><p>Softmax scaling (27:02)</p></li><li><p>Value aggregation (27:40)</p></li><li><p>Concat and output projection (29:26)</p></li><li><p>Attention total (31:52)</p></li></ol></li><li><p>FLOP counting after attention (33:37)</p><ol><li><p>Residual add and LayerNorm</p></li></ol></li><li><p>FLOP counting for the MLP (40:48)</p><ol><li><p>Layer 1 and ReLU</p></li><li><p>Layer 2 and the block total (44:52)</p></li></ol></li></ol><p>The workbook carries two things the hour did not reach: a full backpropagation FLOP count on its own sheet, and the multi-head attention and full-stack sheets underneath it.</p><h2>About the instructor</h2><p>Mohsena Ashraf is a PhD student in computer science at CU Boulder, with a research focus in HCI. Her work is on explainable AI, and specifically on making AI's cost legible to people who are not engineers.</p><h2>Recording &amp; Workbook</h2><div id="youtube2-vSLvSzLq0hY" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;vSLvSzLq0hY&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/vSLvSzLq0hY?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><p><a href="https://library.byhand.ai/files/videos/counting-ai-by-hand/transformer-ops/TransformerFLOPs.xlsx">&#11015; Excel Workbook</a></p><div><hr></div><p>Next:<br><strong><a href="https://www.byhand.ai/p/library-videos-counting-ai-by-hand-agent-tokens">2. Agent Tokens (Jul 14, 2026)</a></strong></p>]]></content:encoded></item><item><title><![CDATA[Kimi 3 ~ New Seminar Recording]]></title><description><![CDATA[AI by Hand &#9997;&#65039; Seminars]]></description><link>https://www.byhand.ai/p/library-videos-seminars-2026-kimi-3-seminar-recording</link><guid isPermaLink="false">https://www.byhand.ai/p/library-videos-seminars-2026-kimi-3-seminar-recording</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Thu, 20 Aug 2026 14:22:27 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!L8wb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-videos-seminars-2026">Seminar Series 2026</a></h3><ol><li><p><a href="https://www.byhand.ai/p/manifold-constrained-hyper-connections">Manifold-Constrained Hyper Connections (mHC) from DeepSeek (Jan 9, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/how-small-models-learn-tool-use">How Small Models Learn Tool Use (Jan 11, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/introduction-to-gen-ai">Generative AI (Jan 11, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/seminar-foundation-attention-to-frontier">Attention (Jan 15, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/google-ironwood-tpu-from-bits-to">Google Ironwood TPU: From Bits to HBM (Jan 19, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/ai-eval-equations-you-must-know">9 AI Eval Formulas You Must Know (Jan 24, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/meta-superintelligence-labs-vs-facebook">Meta Superintelligence Labs vs Facebook AI Research (Jan 30, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/transformer-six-levels-of-understanding">Transformer: Six Levels of Understanding (Feb 13, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/openclaw-seminar">OpenClaw Seminar (Feb 23, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/recording-ppo-dpo-grpo-rubrics">PPO &#8594; DPO &#8594; GRPO &#8594; Rubrics (Mar 2, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/gemma-4-seminar-recording">Gemma 4 (May 7, 2026)</a></p></li><li><p><a href="https://www.byhand.ai/p/qwen-3-6-seminar-recording">Qwen 3.6 (May 21, 2026)</a></p></li><li><p><strong>Kimi 3 (Aug 6, 2026)</strong></p></li></ol></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!L8wb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!L8wb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg 424w, https://substackcdn.com/image/fetch/$s_!L8wb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg 848w, https://substackcdn.com/image/fetch/$s_!L8wb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!L8wb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!L8wb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!L8wb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg 424w, https://substackcdn.com/image/fetch/$s_!L8wb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg 848w, https://substackcdn.com/image/fetch/$s_!L8wb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!L8wb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F50f97871-652e-45f7-9c06-e279ec32a9d4_1920x1080.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>Thank you to everyone who joined the Frontier AI Seminar on Kimi 3.</p><p>It has been a while since I gave the last seminar on Qwen. Happy to get together with many of you again to study frontier model math and architecture by hand in Excel!</p><p>We are blessed with <a href="https://x.com/natolambert">Nathan Lambert</a>, the author of <a href="https://www.interconnects.ai">Interconnects</a>, some of the most authoritative writing on open models, as a special guest. Nathan also wrote the <a href="https://rlhfbook.com">RLHF book</a> which has just been <a href="https://www.manning.com/books/the-rlhf-book">published by Manning</a>.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OKF-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e26bb0-dc43-4385-be26-221cb8e476a8_1206x954.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OKF-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e26bb0-dc43-4385-be26-221cb8e476a8_1206x954.jpeg 424w, https://substackcdn.com/image/fetch/$s_!OKF-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e26bb0-dc43-4385-be26-221cb8e476a8_1206x954.jpeg 848w, https://substackcdn.com/image/fetch/$s_!OKF-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e26bb0-dc43-4385-be26-221cb8e476a8_1206x954.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!OKF-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e26bb0-dc43-4385-be26-221cb8e476a8_1206x954.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OKF-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e26bb0-dc43-4385-be26-221cb8e476a8_1206x954.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/30e26bb0-dc43-4385-be26-221cb8e476a8_1206x954.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OKF-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e26bb0-dc43-4385-be26-221cb8e476a8_1206x954.jpeg 424w, https://substackcdn.com/image/fetch/$s_!OKF-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e26bb0-dc43-4385-be26-221cb8e476a8_1206x954.jpeg 848w, https://substackcdn.com/image/fetch/$s_!OKF-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e26bb0-dc43-4385-be26-221cb8e476a8_1206x954.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!OKF-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30e26bb0-dc43-4385-be26-221cb8e476a8_1206x954.jpeg 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>Here are some of my favorite moments:</p><ul><li><p>Nathan shared his behind-the-scenes story about his trip to Moonshot AI.</p></li><li><p>Nathan's famous dog Phoebe had a surprise appearance on camera.</p></li><li><p>I got to finally talk about Linear Transformer line of frontier model advances.</p></li><li><p>I got to mention LeBron James in my explanation of the attention mechanism.</p></li></ul><p>Thanks for your feedback!</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2y-t!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1c0ffc6-c414-4db9-828c-8fb3f51117fb_1392x1698.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2y-t!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1c0ffc6-c414-4db9-828c-8fb3f51117fb_1392x1698.jpeg 424w, https://substackcdn.com/image/fetch/$s_!2y-t!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1c0ffc6-c414-4db9-828c-8fb3f51117fb_1392x1698.jpeg 848w, https://substackcdn.com/image/fetch/$s_!2y-t!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1c0ffc6-c414-4db9-828c-8fb3f51117fb_1392x1698.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!2y-t!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1c0ffc6-c414-4db9-828c-8fb3f51117fb_1392x1698.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2y-t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1c0ffc6-c414-4db9-828c-8fb3f51117fb_1392x1698.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c1c0ffc6-c414-4db9-828c-8fb3f51117fb_1392x1698.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2y-t!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1c0ffc6-c414-4db9-828c-8fb3f51117fb_1392x1698.jpeg 424w, https://substackcdn.com/image/fetch/$s_!2y-t!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1c0ffc6-c414-4db9-828c-8fb3f51117fb_1392x1698.jpeg 848w, https://substackcdn.com/image/fetch/$s_!2y-t!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1c0ffc6-c414-4db9-828c-8fb3f51117fb_1392x1698.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!2y-t!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc1c0ffc6-c414-4db9-828c-8fb3f51117fb_1392x1698.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Before the summer, I did plan to talk about Linear Transformer line and wanted to use NVIDIA Nemotron as the backdrop. However, when Kimi 3 was released, I found an even stronger storyline, one where I can track the evolution much further from Linear Attention, DeltaNet, to the latest Kimi Delta Attention (KDA).</p><h2>Outline</h2><ol><li><p>Interview and Discussion</p><ul><li><p>Nathan Lambert</p></li><li><p>Moonshot AI Tour</p></li><li><p>Open vs Closed Models</p></li><li><p>Audience Q&amp;A</p></li></ul></li><li><p>Kimi 3 by Hand</p><ul><li><p>Attention</p></li><li><p>Quadratic Attention</p></li><li><p>Inference and KV Cache</p></li><li><p>Local Attention</p></li><li><p>Linear Attention</p></li><li><p>DeltaNet</p></li><li><p>Kimi Delta Attention (KDA)</p></li><li><p>Convolution and Gating</p></li><li><p>Chunkwise Parallel Computation</p></li><li><p>Seq2Seq LSTM</p></li></ul></li></ol><h2>Recording &amp; Workbook</h2><p><em>Limited-time free: the full recording and the Excel workbook are open to everyone for now.</em></p><div id="youtube2-d1O_hQQUe7s" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;d1O_hQQUe7s&quot;,&quot;startTime&quot;:null,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/d1O_hQQUe7s?rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><p><a href="https://library.byhand.ai/files/videos/seminars-2026/kimi-3-seminar-recording/Kimi3.xlsx">&#11015; Excel Workbook</a></p>]]></content:encoded></item><item><title><![CDATA[Context Problems]]></title><description><![CDATA[Agentic AI by hand &#9997;&#65039;]]></description><link>https://www.byhand.ai/p/library-series-agents-context</link><guid isPermaLink="false">https://www.byhand.ai/p/library-series-agents-context</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Wed, 19 Aug 2026 05:20:38 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!zPTv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339fc974-29b2-4b28-98b6-8a49088a6bd8_1845x800.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This is the second workbook in the series, and the one I promised at the end of the first. That one was about tokens: what they are, how to count them, what they cost. This one is about where they go.</p><p>Every model has a context window, and every window is a budget. These problems ask you to spend it. You will mark out a window and fill it turn by turn, work out whether the next message still fits, and count how many turns you get before it does not. Then retrieval arrives and takes its share, and you will see what a single retrieved document does to the turns you had left.</p><p>Halfway through, the window runs out and you have to decide what to do about it. Dropping the oldest turn is the simple answer, and problem 10 asks what that costs you. Compaction is the better one, and five problems work through what it spends, when to reach for it, and what survives.</p><p>The last five changed how I think about long conversations. A stateless API resends the entire context every turn. Add that up across a session and the cost is not the length of the conversation, it is the square of it. You will do the addition by hand, which is the only way I know to make that number feel real.</p><p>Twenty problems again. Bring a pen.</p><h3><a href="https://www.byhand.ai/p/library-agents-context-the-window-as-a-budget">1. The Context Window</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-the-window-as-a-budget" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zPTv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339fc974-29b2-4b28-98b6-8a49088a6bd8_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!zPTv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339fc974-29b2-4b28-98b6-8a49088a6bd8_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!zPTv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339fc974-29b2-4b28-98b6-8a49088a6bd8_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!zPTv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339fc974-29b2-4b28-98b6-8a49088a6bd8_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zPTv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339fc974-29b2-4b28-98b6-8a49088a6bd8_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/339fc974-29b2-4b28-98b6-8a49088a6bd8_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;The Context Window&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-the-window-as-a-budget&quot;,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The Context Window" title="The Context Window" srcset="https://substackcdn.com/image/fetch/$s_!zPTv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339fc974-29b2-4b28-98b6-8a49088a6bd8_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!zPTv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339fc974-29b2-4b28-98b6-8a49088a6bd8_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!zPTv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339fc974-29b2-4b28-98b6-8a49088a6bd8_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!zPTv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F339fc974-29b2-4b28-98b6-8a49088a6bd8_1845x800.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-what-fills-the-window">2. Window Occupancy</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-what-fills-the-window" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!L9Z7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7bec23a-13f5-4526-8f7e-08f0088b30e6_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!L9Z7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7bec23a-13f5-4526-8f7e-08f0088b30e6_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!L9Z7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7bec23a-13f5-4526-8f7e-08f0088b30e6_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!L9Z7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7bec23a-13f5-4526-8f7e-08f0088b30e6_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!L9Z7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7bec23a-13f5-4526-8f7e-08f0088b30e6_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e7bec23a-13f5-4526-8f7e-08f0088b30e6_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Window Occupancy&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-what-fills-the-window&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="Window Occupancy" title="Window Occupancy" srcset="https://substackcdn.com/image/fetch/$s_!L9Z7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7bec23a-13f5-4526-8f7e-08f0088b30e6_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!L9Z7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7bec23a-13f5-4526-8f7e-08f0088b30e6_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!L9Z7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7bec23a-13f5-4526-8f7e-08f0088b30e6_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!L9Z7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe7bec23a-13f5-4526-8f7e-08f0088b30e6_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-turn-by-turn">3. Growth per Turn</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-turn-by-turn" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qxNW!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F361835af-65de-4815-8827-bd74d0f6f7ea_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!qxNW!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F361835af-65de-4815-8827-bd74d0f6f7ea_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!qxNW!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F361835af-65de-4815-8827-bd74d0f6f7ea_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!qxNW!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F361835af-65de-4815-8827-bd74d0f6f7ea_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qxNW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F361835af-65de-4815-8827-bd74d0f6f7ea_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/361835af-65de-4815-8827-bd74d0f6f7ea_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Growth per Turn&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-turn-by-turn&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="Growth per Turn" title="Growth per Turn" srcset="https://substackcdn.com/image/fetch/$s_!qxNW!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F361835af-65de-4815-8827-bd74d0f6f7ea_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!qxNW!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F361835af-65de-4815-8827-bd74d0f6f7ea_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!qxNW!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F361835af-65de-4815-8827-bd74d0f6f7ea_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!qxNW!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F361835af-65de-4815-8827-bd74d0f6f7ea_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-will-it-fit">4. Remaining Space</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-will-it-fit" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!m-g8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd688a7-34c1-436a-b6ea-076ab229ff53_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!m-g8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd688a7-34c1-436a-b6ea-076ab229ff53_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!m-g8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd688a7-34c1-436a-b6ea-076ab229ff53_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!m-g8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd688a7-34c1-436a-b6ea-076ab229ff53_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!m-g8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd688a7-34c1-436a-b6ea-076ab229ff53_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2dd688a7-34c1-436a-b6ea-076ab229ff53_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Remaining Space&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-will-it-fit&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="Remaining Space" title="Remaining Space" srcset="https://substackcdn.com/image/fetch/$s_!m-g8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd688a7-34c1-436a-b6ea-076ab229ff53_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!m-g8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd688a7-34c1-436a-b6ea-076ab229ff53_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!m-g8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd688a7-34c1-436a-b6ea-076ab229ff53_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!m-g8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd688a7-34c1-436a-b6ea-076ab229ff53_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-turns-until-full">5. Turn Budget</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-turns-until-full" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1Qng!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea619674-ddb6-4026-b2ba-af5a35665723_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!1Qng!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea619674-ddb6-4026-b2ba-af5a35665723_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!1Qng!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea619674-ddb6-4026-b2ba-af5a35665723_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!1Qng!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea619674-ddb6-4026-b2ba-af5a35665723_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1Qng!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea619674-ddb6-4026-b2ba-af5a35665723_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ea619674-ddb6-4026-b2ba-af5a35665723_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Turn Budget&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-turns-until-full&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="Turn Budget" title="Turn Budget" srcset="https://substackcdn.com/image/fetch/$s_!1Qng!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea619674-ddb6-4026-b2ba-af5a35665723_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!1Qng!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea619674-ddb6-4026-b2ba-af5a35665723_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!1Qng!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea619674-ddb6-4026-b2ba-af5a35665723_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!1Qng!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fea619674-ddb6-4026-b2ba-af5a35665723_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-chunking-a-document">6. Retrieval Footprint</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-chunking-a-document" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nSnf!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03893d3f-01a1-4a7c-b78c-7132713ce1f5_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!nSnf!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03893d3f-01a1-4a7c-b78c-7132713ce1f5_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!nSnf!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03893d3f-01a1-4a7c-b78c-7132713ce1f5_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!nSnf!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03893d3f-01a1-4a7c-b78c-7132713ce1f5_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nSnf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03893d3f-01a1-4a7c-b78c-7132713ce1f5_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/03893d3f-01a1-4a7c-b78c-7132713ce1f5_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Retrieval Footprint&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-chunking-a-document&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="Retrieval Footprint" title="Retrieval Footprint" srcset="https://substackcdn.com/image/fetch/$s_!nSnf!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03893d3f-01a1-4a7c-b78c-7132713ce1f5_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!nSnf!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03893d3f-01a1-4a7c-b78c-7132713ce1f5_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!nSnf!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03893d3f-01a1-4a7c-b78c-7132713ce1f5_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!nSnf!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F03893d3f-01a1-4a7c-b78c-7132713ce1f5_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-rag-chunks-in-the-budget">7. Retrieval per Turn</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-rag-chunks-in-the-budget" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!kh_e!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526947b8-75b1-40cf-9962-a3a1dc8583e7_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!kh_e!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526947b8-75b1-40cf-9962-a3a1dc8583e7_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!kh_e!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526947b8-75b1-40cf-9962-a3a1dc8583e7_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!kh_e!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526947b8-75b1-40cf-9962-a3a1dc8583e7_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!kh_e!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526947b8-75b1-40cf-9962-a3a1dc8583e7_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/526947b8-75b1-40cf-9962-a3a1dc8583e7_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Retrieval per Turn&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-rag-chunks-in-the-budget&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="Retrieval per Turn" title="Retrieval per Turn" srcset="https://substackcdn.com/image/fetch/$s_!kh_e!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526947b8-75b1-40cf-9962-a3a1dc8583e7_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!kh_e!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526947b8-75b1-40cf-9962-a3a1dc8583e7_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!kh_e!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526947b8-75b1-40cf-9962-a3a1dc8583e7_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!kh_e!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F526947b8-75b1-40cf-9962-a3a1dc8583e7_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-three-rounds-of-search">8. Search Rounds</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-three-rounds-of-search" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ap9A!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2eade3-ee7b-48bf-9f51-664c8b0ab154_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ap9A!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2eade3-ee7b-48bf-9f51-664c8b0ab154_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ap9A!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2eade3-ee7b-48bf-9f51-664c8b0ab154_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ap9A!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2eade3-ee7b-48bf-9f51-664c8b0ab154_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ap9A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2eade3-ee7b-48bf-9f51-664c8b0ab154_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8d2eade3-ee7b-48bf-9f51-664c8b0ab154_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Search Rounds&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-three-rounds-of-search&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="Search Rounds" title="Search Rounds" srcset="https://substackcdn.com/image/fetch/$s_!ap9A!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2eade3-ee7b-48bf-9f51-664c8b0ab154_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ap9A!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2eade3-ee7b-48bf-9f51-664c8b0ab154_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ap9A!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2eade3-ee7b-48bf-9f51-664c8b0ab154_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ap9A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8d2eade3-ee7b-48bf-9f51-664c8b0ab154_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-sizing-the-window">9. Window Sizing</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-sizing-the-window" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!P9h2!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ff813b9-68cf-48ed-82d3-aeef56dab90a_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!P9h2!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ff813b9-68cf-48ed-82d3-aeef56dab90a_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!P9h2!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ff813b9-68cf-48ed-82d3-aeef56dab90a_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!P9h2!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ff813b9-68cf-48ed-82d3-aeef56dab90a_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!P9h2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ff813b9-68cf-48ed-82d3-aeef56dab90a_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5ff813b9-68cf-48ed-82d3-aeef56dab90a_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Window Sizing&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-sizing-the-window&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="Window Sizing" title="Window Sizing" srcset="https://substackcdn.com/image/fetch/$s_!P9h2!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ff813b9-68cf-48ed-82d3-aeef56dab90a_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!P9h2!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ff813b9-68cf-48ed-82d3-aeef56dab90a_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!P9h2!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ff813b9-68cf-48ed-82d3-aeef56dab90a_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!P9h2!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ff813b9-68cf-48ed-82d3-aeef56dab90a_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest">10. Truncation</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2m11!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3064f33-8394-4619-8e05-2af526c0e4d3_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!2m11!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3064f33-8394-4619-8e05-2af526c0e4d3_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!2m11!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3064f33-8394-4619-8e05-2af526c0e4d3_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!2m11!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3064f33-8394-4619-8e05-2af526c0e4d3_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2m11!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3064f33-8394-4619-8e05-2af526c0e4d3_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e3064f33-8394-4619-8e05-2af526c0e4d3_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Truncation&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest&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="Truncation" title="Truncation" srcset="https://substackcdn.com/image/fetch/$s_!2m11!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3064f33-8394-4619-8e05-2af526c0e4d3_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!2m11!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3064f33-8394-4619-8e05-2af526c0e4d3_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!2m11!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3064f33-8394-4619-8e05-2af526c0e4d3_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!2m11!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe3064f33-8394-4619-8e05-2af526c0e4d3_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-window">11. Compaction</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-compacting-the-window" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1rUo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a53d94-4ab0-4340-a4eb-b9f895868a92_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!1rUo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a53d94-4ab0-4340-a4eb-b9f895868a92_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!1rUo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a53d94-4ab0-4340-a4eb-b9f895868a92_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!1rUo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a53d94-4ab0-4340-a4eb-b9f895868a92_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1rUo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a53d94-4ab0-4340-a4eb-b9f895868a92_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c9a53d94-4ab0-4340-a4eb-b9f895868a92_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Compaction&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-compacting-the-window&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="Compaction" title="Compaction" srcset="https://substackcdn.com/image/fetch/$s_!1rUo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a53d94-4ab0-4340-a4eb-b9f895868a92_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!1rUo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a53d94-4ab0-4340-a4eb-b9f895868a92_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!1rUo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a53d94-4ab0-4340-a4eb-b9f895868a92_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!1rUo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc9a53d94-4ab0-4340-a4eb-b9f895868a92_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-costs">12. The Compaction Bill</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-what-compaction-costs" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!YIIa!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc382954a-29d7-4c8b-8e59-8e46df0aa79e_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!YIIa!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc382954a-29d7-4c8b-8e59-8e46df0aa79e_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!YIIa!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc382954a-29d7-4c8b-8e59-8e46df0aa79e_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!YIIa!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc382954a-29d7-4c8b-8e59-8e46df0aa79e_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!YIIa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc382954a-29d7-4c8b-8e59-8e46df0aa79e_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c382954a-29d7-4c8b-8e59-8e46df0aa79e_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;The Compaction Bill&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-what-compaction-costs&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="The Compaction Bill" title="The Compaction Bill" srcset="https://substackcdn.com/image/fetch/$s_!YIIa!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc382954a-29d7-4c8b-8e59-8e46df0aa79e_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!YIIa!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc382954a-29d7-4c8b-8e59-8e46df0aa79e_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!YIIa!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc382954a-29d7-4c8b-8e59-8e46df0aa79e_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!YIIa!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc382954a-29d7-4c8b-8e59-8e46df0aa79e_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document">13. Compacted Retrieval</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!0yAg!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4af0454-c476-4553-b709-39ace5828be2_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!0yAg!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4af0454-c476-4553-b709-39ace5828be2_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!0yAg!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4af0454-c476-4553-b709-39ace5828be2_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!0yAg!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4af0454-c476-4553-b709-39ace5828be2_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!0yAg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4af0454-c476-4553-b709-39ace5828be2_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c4af0454-c476-4553-b709-39ace5828be2_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Compacted Retrieval&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document&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="Compacted Retrieval" title="Compacted Retrieval" srcset="https://substackcdn.com/image/fetch/$s_!0yAg!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4af0454-c476-4553-b709-39ace5828be2_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!0yAg!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4af0454-c476-4553-b709-39ace5828be2_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!0yAg!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4af0454-c476-4553-b709-39ace5828be2_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!0yAg!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc4af0454-c476-4553-b709-39ace5828be2_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-when-to-compact">14. The Compaction Threshold</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-when-to-compact" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ylAh!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61e28348-5179-471a-a32b-d0b6dcf1b9b6_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ylAh!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61e28348-5179-471a-a32b-d0b6dcf1b9b6_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ylAh!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61e28348-5179-471a-a32b-d0b6dcf1b9b6_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ylAh!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61e28348-5179-471a-a32b-d0b6dcf1b9b6_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ylAh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61e28348-5179-471a-a32b-d0b6dcf1b9b6_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/61e28348-5179-471a-a32b-d0b6dcf1b9b6_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;The Compaction Threshold&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-when-to-compact&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="The Compaction Threshold" title="The Compaction Threshold" srcset="https://substackcdn.com/image/fetch/$s_!ylAh!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61e28348-5179-471a-a32b-d0b6dcf1b9b6_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!ylAh!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61e28348-5179-471a-a32b-d0b6dcf1b9b6_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!ylAh!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61e28348-5179-471a-a32b-d0b6dcf1b9b6_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!ylAh!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F61e28348-5179-471a-a32b-d0b6dcf1b9b6_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-keeps">15. Verbatim Tail</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-what-compaction-keeps" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6YFH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1295d857-0fca-496a-9910-0220e75b741b_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!6YFH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1295d857-0fca-496a-9910-0220e75b741b_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!6YFH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1295d857-0fca-496a-9910-0220e75b741b_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!6YFH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1295d857-0fca-496a-9910-0220e75b741b_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6YFH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1295d857-0fca-496a-9910-0220e75b741b_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1295d857-0fca-496a-9910-0220e75b741b_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Verbatim Tail&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-what-compaction-keeps&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="Verbatim Tail" title="Verbatim Tail" srcset="https://substackcdn.com/image/fetch/$s_!6YFH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1295d857-0fca-496a-9910-0220e75b741b_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!6YFH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1295d857-0fca-496a-9910-0220e75b741b_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!6YFH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1295d857-0fca-496a-9910-0220e75b741b_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!6YFH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1295d857-0fca-496a-9910-0220e75b741b_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-what-each-turn-sends">16. Stateless API</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-what-each-turn-sends" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!W79S!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b4af4ea-7903-499b-9fbf-369f633746cb_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!W79S!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b4af4ea-7903-499b-9fbf-369f633746cb_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!W79S!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b4af4ea-7903-499b-9fbf-369f633746cb_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!W79S!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b4af4ea-7903-499b-9fbf-369f633746cb_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!W79S!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b4af4ea-7903-499b-9fbf-369f633746cb_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5b4af4ea-7903-499b-9fbf-369f633746cb_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Stateless API&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-what-each-turn-sends&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="Stateless API" title="Stateless API" srcset="https://substackcdn.com/image/fetch/$s_!W79S!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b4af4ea-7903-499b-9fbf-369f633746cb_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!W79S!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b4af4ea-7903-499b-9fbf-369f633746cb_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!W79S!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b4af4ea-7903-499b-9fbf-369f633746cb_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!W79S!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5b4af4ea-7903-499b-9fbf-369f633746cb_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input">17. Retrieval Cost</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!al4O!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faac9e521-903f-4f96-8d56-196eee490659_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!al4O!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faac9e521-903f-4f96-8d56-196eee490659_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!al4O!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faac9e521-903f-4f96-8d56-196eee490659_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!al4O!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faac9e521-903f-4f96-8d56-196eee490659_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!al4O!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faac9e521-903f-4f96-8d56-196eee490659_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/aac9e521-903f-4f96-8d56-196eee490659_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Retrieval Cost&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input&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="Retrieval Cost" title="Retrieval Cost" srcset="https://substackcdn.com/image/fetch/$s_!al4O!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faac9e521-903f-4f96-8d56-196eee490659_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!al4O!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faac9e521-903f-4f96-8d56-196eee490659_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!al4O!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faac9e521-903f-4f96-8d56-196eee490659_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!al4O!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Faac9e521-903f-4f96-8d56-196eee490659_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-paying-for-the-past">18. Context Tax</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-paying-for-the-past" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!K3_Y!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F836d2a18-dda5-42ad-8268-2d9d053322fb_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!K3_Y!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F836d2a18-dda5-42ad-8268-2d9d053322fb_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!K3_Y!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F836d2a18-dda5-42ad-8268-2d9d053322fb_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!K3_Y!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F836d2a18-dda5-42ad-8268-2d9d053322fb_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!K3_Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F836d2a18-dda5-42ad-8268-2d9d053322fb_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/836d2a18-dda5-42ad-8268-2d9d053322fb_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Context Tax&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-paying-for-the-past&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="Context Tax" title="Context Tax" srcset="https://substackcdn.com/image/fetch/$s_!K3_Y!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F836d2a18-dda5-42ad-8268-2d9d053322fb_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!K3_Y!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F836d2a18-dda5-42ad-8268-2d9d053322fb_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!K3_Y!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F836d2a18-dda5-42ad-8268-2d9d053322fb_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!K3_Y!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F836d2a18-dda5-42ad-8268-2d9d053322fb_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-adding-up-the-turns">19. Quadratic Cost</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-adding-up-the-turns" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yqn7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4caf9afe-714d-4f49-918f-b05f77814fae_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!yqn7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4caf9afe-714d-4f49-918f-b05f77814fae_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!yqn7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4caf9afe-714d-4f49-918f-b05f77814fae_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!yqn7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4caf9afe-714d-4f49-918f-b05f77814fae_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yqn7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4caf9afe-714d-4f49-918f-b05f77814fae_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4caf9afe-714d-4f49-918f-b05f77814fae_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Quadratic Cost&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-adding-up-the-turns&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="Quadratic Cost" title="Quadratic Cost" srcset="https://substackcdn.com/image/fetch/$s_!yqn7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4caf9afe-714d-4f49-918f-b05f77814fae_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!yqn7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4caf9afe-714d-4f49-918f-b05f77814fae_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!yqn7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4caf9afe-714d-4f49-918f-b05f77814fae_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!yqn7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4caf9afe-714d-4f49-918f-b05f77814fae_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div><h3><a href="https://www.byhand.ai/p/library-agents-context-a-long-conversation">20. Cost Forecast</a></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://www.byhand.ai/p/library-agents-context-a-long-conversation" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fy4P!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60548e6c-534a-40c8-84f5-092474e92f42_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!fy4P!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60548e6c-534a-40c8-84f5-092474e92f42_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!fy4P!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60548e6c-534a-40c8-84f5-092474e92f42_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!fy4P!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60548e6c-534a-40c8-84f5-092474e92f42_1845x800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fy4P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60548e6c-534a-40c8-84f5-092474e92f42_1845x800.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/60548e6c-534a-40c8-84f5-092474e92f42_1845x800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Cost Forecast&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:&quot;https://www.byhand.ai/p/library-agents-context-a-long-conversation&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="Cost Forecast" title="Cost Forecast" srcset="https://substackcdn.com/image/fetch/$s_!fy4P!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60548e6c-534a-40c8-84f5-092474e92f42_1845x800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!fy4P!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60548e6c-534a-40c8-84f5-092474e92f42_1845x800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!fy4P!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60548e6c-534a-40c8-84f5-092474e92f42_1845x800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!fy4P!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F60548e6c-534a-40c8-84f5-092474e92f42_1845x800.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div><hr></div>]]></content:encoded></item><item><title><![CDATA[Cost Forecast]]></title><description><![CDATA[Budgeting a Long Session]]></description><link>https://www.byhand.ai/p/library-agents-context-a-long-conversation</link><guid isPermaLink="false">https://www.byhand.ai/p/library-agents-context-a-long-conversation</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Wed, 19 Aug 2026 04:51:56 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!hKqy!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3dae594e-e8a2-47eb-951b-454357a44c25_1845x2400.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-agents-context">Context Problems</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-agents-context-the-window-as-a-budget">The Context Window</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-fills-the-window">Window Occupancy</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turn-by-turn">Growth per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-will-it-fit">Remaining Space</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turns-until-full">Turn Budget</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-chunking-a-document">Retrieval Footprint</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-rag-chunks-in-the-budget">Retrieval per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-three-rounds-of-search">Search Rounds</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-sizing-the-window">Window Sizing</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest">Truncation</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-window">Compaction</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-costs">The Compaction Bill</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document">Compacted Retrieval</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-when-to-compact">The Compaction Threshold</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-keeps">Verbatim Tail</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-each-turn-sends">Stateless API</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input">Retrieval Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-paying-for-the-past">Context Tax</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-adding-up-the-turns">Quadratic Cost</a></p></li><li><p><strong>Cost Forecast</strong></p></li></ol></div><p>One turn's input grows by a fixed step, so the tenth turn sends ten times what the first did. That much is a straight line. But the bill is not the last turn, it is every turn added together, and adding up a straight line gives a curve. That is why doubling the length of a conversation does not double what it costs to run, it roughly quadruples it. The output never joins that curve. It is the same size every turn, so adding it up stays a straight line, and the input half of the bill runs away from it however dearly the output is priced.</p><p><strong>Paid members:</strong> the worksheet and its printable PDF are below &#8595;</p>
      <p>
          <a href="https://www.byhand.ai/p/library-agents-context-a-long-conversation">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Quadratic Cost]]></title><description><![CDATA[Adding Up the Turns]]></description><link>https://www.byhand.ai/p/library-agents-context-adding-up-the-turns</link><guid isPermaLink="false">https://www.byhand.ai/p/library-agents-context-adding-up-the-turns</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Wed, 19 Aug 2026 04:51:35 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Uf7S!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F99ddcb2d-a9e7-418d-90ca-faeb0872c7e7_1845x2400.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-agents-context">Context Problems</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-agents-context-the-window-as-a-budget">The Context Window</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-fills-the-window">Window Occupancy</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turn-by-turn">Growth per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-will-it-fit">Remaining Space</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turns-until-full">Turn Budget</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-chunking-a-document">Retrieval Footprint</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-rag-chunks-in-the-budget">Retrieval per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-three-rounds-of-search">Search Rounds</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-sizing-the-window">Window Sizing</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest">Truncation</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-window">Compaction</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-costs">The Compaction Bill</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document">Compacted Retrieval</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-when-to-compact">The Compaction Threshold</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-keeps">Verbatim Tail</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-each-turn-sends">Stateless API</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input">Retrieval Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-paying-for-the-past">Context Tax</a></p></li><li><p><strong>Quadratic Cost</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-a-long-conversation">Cost Forecast</a></p></li></ol></div><p>Adding four numbers is easy. Adding a hundred is not, and a conversation does not stop at four. The input goes up by the same step every turn, and a run of numbers like that has an equation: multiply the number of turns by the next number up, halve it, then scale by the step. Work the small case by hand first, then check the equation against what you got. Two numbers decide the total: k, what one turn adds, and n, how many turns there have been. k is fixed by the agent, so shortening its answers drops every total, while n is the conversation itself, and because it appears twice, doubling it does not double the total.</p><p><strong>Paid members:</strong> the worksheet and its printable PDF are below &#8595;</p>
      <p>
          <a href="https://www.byhand.ai/p/library-agents-context-adding-up-the-turns">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Context Tax]]></title><description><![CDATA[Paying for the Past]]></description><link>https://www.byhand.ai/p/library-agents-context-paying-for-the-past</link><guid isPermaLink="false">https://www.byhand.ai/p/library-agents-context-paying-for-the-past</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Wed, 19 Aug 2026 04:51:14 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!onsu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2cb5d8e3-202a-444b-9063-32bc5a1dd254_1845x2400.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-agents-context">Context Problems</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-agents-context-the-window-as-a-budget">The Context Window</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-fills-the-window">Window Occupancy</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turn-by-turn">Growth per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-will-it-fit">Remaining Space</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turns-until-full">Turn Budget</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-chunking-a-document">Retrieval Footprint</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-rag-chunks-in-the-budget">Retrieval per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-three-rounds-of-search">Search Rounds</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-sizing-the-window">Window Sizing</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest">Truncation</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-window">Compaction</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-costs">The Compaction Bill</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document">Compacted Retrieval</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-when-to-compact">The Compaction Threshold</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-keeps">Verbatim Tail</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-each-turn-sends">Stateless API</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input">Retrieval Cost</a></p></li><li><p><strong>Context Tax</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-adding-up-the-turns">Quadratic Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-a-long-conversation">Cost Forecast</a></p></li></ol></div><p>Each turn's bill has two halves, and they behave differently. The answer is the same size every turn, so its half never moves. The input is the whole conversation so far, so it grows by a fixed step, and its half grows with it. Three turns in, the input half has tripled while the output half has not shifted a cent.</p><p><strong>Paid members:</strong> the worksheet and its printable PDF are below &#8595;</p>
      <p>
          <a href="https://www.byhand.ai/p/library-agents-context-paying-for-the-past">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Retrieval Cost]]></title><description><![CDATA[Retrieved Chunks Are Input]]></description><link>https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input</link><guid isPermaLink="false">https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Wed, 19 Aug 2026 04:50:53 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!aqtf!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F49a09124-42b6-4a4e-afc0-56cdb8f58cae_1845x2400.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-agents-context">Context Problems</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-agents-context-the-window-as-a-budget">The Context Window</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-fills-the-window">Window Occupancy</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turn-by-turn">Growth per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-will-it-fit">Remaining Space</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turns-until-full">Turn Budget</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-chunking-a-document">Retrieval Footprint</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-rag-chunks-in-the-budget">Retrieval per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-three-rounds-of-search">Search Rounds</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-sizing-the-window">Window Sizing</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest">Truncation</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-window">Compaction</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-costs">The Compaction Bill</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document">Compacted Retrieval</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-when-to-compact">The Compaction Threshold</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-keeps">Verbatim Tail</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-each-turn-sends">Stateless API</a></p></li><li><p><strong>Retrieval Cost</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-paying-for-the-past">Context Tax</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-adding-up-the-turns">Quadratic Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-a-long-conversation">Cost Forecast</a></p></li></ol></div><p>A retrieved chunk arrives from the search rather than from you, so it feels like something the model produced. It is not. Retrieval puts the document into the request, which makes every chunk an input token: priced as input, and re-read on every turn after the one that fetched it. So a document retrieved once is paid for again and again, long after the question that went looking for it.</p><p><strong>Paid members:</strong> the worksheet and its printable PDF are below &#8595;</p>
      <p>
          <a href="https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Stateless API]]></title><description><![CDATA[Resending the Context]]></description><link>https://www.byhand.ai/p/library-agents-context-what-each-turn-sends</link><guid isPermaLink="false">https://www.byhand.ai/p/library-agents-context-what-each-turn-sends</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Wed, 19 Aug 2026 04:50:32 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!9MHi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F74b3f734-35bc-40e5-b679-1d194bae3c35_1845x2400.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-agents-context">Context Problems</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-agents-context-the-window-as-a-budget">The Context Window</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-fills-the-window">Window Occupancy</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turn-by-turn">Growth per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-will-it-fit">Remaining Space</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turns-until-full">Turn Budget</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-chunking-a-document">Retrieval Footprint</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-rag-chunks-in-the-budget">Retrieval per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-three-rounds-of-search">Search Rounds</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-sizing-the-window">Window Sizing</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest">Truncation</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-window">Compaction</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-costs">The Compaction Bill</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document">Compacted Retrieval</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-when-to-compact">The Compaction Threshold</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-keeps">Verbatim Tail</a></p></li><li><p><strong>Stateless API</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input">Retrieval Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-paying-for-the-past">Context Tax</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-adding-up-the-turns">Quadratic Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-a-long-conversation">Cost Forecast</a></p></li></ol></div><p>The API keeps nothing between turns, so every request carries the whole conversation again. The model does not remember turn one, it reads it a second time. Written out chunk by chunk, each request contains the one before it entire, with a new question on the end. That is the shape the bill follows, and it is why a conversation costs more than the sum of its turns.</p><p><strong>Paid members:</strong> the worksheet and its printable PDF are below &#8595;</p>
      <p>
          <a href="https://www.byhand.ai/p/library-agents-context-what-each-turn-sends">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Verbatim Tail]]></title><description><![CDATA[Keeping the recent rounds whole]]></description><link>https://www.byhand.ai/p/library-agents-context-what-compaction-keeps</link><guid isPermaLink="false">https://www.byhand.ai/p/library-agents-context-what-compaction-keeps</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Wed, 19 Aug 2026 04:50:11 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!oheS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdcd29af1-eb8f-4771-9e04-4af42439a92c_1845x2400.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-agents-context">Context Problems</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-agents-context-the-window-as-a-budget">The Context Window</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-fills-the-window">Window Occupancy</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turn-by-turn">Growth per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-will-it-fit">Remaining Space</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turns-until-full">Turn Budget</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-chunking-a-document">Retrieval Footprint</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-rag-chunks-in-the-budget">Retrieval per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-three-rounds-of-search">Search Rounds</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-sizing-the-window">Window Sizing</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest">Truncation</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-window">Compaction</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-costs">The Compaction Bill</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document">Compacted Retrieval</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-when-to-compact">The Compaction Threshold</a></p></li><li><p><strong>Verbatim Tail</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-each-turn-sends">Stateless API</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input">Retrieval Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-paying-for-the-past">Context Tax</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-adding-up-the-turns">Quadratic Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-a-long-conversation">Cost Forecast</a></p></li></ol></div><p>Compaction does not summarize everything behind the system prompt. It leaves the most recent rounds alone. An agent that summarized the round it was in the middle of would lose the thread it is holding, so the summary stops short and the live end of the conversation stays verbatim. That leaves the window in three parts: the prompt, the summary of what is old, and the rounds still in their own words.</p><p><strong>Paid members:</strong> the worksheet and its printable PDF are below &#8595;</p>
      <p>
          <a href="https://www.byhand.ai/p/library-agents-context-what-compaction-keeps">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[The Compaction Threshold]]></title><description><![CDATA[Picking the number from a round]]></description><link>https://www.byhand.ai/p/library-agents-context-when-to-compact</link><guid isPermaLink="false">https://www.byhand.ai/p/library-agents-context-when-to-compact</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Wed, 19 Aug 2026 04:49:50 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Yicj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8be296f2-63c9-43ac-bef8-d655fc618e7b_1845x2400.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-agents-context">Context Problems</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-agents-context-the-window-as-a-budget">The Context Window</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-fills-the-window">Window Occupancy</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turn-by-turn">Growth per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-will-it-fit">Remaining Space</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turns-until-full">Turn Budget</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-chunking-a-document">Retrieval Footprint</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-rag-chunks-in-the-budget">Retrieval per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-three-rounds-of-search">Search Rounds</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-sizing-the-window">Window Sizing</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest">Truncation</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-window">Compaction</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-costs">The Compaction Bill</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document">Compacted Retrieval</a></p></li><li><p><strong>The Compaction Threshold</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-keeps">Verbatim Tail</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-each-turn-sends">Stateless API</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input">Retrieval Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-paying-for-the-past">Context Tax</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-adding-up-the-turns">Quadratic Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-a-long-conversation">Cost Forecast</a></p></li></ol></div><p>A threshold picked by taste is a threshold picked wrong. The number has to come from the size of a round. Compaction must fire while there is still room for one more question and one more answer, or the agent runs out of window with nowhere to put the reply. So the trigger sits where the conversation last had a full round of room, and whatever percentage that works out to is the percentage.</p><p><strong>Paid members:</strong> the worksheet and its printable PDF are below &#8595;</p>
      <p>
          <a href="https://www.byhand.ai/p/library-agents-context-when-to-compact">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Compacted Retrieval]]></title><description><![CDATA[A summary instead of raw chunks]]></description><link>https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document</link><guid isPermaLink="false">https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Wed, 19 Aug 2026 04:49:28 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!HYSw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdf10f3fe-acd6-4d41-b553-9692271dacdc_1845x2400.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-agents-context">Context Problems</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-agents-context-the-window-as-a-budget">The Context Window</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-fills-the-window">Window Occupancy</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turn-by-turn">Growth per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-will-it-fit">Remaining Space</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turns-until-full">Turn Budget</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-chunking-a-document">Retrieval Footprint</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-rag-chunks-in-the-budget">Retrieval per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-three-rounds-of-search">Search Rounds</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-sizing-the-window">Window Sizing</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest">Truncation</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-window">Compaction</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-costs">The Compaction Bill</a></p></li><li><p><strong>Compacted Retrieval</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-when-to-compact">The Compaction Threshold</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-keeps">Verbatim Tail</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-each-turn-sends">Stateless API</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input">Retrieval Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-paying-for-the-past">Context Tax</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-adding-up-the-turns">Quadratic Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-a-long-conversation">Cost Forecast</a></p></li></ol></div><p>A retrieved document arrives as raw chunks, and most of what they hold is not what the question needed. Compacting them before they enter the window means the agent reads a summary of the document instead of the document. Only the retrieval is compressed. The system prompt, the question, and the answer are what they were.</p><p><strong>Paid members:</strong> the worksheet and its printable PDF are below &#8595;</p>
      <p>
          <a href="https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[The Compaction Bill]]></title><description><![CDATA[What a summary call costs]]></description><link>https://www.byhand.ai/p/library-agents-context-what-compaction-costs</link><guid isPermaLink="false">https://www.byhand.ai/p/library-agents-context-what-compaction-costs</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Wed, 19 Aug 2026 04:49:07 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!iACd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fde9313db-c78c-4d2f-8a63-f0cd7ad37ebf_1845x2400.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-agents-context">Context Problems</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-agents-context-the-window-as-a-budget">The Context Window</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-fills-the-window">Window Occupancy</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turn-by-turn">Growth per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-will-it-fit">Remaining Space</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turns-until-full">Turn Budget</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-chunking-a-document">Retrieval Footprint</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-rag-chunks-in-the-budget">Retrieval per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-three-rounds-of-search">Search Rounds</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-sizing-the-window">Window Sizing</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest">Truncation</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-window">Compaction</a></p></li><li><p><strong>The Compaction Bill</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document">Compacted Retrieval</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-when-to-compact">The Compaction Threshold</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-keeps">Verbatim Tail</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-each-turn-sends">Stateless API</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input">Retrieval Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-paying-for-the-past">Context Tax</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-adding-up-the-turns">Quadratic Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-a-long-conversation">Cost Forecast</a></p></li></ol></div><p>Compacting is itself a call to the model, and it is billed like any other. The model reads the whole window to write the summary, system prompt included, and that is the input. Then it writes the summary one token at a time, and that is the output, priced several times higher. So a summary that is a quarter the size of the history is nowhere near a quarter of the bill.</p><p><strong>Paid members:</strong> the worksheet and its printable PDF are below &#8595;</p>
      <p>
          <a href="https://www.byhand.ai/p/library-agents-context-what-compaction-costs">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Compaction]]></title><description><![CDATA[Summarizing history to make room]]></description><link>https://www.byhand.ai/p/library-agents-context-compacting-the-window</link><guid isPermaLink="false">https://www.byhand.ai/p/library-agents-context-compacting-the-window</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Wed, 19 Aug 2026 04:48:46 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!hMho!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdab20352-1046-44a1-9729-6494473ff03f_1845x2400.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-agents-context">Context Problems</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-agents-context-the-window-as-a-budget">The Context Window</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-fills-the-window">Window Occupancy</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turn-by-turn">Growth per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-will-it-fit">Remaining Space</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turns-until-full">Turn Budget</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-chunking-a-document">Retrieval Footprint</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-rag-chunks-in-the-budget">Retrieval per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-three-rounds-of-search">Search Rounds</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-sizing-the-window">Window Sizing</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest">Truncation</a></p></li><li><p><strong>Compaction</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-costs">The Compaction Bill</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document">Compacted Retrieval</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-when-to-compact">The Compaction Threshold</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-keeps">Verbatim Tail</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-each-turn-sends">Stateless API</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input">Retrieval Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-paying-for-the-past">Context Tax</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-adding-up-the-turns">Quadratic Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-a-long-conversation">Cost Forecast</a></p></li></ol></div><p>Truncation throws the oldest turns away. Compaction keeps them, but small: the model reads the history and writes a summary that stands in for it. The system prompt is not part of the history and does not get compacted; it is pinned at the front and survives intact. So the window after a compaction is the same system prompt, followed by a summary a fraction of the size, and a great deal of space that was not there before.</p><p><strong>Paid members:</strong> the worksheet and its printable PDF are below &#8595;</p>
      <p>
          <a href="https://www.byhand.ai/p/library-agents-context-compacting-the-window">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Truncation]]></title><description><![CDATA[Crossing out the oldest turns]]></description><link>https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest</link><guid isPermaLink="false">https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Wed, 19 Aug 2026 04:48:25 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!NOMj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9242d919-6238-4e67-864f-594efed1aa3c_1845x2400.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-agents-context">Context Problems</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-agents-context-the-window-as-a-budget">The Context Window</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-fills-the-window">Window Occupancy</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turn-by-turn">Growth per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-will-it-fit">Remaining Space</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turns-until-full">Turn Budget</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-chunking-a-document">Retrieval Footprint</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-rag-chunks-in-the-budget">Retrieval per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-three-rounds-of-search">Search Rounds</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-sizing-the-window">Window Sizing</a></p></li><li><p><strong>Truncation</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-window">Compaction</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-costs">The Compaction Bill</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document">Compacted Retrieval</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-when-to-compact">The Compaction Threshold</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-keeps">Verbatim Tail</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-each-turn-sends">Stateless API</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input">Retrieval Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-paying-for-the-past">Context Tax</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-adding-up-the-turns">Quadratic Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-a-long-conversation">Cost Forecast</a></p></li></ol></div><p>Truncation is the crudest fix for a full window: cross out the earliest turns until the new message has room. It is cheap and it always works, which is why agents do it, and it costs the beginning of the conversation, which is usually the part that said what the conversation was for. Turns go whole. You cannot drop half a turn, so the count always rounds up and a little more is thrown away than strictly had to be.</p><p><strong>Paid members:</strong> the worksheet and its printable PDF are below &#8595;</p>
      <p>
          <a href="https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Window Sizing]]></title><description><![CDATA[Working the budget backwards]]></description><link>https://www.byhand.ai/p/library-agents-context-sizing-the-window</link><guid isPermaLink="false">https://www.byhand.ai/p/library-agents-context-sizing-the-window</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Wed, 19 Aug 2026 04:48:04 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!6rgc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7e81bbc-eaab-4cb3-9ddf-84e1a2b423fb_1845x2400.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-agents-context">Context Problems</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-agents-context-the-window-as-a-budget">The Context Window</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-fills-the-window">Window Occupancy</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turn-by-turn">Growth per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-will-it-fit">Remaining Space</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turns-until-full">Turn Budget</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-chunking-a-document">Retrieval Footprint</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-rag-chunks-in-the-budget">Retrieval per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-three-rounds-of-search">Search Rounds</a></p></li><li><p><strong>Window Sizing</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest">Truncation</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-window">Compaction</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-costs">The Compaction Bill</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document">Compacted Retrieval</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-when-to-compact">The Compaction Threshold</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-keeps">Verbatim Tail</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-each-turn-sends">Stateless API</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input">Retrieval Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-paying-for-the-past">Context Tax</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-adding-up-the-turns">Quadratic Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-a-long-conversation">Cost Forecast</a></p></li></ol></div><p>Run the budgeting in reverse: decide how long a conversation must last, and the arithmetic tells you how big a window it needs. Then comes the part the arithmetic does not do for you. Windows come in sizes, and you take the smallest one that fits, so the number you calculated is a floor rather than an answer. Land a little over a size and the next one up is twice the window and twice the price, most of it unused.</p><p><strong>Paid members:</strong> the worksheet and its printable PDF are below &#8595;</p>
      <p>
          <a href="https://www.byhand.ai/p/library-agents-context-sizing-the-window">
              Read more
          </a>
      </p>
   ]]></content:encoded></item><item><title><![CDATA[Search Rounds]]></title><description><![CDATA[Three searches, three unknown sizes]]></description><link>https://www.byhand.ai/p/library-agents-context-three-rounds-of-search</link><guid isPermaLink="false">https://www.byhand.ai/p/library-agents-context-three-rounds-of-search</guid><dc:creator><![CDATA[Prof. Tom Yeh]]></dc:creator><pubDate>Wed, 19 Aug 2026 04:47:43 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ZAOE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feb626747-b79f-475f-9347-d6e12679ab93_1845x2400.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="callout-block" data-callout="true"><h3><a href="https://www.byhand.ai/p/library">Library</a> &#8250; <a href="https://www.byhand.ai/p/library-series-agents-context">Context Problems</a></h3><ol><li><p><a href="https://www.byhand.ai/p/library-agents-context-the-window-as-a-budget">The Context Window</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-fills-the-window">Window Occupancy</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turn-by-turn">Growth per Turn</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-will-it-fit">Remaining Space</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-turns-until-full">Turn Budget</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-chunking-a-document">Retrieval Footprint</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-rag-chunks-in-the-budget">Retrieval per Turn</a></p></li><li><p><strong>Search Rounds</strong></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-sizing-the-window">Window Sizing</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-truncation-dropping-the-oldest">Truncation</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-window">Compaction</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-costs">The Compaction Bill</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-compacting-the-retrieved-document">Compacted Retrieval</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-when-to-compact">The Compaction Threshold</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-compaction-keeps">Verbatim Tail</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-what-each-turn-sends">Stateless API</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-retrieved-chunks-are-input">Retrieval Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-paying-for-the-past">Context Tax</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-adding-up-the-turns">Quadratic Cost</a></p></li><li><p><a href="https://www.byhand.ai/p/library-agents-context-a-long-conversation">Cost Forecast</a></p></li></ol></div><p>An agent that searches does not know in advance what it will get back. A query that finds nothing still costs a query, an empty result and an answer, and the window keeps all three: nothing is thrown away between rounds. So the cost of searching is not the cost of the search that worked, it is the cost of every search that came before it as well. Watch what one successful retrieval does to a window that two failed ones had barely touched.</p><p><strong>Paid members:</strong> the worksheet and its printable PDF are below &#8595;</p>
      <p>
          <a href="https://www.byhand.ai/p/library-agents-context-three-rounds-of-search">
              Read more
          </a>
      </p>
   ]]></content:encoded></item></channel></rss>