<?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[Aditya's Newsletter: AI ]]></title><description><![CDATA[Learn about all the latest tech updates on AI here]]></description><link>https://adityatrivedi17.substack.com/s/ai</link><image><url>https://substackcdn.com/image/fetch/$s_!tWEc!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F068dc990-80e4-4463-b5d0-ad204c8e1f2b_1086x1086.png</url><title>Aditya&apos;s Newsletter: AI </title><link>https://adityatrivedi17.substack.com/s/ai</link></image><generator>Substack</generator><lastBuildDate>Mon, 20 Jul 2026 10:47:20 GMT</lastBuildDate><atom:link href="https://adityatrivedi17.substack.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Aditya Trivedi]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[adityatrivedi17@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[adityatrivedi17@substack.com]]></itunes:email><itunes:name><![CDATA[Aditya Trivedi]]></itunes:name></itunes:owner><itunes:author><![CDATA[Aditya Trivedi]]></itunes:author><googleplay:owner><![CDATA[adityatrivedi17@substack.com]]></googleplay:owner><googleplay:email><![CDATA[adityatrivedi17@substack.com]]></googleplay:email><googleplay:author><![CDATA[Aditya Trivedi]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Understanding LLM Inferencing]]></title><description><![CDATA[To truly understand Large Language Model (LLM) inferencing at a deep technical level, we must look past the simple abstraction of &#8220;predicting the next word&#8221;.]]></description><link>https://adityatrivedi17.substack.com/p/understanding-llm-inferencing</link><guid isPermaLink="false">https://adityatrivedi17.substack.com/p/understanding-llm-inferencing</guid><dc:creator><![CDATA[Aditya Trivedi]]></dc:creator><pubDate>Sat, 18 Jul 2026 04:43:23 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/e0bc256d-8fd6-4cbd-a39e-c3c3d3e97858_1536x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>To truly understand Large Language Model (LLM) inferencing at a deep technical level, we must look past the simple abstraction of &#8220;predicting the next word&#8221;. Inferencing is a highly coordinated sequence of matrix multiplications, memory lookups, and hardware-level optimizations.</p><div><hr></div><p>When you submit a prompt to an LLM, the inference engine executes 2 distinct phases: the <strong>Prefill Phase</strong> and the <strong>Decoding Phase</strong>. </p><h3>Phase 1: The Prefill Phase (Processing the Context)</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!evHb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ab5c501-546b-4191-aea8-43eb13924a8f_1267x508.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!evHb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ab5c501-546b-4191-aea8-43eb13924a8f_1267x508.png 424w, https://substackcdn.com/image/fetch/$s_!evHb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ab5c501-546b-4191-aea8-43eb13924a8f_1267x508.png 848w, https://substackcdn.com/image/fetch/$s_!evHb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ab5c501-546b-4191-aea8-43eb13924a8f_1267x508.png 1272w, https://substackcdn.com/image/fetch/$s_!evHb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ab5c501-546b-4191-aea8-43eb13924a8f_1267x508.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!evHb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ab5c501-546b-4191-aea8-43eb13924a8f_1267x508.png" width="1267" height="508" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0ab5c501-546b-4191-aea8-43eb13924a8f_1267x508.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:508,&quot;width&quot;:1267,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:877289,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://adityatrivedi17.substack.com/i/207513925?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ab5c501-546b-4191-aea8-43eb13924a8f_1267x508.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!evHb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ab5c501-546b-4191-aea8-43eb13924a8f_1267x508.png 424w, https://substackcdn.com/image/fetch/$s_!evHb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ab5c501-546b-4191-aea8-43eb13924a8f_1267x508.png 848w, https://substackcdn.com/image/fetch/$s_!evHb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ab5c501-546b-4191-aea8-43eb13924a8f_1267x508.png 1272w, https://substackcdn.com/image/fetch/$s_!evHb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ab5c501-546b-4191-aea8-43eb13924a8f_1267x508.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The prefill phase occurs the instant you hit &#8220;Send&#8221;. Its objective is to ingest your entire prompt, calculate the semantic relationships between all your input words, and prepare the model to write the first token of its response.</p><h4>Step 1: Tokenization and Embedding Tensor Construction</h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!IVWd!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feac169a2-3820-4b70-bf45-3521b3f0e236_388x458.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!IVWd!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feac169a2-3820-4b70-bf45-3521b3f0e236_388x458.png 424w, https://substackcdn.com/image/fetch/$s_!IVWd!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feac169a2-3820-4b70-bf45-3521b3f0e236_388x458.png 848w, https://substackcdn.com/image/fetch/$s_!IVWd!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feac169a2-3820-4b70-bf45-3521b3f0e236_388x458.png 1272w, https://substackcdn.com/image/fetch/$s_!IVWd!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feac169a2-3820-4b70-bf45-3521b3f0e236_388x458.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!IVWd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feac169a2-3820-4b70-bf45-3521b3f0e236_388x458.png" width="388" height="458" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/eac169a2-3820-4b70-bf45-3521b3f0e236_388x458.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:458,&quot;width&quot;:388,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:263864,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adityatrivedi17.substack.com/i/207513925?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feac169a2-3820-4b70-bf45-3521b3f0e236_388x458.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!IVWd!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feac169a2-3820-4b70-bf45-3521b3f0e236_388x458.png 424w, https://substackcdn.com/image/fetch/$s_!IVWd!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feac169a2-3820-4b70-bf45-3521b3f0e236_388x458.png 848w, https://substackcdn.com/image/fetch/$s_!IVWd!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feac169a2-3820-4b70-bf45-3521b3f0e236_388x458.png 1272w, https://substackcdn.com/image/fetch/$s_!IVWd!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Feac169a2-3820-4b70-bf45-3521b3f0e236_388x458.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Your raw text prompt is split into standard units called tokens. Each token corresponds to a specific ID inside the model&#8217;s vocabulary matrix.</p><ul><li><p>These token IDs are looked up in a massive weight matrix known as the <strong>Embedding Layer.</strong></p></li><li><p>The embedding layer converts each token ID into a dense mathematical vector of continuous numbers (often 4096 or 8192 dimensions deep).</p></li><li><p><strong>Positional Encodings</strong> are mathematically added directly using these vectors. This ensures the model retains structural context, understanding the exact difference between &#8220;The dog bit the cat&#8221; and the &#8220;The cat bit the dog&#8221;.</p></li></ul><h4>Step 2: Parallel Matrix Computation</h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3Pz0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae8ab97e-a803-4974-b394-7f77e89f6984_252x458.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3Pz0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae8ab97e-a803-4974-b394-7f77e89f6984_252x458.png 424w, https://substackcdn.com/image/fetch/$s_!3Pz0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae8ab97e-a803-4974-b394-7f77e89f6984_252x458.png 848w, https://substackcdn.com/image/fetch/$s_!3Pz0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae8ab97e-a803-4974-b394-7f77e89f6984_252x458.png 1272w, https://substackcdn.com/image/fetch/$s_!3Pz0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae8ab97e-a803-4974-b394-7f77e89f6984_252x458.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3Pz0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae8ab97e-a803-4974-b394-7f77e89f6984_252x458.png" width="252" height="458" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ae8ab97e-a803-4974-b394-7f77e89f6984_252x458.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:458,&quot;width&quot;:252,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:155522,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adityatrivedi17.substack.com/i/207513925?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae8ab97e-a803-4974-b394-7f77e89f6984_252x458.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!3Pz0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae8ab97e-a803-4974-b394-7f77e89f6984_252x458.png 424w, https://substackcdn.com/image/fetch/$s_!3Pz0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae8ab97e-a803-4974-b394-7f77e89f6984_252x458.png 848w, https://substackcdn.com/image/fetch/$s_!3Pz0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae8ab97e-a803-4974-b394-7f77e89f6984_252x458.png 1272w, https://substackcdn.com/image/fetch/$s_!3Pz0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae8ab97e-a803-4974-b394-7f77e89f6984_252x458.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Unlike the output phase, the prefill phase is highly parallelized. Because the entire prompt is available upfront, the graphics processing unit (GPU) processes all input tokens simultaneously. The sequence of embedding vectors is passed into the first Transformer layer as a single massive matrix</p><h4>Step 3: Calculating Queries, Keys, and Values (Q,K,V)</h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!-GyT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7355e661-12b2-4b3c-9036-e0cd038c525c_308x458.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!-GyT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7355e661-12b2-4b3c-9036-e0cd038c525c_308x458.png 424w, https://substackcdn.com/image/fetch/$s_!-GyT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7355e661-12b2-4b3c-9036-e0cd038c525c_308x458.png 848w, https://substackcdn.com/image/fetch/$s_!-GyT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7355e661-12b2-4b3c-9036-e0cd038c525c_308x458.png 1272w, https://substackcdn.com/image/fetch/$s_!-GyT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7355e661-12b2-4b3c-9036-e0cd038c525c_308x458.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!-GyT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7355e661-12b2-4b3c-9036-e0cd038c525c_308x458.png" width="308" height="458" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7355e661-12b2-4b3c-9036-e0cd038c525c_308x458.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:458,&quot;width&quot;:308,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:185197,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adityatrivedi17.substack.com/i/207513925?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7355e661-12b2-4b3c-9036-e0cd038c525c_308x458.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!-GyT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7355e661-12b2-4b3c-9036-e0cd038c525c_308x458.png 424w, https://substackcdn.com/image/fetch/$s_!-GyT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7355e661-12b2-4b3c-9036-e0cd038c525c_308x458.png 848w, https://substackcdn.com/image/fetch/$s_!-GyT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7355e661-12b2-4b3c-9036-e0cd038c525c_308x458.png 1272w, https://substackcdn.com/image/fetch/$s_!-GyT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7355e661-12b2-4b3c-9036-e0cd038c525c_308x458.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Inside every attention head of Transformer layer, the token matrix is multiplied by 3 distinct learned weight matrices to produce 3 new matrices:</p><ul><li><p>Queries (<em><strong>Q</strong></em>): What a token is actively searching for in the rest of the sentence</p></li><li><p>Keys (<em><strong>K</strong></em>): What information a token contains that might be relevant to other tokens.</p></li><li><p>Values (<em><strong>V</strong></em>): The actual semantic content of the token.</p></li></ul><h4>Step 4: The KV Cache Initialization (The Memory Anchor)</h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8zGM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5de682b5-57bf-445a-83ff-052ade0adf07_308x458.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8zGM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5de682b5-57bf-445a-83ff-052ade0adf07_308x458.png 424w, https://substackcdn.com/image/fetch/$s_!8zGM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5de682b5-57bf-445a-83ff-052ade0adf07_308x458.png 848w, https://substackcdn.com/image/fetch/$s_!8zGM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5de682b5-57bf-445a-83ff-052ade0adf07_308x458.png 1272w, https://substackcdn.com/image/fetch/$s_!8zGM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5de682b5-57bf-445a-83ff-052ade0adf07_308x458.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8zGM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5de682b5-57bf-445a-83ff-052ade0adf07_308x458.png" width="308" height="458" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5de682b5-57bf-445a-83ff-052ade0adf07_308x458.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:458,&quot;width&quot;:308,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:189017,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adityatrivedi17.substack.com/i/207513925?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5de682b5-57bf-445a-83ff-052ade0adf07_308x458.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8zGM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5de682b5-57bf-445a-83ff-052ade0adf07_308x458.png 424w, https://substackcdn.com/image/fetch/$s_!8zGM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5de682b5-57bf-445a-83ff-052ade0adf07_308x458.png 848w, https://substackcdn.com/image/fetch/$s_!8zGM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5de682b5-57bf-445a-83ff-052ade0adf07_308x458.png 1272w, https://substackcdn.com/image/fetch/$s_!8zGM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5de682b5-57bf-445a-83ff-052ade0adf07_308x458.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This is the single most critical performance optimization in modern LLM inferencing. During the prefill phase, the calculated Key (<em><strong>K</strong></em>) and Value (<em><strong>V</strong></em>) matrices for all your prompt tokens are computed once and stored directly inside the GPU&#8217;s high-bandwidth memory. This storage space is called the <strong>KV Cache</strong>. By saving these values now, the model avoids recalculating the historical context for every single word it generates later.</p><h3>Phase 2: The Decoding Phase (The Generation Loop)</h3><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!74cb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff95dd772-26fa-4a25-a7bc-e88795d077ac_1462x405.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!74cb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff95dd772-26fa-4a25-a7bc-e88795d077ac_1462x405.png 424w, https://substackcdn.com/image/fetch/$s_!74cb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff95dd772-26fa-4a25-a7bc-e88795d077ac_1462x405.png 848w, https://substackcdn.com/image/fetch/$s_!74cb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff95dd772-26fa-4a25-a7bc-e88795d077ac_1462x405.png 1272w, https://substackcdn.com/image/fetch/$s_!74cb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff95dd772-26fa-4a25-a7bc-e88795d077ac_1462x405.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!74cb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff95dd772-26fa-4a25-a7bc-e88795d077ac_1462x405.png" width="1456" height="403" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f95dd772-26fa-4a25-a7bc-e88795d077ac_1462x405.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:403,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:892506,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adityatrivedi17.substack.com/i/207513925?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff95dd772-26fa-4a25-a7bc-e88795d077ac_1462x405.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!74cb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff95dd772-26fa-4a25-a7bc-e88795d077ac_1462x405.png 424w, https://substackcdn.com/image/fetch/$s_!74cb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff95dd772-26fa-4a25-a7bc-e88795d077ac_1462x405.png 848w, https://substackcdn.com/image/fetch/$s_!74cb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff95dd772-26fa-4a25-a7bc-e88795d077ac_1462x405.png 1272w, https://substackcdn.com/image/fetch/$s_!74cb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff95dd772-26fa-4a25-a7bc-e88795d077ac_1462x405.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h4>Step 5: Masked Multi-Head Attention</h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!QAu7!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb55e8bb9-e430-4b65-b628-36f8146a3302_637x531.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!QAu7!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb55e8bb9-e430-4b65-b628-36f8146a3302_637x531.png 424w, https://substackcdn.com/image/fetch/$s_!QAu7!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb55e8bb9-e430-4b65-b628-36f8146a3302_637x531.png 848w, https://substackcdn.com/image/fetch/$s_!QAu7!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb55e8bb9-e430-4b65-b628-36f8146a3302_637x531.png 1272w, https://substackcdn.com/image/fetch/$s_!QAu7!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb55e8bb9-e430-4b65-b628-36f8146a3302_637x531.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!QAu7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb55e8bb9-e430-4b65-b628-36f8146a3302_637x531.png" width="637" height="531" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b55e8bb9-e430-4b65-b628-36f8146a3302_637x531.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:531,&quot;width&quot;:637,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:437746,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adityatrivedi17.substack.com/i/207513925?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb55e8bb9-e430-4b65-b628-36f8146a3302_637x531.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!QAu7!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb55e8bb9-e430-4b65-b628-36f8146a3302_637x531.png 424w, https://substackcdn.com/image/fetch/$s_!QAu7!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb55e8bb9-e430-4b65-b628-36f8146a3302_637x531.png 848w, https://substackcdn.com/image/fetch/$s_!QAu7!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb55e8bb9-e430-4b65-b628-36f8146a3302_637x531.png 1272w, https://substackcdn.com/image/fetch/$s_!QAu7!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb55e8bb9-e430-4b65-b628-36f8146a3302_637x531.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>To generate the very first new token, the model executes the standard self-attention equation across the <em>Q,K </em>and<em> V </em>matrices:</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\text{Attention}(Q,K,V) = \\text{softmax}\\left(\\frac{QK^T}{\\sqrt{d_k}}\\right)V&quot;,&quot;id&quot;:&quot;BJHHWPUNUE&quot;}" data-component-name="LatexBlockToDOM"></div><p>However, during this phase, the attention mechanism is <strong>masked.</strong> Because it is generating text chronologically, a token is mathematically forbidden from looking at any information that supposedly comes after it. It can only compute scores against the historical tokens stored inside the KV Cache.</p><h4>Step 6: The Feed-Forward Network Processing</h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!lY5N!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd352d01-3d55-4819-b1b1-a4a9a4c70a13_351x531.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!lY5N!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd352d01-3d55-4819-b1b1-a4a9a4c70a13_351x531.png 424w, https://substackcdn.com/image/fetch/$s_!lY5N!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd352d01-3d55-4819-b1b1-a4a9a4c70a13_351x531.png 848w, https://substackcdn.com/image/fetch/$s_!lY5N!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd352d01-3d55-4819-b1b1-a4a9a4c70a13_351x531.png 1272w, https://substackcdn.com/image/fetch/$s_!lY5N!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd352d01-3d55-4819-b1b1-a4a9a4c70a13_351x531.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!lY5N!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd352d01-3d55-4819-b1b1-a4a9a4c70a13_351x531.png" width="351" height="531" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/cd352d01-3d55-4819-b1b1-a4a9a4c70a13_351x531.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:531,&quot;width&quot;:351,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:233412,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adityatrivedi17.substack.com/i/207513925?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd352d01-3d55-4819-b1b1-a4a9a4c70a13_351x531.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!lY5N!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd352d01-3d55-4819-b1b1-a4a9a4c70a13_351x531.png 424w, https://substackcdn.com/image/fetch/$s_!lY5N!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd352d01-3d55-4819-b1b1-a4a9a4c70a13_351x531.png 848w, https://substackcdn.com/image/fetch/$s_!lY5N!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd352d01-3d55-4819-b1b1-a4a9a4c70a13_351x531.png 1272w, https://substackcdn.com/image/fetch/$s_!lY5N!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fcd352d01-3d55-4819-b1b1-a4a9a4c70a13_351x531.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The output matrix from attention mechanism is passed through a sequence of Feed-Forward Network layers. While the attention layers are designed to map the spatial relationships between tokens, the FFN layer acts as the model&#8217;s static factual database, extracting semantic facts based on the mapped context.</p><h4>Step 7: The Un-embedding Layer</h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!h0wr!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F233dbc1b-538f-40b0-9e94-e494bebb7ea0_351x531.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!h0wr!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F233dbc1b-538f-40b0-9e94-e494bebb7ea0_351x531.png 424w, https://substackcdn.com/image/fetch/$s_!h0wr!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F233dbc1b-538f-40b0-9e94-e494bebb7ea0_351x531.png 848w, https://substackcdn.com/image/fetch/$s_!h0wr!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F233dbc1b-538f-40b0-9e94-e494bebb7ea0_351x531.png 1272w, https://substackcdn.com/image/fetch/$s_!h0wr!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F233dbc1b-538f-40b0-9e94-e494bebb7ea0_351x531.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!h0wr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F233dbc1b-538f-40b0-9e94-e494bebb7ea0_351x531.png" width="351" height="531" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/233dbc1b-538f-40b0-9e94-e494bebb7ea0_351x531.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:531,&quot;width&quot;:351,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:251255,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adityatrivedi17.substack.com/i/207513925?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F233dbc1b-538f-40b0-9e94-e494bebb7ea0_351x531.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!h0wr!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F233dbc1b-538f-40b0-9e94-e494bebb7ea0_351x531.png 424w, https://substackcdn.com/image/fetch/$s_!h0wr!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F233dbc1b-538f-40b0-9e94-e494bebb7ea0_351x531.png 848w, https://substackcdn.com/image/fetch/$s_!h0wr!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F233dbc1b-538f-40b0-9e94-e494bebb7ea0_351x531.png 1272w, https://substackcdn.com/image/fetch/$s_!h0wr!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F233dbc1b-538f-40b0-9e94-e494bebb7ea0_351x531.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The final hidden vector emerging from the last Transformer layer represents the mathematical essence of the next token. To translate this back into vocabulary words, it is multiplied by the inverse of the embedding matrix (the un-embedding layer).</p><ul><li><p>This operation outputs a sequence of raw numerical values called <strong>logits</strong>.</p></li><li><p>There is exactly one logit score for every single word/token in the model&#8217;s dictionary.</p></li></ul><h4>Step 8: <strong>Softmax Transformation and Sampling Filters</strong> </h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!cH4H!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52307b26-8979-42c0-9d15-8bf29a9def55_443x531.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!cH4H!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52307b26-8979-42c0-9d15-8bf29a9def55_443x531.png 424w, https://substackcdn.com/image/fetch/$s_!cH4H!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52307b26-8979-42c0-9d15-8bf29a9def55_443x531.png 848w, https://substackcdn.com/image/fetch/$s_!cH4H!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52307b26-8979-42c0-9d15-8bf29a9def55_443x531.png 1272w, https://substackcdn.com/image/fetch/$s_!cH4H!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52307b26-8979-42c0-9d15-8bf29a9def55_443x531.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!cH4H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52307b26-8979-42c0-9d15-8bf29a9def55_443x531.png" width="443" height="531" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/52307b26-8979-42c0-9d15-8bf29a9def55_443x531.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:531,&quot;width&quot;:443,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:313743,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adityatrivedi17.substack.com/i/207513925?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52307b26-8979-42c0-9d15-8bf29a9def55_443x531.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!cH4H!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52307b26-8979-42c0-9d15-8bf29a9def55_443x531.png 424w, https://substackcdn.com/image/fetch/$s_!cH4H!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52307b26-8979-42c0-9d15-8bf29a9def55_443x531.png 848w, https://substackcdn.com/image/fetch/$s_!cH4H!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52307b26-8979-42c0-9d15-8bf29a9def55_443x531.png 1272w, https://substackcdn.com/image/fetch/$s_!cH4H!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F52307b26-8979-42c0-9d15-8bf29a9def55_443x531.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The raw logits are passed through a Softmax function to turn them into clean percentages. If your model vocabulary is 32,000 words, you now have 32,000 distinct probability scores that altogether sum up to 1.0. The inference engine then applies your generation parameters:</p><ul><li><p><strong>Temperature:</strong> Divides the logits before Softmax. A lower temperature crushes lower-probability options, rendering the model predictable. A higher temperature flattens the distribution, raising the probability of unusual word choices.</p></li><li><p><strong>Top-P (Nucleus Sampling):</strong> Sorts the tokens by probability and discards everything outside the top cumulative percentage pool (e.g., the top 90% of probability weight), eliminating chaotic outliers entirely.</p></li></ul><h4>Step 9: <strong>Autoregressive Loop Update</strong></h4><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xf15!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F155f9089-c429-4681-9149-c33c346ebd0d_477x531.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xf15!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F155f9089-c429-4681-9149-c33c346ebd0d_477x531.png 424w, https://substackcdn.com/image/fetch/$s_!xf15!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F155f9089-c429-4681-9149-c33c346ebd0d_477x531.png 848w, https://substackcdn.com/image/fetch/$s_!xf15!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F155f9089-c429-4681-9149-c33c346ebd0d_477x531.png 1272w, https://substackcdn.com/image/fetch/$s_!xf15!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F155f9089-c429-4681-9149-c33c346ebd0d_477x531.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xf15!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F155f9089-c429-4681-9149-c33c346ebd0d_477x531.png" width="477" height="531" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/155f9089-c429-4681-9149-c33c346ebd0d_477x531.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:531,&quot;width&quot;:477,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:317074,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adityatrivedi17.substack.com/i/207513925?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F155f9089-c429-4681-9149-c33c346ebd0d_477x531.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!xf15!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F155f9089-c429-4681-9149-c33c346ebd0d_477x531.png 424w, https://substackcdn.com/image/fetch/$s_!xf15!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F155f9089-c429-4681-9149-c33c346ebd0d_477x531.png 848w, https://substackcdn.com/image/fetch/$s_!xf15!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F155f9089-c429-4681-9149-c33c346ebd0d_477x531.png 1272w, https://substackcdn.com/image/fetch/$s_!xf15!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F155f9089-c429-4681-9149-c33c346ebd0d_477x531.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The final winning token is selected, converted back into text via the de-tokenizer, and streamed to your user interface. Crucially, the Key and Value matrices for this brand-new token are calculated and immediately appended to the existing <strong>KV Cache</strong>. The model then restarts Phase 2, feeding only this single new token back into the input layer while referencing the expanded KV cache for historical memory.</p><div><hr></div><p>The complete diagram is shown below:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Gct-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aea86c4-8444-41f4-8155-4adce38d72a9_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Gct-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aea86c4-8444-41f4-8155-4adce38d72a9_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!Gct-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aea86c4-8444-41f4-8155-4adce38d72a9_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!Gct-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aea86c4-8444-41f4-8155-4adce38d72a9_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!Gct-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aea86c4-8444-41f4-8155-4adce38d72a9_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Gct-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aea86c4-8444-41f4-8155-4adce38d72a9_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1aea86c4-8444-41f4-8155-4adce38d72a9_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1904232,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adityatrivedi17.substack.com/i/207513925?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aea86c4-8444-41f4-8155-4adce38d72a9_1536x1024.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Gct-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aea86c4-8444-41f4-8155-4adce38d72a9_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!Gct-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aea86c4-8444-41f4-8155-4adce38d72a9_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!Gct-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aea86c4-8444-41f4-8155-4adce38d72a9_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!Gct-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1aea86c4-8444-41f4-8155-4adce38d72a9_1536x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p></p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://adityatrivedi17.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Aditya's Newsletter! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[The Elephant-Goldfish Model]]></title><description><![CDATA[If you&#8217;ve used Large Language Models to write code for longer than 10 minutes, you&#8217;ve likely run into the Context Wall.]]></description><link>https://adityatrivedi17.substack.com/p/the-elephant-goldfish-model</link><guid isPermaLink="false">https://adityatrivedi17.substack.com/p/the-elephant-goldfish-model</guid><dc:creator><![CDATA[Aditya Trivedi]]></dc:creator><pubDate>Mon, 06 Jul 2026 08:14:35 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/e4e7e40c-02d6-4c62-b519-bc7207e4d3e9_1376x768.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you&#8217;ve used Large Language Models to write code for longer than 10 minutes, you&#8217;ve likely run into the <strong>Context Wall.</strong></p><p>It always starts the same way. You open a fresh chat, explain your project, and the AI splits out flawless code. Encouraged, you keep chatting. You add features, fix bugs, and alter requirements. But by Prompt 30, something breaks. The AI begins forgetting core constraints, hallucinating functions and generating messy, cyclical code.</p><p>This isn&#8217;t an execution problem; it&#8217;s a <strong>context fatigue</strong> problem. When an LLM&#8217;s context window is crammed full of conversational chatter, tangential debugging loops, and shifting requirements, its cognitive capability degrades.</p><p>To solve this, researchers at Google introduced a new framework: <strong>The Elephant-Goldfish Model.</strong></p><div><hr></div><h2>What is the Elephant-Goldfish Model ?</h2><p>Introduced in the foundational Google Research paper, <a href="https://research.google/pubs/elephants-goldfish-and-the-new-golden-age-of-software-engineering/">Elephants, Goldfish and New Golden Age of Engineering</a>, this framework completely flips the traditional developer-AI relationship. </p><p>Instead of treating the AI as an on-demand code monkey, the Elephant-Goldfish model forces the developer into the role of an <strong>Architect</strong>. It splits your interactions into 2 distinct phases, handled by 2 completely different mental modes.</p><h4>1. The Elephant:</h4><p>Like the proverb says, an elephant never forgets. In this phase, you use a long-lived continuous AI session. Together, you and the Elephant brainstorm features, challenge architectural assumptions, and map out edge cases. The ultimate goal of Elephant is to <strong>not to write code</strong>, but to draft a flawless, highly detailed <strong>Design Document</strong> (PRD or functional specification).</p><h4><strong>2. The Goldfish:</strong></h4><p>A goldfish has no long-term memory. In this phase, you spin up brand-new, completely stateless AI sessions. These &#8220;Goldfish&#8221; agents have 0 historical knowledge of your previous conversations. Their sole job is to act a cold-reader to stress-test the Elephant&#8217;s design document. </p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iDm-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2db2e16-085f-468a-9dc4-613e2d9b7a59_994x902.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iDm-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2db2e16-085f-468a-9dc4-613e2d9b7a59_994x902.png 424w, https://substackcdn.com/image/fetch/$s_!iDm-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2db2e16-085f-468a-9dc4-613e2d9b7a59_994x902.png 848w, https://substackcdn.com/image/fetch/$s_!iDm-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2db2e16-085f-468a-9dc4-613e2d9b7a59_994x902.png 1272w, https://substackcdn.com/image/fetch/$s_!iDm-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2db2e16-085f-468a-9dc4-613e2d9b7a59_994x902.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iDm-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2db2e16-085f-468a-9dc4-613e2d9b7a59_994x902.png" width="994" height="902" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c2db2e16-085f-468a-9dc4-613e2d9b7a59_994x902.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:902,&quot;width&quot;:994,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:155407,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adityatrivedi17.substack.com/i/205460136?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2db2e16-085f-468a-9dc4-613e2d9b7a59_994x902.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!iDm-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2db2e16-085f-468a-9dc4-613e2d9b7a59_994x902.png 424w, https://substackcdn.com/image/fetch/$s_!iDm-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2db2e16-085f-468a-9dc4-613e2d9b7a59_994x902.png 848w, https://substackcdn.com/image/fetch/$s_!iDm-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2db2e16-085f-468a-9dc4-613e2d9b7a59_994x902.png 1272w, https://substackcdn.com/image/fetch/$s_!iDm-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc2db2e16-085f-468a-9dc4-613e2d9b7a59_994x902.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h3>The 3 Gate Protocol: How it Works</h3><p>The core rule of Elephant-Goldfish model is simple: <strong>No production code is written until the design document passes the Goldfish Gates.</strong></p><p>Before execution, the design document is fed to isolated Goldfish agents through a three-stage lifecycle:</p><h4><strong>Gate 1: The Comprehension Gate</strong></h4><p>A stateless Goldfish reads the document. Can an outside observer with zero historical context understand exactly what this software is supposed to do ? If the Goldfish asks a clarifying question, the document fails.</p><h4><strong>Gate 2: The Critic Gate</strong></h4><p>Specialized Goldfish agents (acting as Security, UX or Performance specialists) aggressively audit the design. They hunt for hidden logic flaws, missing edge cases, and architectural bottlenecks.</p><h4><strong>Gate 3: The Readiness Gate</strong></h4><p>An implementation Goldfish looks at the blueprint and answers one question: <em>Could a junior developer build this entire system right now without asking a follow-up question ?</em></p><p>If the document fails any of these gates, you take the Goldfish&#8217;s feedback back to the Elephant session, refine the blueprint, and run it through the gates again. Once it passes, the Elephant is finally allowed to generate the code. Because the blueprint is airtight, the resulting code is modular, clean, and free of technical debt.</p><div><hr></div><h3><strong>Scaling to Massive Applications: &#8220;Peanuts and Hay&#8221;</strong></h3><p>A common objection to this model is: <em>&#8220;This sounds great for greenfield projects, but how do I apply this to an enterprise codebase with millions of lines of legacy code?&#8221;</em></p><p>The framework handles this through a context-compression technique metaphorically called <strong>Peanuts and Hay</strong>:</p><ol><li><p><strong><span>Micro-Context Chunking</span></strong><span>: Large codebases are broken down into microscopic directories (the &#8220;peanuts&#8221;).</span></p></li><li><p><strong><span>Bottom-Up Summarization</span></strong><span>: Isolated Goldfish agents scan these tiny directories and write hyper-dense, highly structured local </span><code>readme.md</code><span> files detailing local logic dependencies.</span></p></li><li><p><strong><span>Hierarchical Indexing</span></strong><span>: A higher-level agent summarizes those readmes into a parent structure (the &#8220;hay&#8221;).</span></p></li></ol><p>This creates a highly compressed, completely accurate map of institutional memory that the Elephant can consult instantly, without ever overloading its context window.</p><div><hr></div><p>The old way of using AI&#8212;writing code line-by-line in a messy, endless chat room&#8212;is dead. It creates fragile codebases and exhausting debugging loops.</p><p>The Elephant-Goldfish model proves that <strong>the design document is the code</strong>. By rigorously separating long-term strategic context (The Elephant) from isolated, stateless execution validation (The Goldfish), you can harness the maximum cognitive power of LLMs.</p><p>Next time you start a feature, resist the urge to ask your AI for code. Ask it for a design doc, bring in the goldfish to tear it apart, and watch your development velocity skyrocket.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://adityatrivedi17.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Aditya's Newsletter! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[The Prompt is a Bottleneck: Moving from Prompting to Loop Engineering]]></title><description><![CDATA[If you've spent any significant time building with LLMs, you know the feeling.]]></description><link>https://adityatrivedi17.substack.com/p/the-prompt-is-a-bottleneck-moving</link><guid isPermaLink="false">https://adityatrivedi17.substack.com/p/the-prompt-is-a-bottleneck-moving</guid><dc:creator><![CDATA[Aditya Trivedi]]></dc:creator><pubDate>Tue, 30 Jun 2026 16:00:27 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!a7Tc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95a3960c-582a-41ea-9bb0-6f81a91f6c30_1536x1024.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you've spent any significant time building with LLMs, you know the feeling. You write a prompt, get an output, realise it's missing something, write another prompt, fix a bug, and repeat. It quickly starts to feel less like software engineering and more like... babysitting.</p><p>The problem is not that Ai is incapable. The problem is our interface. We are stuck in a manual, single-turn mindset.</p><h2>Loop Engineering:</h2><p>Welcome to <strong>Loop Engineering</strong>. This is the paradigm shift from writing static prompts to designing systems that execute continuous, autonomous loops. </p><p>This visual guide breaks down the core architecture of loops across 10 logical sections. Let&#8217;s trace this journey from fundamental problem to the future of AI development.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!a7Tc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95a3960c-582a-41ea-9bb0-6f81a91f6c30_1536x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!a7Tc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95a3960c-582a-41ea-9bb0-6f81a91f6c30_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!a7Tc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95a3960c-582a-41ea-9bb0-6f81a91f6c30_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!a7Tc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95a3960c-582a-41ea-9bb0-6f81a91f6c30_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!a7Tc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95a3960c-582a-41ea-9bb0-6f81a91f6c30_1536x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!a7Tc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95a3960c-582a-41ea-9bb0-6f81a91f6c30_1536x1024.png" width="1456" height="971" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/95a3960c-582a-41ea-9bb0-6f81a91f6c30_1536x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:971,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1869764,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://adityatrivedi17.substack.com/i/204260113?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95a3960c-582a-41ea-9bb0-6f81a91f6c30_1536x1024.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!a7Tc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95a3960c-582a-41ea-9bb0-6f81a91f6c30_1536x1024.png 424w, https://substackcdn.com/image/fetch/$s_!a7Tc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95a3960c-582a-41ea-9bb0-6f81a91f6c30_1536x1024.png 848w, https://substackcdn.com/image/fetch/$s_!a7Tc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95a3960c-582a-41ea-9bb0-6f81a91f6c30_1536x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!a7Tc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F95a3960c-582a-41ea-9bb0-6f81a91f6c30_1536x1024.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Step 1 &amp; 2: The Bottleneck of the &#8220;One-Turn World&#8221;</h3><p>The current state of interacting with AI relies entirely on a human supervisor manually micro-managing every transaction.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Pfle!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af79eaf-6062-4339-a6be-f814cb7738ca_382x282.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Pfle!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af79eaf-6062-4339-a6be-f814cb7738ca_382x282.png 424w, https://substackcdn.com/image/fetch/$s_!Pfle!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af79eaf-6062-4339-a6be-f814cb7738ca_382x282.png 848w, https://substackcdn.com/image/fetch/$s_!Pfle!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af79eaf-6062-4339-a6be-f814cb7738ca_382x282.png 1272w, https://substackcdn.com/image/fetch/$s_!Pfle!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af79eaf-6062-4339-a6be-f814cb7738ca_382x282.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Pfle!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af79eaf-6062-4339-a6be-f814cb7738ca_382x282.png" width="382" height="282" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9af79eaf-6062-4339-a6be-f814cb7738ca_382x282.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:282,&quot;width&quot;:382,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:200936,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adityatrivedi17.substack.com/i/204260113?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af79eaf-6062-4339-a6be-f814cb7738ca_382x282.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Pfle!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af79eaf-6062-4339-a6be-f814cb7738ca_382x282.png 424w, https://substackcdn.com/image/fetch/$s_!Pfle!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af79eaf-6062-4339-a6be-f814cb7738ca_382x282.png 848w, https://substackcdn.com/image/fetch/$s_!Pfle!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af79eaf-6062-4339-a6be-f814cb7738ca_382x282.png 1272w, https://substackcdn.com/image/fetch/$s_!Pfle!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af79eaf-6062-4339-a6be-f814cb7738ca_382x282.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>When every output requires a new human decision, building with AI becomes incredibly repetitive, slow, and fragile. Because humans must decide what happens next every single time the AI finishes a task, <strong>the human becomes the ultimate bottleneck.</strong></p><div><hr></div><h3>Step 3: The Big Idea (Letting AI Decide the Next Step)</h3><p>What if we removed the human from the micro-management layer entirely?</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tdHB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ba766cd-851e-40e9-9b0c-f1cade552cdb_213x282.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tdHB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ba766cd-851e-40e9-9b0c-f1cade552cdb_213x282.png 424w, https://substackcdn.com/image/fetch/$s_!tdHB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ba766cd-851e-40e9-9b0c-f1cade552cdb_213x282.png 848w, https://substackcdn.com/image/fetch/$s_!tdHB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ba766cd-851e-40e9-9b0c-f1cade552cdb_213x282.png 1272w, https://substackcdn.com/image/fetch/$s_!tdHB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ba766cd-851e-40e9-9b0c-f1cade552cdb_213x282.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tdHB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ba766cd-851e-40e9-9b0c-f1cade552cdb_213x282.png" width="213" height="282" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9ba766cd-851e-40e9-9b0c-f1cade552cdb_213x282.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:282,&quot;width&quot;:213,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:113284,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adityatrivedi17.substack.com/i/204260113?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ba766cd-851e-40e9-9b0c-f1cade552cdb_213x282.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!tdHB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ba766cd-851e-40e9-9b0c-f1cade552cdb_213x282.png 424w, https://substackcdn.com/image/fetch/$s_!tdHB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ba766cd-851e-40e9-9b0c-f1cade552cdb_213x282.png 848w, https://substackcdn.com/image/fetch/$s_!tdHB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ba766cd-851e-40e9-9b0c-f1cade552cdb_213x282.png 1272w, https://substackcdn.com/image/fetch/$s_!tdHB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9ba766cd-851e-40e9-9b0c-f1cade552cdb_213x282.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The core premise of Loop Engineering is shifting from a linear sequence to a continuous cycle. Instead of a human executing every turn, a high-level goal is fed into an autonomous loop: <strong>Plan &#8212;&gt; Build <span>&#8212;&gt;</span> Test <span>&#8212;&gt;</span> Review <span>&#8212;&gt;</span> Improve</strong>.</p><p>The mindset shift is clear: <strong>Stop writing prompts. Start designing systems that write prompts.</strong></p><div><hr></div><h3>Step 4 &amp; 5: The Loop Engine and the Core Cycle</h3><p>To bring this big idea to life, we need a standard operational architecture. This is managed by the <strong>Loop Engine</strong>.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NWjG!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b985cd9-f0ad-4946-8efc-c99619aeacb1_396x282.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NWjG!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b985cd9-f0ad-4946-8efc-c99619aeacb1_396x282.png 424w, https://substackcdn.com/image/fetch/$s_!NWjG!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b985cd9-f0ad-4946-8efc-c99619aeacb1_396x282.png 848w, https://substackcdn.com/image/fetch/$s_!NWjG!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b985cd9-f0ad-4946-8efc-c99619aeacb1_396x282.png 1272w, https://substackcdn.com/image/fetch/$s_!NWjG!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b985cd9-f0ad-4946-8efc-c99619aeacb1_396x282.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NWjG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b985cd9-f0ad-4946-8efc-c99619aeacb1_396x282.png" width="396" height="282" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2b985cd9-f0ad-4946-8efc-c99619aeacb1_396x282.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:282,&quot;width&quot;:396,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:201494,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adityatrivedi17.substack.com/i/204260113?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b985cd9-f0ad-4946-8efc-c99619aeacb1_396x282.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!NWjG!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b985cd9-f0ad-4946-8efc-c99619aeacb1_396x282.png 424w, https://substackcdn.com/image/fetch/$s_!NWjG!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b985cd9-f0ad-4946-8efc-c99619aeacb1_396x282.png 848w, https://substackcdn.com/image/fetch/$s_!NWjG!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b985cd9-f0ad-4946-8efc-c99619aeacb1_396x282.png 1272w, https://substackcdn.com/image/fetch/$s_!NWjG!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2b985cd9-f0ad-4946-8efc-c99619aeacb1_396x282.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The core premise of Loop Engineering is shifting from a linear sequence to a continuous cycle. Instead of a human executing every turn, a high-level goal is fed into an autonomous loop: <strong>Plan &#8212;&gt; Build &#8212;&gt; Test &#8212;&gt; Review &#8212;&gt; Improve</strong>.</p><p>The mindset shift is clear: <strong>Stop writing prompts. Start designing systems that write prompts.</strong></p><div><hr></div><h3>Step 6: A Real-World Example (Building a Login Page)</h3><p>How does this look in practice? Let's take a common development task: creating a functional application feature.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!StI9!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13b3f70e-2779-4ab3-849e-508a9909e43a_203x282.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!StI9!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13b3f70e-2779-4ab3-849e-508a9909e43a_203x282.png 424w, https://substackcdn.com/image/fetch/$s_!StI9!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13b3f70e-2779-4ab3-849e-508a9909e43a_203x282.png 848w, https://substackcdn.com/image/fetch/$s_!StI9!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13b3f70e-2779-4ab3-849e-508a9909e43a_203x282.png 1272w, https://substackcdn.com/image/fetch/$s_!StI9!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13b3f70e-2779-4ab3-849e-508a9909e43a_203x282.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!StI9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13b3f70e-2779-4ab3-849e-508a9909e43a_203x282.png" width="203" height="282" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/13b3f70e-2779-4ab3-849e-508a9909e43a_203x282.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:282,&quot;width&quot;:203,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:108262,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adityatrivedi17.substack.com/i/204260113?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13b3f70e-2779-4ab3-849e-508a9909e43a_203x282.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!StI9!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13b3f70e-2779-4ab3-849e-508a9909e43a_203x282.png 424w, https://substackcdn.com/image/fetch/$s_!StI9!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13b3f70e-2779-4ab3-849e-508a9909e43a_203x282.png 848w, https://substackcdn.com/image/fetch/$s_!StI9!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13b3f70e-2779-4ab3-849e-508a9909e43a_203x282.png 1272w, https://substackcdn.com/image/fetch/$s_!StI9!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F13b3f70e-2779-4ab3-849e-508a9909e43a_203x282.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Instead of a human developer reviewing code, spotting a lack of input validation, writing a new prompt, running tests, seeing an error, and writing another prompt&#8212;the Loop Engine manages it natively. The system generates code, tests it, catches its own omissions, fixes its own bugs, and delivers a finished, verified asset in a fraction of the time.</p><div><hr></div><h3>Step 7 &amp; 8: Why Loops Beat Prompts in Dynamic Workflows</h3><p>When we compare traditional prompting side-by-side with Loop Engineering, the structural advantages become undeniable.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rIpK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffad16d17-cbc3-4849-bdbd-e5d966912059_409x282.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rIpK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffad16d17-cbc3-4849-bdbd-e5d966912059_409x282.png 424w, https://substackcdn.com/image/fetch/$s_!rIpK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffad16d17-cbc3-4849-bdbd-e5d966912059_409x282.png 848w, https://substackcdn.com/image/fetch/$s_!rIpK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffad16d17-cbc3-4849-bdbd-e5d966912059_409x282.png 1272w, https://substackcdn.com/image/fetch/$s_!rIpK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffad16d17-cbc3-4849-bdbd-e5d966912059_409x282.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rIpK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffad16d17-cbc3-4849-bdbd-e5d966912059_409x282.png" width="409" height="282" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fad16d17-cbc3-4849-bdbd-e5d966912059_409x282.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:282,&quot;width&quot;:409,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:217648,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adityatrivedi17.substack.com/i/204260113?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffad16d17-cbc3-4849-bdbd-e5d966912059_409x282.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!rIpK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffad16d17-cbc3-4849-bdbd-e5d966912059_409x282.png 424w, https://substackcdn.com/image/fetch/$s_!rIpK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffad16d17-cbc3-4849-bdbd-e5d966912059_409x282.png 848w, https://substackcdn.com/image/fetch/$s_!rIpK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffad16d17-cbc3-4849-bdbd-e5d966912059_409x282.png 1272w, https://substackcdn.com/image/fetch/$s_!rIpK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffad16d17-cbc3-4849-bdbd-e5d966912059_409x282.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Traditional prompting is fundamentally linear, fragile, and manual. Loop Engineering is cyclical, scalable, and resilient.</p><p>Furthermore, loops break down the limitation of a single LLM instance. A single Loop Engine can orchestrate a <strong>Dynamic Workflow</strong> composed of multiple specialized sub-agents&#8212;such as Research, Coding, Testing, Reviewer, and Documentation agents&#8212;all collaborating within the same loop to deliver a unified result.</p><div><hr></div><h3>Step 9 &amp; 10: The Five Building Blocks and the Future of AI Development</h3><p>To construct a reliable Loop Engine, you need to bring together five core architectural building blocks, shifting the entire developer paradigm.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!aU-8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe71fd4a1-ca53-4fcf-ae95-8a0fb32f990f_387x282.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!aU-8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe71fd4a1-ca53-4fcf-ae95-8a0fb32f990f_387x282.png 424w, https://substackcdn.com/image/fetch/$s_!aU-8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe71fd4a1-ca53-4fcf-ae95-8a0fb32f990f_387x282.png 848w, https://substackcdn.com/image/fetch/$s_!aU-8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe71fd4a1-ca53-4fcf-ae95-8a0fb32f990f_387x282.png 1272w, https://substackcdn.com/image/fetch/$s_!aU-8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe71fd4a1-ca53-4fcf-ae95-8a0fb32f990f_387x282.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!aU-8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe71fd4a1-ca53-4fcf-ae95-8a0fb32f990f_387x282.png" width="387" height="282" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e71fd4a1-ca53-4fcf-ae95-8a0fb32f990f_387x282.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:282,&quot;width&quot;:387,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:202746,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://adityatrivedi17.substack.com/i/204260113?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe71fd4a1-ca53-4fcf-ae95-8a0fb32f990f_387x282.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!aU-8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe71fd4a1-ca53-4fcf-ae95-8a0fb32f990f_387x282.png 424w, https://substackcdn.com/image/fetch/$s_!aU-8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe71fd4a1-ca53-4fcf-ae95-8a0fb32f990f_387x282.png 848w, https://substackcdn.com/image/fetch/$s_!aU-8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe71fd4a1-ca53-4fcf-ae95-8a0fb32f990f_387x282.png 1272w, https://substackcdn.com/image/fetch/$s_!aU-8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe71fd4a1-ca53-4fcf-ae95-8a0fb32f990f_387x282.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The robust loop environment relies on a shared <strong>Memory (Context)</strong> foundation supporting:</p><ol><li><p><strong>Automations:</strong> Background triggers and handlers.</p></li><li><p><strong>Skills:</strong> Specific capabilities or tool executions.</p></li><li><p><strong>Connectors:</strong> Integrations to external systems and data.</p></li><li><p><strong>Sub-Agents:</strong> Specialized LLM personas.</p></li><li><p><strong>Workspaces:</strong> Isolated sandboxes where code can be executed and tested.</p></li></ol><p>This entirely reimagines the role of the software developer. In the old world, developers spent their time writing individual prompts to get individual outputs. In the new world, <strong>the developer designs the loop, and the loop builds the software.</strong></p><div><hr></div><p>The era of manual, chat-based micro-management is coming to a close. To build truly powerful, autonomous software systems, we must look past the individual prompt window.</p><p>Design the engine, orchestrate the sub-agents, and establish robust verification layers.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://adityatrivedi17.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading Aditya's Newsletter! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[What is an LLM Wiki and Why are People Paying Attention to it ?]]></title><description><![CDATA[Andrej Karpathy just broke the internet with a new research method that is going to fundamentally change how we all use AI.]]></description><link>https://adityatrivedi17.substack.com/p/what-is-an-llm-wiki-and-why-are-people</link><guid isPermaLink="false">https://adityatrivedi17.substack.com/p/what-is-an-llm-wiki-and-why-are-people</guid><dc:creator><![CDATA[Aditya Trivedi]]></dc:creator><pubDate>Tue, 02 Jun 2026 16:45:57 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/19a8ffdf-c852-4522-bbed-36ec35116232_2430x1529.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Andrej Karpathy just broke the internet with a new research method that is going to fundamentally change how we all use AI. Here&#8217;s the problem, LLM suck at deep research. They can look at a couple websites and get you surface level answers, but when you try and compare ideas or actually dive deeper, it all completely falls apart. The solution is Karpathy&#8217;s exact system for doing PhD level research with AI that creates custom LLM knowledge bases that actually get smarter over time.</p><p>The concept is straightforward. Instead of scattering knowledge across Notion, Google Docs, browser bookmarks, and sticky notes, you keep everything as structured markdown files. Then you point Claude Code (or any other agent like Gemini CLI) at the folder and ask it questions. The LLM reads your files, finds what&#8217;s relevant, and gives you grounded answers drawn from your own knowledge - not the general internet.</p><div><hr></div><h2>What Makes This Different ?</h2><p>Most note-taking apps are build for human reading. You browse, search, click. They&#8217;re optimized for you to find things manually.<br>An LLM wiki is optimized for the model to read on your behalf. That shift changes everything about how you structure information. Here&#8217;s the core difference:</p><ul><li><p><strong>Traditional App:</strong> You remember where something is navigate to it</p></li><li><p><strong>LLM Wiki:</strong> You describe what you need in plain language, and LLM finds and synthesizes it across your entire knowledge base.</p></li></ul><div><hr></div><h2>Why does this idea appear now ?</h2><p>A lot of the current AI document workflows look like RAG. You upload documents, the model retrieves relevant pieces at query time, and then generates an answer. But here there are some limitations:</p><ul><li><p>Questions that requires synthesis across many documents often force repeated rediscovery</p></li><li><p>Good answers disappear into chat logs</p></li><li><p>Interpretations do not accumulate very well across sessions</p></li></ul><p>The <code>LLM Wiki</code> reframes it like : &#8216;<strong>Instead of reassembling knowledge every time, compile it once and keep it updated</strong>&#8216;</p><div><hr></div><h2>How LLM Wiki Actually Works ?</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!tJFE!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccb2449a-cf41-4029-9faa-00e80e2e91da_2430x1529.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!tJFE!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccb2449a-cf41-4029-9faa-00e80e2e91da_2430x1529.png 424w, https://substackcdn.com/image/fetch/$s_!tJFE!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccb2449a-cf41-4029-9faa-00e80e2e91da_2430x1529.png 848w, https://substackcdn.com/image/fetch/$s_!tJFE!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccb2449a-cf41-4029-9faa-00e80e2e91da_2430x1529.png 1272w, https://substackcdn.com/image/fetch/$s_!tJFE!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccb2449a-cf41-4029-9faa-00e80e2e91da_2430x1529.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!tJFE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccb2449a-cf41-4029-9faa-00e80e2e91da_2430x1529.png" width="1456" height="916" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ccb2449a-cf41-4029-9faa-00e80e2e91da_2430x1529.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:916,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!tJFE!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccb2449a-cf41-4029-9faa-00e80e2e91da_2430x1529.png 424w, https://substackcdn.com/image/fetch/$s_!tJFE!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccb2449a-cf41-4029-9faa-00e80e2e91da_2430x1529.png 848w, https://substackcdn.com/image/fetch/$s_!tJFE!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccb2449a-cf41-4029-9faa-00e80e2e91da_2430x1529.png 1272w, https://substackcdn.com/image/fetch/$s_!tJFE!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fccb2449a-cf41-4029-9faa-00e80e2e91da_2430x1529.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The architecture is the most minimal. There are 3 components:</p><ol><li><p><strong>A folder of markdown files:</strong> This is your knowledge base. It can contain anything: research notes, meeting summaries, project documentation, book notes, personal reference material, code snippets with explanations.</p></li><li><p><strong>A consistent structure within each file:</strong> Good LLM wikis use a consistent internal format - a title, a brief summary, tagged topics, and then the content. The model uses this structure to locate relevant information faster.</p></li><li><p><strong>Claude Code as the query interface:</strong> You open a terminal, navigate to your wiki folder, launch Claude Code, and ask it a question. It reads the files it needs, synthesizes an answer, and can even update or add notes when you ask it to .</p></li></ol><h3>1. Data Ingest: Compile Raw Materials into a Wiki</h3><p>Karpathy describes dropping source materials such as articles, papers, repositories, datasets, and images into a <code>raw</code> directory and then using LLM to incrementally <code>compile</code> a wiki from them. This includes:</p><ul><li><p>Model write summaries</p></li><li><p>Creating Backlinks</p></li><li><p>Group information into concepts</p></li><li><p>Write page for those concepts</p></li><li><p>Links the page together</p></li></ul><h3>2. IDE: Obsidian acts as Frontend</h3><p>Obsidian is the best thing we can use as IDE Frontend. Here we can view raw data, compiled wiki and derived visual outputs. The LLM writes and maintains the wiki, while the human mostly reads, explores and guides.</p><h3>3. Q&amp;A</h3><p>He writes that one of his recent research wikis is roughly <code>100 articles</code> and <code>400K words</code>, and that at this kind of <code>small scale</code>, more elaborate RAG infrastructure was not strictly necessary.</p><p>The reasons he gives are practical:</p><ul><li><p>The LLM keeps index files updated</p></li><li><p>It maintains brief summaries of the documents</p></li><li><p>It can read and connect the important related material fairly well</p></li></ul><p>So the claim is not &#8220;RAG is unnecessary.&#8221;<br>It is closer to: &#8220;at smaller scales, a structured wiki plus index files can go surprisingly far.&#8221;</p><h3>4. Output: Answers filed back to the wiki</h3><p>Karpathy says he often prefers outputs not as plain terminal text but as markdown files, Marp slides, or matplotlib figures that he can view again in Obsidian.</p><p>And one of the most important ideas is this:</p><p><code>Good outputs can be filed back into the wiki.</code></p><p>That means the results of exploration become part of the knowledge base.</p><ul><li><p>An analysis can become a new page</p></li><li><p>A slide deck can become both a deliverable and a knowledge artifact</p></li><li><p>A chart can become something queryable later</p></li></ul><p>This is where the gist and the follow-up posts point in the same direction:<br><code>queries compound instead of disappearing.</code></p><h3><strong>5. Linting: the wiki gets ongoing health checks</strong></h3><p>He also describes running LLM-based health checks over the wiki: finding inconsistent data, filling gaps via web search, and identifying interesting connections that might deserve new pages.</p><p>This matters because it shows the wiki is not just a static archive.<br>It is something that can be continuously cleaned up and strengthened.</p><h3><strong>6. Extra tools: search and tooling naturally get added</strong></h3><p>In a follow-up post he says he vibe-coded a small search engine over the wiki.<br>He uses it directly through a web UI, but more often wants to pass it to an LLM through the CLI for larger queries.</p><p>That suggests a natural progression:</p><ul><li><p>Start with markdown files and index pages</p></li><li><p>Add search tools as the repository grows</p></li><li><p>Eventually make those tools available to the LLM as part of its working toolset</p></li></ul><p>In that sense, <code>LLM Wiki</code> is both a documentation pattern and a starting point for a tool ecosystem.</p><div><hr></div><h2>Set Up Your LLM Wiki in Obsidian</h2><h3>Step 1: Install Obsidian and Create a Vault:</h3><p>Download Obsidian from <strong><a href="https://obsidian.md/?_sm_vck=pnPnVkVfDHF8FfstNLcV4FQS0PNqMsRFbVcVKD5tMD6VkpQcK50Q">the official Obsidian site</a></strong>. Create a new vault in a folder you&#8217;ll remember &#8212; something like <code>~/wiki</code> or <code>~/Documents/llm-wiki</code>.</p><p>A &#8220;vault&#8221; in Obsidian is just a folder. Everything in it is plain markdown.</p><h3>Step 2: Create the folder structure</h3><p>Open your Coding Agent (Claude Code, Gemini CLI) and paste the following prompt:</p><pre><code><code>You are now my LLM Wiki agent. Implement this exact idea file as my complete second brain. Guide me step-by-step: create the SKILL.md schema with full rules, setup index.md and log.md, define folder conventions, and show me the first ingest example. From now on, every interaction follows the schema.

# LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

## The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

The idea here is different. Instead of just retrieving from raw documents at query time, the LLM **incrementally builds and maintains a persistent wiki** &#8212; a structured, interlinked collection of markdown files that sits between you and the raw sources. When you add a new source, the LLM doesn't just index it for later retrieval. It reads it, extracts the key information, and integrates it into the existing wiki &#8212; updating entity pages, revising topic summaries, noting where new data contradicts old claims, strengthening or challenging the evolving synthesis. The knowledge is compiled once and then *kept current*, not re-derived on every query.

This is the key difference: **the wiki is a persistent, compounding artifact.** The cross-references are already there. The contradictions have already been flagged. The synthesis already reflects everything you've read. The wiki keeps getting richer with every source you add and every question you ask.

You never (or rarely) write the wiki yourself &#8212; the LLM writes and maintains all of it. You're in charge of sourcing, exploration, and asking the right questions. The LLM does all the grunt work &#8212; the summarizing, cross-referencing, filing, and bookkeeping that makes a knowledge base actually useful over time. In practice, I have the LLM agent open on one side and Obsidian open on the other. The LLM makes edits based on our conversation, and I browse the results in real time &#8212; following links, checking the graph view, reading the updated pages. Obsidian is the IDE; the LLM is the programmer; the wiki is the codebase.

This can apply to a lot of different contexts. A few examples:

- **Personal**: tracking your own goals, health, psychology, self-improvement &#8212; filing journal entries, articles, podcast notes, and building up a structured picture of yourself over time.
- **Research**: going deep on a topic over weeks or months &#8212; reading papers, articles, reports, and incrementally building a comprehensive wiki with an evolving thesis.
- **Reading a book**: filing each chapter as you go, building out pages for characters, themes, plot threads, and how they connect. By the end you have a rich companion wiki. Think of fan wikis like [Tolkien Gateway](https://tolkiengateway.net/wiki/Main_Page) &#8212; thousands of interlinked pages covering characters, places, events, languages, built by a community of volunteers over years. You could build something like that personally as you read, with the LLM doing all the cross-referencing and maintenance.
- **Business/team**: an internal wiki maintained by LLMs, fed by Slack threads, meeting transcripts, project documents, customer calls. Possibly with humans in the loop reviewing updates. The wiki stays current because the LLM does the maintenance that no one on the team wants to do.
- **Competitive analysis, due diligence, trip planning, course notes, hobby deep-dives** &#8212; anything where you're accumulating knowledge over time and want it organized rather than scattered.

## Architecture

There are three layers:

**Raw sources** &#8212; your curated collection of source documents. Articles, papers, images, data files. These are immutable &#8212; the LLM reads from them but never modifies them. This is your source of truth.

**The wiki** &#8212; a directory of LLM-generated markdown files. Summaries, entity pages, concept pages, comparisons, an overview, a synthesis. The LLM owns this layer entirely. It creates pages, updates them when new sources arrive, maintains cross-references, and keeps everything consistent. You read it; the LLM writes it.

**The schema** &#8212; a document (e.g. CLAUDE.md for Claude Code or AGENTS.md for Codex) that tells the LLM how the wiki is structured, what the conventions are, and what workflows to follow when ingesting sources, answering questions, or maintaining the wiki. This is the key configuration file &#8212; it's what makes the LLM a disciplined wiki maintainer rather than a generic chatbot. You and the LLM co-evolve this over time as you figure out what works for your domain.

## Operations

**Ingest.** You drop a new source into the raw collection and tell the LLM to process it. An example flow: the LLM reads the source, discusses key takeaways with you, writes a summary page in the wiki, updates the index, updates relevant entity and concept pages across the wiki, and appends an entry to the log. A single source might touch 10-15 wiki pages. Personally I prefer to ingest sources one at a time and stay involved &#8212; I read the summaries, check the updates, and guide the LLM on what to emphasize. But you could also batch-ingest many sources at once with less supervision. It's up to you to develop the workflow that fits your style and document it in the schema for future sessions.

**Query.** You ask questions against the wiki. The LLM searches for relevant pages, reads them, and synthesizes an answer with citations. Answers can take different forms depending on the question &#8212; a markdown page, a comparison table, a slide deck (Marp), a chart (matplotlib), a canvas. The important insight: **good answers can be filed back into the wiki as new pages.** A comparison you asked for, an analysis, a connection you discovered &#8212; these are valuable and shouldn't disappear into chat history. This way your explorations compound in the knowledge base just like ingested sources do.

**Lint.** Periodically, ask the LLM to health-check the wiki. Look for: contradictions between pages, stale claims that newer sources have superseded, orphan pages with no inbound links, important concepts mentioned but lacking their own page, missing cross-references, data gaps that could be filled with a web search. The LLM is good at suggesting new questions to investigate and new sources to look for. This keeps the wiki healthy as it grows.

## Indexing and logging

Two special files help the LLM (and you) navigate the wiki as it grows. They serve different purposes:

**index.md** is content-oriented. It's a catalog of everything in the wiki &#8212; each page listed with a link, a one-line summary, and optionally metadata like date or source count. Organized by category (entities, concepts, sources, etc.). The LLM updates it on every ingest. When answering a query, the LLM reads the index first to find relevant pages, then drills into them. This works surprisingly well at moderate scale (~100 sources, ~hundreds of pages) and avoids the need for embedding-based RAG infrastructure.

**log.md** is chronological. It's an append-only record of what happened and when &#8212; ingests, queries, lint passes. A useful tip: if each entry starts with a consistent prefix (e.g. `## [2026-04-02] ingest | Article Title`), the log becomes parseable with simple unix tools &#8212; `grep "^## \[" log.md | tail -5` gives you the last 5 entries. The log gives you a timeline of the wiki's evolution and helps the LLM understand what's been done recently.

## Optional: CLI tools

At some point you may want to build small tools that help the LLM operate on the wiki more efficiently. A search engine over the wiki pages is the most obvious one &#8212; at small scale the index file is enough, but as the wiki grows you want proper search. [qmd](https://github.com/tobi/qmd) is a good option: it's a local search engine for markdown files with hybrid BM25/vector search and LLM re-ranking, all on-device. It has both a CLI (so the LLM can shell out to it) and an MCP server (so the LLM can use it as a native tool). You could also build something simpler yourself &#8212; the LLM can help you vibe-code a naive search script as the need arises.

## Tips and tricks

- **Obsidian Web Clipper** is a browser extension that converts web articles to markdown. Very useful for quickly getting sources into your raw collection.
- **Download images locally.** In Obsidian Settings &#8594; Files and links, set "Attachment folder path" to a fixed directory (e.g. `raw/assets/`). Then in Settings &#8594; Hotkeys, search for "Download" to find "Download attachments for current file" and bind it to a hotkey (e.g. Ctrl+Shift+D). After clipping an article, hit the hotkey and all images get downloaded to local disk. This is optional but useful &#8212; it lets the LLM view and reference images directly instead of relying on URLs that may break. Note that LLMs can't natively read markdown with inline images in one pass &#8212; the workaround is to have the LLM read the text first, then view some or all of the referenced images separately to gain additional context. It's a bit clunky but works well enough.
- **Obsidian's graph view** is the best way to see the shape of your wiki &#8212; what's connected to what, which pages are hubs, which are orphans.
- **Marp** is a markdown-based slide deck format. Obsidian has a plugin for it. Useful for generating presentations directly from wiki content.
- **Dataview** is an Obsidian plugin that runs queries over page frontmatter. If your LLM adds YAML frontmatter to wiki pages (tags, dates, source counts), Dataview can generate dynamic tables and lists.
- The wiki is just a git repo of markdown files. You get version history, branching, and collaboration for free.

## Why this works

The tedious part of maintaining a knowledge base is not the reading or the thinking &#8212; it's the bookkeeping. Updating cross-references, keeping summaries current, noting when new data contradicts old claims, maintaining consistency across dozens of pages. Humans abandon wikis because the maintenance burden grows faster than the value. LLMs don't get bored, don't forget to update a cross-reference, and can touch 15 files in one pass. The wiki stays maintained because the cost of maintenance is near zero.

The human's job is to curate sources, direct the analysis, ask good questions, and think about what it all means. The LLM's job is everything else.

The idea is related in spirit to Vannevar Bush's Memex (1945) &#8212; a personal, curated knowledge store with associative trails between documents. Bush's vision was closer to this than to what the web became: private, actively curated, with the connections between documents as valuable as the documents themselves. The part he couldn't solve was who does the maintenance. The LLM handles that.


## Note

This document is intentionally abstract. It describes the idea, not a specific implementation. The exact directory structure, the schema conventions, the page formats, the tooling &#8212; all of that will depend on your domain, your preferences, and your LLM of choice. Everything mentioned above is optional and modular &#8212; pick what's useful, ignore what isn't. For example: your sources might be text-only, so you don't need image handling at all. Your wiki might be small enough that the index file is all you need, no search engine required. You might not care about slide decks and just want markdown pages. You might want a completely different set of output formats. The right way to use this is to share it with your LLM agent and work together to instantiate a version that fits your needs. The document's only job is to communicate the pattern. Your LLM can figure out the rest.
</code></code></pre><p>This will create the entire folder structure needed. You can also copy it from the following GitHub <a href="https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f">Gist</a>.</p><h3>Step 3: Ingest your first Knowledge Base</h3><p>Add a new file under your <code>raw/</code> folder and give the following prompt to the LLM:</p><pre><code><code>I have ingested a new file under the raw folder. Ingest it.
</code></code></pre><p>And you will the LLM do the magic. It will go through the file, summarize it, find cross references, link them.</p><h3>Step 4: MindMap created by Obsidian</h3><p>Click on the mindmap button on obsidian to see the entire mind-map created by obsidian. This is how my mindmap looks like:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rIe0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30c3ea4f-9f7d-41f4-a315-7f06d16ee304_2065x1297.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rIe0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30c3ea4f-9f7d-41f4-a315-7f06d16ee304_2065x1297.png 424w, https://substackcdn.com/image/fetch/$s_!rIe0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30c3ea4f-9f7d-41f4-a315-7f06d16ee304_2065x1297.png 848w, https://substackcdn.com/image/fetch/$s_!rIe0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30c3ea4f-9f7d-41f4-a315-7f06d16ee304_2065x1297.png 1272w, https://substackcdn.com/image/fetch/$s_!rIe0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30c3ea4f-9f7d-41f4-a315-7f06d16ee304_2065x1297.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rIe0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30c3ea4f-9f7d-41f4-a315-7f06d16ee304_2065x1297.png" width="1456" height="914" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/30c3ea4f-9f7d-41f4-a315-7f06d16ee304_2065x1297.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:914,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!rIe0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30c3ea4f-9f7d-41f4-a315-7f06d16ee304_2065x1297.png 424w, https://substackcdn.com/image/fetch/$s_!rIe0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30c3ea4f-9f7d-41f4-a315-7f06d16ee304_2065x1297.png 848w, https://substackcdn.com/image/fetch/$s_!rIe0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30c3ea4f-9f7d-41f4-a315-7f06d16ee304_2065x1297.png 1272w, https://substackcdn.com/image/fetch/$s_!rIe0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F30c3ea4f-9f7d-41f4-a315-7f06d16ee304_2065x1297.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h2>Most Useful way to understand LLM Wiki</h2><p><code>LLM Wiki</code> tends to be strongest when:</p><ul><li><p>materials keep accumulating</p></li><li><p>similar questions recur</p></li><li><p>links and context matter</p></li><li><p>human-readable intermediate outputs are valuable</p></li></ul><p>It is not something every team should adopt immediately.<br>If real-time data, high-stakes decisions, or large-scale freshness are the real problem, other retrieval systems may come first.</p><p>Still, the idea matters.<br>At minimum, Karpathy&#8217;s proposal suggests that alongside better models, we may also need better-maintained memory layers.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://adityatrivedi17.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[PageIndex: Vectorless Reasoning-Based RAG Framework]]></title><description><![CDATA[Not all improvements come from adding complexity -- sometimes it&#8217;s about removing it.]]></description><link>https://adityatrivedi17.substack.com/p/pageindex-vectorless-reasoning-based</link><guid isPermaLink="false">https://adityatrivedi17.substack.com/p/pageindex-vectorless-reasoning-based</guid><dc:creator><![CDATA[Aditya Trivedi]]></dc:creator><pubDate>Tue, 02 Jun 2026 16:31:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/800e5e87-30d5-4c60-87e3-23a98eb7387a_2752x1536.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Not all improvements come from adding complexity -- sometimes it&#8217;s about removing it. PageIndex takes a different approach to RAG. Instead of relying on vector databases or artificial chunking, it builds a hierarchical tree structure from documents and uses reasoning-based tree search to locate most relevant sections. This mirrors how humans approach reading:  navigating through sections and context rather than matching embeddings. As a result, the retrieval feels transparent, structured, and explainable. It moves RAG away from approximate semantic vibes and towards explicit reasoning about where information lives.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3aLS!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59bd5f1d-0371-4c04-9489-e14cecabf9c8_4500x1500.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3aLS!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59bd5f1d-0371-4c04-9489-e14cecabf9c8_4500x1500.png 424w, https://substackcdn.com/image/fetch/$s_!3aLS!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59bd5f1d-0371-4c04-9489-e14cecabf9c8_4500x1500.png 848w, https://substackcdn.com/image/fetch/$s_!3aLS!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59bd5f1d-0371-4c04-9489-e14cecabf9c8_4500x1500.png 1272w, https://substackcdn.com/image/fetch/$s_!3aLS!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59bd5f1d-0371-4c04-9489-e14cecabf9c8_4500x1500.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3aLS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59bd5f1d-0371-4c04-9489-e14cecabf9c8_4500x1500.png" width="1456" height="485" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/59bd5f1d-0371-4c04-9489-e14cecabf9c8_4500x1500.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:485,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&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;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!3aLS!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59bd5f1d-0371-4c04-9489-e14cecabf9c8_4500x1500.png 424w, https://substackcdn.com/image/fetch/$s_!3aLS!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59bd5f1d-0371-4c04-9489-e14cecabf9c8_4500x1500.png 848w, https://substackcdn.com/image/fetch/$s_!3aLS!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59bd5f1d-0371-4c04-9489-e14cecabf9c8_4500x1500.png 1272w, https://substackcdn.com/image/fetch/$s_!3aLS!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F59bd5f1d-0371-4c04-9489-e14cecabf9c8_4500x1500.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>LLMs have become very powerful engines for document understanding and question answering. However, they are constrained by a fundamental architectural limit: <strong>context window</strong> which is the maximum number of tokens the model can process at once. This makes it challenging for LLMs to accurately interpret and reason over long, complex, domain-specific documents such as financial reports or legal filings.</p><p>To solve this, developers have heavily relied on <strong>Retrieval-Augmented Generation (RAG)</strong> powered by vector databases. But what if the very foundation of vector RAG is flawed for complex tasks ?<br>Enter <strong>PageIndex</strong>, a paradigm-shifting, &#8220;<strong>vectorless</strong>&#8220; <strong>and reasoning-based RAG framework</strong>. Instead of relying on mathematical embeddings, PageIndex organizes documents into a hierarchical tree and uses the LLM&#8217;s own reasoning to navigate them -- just like a human expert would. Let us deep dive into how it works, why it matters, and how it&#8217;s redifining document retrieval.</p><div><hr></div><h2>The Problem with Traditional Vector RAG</h2><p>In traditional RAG, a document is chopped up into fixed-size &#8220;chunks&#8221; (e.g., 512 tokens), converted into mathematical vectors, and stored in a database. When you ask a question, the system looks for chunks that are <em>semantically similar</em> to your query.</p><p>While this works for simple lookups, it falls apart in complex, domain-specific scenarios (like legal or financial analysis). Here is why:</p><ol><li><p><strong>Similarity &#8800; Relevance:</strong> Vector databases assume that words with similar meanings contain the right answer. But if you ask for &#8220;inconsistencies across documents&#8221; or &#8220;direct quotes from John,&#8221; vector search fails because these concepts do not map well to embeddings.</p></li><li><p><strong>Hard Chunking Destroys Context:</strong> Chopping a document into fixed blocks arbitrarily cuts through sentences and paragraphs, fragmenting the actual meaning of the text.</p></li><li><p><strong>Blind to Cross-References:</strong> If a document says <em>&#8220;see Appendix G,&#8221;</em> a vector database will miss it because the text in Appendix G is not semantically similar to your original question.</p></li><li><p><strong>No Conversational Memory:</strong> Vector searches treat every query in isolation, making it incredibly hard to maintain multi-turn chat contexts (e.g., asking &#8220;What are the assets?&#8221; followed by &#8220;What about the liabilities?&#8221;).</p></li></ol><div><hr></div><h2>What is PageIndex ? The Core Concept</h2><p>PageIndex takes a &#8220;subtraction&#8221; approach to innovation: it completely removes vector databases and chunking from the equation.</p><p>Instead of searching for semantic vibes, PageIndex relies on <strong>reasoning-based retrieval</strong>. In the preprocessing stage, it uses an LLM to read the document and generate a structured, JSON-based <strong>Table of Contents (ToC) tree</strong>.</p><p>This tree organizes the content into logical, natural sections&#8212;like chapters, subheadings, and pages&#8212;complete with node IDs, summaries, and metadata. This ToC is then fed directly into the LLM&#8217;s active context window, acting as an <strong>&#8220;in-context index&#8221;</strong>.</p><div><hr></div><h2>How PageIndex Works: The Human-Like Loop</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WCAM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91766fae-30ed-461d-952a-534849b693e9_2418x1008.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WCAM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91766fae-30ed-461d-952a-534849b693e9_2418x1008.png 424w, https://substackcdn.com/image/fetch/$s_!WCAM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91766fae-30ed-461d-952a-534849b693e9_2418x1008.png 848w, https://substackcdn.com/image/fetch/$s_!WCAM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91766fae-30ed-461d-952a-534849b693e9_2418x1008.png 1272w, https://substackcdn.com/image/fetch/$s_!WCAM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91766fae-30ed-461d-952a-534849b693e9_2418x1008.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WCAM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91766fae-30ed-461d-952a-534849b693e9_2418x1008.png" width="1456" height="607" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/91766fae-30ed-461d-952a-534849b693e9_2418x1008.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:607,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!WCAM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91766fae-30ed-461d-952a-534849b693e9_2418x1008.png 424w, https://substackcdn.com/image/fetch/$s_!WCAM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91766fae-30ed-461d-952a-534849b693e9_2418x1008.png 848w, https://substackcdn.com/image/fetch/$s_!WCAM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91766fae-30ed-461d-952a-534849b693e9_2418x1008.png 1272w, https://substackcdn.com/image/fetch/$s_!WCAM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F91766fae-30ed-461d-952a-534849b693e9_2418x1008.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>When you ask PageIndex a question, it doesn&#8217;t just return a mathematical match. It dynamically &#8220;thinks&#8221; about where the answer might be, following a highly traceable, iterative loop:</p><ol><li><p><strong>Read the ToC:</strong> The AI reviews the document&#8217;s structure to understand the layout.</p></li><li><p><strong>Select a Section:</strong> It infers which section is most relevant (e.g., <em>&#8220;The user asked about deferred assets, let me check the Financial Summary section&#8221;</em> ).</p></li><li><p><strong>Extract Information:</strong> It pulls the raw data from that specific node.</p></li><li><p><strong>Evaluate Sufficiency:</strong> It asks itself: <em>&#8220;Did I find the complete answer?&#8221;</em> If the answer references &#8220;Table 5.3 in Appendix G,&#8221; the AI loops back to the ToC, finds Appendix G, and reads it.</p></li><li><p><strong>Answer the Question:</strong> Once all context is gathered, it delivers a precise, fully-informed response.</p></li></ol><div><hr></div><h2>Trade-Offs: Accuracy vs Speed</h2><p>No system is perfect, and the developer community has rightly pointed out the trade-offs of vectorless retrieval.</p><ul><li><p><strong>The Pros:</strong> It is incredibly accurate. On the FinanceBench benchmark, PageIndex achieved a <strong>state-of-the-art 98.7% accuracy</strong>, significantly outperforming traditional vector systems. Furthermore, retrieval is completely transparent; the system leaves a trail of exactly which pages and sections it reasoned through.</p></li><li><p><strong>The Cons:</strong> It is computationally heavier and slower. Having an LLM iteratively read summaries and traverse a tree costs more time and money per query than a simple mathematical vector comparison.</p></li></ul><p>Ultimately, PageIndex is built for <strong>quality maximalists</strong>. If you are building a quick chat app over a product catalog, use a vector database. If you are building an AI analyst to parse 200-page earnings reports where a hallucination could cost millions, PageIndex is the superior choice.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!40vM!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F961241b4-a1d2-4bee-9c19-0907749a828e_3290x4937.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!40vM!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F961241b4-a1d2-4bee-9c19-0907749a828e_3290x4937.png 424w, https://substackcdn.com/image/fetch/$s_!40vM!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F961241b4-a1d2-4bee-9c19-0907749a828e_3290x4937.png 848w, https://substackcdn.com/image/fetch/$s_!40vM!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F961241b4-a1d2-4bee-9c19-0907749a828e_3290x4937.png 1272w, https://substackcdn.com/image/fetch/$s_!40vM!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F961241b4-a1d2-4bee-9c19-0907749a828e_3290x4937.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!40vM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F961241b4-a1d2-4bee-9c19-0907749a828e_3290x4937.png" width="1456" height="2185" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/961241b4-a1d2-4bee-9c19-0907749a828e_3290x4937.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2185,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!40vM!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F961241b4-a1d2-4bee-9c19-0907749a828e_3290x4937.png 424w, https://substackcdn.com/image/fetch/$s_!40vM!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F961241b4-a1d2-4bee-9c19-0907749a828e_3290x4937.png 848w, https://substackcdn.com/image/fetch/$s_!40vM!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F961241b4-a1d2-4bee-9c19-0907749a828e_3290x4937.png 1272w, https://substackcdn.com/image/fetch/$s_!40vM!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F961241b4-a1d2-4bee-9c19-0907749a828e_3290x4937.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://adityatrivedi17.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Deep Dive into Vector Databases and Indexing]]></title><description><![CDATA[In the middle of AI Revolution, it is for sure that any industry it touches, it promises great innovations but also introduces new challenges.]]></description><link>https://adityatrivedi17.substack.com/p/deep-dive-into-vector-databases-and</link><guid isPermaLink="false">https://adityatrivedi17.substack.com/p/deep-dive-into-vector-databases-and</guid><dc:creator><![CDATA[Aditya Trivedi]]></dc:creator><pubDate>Tue, 02 Jun 2026 15:46:08 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/51e9f206-b32f-4a58-9431-a2625d2c0318_2752x1536.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In the middle of AI Revolution, it is for sure that any industry it touches, it promises great innovations but also introduces new challenges. It is very important to have efficient data processing for all applications which involves <strong>Large Language Models</strong>, <strong>Generative AI</strong> &amp; <strong>Semantic Search.</strong></p><div><hr></div><p>All of the applications rely on <strong>vector embeddings</strong>, which are a type of vector data representation that carries semantic information that is critical for AI to gain understanding and maintain a long-term memory they can draw upon executing complex tasks. <strong>Embeddings</strong> are generated by the LLMs and have many features, making their representation challenging to manage. These features represent different dimensions of data that are essential for understanding patterns, relationships and underlying structures.</p><p>This requires specialized database designed specifically for handling this data type. Vector Databases have the capabilities of traditional database that are absent in standalone vector indexes and the specialization of dealing with vector embeddings, which the traditional databases lack. These vector databases are intentionally designed to handle complex data and offer performance, scalability and flexibility you need to make the most out of your data. With a vector database, we as a developer can add our knowledge to our AIs, like <strong>semantic information retrieval</strong>, <strong>long-term memory</strong> and more**.**</p><div><hr></div><h2>How does a Vector Database Work ?</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ru4u!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5247808-3aae-4628-a82c-2f9f3f84a6c9_1399x537.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ru4u!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5247808-3aae-4628-a82c-2f9f3f84a6c9_1399x537.png 424w, https://substackcdn.com/image/fetch/$s_!ru4u!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5247808-3aae-4628-a82c-2f9f3f84a6c9_1399x537.png 848w, https://substackcdn.com/image/fetch/$s_!ru4u!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5247808-3aae-4628-a82c-2f9f3f84a6c9_1399x537.png 1272w, https://substackcdn.com/image/fetch/$s_!ru4u!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5247808-3aae-4628-a82c-2f9f3f84a6c9_1399x537.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ru4u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5247808-3aae-4628-a82c-2f9f3f84a6c9_1399x537.png" width="728" height="279.4395997140815" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d5247808-3aae-4628-a82c-2f9f3f84a6c9_1399x537.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:537,&quot;width&quot;:1399,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!ru4u!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5247808-3aae-4628-a82c-2f9f3f84a6c9_1399x537.png 424w, https://substackcdn.com/image/fetch/$s_!ru4u!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5247808-3aae-4628-a82c-2f9f3f84a6c9_1399x537.png 848w, https://substackcdn.com/image/fetch/$s_!ru4u!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5247808-3aae-4628-a82c-2f9f3f84a6c9_1399x537.png 1272w, https://substackcdn.com/image/fetch/$s_!ru4u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd5247808-3aae-4628-a82c-2f9f3f84a6c9_1399x537.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The traditional approach for database is that they store strings, numbers and other types of scaler data in rows and columns. Vector databases on the other hand operates on Vectors, so the way it is optimised and queried is quite different. In our traditional databases, we usually query for rows in the database where the value exactly matches our query, whereas in vector databases, we apply a similarity metric to find out a vector that is the most similar to our query.</p><p>In a vector database, there are combinations of different algorithms that participate in <strong>ANN Search Algorithm</strong> which is basically a technique to quickly find data points in large, high-dimensional datasets that are similar to a given query point, prioritizing speed and scalability over find single absolute closest match.</p><p>These algorithms are assembled into a pipeline that provides fast and accurate retrieval of neighbours of a queried vector. Below is a common pipeline:</p><div class="captioned-image-container"><figure><a class="image-link image2 image2-align-left" target="_blank" href="https://substackcdn.com/image/fetch/$s_!eTfb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70319893-9737-457b-8a81-ff77edbb574d_1307x233.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eTfb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70319893-9737-457b-8a81-ff77edbb574d_1307x233.png 424w, https://substackcdn.com/image/fetch/$s_!eTfb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70319893-9737-457b-8a81-ff77edbb574d_1307x233.png 848w, https://substackcdn.com/image/fetch/$s_!eTfb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70319893-9737-457b-8a81-ff77edbb574d_1307x233.png 1272w, https://substackcdn.com/image/fetch/$s_!eTfb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70319893-9737-457b-8a81-ff77edbb574d_1307x233.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!eTfb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70319893-9737-457b-8a81-ff77edbb574d_1307x233.png" width="1307" height="233" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/70319893-9737-457b-8a81-ff77edbb574d_1307x233.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:233,&quot;width&quot;:1307,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Vector Database pipeline&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;left&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="Vector Database pipeline" title="Vector Database pipeline" srcset="https://substackcdn.com/image/fetch/$s_!eTfb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70319893-9737-457b-8a81-ff77edbb574d_1307x233.png 424w, https://substackcdn.com/image/fetch/$s_!eTfb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70319893-9737-457b-8a81-ff77edbb574d_1307x233.png 848w, https://substackcdn.com/image/fetch/$s_!eTfb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70319893-9737-457b-8a81-ff77edbb574d_1307x233.png 1272w, https://substackcdn.com/image/fetch/$s_!eTfb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F70319893-9737-457b-8a81-ff77edbb574d_1307x233.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><ol><li><p><strong>Indexing:</strong> Indexing is about intelligently organising vector embeddings to optimise the retrieval process. It involves advanced algorithms to nearly arrange the high dimensional vectors in searchable and efficient manner. Some of the common techniques are <strong>Inverted File (IVF)</strong>, <strong>Hierarchical Navigable Small World Algorithms (HNSW)</strong>, <strong>Multi-Scale Tree Graph Algorithm (MSTG).</strong></p></li><li><p><strong>Querying:</strong> The vector database now compares the indexed query vector to indexed vectors in dataset to find the nearest neighbours.</p></li><li><p><strong>Post Processing:</strong> Some cases where the vector database retrieves the final nearest neighbours from dataset, it then post-processes them to return the final results. This step can include reranking the nearest neighbours using a different similarity measure.</p></li></ol><div><hr></div><h2>What are Vectors ?</h2><p>Before moving forward, let us first get into the fundamentals first. Let us first understand what are <strong>Vectors.</strong> A <strong>vector</strong> is essentially a list (or array) of numbers that represents data. Think of a vector as a coordinate system for meaning.</p><p><strong>Scalar vs. Vector:</strong> A &#8220;scalar&#8221; is a single number (e.g., today&#8217;s temperature is 85&#176;F). A &#8220;vector&#8221; is a collection of numbers describing a complex object (e.g., today&#8217;s weather is representing the low, mean, and high temperatures)</p><p>Vector numbers can represent complex objects such as words, images, videos and audio generated by an ML model. This high-dimensional <strong>vector data</strong>, containing multiple features, is essential to <strong>machine learning, natural language processing (NLP)</strong> and other AI tasks.</p><div><hr></div><h2>What are Vector Embeddings ?</h2><p>Now that we know what are vectors, let us now understand what are vector embeddings. <strong>Vector Embeddings</strong> are numerical representations of data points that converts various types of data including non-mathematical data such as words, audio or images - into array of numbers that ML models can process. Vector embedding is a way to convert an unstructured data point into an array of numbers that expresses that data&#8217;s original meaning.</p><p>Consider the example:</p><blockquote><p>cat = [ 0.5, -0.7, 0.9]</p><p>dog = [0.9, 0.2, 0.9]</p></blockquote><p>Here, each word is associated with a unique vector. The values in the vector represent the word&#8217;s position in a continuous 3-dimensional vector space. Embedding models are trained to convert data points into vectors. Vector databases store and index the outputs of these embedding models.</p><p>Summing up, this is how the vectors are displayed on a x-y-z scale:<br></p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3Mno!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf98b500-d1ce-4634-a3ae-618a1c22db97_735x751.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3Mno!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf98b500-d1ce-4634-a3ae-618a1c22db97_735x751.jpeg 424w, https://substackcdn.com/image/fetch/$s_!3Mno!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf98b500-d1ce-4634-a3ae-618a1c22db97_735x751.jpeg 848w, https://substackcdn.com/image/fetch/$s_!3Mno!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf98b500-d1ce-4634-a3ae-618a1c22db97_735x751.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!3Mno!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf98b500-d1ce-4634-a3ae-618a1c22db97_735x751.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3Mno!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf98b500-d1ce-4634-a3ae-618a1c22db97_735x751.jpeg" width="728" height="743.847619047619" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/bf98b500-d1ce-4634-a3ae-618a1c22db97_735x751.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:751,&quot;width&quot;:735,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Vector Embeddings Explained | Weaviate&quot;,&quot;title&quot;:&quot;Vector Embeddings Explained | Weaviate&quot;,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="Vector Embeddings Explained | Weaviate" title="Vector Embeddings Explained | Weaviate" srcset="https://substackcdn.com/image/fetch/$s_!3Mno!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf98b500-d1ce-4634-a3ae-618a1c22db97_735x751.jpeg 424w, https://substackcdn.com/image/fetch/$s_!3Mno!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf98b500-d1ce-4634-a3ae-618a1c22db97_735x751.jpeg 848w, https://substackcdn.com/image/fetch/$s_!3Mno!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf98b500-d1ce-4634-a3ae-618a1c22db97_735x751.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!3Mno!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fbf98b500-d1ce-4634-a3ae-618a1c22db97_735x751.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h2>Vector Indexing</h2><p>Vectors created need to be indexed to accelerate searches within high-dimensional data spaces. Vector databases create indexes on vector embeddings for search functions. Indexing maps the vectors to new data structures that enables faster similarity such as nearest neighbor searches, between vectors. Vector can be indexed by using algorithms such as <strong>Hierarchical Navigable Small World (HNSW), Locality-Sensitive Hashing (LSH) or Product Quantization (PQ)</strong></p><div><hr></div><h2>Semantic Search</h2><p>Traditional search engines typically focus on matching keywords within a search query to corresponding keywords in indexed web pages. <strong>Semantic search</strong> is a data searching technique that focuses on understanding the contextual meaning and intent behind a user&#8217;s search query, rather than only matching keywords. Imagine searching for &#8220;best laptops for graphic design students.&#8221; A traditional search engine might focus solely on matching those keywords to web pages. Whereas, a semantic search engine would try to understand that you are looking for laptops with specific features like powerful graphics cards, ample RAM, and color-accurate displays. Then it would return the results that would recommend laptops for graphic design related tasks.</p><p>Here&#8217;s how it works:</p><p>Semantic search engines employ various techniques from <a href="https://cloud.google.com/learn/what-is-natural-language-processing">natural language processing (NLP)</a>, knowledge representation, and machine learning to understand the semantics of search queries and web content. Here&#8217;s a breakdown of the process:</p><ul><li><p><strong>Query analysis</strong>: The search engine analyzes the user&#8217;s query to identify keywords, phrases, and entities. It also attempts to interpret the user&#8217;s search intent by analyzing the relationships between these elements.</p></li><li><p><strong>Knowledge graph integration</strong>: Semantic search engines often leverage knowledge graphs, vast databases containing information about entities and their relationships. This information helps the engine understand the context of the search query.</p></li><li><p><strong>Content analysis</strong>: Similar to how a search engine analyzes queries, it also examines the content of web pages to determine their relevance to a particular search. This analysis goes beyond keyword matching and considers factors such as the overall topic, sentiment, and entities mentioned within the content.</p></li><li><p><strong>Result return and retrieval</strong>: Based on the analysis of the query and the content, the search engine could return  web pages according to their relevance and semantic similarity to the search query. It then retrieves and displays the most relevant results to the user.</p></li></ul><div><hr></div><p>Use the links given below to understand more about vector databases:</p><ul><li><p><a href="https://www.ibm.com/think/topics/vector-database">https://www.ibm.com/think/topics/vector-database</a></p></li><li><p><a href="https://thedataquarry.com/blog/vector-db-2/">https://thedataquarry.com/blog/vector-db-2/</a></p></li><li><p><a href="https://www.pinecone.io/learn/vector-database/?_sm_vck=MqVLq7tq4TJQHJg5gZqjMVZV0rNTTqHHvLHsNWnn00fq7tHvvrvn">https://www.pinecone.io/learn/vector-database/?_sm_vck=MqVLq7tq4TJQHJg5gZqjMVZV0rNTTqHHvLHsNWnn00fq7tHvvrvn</a></p></li><li><p><a href="https://www.computer.org/publications/tech-news/trends/vector-database-deep-dive">https://www.computer.org/publications/tech-news/trends/vector-database-deep-dive</a></p></li></ul><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://adityatrivedi17.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Memory in AI Agents]]></title><description><![CDATA[Imagine talking to a friend who forgets everything you&#8217;ve ever said.]]></description><link>https://adityatrivedi17.substack.com/p/memory-in-ai-agents</link><guid isPermaLink="false">https://adityatrivedi17.substack.com/p/memory-in-ai-agents</guid><dc:creator><![CDATA[Aditya Trivedi]]></dc:creator><pubDate>Tue, 02 Jun 2026 15:32:19 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/aad56c49-83fe-4a9c-8896-54dcdb6eb3d9_1600x840.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Imagine talking to a friend who forgets everything you&#8217;ve ever said. Every conversation starts from zero. No memory, no progress, no context. It would feel awkward, exhausting and impersonal right ? Unfortunately, that is exactly how most AI systems behave today. They&#8217;re smart, but they lack something very crucial: <strong>memory.</strong></p><div><hr></div><h1>Introduction: <strong>Why is AI Naturally &#8220;Forgetful&#8221; ?</strong></h1><p>Consider this very use case:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5iSV!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc548be1f-6993-4e0d-ab76-c77aeffbe41f_2592x848.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5iSV!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc548be1f-6993-4e0d-ab76-c77aeffbe41f_2592x848.png 424w, https://substackcdn.com/image/fetch/$s_!5iSV!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc548be1f-6993-4e0d-ab76-c77aeffbe41f_2592x848.png 848w, https://substackcdn.com/image/fetch/$s_!5iSV!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc548be1f-6993-4e0d-ab76-c77aeffbe41f_2592x848.png 1272w, https://substackcdn.com/image/fetch/$s_!5iSV!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc548be1f-6993-4e0d-ab76-c77aeffbe41f_2592x848.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5iSV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc548be1f-6993-4e0d-ab76-c77aeffbe41f_2592x848.png" width="1456" height="476" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c548be1f-6993-4e0d-ab76-c77aeffbe41f_2592x848.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:476,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!5iSV!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc548be1f-6993-4e0d-ab76-c77aeffbe41f_2592x848.png 424w, https://substackcdn.com/image/fetch/$s_!5iSV!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc548be1f-6993-4e0d-ab76-c77aeffbe41f_2592x848.png 848w, https://substackcdn.com/image/fetch/$s_!5iSV!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc548be1f-6993-4e0d-ab76-c77aeffbe41f_2592x848.png 1272w, https://substackcdn.com/image/fetch/$s_!5iSV!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc548be1f-6993-4e0d-ab76-c77aeffbe41f_2592x848.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>I created a fresh new account on ChatGPT and asked it Who am I ? The answer that I got is &#8216;I&#8217;m not sure yet - you tell me!&#8216;. This means that it does not have any context or memory initially of who I am . Now, the next thing I tell it is to remember that &#8216;My name is Aditya Trivedi and I am from Mumbai&#8217;.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!sYvQ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd345561d-91bc-474d-8aa8-f0693ccfb656_2788x848.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!sYvQ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd345561d-91bc-474d-8aa8-f0693ccfb656_2788x848.png 424w, https://substackcdn.com/image/fetch/$s_!sYvQ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd345561d-91bc-474d-8aa8-f0693ccfb656_2788x848.png 848w, https://substackcdn.com/image/fetch/$s_!sYvQ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd345561d-91bc-474d-8aa8-f0693ccfb656_2788x848.png 1272w, https://substackcdn.com/image/fetch/$s_!sYvQ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd345561d-91bc-474d-8aa8-f0693ccfb656_2788x848.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!sYvQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd345561d-91bc-474d-8aa8-f0693ccfb656_2788x848.png" width="1456" height="443" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d345561d-91bc-474d-8aa8-f0693ccfb656_2788x848.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:443,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!sYvQ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd345561d-91bc-474d-8aa8-f0693ccfb656_2788x848.png 424w, https://substackcdn.com/image/fetch/$s_!sYvQ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd345561d-91bc-474d-8aa8-f0693ccfb656_2788x848.png 848w, https://substackcdn.com/image/fetch/$s_!sYvQ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd345561d-91bc-474d-8aa8-f0693ccfb656_2788x848.png 1272w, https://substackcdn.com/image/fetch/$s_!sYvQ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd345561d-91bc-474d-8aa8-f0693ccfb656_2788x848.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>What do we see from the image above ? We get that Memory in ChatGPT has changed meaning now the AI has a memory of who I am and where do I live. It also tries to remember your recent chats but may forget over time.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2ReL!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77aae4ac-a560-471d-a4ee-8cb846a911b1_1504x1558.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2ReL!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77aae4ac-a560-471d-a4ee-8cb846a911b1_1504x1558.png 424w, https://substackcdn.com/image/fetch/$s_!2ReL!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77aae4ac-a560-471d-a4ee-8cb846a911b1_1504x1558.png 848w, https://substackcdn.com/image/fetch/$s_!2ReL!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77aae4ac-a560-471d-a4ee-8cb846a911b1_1504x1558.png 1272w, https://substackcdn.com/image/fetch/$s_!2ReL!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77aae4ac-a560-471d-a4ee-8cb846a911b1_1504x1558.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2ReL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77aae4ac-a560-471d-a4ee-8cb846a911b1_1504x1558.png" width="1456" height="1508" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/77aae4ac-a560-471d-a4ee-8cb846a911b1_1504x1558.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1508,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!2ReL!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77aae4ac-a560-471d-a4ee-8cb846a911b1_1504x1558.png 424w, https://substackcdn.com/image/fetch/$s_!2ReL!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77aae4ac-a560-471d-a4ee-8cb846a911b1_1504x1558.png 848w, https://substackcdn.com/image/fetch/$s_!2ReL!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77aae4ac-a560-471d-a4ee-8cb846a911b1_1504x1558.png 1272w, https://substackcdn.com/image/fetch/$s_!2ReL!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F77aae4ac-a560-471d-a4ee-8cb846a911b1_1504x1558.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Now when I ask the same question, ChatGPT will now be able to answer the question, why ? Because now it has the memory of my name and where do I live.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VIPj!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73a4378a-10a9-42ba-9e6c-977f7a39e4ce_1604x370.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VIPj!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73a4378a-10a9-42ba-9e6c-977f7a39e4ce_1604x370.png 424w, https://substackcdn.com/image/fetch/$s_!VIPj!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73a4378a-10a9-42ba-9e6c-977f7a39e4ce_1604x370.png 848w, https://substackcdn.com/image/fetch/$s_!VIPj!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73a4378a-10a9-42ba-9e6c-977f7a39e4ce_1604x370.png 1272w, https://substackcdn.com/image/fetch/$s_!VIPj!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73a4378a-10a9-42ba-9e6c-977f7a39e4ce_1604x370.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VIPj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73a4378a-10a9-42ba-9e6c-977f7a39e4ce_1604x370.png" width="1456" height="336" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/73a4378a-10a9-42ba-9e6c-977f7a39e4ce_1604x370.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:336,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!VIPj!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73a4378a-10a9-42ba-9e6c-977f7a39e4ce_1604x370.png 424w, https://substackcdn.com/image/fetch/$s_!VIPj!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73a4378a-10a9-42ba-9e6c-977f7a39e4ce_1604x370.png 848w, https://substackcdn.com/image/fetch/$s_!VIPj!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73a4378a-10a9-42ba-9e6c-977f7a39e4ce_1604x370.png 1272w, https://substackcdn.com/image/fetch/$s_!VIPj!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F73a4378a-10a9-42ba-9e6c-977f7a39e4ce_1604x370.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Tools like ChatGPT feel helpful until you find yourself repeating instructions or preferences, again and again. To build agents that can learn, evolve and collaborate, real memory isn&#8217;t just beneficial - it&#8217;s <strong>essential.</strong></p><p>To understand memory, we first need to understand how tools like ChatGPT work under the hood.</p><ol><li><p>The <strong>Stateless</strong> Problem:</p><p>By default, AI models are stateless. This means that they do not have built-in memory of past requests. If you say &#8220;Hello&#8221; and AI replies, and then when you say &#8220;My name is Aditya&#8221;, the AI will process that specific message. The catch here is that if you send a new message without the previous context, the AI will treat it as a brand-new conversation. One way to keep the chat going could be that the developer actually has to send entire <strong>conversation history</strong> back to AI with every single message you type.</p></li><li><p><strong>Context Window</strong> Limit:</p><p>Considering the above solution , you may ask &#8220;Why now send the entire history forever ?&#8221;. Hehe, that&#8217;s not possible. AI models have a limit called the <strong>Context Window.</strong> In simple words you can think of it as AI&#8217;s short term-attention span.</p></li></ol><div><hr></div><h1>What do we mean by Memory in AI Agents ?</h1><p>Memory is the ability to retain and remember/recall relevant information from the context of the user&#8217;s input across time, tasks and multiple user interactions. It allows agents to remember what happened in the past and use the relevant information to improve behaviour in the future.<br>It is not about storing the chat history, it is about giving more and more context to the LLMs and building a persistent state which evolves.</p><p>Think of it like a human memory. If you meet a friend after say 15 years, it is obvious that you would not remember everything. You remember the important stuff like their name, where they live, what are their likings in food, etc. This is the exact same thing the <strong>Memory Layer</strong> does for AI.</p><div><hr></div><h1>The 4 Types of AI Memory:</h1><h3>Short Term Memory:</h3><p>This is like a temporary memory. It will exist only for the current conversation or task and will be deleted once the task is finished. For eg, you are going to a restaurant and you order a coffee and a burger and you get the order number <strong>132</strong>. After 10 minutes, the waiter calls for order number <strong>132.</strong> Since you have memorized the number as your order number, you get the food. Once you complete eating, you leave, you forget the number. You don&#8217;t remember the order number for the rest of your life.</p><div class="captioned-image-container"><figure><a class="image-link image2 image2-align-left is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Rqzi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e66db6d-1176-4a38-85ca-4dd2b61d34b2_1024x1024.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Rqzi!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e66db6d-1176-4a38-85ca-4dd2b61d34b2_1024x1024.png 424w, https://substackcdn.com/image/fetch/$s_!Rqzi!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e66db6d-1176-4a38-85ca-4dd2b61d34b2_1024x1024.png 848w, https://substackcdn.com/image/fetch/$s_!Rqzi!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e66db6d-1176-4a38-85ca-4dd2b61d34b2_1024x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!Rqzi!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e66db6d-1176-4a38-85ca-4dd2b61d34b2_1024x1024.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Rqzi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e66db6d-1176-4a38-85ca-4dd2b61d34b2_1024x1024.png" width="1024" height="1024" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/6e66db6d-1176-4a38-85ca-4dd2b61d34b2_1024x1024.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1024,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;left&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!Rqzi!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e66db6d-1176-4a38-85ca-4dd2b61d34b2_1024x1024.png 424w, https://substackcdn.com/image/fetch/$s_!Rqzi!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e66db6d-1176-4a38-85ca-4dd2b61d34b2_1024x1024.png 848w, https://substackcdn.com/image/fetch/$s_!Rqzi!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e66db6d-1176-4a38-85ca-4dd2b61d34b2_1024x1024.png 1272w, https://substackcdn.com/image/fetch/$s_!Rqzi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F6e66db6d-1176-4a38-85ca-4dd2b61d34b2_1024x1024.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Long-Term Memory:</h3><p>This memory lasts forever. It will stay across different chats, days months or even if you refresh your browser &#128517;. It is now divider into 3 subtypes:</p><ol><li><p><strong>Factual Memory</strong>: Retains user preferences, communication style, domain context etc. For eg &#8220;You prefer TypeScript output and detailed answers&#8221;.</p></li><li><p><strong>Episodic Memory</strong>: Remembers specific past interactions or outcomes. For eg &#8220;Last time when i used this script, it destroyed my performance&#8221;.</p></li><li><p><strong>Semantic Memory</strong>: Stores generalized, abstract knowledge acquired over time. For eg &#8220;Tasks involving JSON parsing usually stress you out, want a quick template?&#8221;</p></li></ol><div><hr></div><h1>RAG &#8800; Memory</h1><p>While both <strong>RAG (Retrieval-Augmented-Generation)</strong> and <strong>memory systems</strong> retrieve information to support LLMs, they both solve very different problems.</p><p>RAG brings external knowledge into the prompt at inteference time. It is fundamentally <strong>stateless</strong> meaning it has no awareness of previous interactions, user identity, or how the current query relates to past conversations whereas</p><p><strong>Memory</strong>, brings continuation. It will capture user preferences, past queries, decisions and failures and make them available in future interactions.</p><div><hr></div><p>In a world where every agent has access to the same models and tools, memory will be the differentiator. Not just the agent that responds &#8212; the one that <strong>remembers</strong>, <strong>learns</strong>, and <strong>grows with you</strong> will win.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://adityatrivedi17.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[Agent to Agent Protocol (A2A) By Google]]></title><description><![CDATA[With the introduction of MCP Servers, it has changed the entire game of LLMs from just being able to give the response now to able to execute them with the help of tools.]]></description><link>https://adityatrivedi17.substack.com/p/agent-to-agent-protocol-a2a-by-google</link><guid isPermaLink="false">https://adityatrivedi17.substack.com/p/agent-to-agent-protocol-a2a-by-google</guid><dc:creator><![CDATA[Aditya Trivedi]]></dc:creator><pubDate>Tue, 02 Jun 2026 14:32:07 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/fd9a9612-9c23-4e52-bab1-26d41facabbd_1600x840.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>With the introduction of MCP Servers, it has changed the entire game of LLMs from just being able to give the response now to able to execute them with the help of tools. It may be:</p><ul><li><p>Querying data to get the data from database</p></li><li><p>Executing an API call to make a POST request over a server</p></li><li><p>Having AI do the stuff for you</p></li></ul><div><hr></div><h2>What is the Agent to Agent Protocol ?</h2><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nnoO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f7da9f6-d5f7-40d3-a8d0-7938cecafa43_1600x476.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nnoO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f7da9f6-d5f7-40d3-a8d0-7938cecafa43_1600x476.jpeg 424w, https://substackcdn.com/image/fetch/$s_!nnoO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f7da9f6-d5f7-40d3-a8d0-7938cecafa43_1600x476.jpeg 848w, https://substackcdn.com/image/fetch/$s_!nnoO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f7da9f6-d5f7-40d3-a8d0-7938cecafa43_1600x476.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!nnoO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f7da9f6-d5f7-40d3-a8d0-7938cecafa43_1600x476.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nnoO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f7da9f6-d5f7-40d3-a8d0-7938cecafa43_1600x476.jpeg" width="728" height="216.5" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4f7da9f6-d5f7-40d3-a8d0-7938cecafa43_1600x476.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:false,&quot;imageSize&quot;:&quot;normal&quot;,&quot;height&quot;:433,&quot;width&quot;:1456,&quot;resizeWidth&quot;:728,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;A2A protocol&quot;,&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;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="A2A protocol" title="A2A protocol" srcset="https://substackcdn.com/image/fetch/$s_!nnoO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f7da9f6-d5f7-40d3-a8d0-7938cecafa43_1600x476.jpeg 424w, https://substackcdn.com/image/fetch/$s_!nnoO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f7da9f6-d5f7-40d3-a8d0-7938cecafa43_1600x476.jpeg 848w, https://substackcdn.com/image/fetch/$s_!nnoO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f7da9f6-d5f7-40d3-a8d0-7938cecafa43_1600x476.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!nnoO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4f7da9f6-d5f7-40d3-a8d0-7938cecafa43_1600x476.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p><strong>A2A Protocol</strong> is a protocol launched by <strong>Google</strong> to maximise the benefits that we can get from Agentic AI. This is to make the agents be able to collaborate in a dynamic, multi-agent ecosystem across data systems and applications.</p><p>Here they have collaborated with more than <strong>50 technology partners</strong> like <strong>Atlassian, Langchain, MongoDB, PayPal, CapGemini, KPMG, PwC, TCS,</strong> etc**.** This will now allow AI agents to communicate with each other, securely exchange information, coordinate actions on top of various enterprise platforms or applications. It is an open protocol that complements <strong>Anthropic&#8217;s Model Context Protocol (MCP)</strong>, which provides helpful tools, and context to agents.</p><div><hr></div><h2><strong>How Does it Work ?</strong></h2><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!gmLO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae1f9a2a-470c-41e1-ae7b-81e60f72aefa_557x227.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!gmLO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae1f9a2a-470c-41e1-ae7b-81e60f72aefa_557x227.png 424w, https://substackcdn.com/image/fetch/$s_!gmLO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae1f9a2a-470c-41e1-ae7b-81e60f72aefa_557x227.png 848w, https://substackcdn.com/image/fetch/$s_!gmLO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae1f9a2a-470c-41e1-ae7b-81e60f72aefa_557x227.png 1272w, https://substackcdn.com/image/fetch/$s_!gmLO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae1f9a2a-470c-41e1-ae7b-81e60f72aefa_557x227.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!gmLO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae1f9a2a-470c-41e1-ae7b-81e60f72aefa_557x227.png" width="557" height="227" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ae1f9a2a-470c-41e1-ae7b-81e60f72aefa_557x227.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:227,&quot;width&quot;:557,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!gmLO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae1f9a2a-470c-41e1-ae7b-81e60f72aefa_557x227.png 424w, https://substackcdn.com/image/fetch/$s_!gmLO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae1f9a2a-470c-41e1-ae7b-81e60f72aefa_557x227.png 848w, https://substackcdn.com/image/fetch/$s_!gmLO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae1f9a2a-470c-41e1-ae7b-81e60f72aefa_557x227.png 1272w, https://substackcdn.com/image/fetch/$s_!gmLO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae1f9a2a-470c-41e1-ae7b-81e60f72aefa_557x227.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>Consider an example where there is an agent made by me. My agent has the task to get the resume, analyse it , and return the best fit candidate for based on the Job Description and Job Profile. Now consider <strong>Apple</strong> is the recruiting partner, and they have created their own agent to get the work done for them and get the best candidate for them. This would be the flow now:</p><ul><li><p>Agent 1 finds the relevant job role, description and sends it to Agent 2.</p></li><li><p>Agent 2 now checks all the resumes which match the job role and description given by Agent 1.</p></li><li><p>After analysing and finding out the best candidate, it sends it to Agent 1.</p></li><li><p>Agent 1 now sends handles the next step.</p></li></ul><p>With this both the agents will be able to talk internally within themselves.</p><div><hr></div><h2>Consider a real life example:</h2><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!rgoR!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb943f5c6-979b-4132-b94f-23b44487a32b_3880x1649.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!rgoR!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb943f5c6-979b-4132-b94f-23b44487a32b_3880x1649.png 424w, https://substackcdn.com/image/fetch/$s_!rgoR!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb943f5c6-979b-4132-b94f-23b44487a32b_3880x1649.png 848w, https://substackcdn.com/image/fetch/$s_!rgoR!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb943f5c6-979b-4132-b94f-23b44487a32b_3880x1649.png 1272w, https://substackcdn.com/image/fetch/$s_!rgoR!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb943f5c6-979b-4132-b94f-23b44487a32b_3880x1649.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!rgoR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb943f5c6-979b-4132-b94f-23b44487a32b_3880x1649.png" width="1456" height="619" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/b943f5c6-979b-4132-b94f-23b44487a32b_3880x1649.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:619,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!rgoR!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb943f5c6-979b-4132-b94f-23b44487a32b_3880x1649.png 424w, https://substackcdn.com/image/fetch/$s_!rgoR!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb943f5c6-979b-4132-b94f-23b44487a32b_3880x1649.png 848w, https://substackcdn.com/image/fetch/$s_!rgoR!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb943f5c6-979b-4132-b94f-23b44487a32b_3880x1649.png 1272w, https://substackcdn.com/image/fetch/$s_!rgoR!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fb943f5c6-979b-4132-b94f-23b44487a32b_3880x1649.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p><strong>Dominos &amp; Burger King</strong> have also started to create their own agent to make their work life easier for them. Zomato now as a platform which has both Dominos and Burger King will have their own agent which will take care for the work for them.</p><p>Consider a situation where the user says, &#8216;I want to eat a Pizza&#8217;, what will Zomato&#8217;s agent do ?. It needs to get the access to Domios&#8217;s Database to get the orders, but how will it get ? This will be done via the <strong>A2A Protocol</strong>. Same with the case when the user says, &#8216; I want to eat a Whooper Burger Also&#8217;.</p><div><hr></div><h2>How Do These Agents Discover Each Other ?</h2><p>Making it more simple, How does Zomato&#8217;s agent discover that Dominos Agent has the following capabilities ?</p><p>They connect via <strong>OpenID Connect.</strong></p><div><hr></div><h2>What is OpenID Connect ?</h2><p>Imagine you&#8217;re logging into a website, and instead of creating an account, you see a &#8220;<strong>Login with Google&#8221;</strong> button. You click it, and boom &#8212; you&#8217;re in. That is powered by <strong>OpenID Connect (OIDC).</strong></p><h3>&#128204; In Simple Terms:</h3><p>OpenID Connect is a layer built on top of <strong>OAuth 2.0</strong> that lets you log into apps using your existing account from providers like Google, Microsoft, Facebook,etc. It handles:</p><ul><li><p>&#9989; Authentication (Who are you?)</p></li><li><p>&#128272; Secure login without passwords</p></li><li><p>&#128257; Passing user info between services</p></li></ul><h3>&#128260; <code>`/.well-known`</code> in OIDC:</h3><p><code>/.well-known</code> is a standard path used by OIDC to automatically discover <strong>important configuration information</strong> about the identity provider like Google, AuthO, Okta,etc. In other terms, it&#8217;s where the <strong>identity provider publishes its OIDC configuration</strong> so that client apps know <strong>where to authenticate, get tokens, and fetch user info</strong>. Let&#8217;s take an example:</p><p>When an app wants to use Google as an identity provider, it goes to:</p><pre><code><code>https://accounts.google.com/.well-known/openid-configuration
</code></code></pre><p>And gets back a <strong>JSON file</strong> like this:</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wbRk!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1002abc2-df29-4c3a-8828-a63457d7fe5e_1732x1962.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wbRk!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1002abc2-df29-4c3a-8828-a63457d7fe5e_1732x1962.png 424w, https://substackcdn.com/image/fetch/$s_!wbRk!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1002abc2-df29-4c3a-8828-a63457d7fe5e_1732x1962.png 848w, https://substackcdn.com/image/fetch/$s_!wbRk!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1002abc2-df29-4c3a-8828-a63457d7fe5e_1732x1962.png 1272w, https://substackcdn.com/image/fetch/$s_!wbRk!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1002abc2-df29-4c3a-8828-a63457d7fe5e_1732x1962.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wbRk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1002abc2-df29-4c3a-8828-a63457d7fe5e_1732x1962.png" width="1456" height="1649" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1002abc2-df29-4c3a-8828-a63457d7fe5e_1732x1962.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1649,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:&quot;center&quot;,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!wbRk!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1002abc2-df29-4c3a-8828-a63457d7fe5e_1732x1962.png 424w, https://substackcdn.com/image/fetch/$s_!wbRk!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1002abc2-df29-4c3a-8828-a63457d7fe5e_1732x1962.png 848w, https://substackcdn.com/image/fetch/$s_!wbRk!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1002abc2-df29-4c3a-8828-a63457d7fe5e_1732x1962.png 1272w, https://substackcdn.com/image/fetch/$s_!wbRk!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1002abc2-df29-4c3a-8828-a63457d7fe5e_1732x1962.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>For the agents, they connect via <code>./well-known/agent.json</code> configuration in OpenID Connect.</p><div><hr></div><p>This is just the start of something new, there&#8217;s more to come. Checkout the GitHub link below for a sample code using A2A Protocol.</p><p><strong>Source Code</strong>: <a href="https://github.com/google/A2A">https://github.com/google/A2A</a></p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://adityatrivedi17.substack.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">Thanks for reading! Subscribe for free to receive new posts and support my work.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item></channel></rss>