<?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[BinaryBox]]></title><description><![CDATA[BinaryBox is where coders level up to engineers. I share practical insights, mental models, and real-world stories that help you think beyond code, design better solutions, and grow into a problem-solving powerhouse.]]></description><link>https://www.binarybox.org</link><image><url>https://substackcdn.com/image/fetch/$s_!nQ1g!,w_256,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5439f3e3-02d6-4fcb-916e-c999f65d4c56_300x300.png</url><title>BinaryBox</title><link>https://www.binarybox.org</link></image><generator>Substack</generator><lastBuildDate>Sun, 23 Aug 2026 22:03:47 GMT</lastBuildDate><atom:link href="https://www.binarybox.org/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Ashok Vishwakarma]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[binarybox@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[binarybox@substack.com]]></itunes:email><itunes:name><![CDATA[Ashok Vishwakarma]]></itunes:name></itunes:owner><itunes:author><![CDATA[Ashok Vishwakarma]]></itunes:author><googleplay:owner><![CDATA[binarybox@substack.com]]></googleplay:owner><googleplay:email><![CDATA[binarybox@substack.com]]></googleplay:email><googleplay:author><![CDATA[Ashok Vishwakarma]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[The AI rehiring panic everyone got wrong]]></title><description><![CDATA[We all know that roughly 120k tech roles has been cut in the year 2026 and AI was the most cited reason among all.]]></description><link>https://www.binarybox.org/p/the-ai-rehiring-panic-everyone-got</link><guid isPermaLink="false">https://www.binarybox.org/p/the-ai-rehiring-panic-everyone-got</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Sun, 16 Aug 2026 06:02:54 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!zGW8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23558de7-de70-41cf-9a1c-9e2b86e25d42_1080x607.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zGW8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23558de7-de70-41cf-9a1c-9e2b86e25d42_1080x607.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zGW8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23558de7-de70-41cf-9a1c-9e2b86e25d42_1080x607.jpeg 424w, https://substackcdn.com/image/fetch/$s_!zGW8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23558de7-de70-41cf-9a1c-9e2b86e25d42_1080x607.jpeg 848w, https://substackcdn.com/image/fetch/$s_!zGW8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23558de7-de70-41cf-9a1c-9e2b86e25d42_1080x607.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!zGW8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23558de7-de70-41cf-9a1c-9e2b86e25d42_1080x607.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zGW8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23558de7-de70-41cf-9a1c-9e2b86e25d42_1080x607.jpeg" width="1080" height="607" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/23558de7-de70-41cf-9a1c-9e2b86e25d42_1080x607.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:607,&quot;width&quot;:1080,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;The AI Layoff Bill Is Coming Due, And CTOs Are Going To Pay It Twice :  r/technology&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;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="The AI Layoff Bill Is Coming Due, And CTOs Are Going To Pay It Twice :  r/technology" title="The AI Layoff Bill Is Coming Due, And CTOs Are Going To Pay It Twice :  r/technology" srcset="https://substackcdn.com/image/fetch/$s_!zGW8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23558de7-de70-41cf-9a1c-9e2b86e25d42_1080x607.jpeg 424w, https://substackcdn.com/image/fetch/$s_!zGW8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23558de7-de70-41cf-9a1c-9e2b86e25d42_1080x607.jpeg 848w, https://substackcdn.com/image/fetch/$s_!zGW8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23558de7-de70-41cf-9a1c-9e2b86e25d42_1080x607.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!zGW8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F23558de7-de70-41cf-9a1c-9e2b86e25d42_1080x607.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>You may have hearing or reading that AI is backfiring or Companies bringing the engineers back or AI is failing or The humans are coming back etc etc. Trust me I am reading these for a quite long time. And I start wondering, is it really? </p><p>So being a nerd I started digging deeper and here is what I found.</p><h2>The trend is divided</h2><p>Here is the scale of things everyone is talking about.</p><p>We all know that roughly <strong>120k</strong> tech roles has been cut in the year 2026 and AI was the most cited reason among all. </p><p>Read this report by <strong><a href="https://techcrunch.com/2026/07/06/the-running-list-major-tech-layoffs-in-2026-where-employers-cited-ai/">Challenger, Gray and Christmas</a></strong> if feel otherwise.</p><p>That report mentioned all the tech giants and their layoffs as they were announced.</p><p>PayPal, Microsoft, Meta, Google Amazon and everyone else who cut their workforce in those times marked as AI specific layoffs. But if I look closer that line is still trending downward and companies still laying off their workforce.</p><p>So, I started focusing on the other line which is smaller but louder. Here are some context before I get into it</p><ul><li><p><strong><a href="https://www.cnbc.com/2026/07/01/employers-who-laid-off-workers-for-ai-are-reversing-their-decisions.htmlhttps://www.cnbc.com/2026/07/01/employers-who-laid-off-workers-for-ai-are-reversing-their-decisions.html">The Orgvue survey</a></strong> tells us that <strong>39%</strong> of business leaders made people redundant because of AI and <strong>55%</strong> of those now admit that the decision was wrong.</p></li><li><p><strong>Robert Half </strong>mentioned that thirty two percent of the hiring managers from US have already rehired someone for a role they cut because of AI.</p></li><li><p><strong><a href="https://www.inc.com/bruce-crumley/55-percent-of-leaders-regret-ai-layoffs-and-a-major-hiring-reversal-has-begun/91380901">Forrester is predicting</a></strong> that half of all AI attributed layoffs will eventually be quietly reversed.</p></li></ul><p>So, I can understand why the conclusion you have made seems backed by the data itself. The industry is still in layoff mode and some of those layoffs are being rehired as well both are true at the same time.</p><p>But the story has a lot more to say, actually there are three different failures and each one has a specific engineering cause behind it. Putting them together as <strong>AI is failing</strong> misses the actual lesson in each case and that is the only part worth keeping for our own deployment decisions.</p><h3>Failure 1 - The undocumented knowledge </h3><p>Read this story</p><p><strong><a href="https://allwork.space/2026/07/ibm-ford-and-commonwealth-bank-rehire-staff-after-ai-fails-to-replace-key-roles/">Ford rehired and promoted more than 350 engineers.</a></strong></p><p>But what matters is, the why? </p><p>The knowledge these engineers has to run design reviews before vehicles reach production were undocumented. They knew the failure patterns which they have experienced, the edge cases which was never logged and things which was never written down but was important. All these existed only in their mind. </p><p>So, when Ford trained their system on available data (service records, design specs, test logs etc) was an incomplete version of what those engineers actually knew. And they found that out in a hard way. </p><p>Ford&#8217;s executives estimated this knowledge worth hundreds of millions to help catch those issues early.</p><p>This is not a story where AI is not able to understand vehicle design, it is all about the undocumented knowldge.</p><p>I have experienced this first hand with obviously a less expensive consequences.</p><p>Every Knowledge Graph I have shipped runs into the same undocumented knowledge wall. The system is only as good as what was recorded and available. The most valuable knowledge in most of the organization are the ones live in a senior person&#8217;s head.</p><p>Buying better models cannot fix this, you only fix it by writing down the undocumented knowledge before the AI project starts.</p><h3>Failure 2 - The remaining 6%</h3><p>Using <strong><a href="https://theslowai.substack.com/p/ai-rehiring-workers-replaced">AskHR</a> </strong>(An AI Agent) IBM resolves <strong>94%</strong> of the employee request in their HR function without a single human in the loop. That is commendable result and nobody can deny that.</p><p>But the remaining <strong>6%</strong> is where the actual story is. IBM describe that as <strong>Ethical Dilemmas</strong> and <strong>Complex Situations </strong>which does not fit into their policies as cleanly as it was needed. Simply means those requests needed some judgement instead a lookup into the database. </p><p>So, IBM does not gave up the their AI Agent but it was to announce that they would triple entry level hiring across their US business in the year 2026.</p><p>Another example where <strong>Commonwealth Bank of Australia</strong> faced the similar problem but in different angle. </p><p>They laid off more than 40 of their customer service staff and replaced them with AI Voice Bot. The Bot could not handle the call volume and the cases where human judgement was needed. They reversed the layoffs and admitted that they had not consider all the relevant business cases.<br><br>Both these cases are not a capability failures, AskHR is resolving 94% of the cases correctly, the CBA bot was able to process most of the routine calls. What went wrong was the boundary, when they deployed the system without a precise definition of what was suppose to do in those specific scenarios.</p><p>The 6% number is completely depends on the judgment specific worjloads which training data cannot encode by itself.</p><h3>Failure 3 - The single metric trap</h3><p>I hear a lot about Klarna case and I feel that everybody only reads the headline, if they go past that they would know. </p><p>In the year 2024 <strong><a href="https://www.digitalapplied.com/blog/klarna-reverses-ai-layoffs-replacing-700-workers-backfired">Klarna&#8217;s OpenAI powered Agent</a></strong> handled <strong>2.3 Million</strong> customer service conversations in its first month and cut down the resolution time from <strong>11 Min </strong>to under <strong>2 Min</strong>. The company projected A total of <strong>$40 Million</strong> in savings that year.</p><p>But, within <strong>18 Months</strong> they started rehiring and headlines framed this as a reversal. Actually it was a rebalancing, the AI Agent is still in the front lines for the high volume routine tier support. The human agent was to serve the premium tier for complex cases which involves trust, emotion and risk where resolution time is not that important.</p><p>Look what the <strong><a href="https://getperspective.ai/blog/klarna-ai-customer-service-replacing-700-agents-conversational-ai-case-study">CEO has said</a></strong> about this whole situation. It fits into a clear case of <strong>The single metric trap</strong> as they were only focused on volume and resolution time and has not consider the customer satisfaction etc in the beginning.</p><p>If we pick an easy number to optimize for example resolution time, cost per ticket, tokens per task etc. The data will support you for it but you also need to look at the things you are not measuring, churn, complaints, warranty claims etc. The fix in such scenarios are quite higher then the original savings.</p><p>At the end, this case of Klarna does not prove that AI cannot do customer service, it proved that fixing and optimizing for a single metric will eventually fail.</p><h2>What we should learn from this cases</h2><p>Each of this headlines and cases are there to teach us something and it only become clear when we dig deeper and beyond the headlines</p><h3>The five year clock</h3><p>If you look at the IBM&#8217;s case, their <strong><a href="https://theslowai.substack.com/p/ai-rehiring-workers-replaced">CHRO said</a></strong> that investing in entry level hires is a must otherwise in <strong>3 to 5 years</strong> there will be no pipeline and the well simply dries up. They are doing headcount calculations on a longer clock then completely relying on AI only solution.</p><p>So if we cut that intake today as AI can do the entry level work, we are not eliminating the cost but deferring it into the future with a bigger number.</p><p>I myself has scaled engineering org from 3 to 130 people and I have been on the other side of this exact decision to hire or automate. One thing I have learned in the hard way that automating everything is not possible and we need people to manage the complex workflows and systems.</p><h3>The Duolingo&#8217;s case</h3><p>You may have read that Duolingo&#8217;s CEO announced an AI First memo in the April 2025, he stated only hire if a team cannot automate more of its work. He met with <strong><a href="https://www.staffingindustry.com/news/global-daily-news/duolingo-pulls-back-on-plans-to-shift-from-contractors-to-ai">immediate backlash</a></strong>, <strong>1000s</strong> of comments with <strong>600 reposts</strong> and even <strong>threats to delete the app</strong>. This story and the coverage on it was very wrong in every way that matters.</p><p>In fact,<strong> <a href="https://www.metaintro.com/blog/duolingo-ceo-walks-back-ai-first-memo-hiring-grows-2026">Duolingo never laid off a single full time employee</a></strong>.<strong> </strong>They even keep hiring in the same year the Memo went public. </p><p>In the year 2023 and again in 2024 they cut down <strong>10%</strong> of their <strong>contract workforce</strong> of translators and writers.  In May 2026 they backtracked on their internal policy to evaluate employees on their AI usages due to employees kept asking if they must use the tools for the sake of using them.</p><p>But, the headline said that AI first company reverses course on AI. And the fact was company never touched full time headcount and clarifies on their internal policy after the employee push back.</p><p>So, this story was never about employees or AI failing but contractors are being replaced with the internal systems.</p><div><hr></div><h2>Conclusion</h2><p>Here is what I got and think about this whole AI is backfiring narrative</p><ul><li><p>The rehiring stories are real and each one of them has a specific case to learn. None of them are evidence that AI does not work and cannot do the tasks.</p></li><li><p>Shopify&#8217;s headcount has been very flat and its not because of AI failed but they decided to keep a flat headcount. PayPal, Microsoft and Meta are still laying off and data does not show they are wrong.</p></li><li><p>The tech headcount in 2026 is still declining and roughly <strong>120k</strong> jobs has been cut and not comparable against the rehires. </p></li></ul><p>These stories also gives us a checklist which we can run before we go about deploying AI in our workflow</p><ul><li><p>Make sure you have all the knowledge each person holding before they leave.</p></li><li><p>Not everything can be automated or offload to AI, keeping key persons become important.</p></li><li><p>Pick a mixed of metrics which includes quality before you optimize the easy ones.</p></li><li><p>Plan for at least 5 years on headcount so that you have an active pipeline.</p></li></ul><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/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 BinaryBox! 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><p><em>Further reading</em><a class="footnote-anchor" data-component-name="FootnoteAnchorToDOM" id="footnote-anchor-1" href="#footnote-1" target="_self">1</a></p><div class="footnote" data-component-name="FootnoteToDOM"><a id="footnote-1" href="#footnote-anchor-1" class="footnote-number" contenteditable="false" target="_self">1</a><div class="footnote-content"><p></p><p><a href="https://techcrunch.com/2026/07/06/the-running-list-major-tech-layoffs-in-2026-where-employers-cited-ai/">The running list of every major 2026 tech layoff that named AI, TechCrunch</a></p><p><a href="https://www.cnbc.com/2026/07/01/employers-who-laid-off-workers-for-ai-are-reversing-their-decisions.html">Employers who laid off workers for AI are reversing their decisions, CNBC</a></p><p><a href="https://www.inc.com/bruce-crumley/55-percent-of-leaders-regret-ai-layoffs-and-a-major-hiring-reversal-has-begun/91380901">55 percent of leaders regret AI layoffs, Inc.</a></p><p><a href="https://allwork.space/2026/07/ibm-ford-and-commonwealth-bank-rehire-staff-after-ai-fails-to-replace-key-roles/">IBM, Ford, and Commonwealth Bank rehire staff after AI fails to replace key roles, Allwork.Space</a></p><p><a href="https://www.techspot.com/news/112960-more-companies-rehiring-workers-they-replaced-ai-after.html">More companies are rehiring workers they replaced with AI, TechSpot</a></p><p><a href="https://theslowai.substack.com/p/ai-rehiring-workers-replaced">Companies are rehiring the workers they replaced with AI, on IBM&#8217;s AskHR and the entry level pipeline</a></p><p><a href="https://www.digitalapplied.com/blog/klarna-reverses-ai-layoffs-replacing-700-workers-backfired">Klarna reverses AI layoffs, why replacing 700 failed</a></p><p><a href="https://getperspective.ai/blog/klarna-ai-customer-service-replacing-700-agents-conversational-ai-case-study">Klarna AI customer service, replacing 700 agents, a 2026 case study</a></p><p><a href="https://www.metaintro.com/blog/duolingo-ceo-walks-back-ai-first-memo-hiring-grows-2026">Duolingo CEO reverses AI first memo in 2026</a></p><p><a href="https://www.staffingindustry.com/news/global-daily-news/duolingo-pulls-back-on-plans-to-shift-from-contractors-to-ai">Duolingo pulls back on plans to shift from contractors to AI, Staffing Industry</a></p><p><a href="https://techcrunch.com/2025/05/04/is-duolingo-the-face-of-an-ai-jobs-crisis/">Is Duolingo the face of an AI jobs crisis, TechCrunch</a></p><p><a href="https://www.kore1.com/shopify-layoffs-2026/">Shopify layoffs 2026, ecommerce engineering hiring window, KORE1</a></p></div></div>]]></content:encoded></item><item><title><![CDATA[Stop treating MCPs as Plugins. They are a Pipeline.]]></title><description><![CDATA[MCPs are not individual add-ons. They are structural building blocks for a pipeline. When configured as an interconnected graph, MCPs mirror every stage of your development workflow.]]></description><link>https://www.binarybox.org/p/stop-treating-mcps-as-plugins-they</link><guid isPermaLink="false">https://www.binarybox.org/p/stop-treating-mcps-as-plugins-they</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Tue, 28 Jul 2026 06:01:31 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!InMb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734333fd-a239-4618-8efb-558cc64a9acd_3200x1800.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!InMb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734333fd-a239-4618-8efb-558cc64a9acd_3200x1800.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!InMb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734333fd-a239-4618-8efb-558cc64a9acd_3200x1800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!InMb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734333fd-a239-4618-8efb-558cc64a9acd_3200x1800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!InMb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734333fd-a239-4618-8efb-558cc64a9acd_3200x1800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!InMb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734333fd-a239-4618-8efb-558cc64a9acd_3200x1800.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!InMb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734333fd-a239-4618-8efb-558cc64a9acd_3200x1800.jpeg" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/734333fd-a239-4618-8efb-558cc64a9acd_3200x1800.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2383346,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.binarybox.org/i/208712903?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734333fd-a239-4618-8efb-558cc64a9acd_3200x1800.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!InMb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734333fd-a239-4618-8efb-558cc64a9acd_3200x1800.jpeg 424w, https://substackcdn.com/image/fetch/$s_!InMb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734333fd-a239-4618-8efb-558cc64a9acd_3200x1800.jpeg 848w, https://substackcdn.com/image/fetch/$s_!InMb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734333fd-a239-4618-8efb-558cc64a9acd_3200x1800.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!InMb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F734333fd-a239-4618-8efb-558cc64a9acd_3200x1800.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Count the open tabs sitting on your browser right now</p><ol><li><p><strong>Figma</strong> to inspect the design tokens and layout rules.</p></li><li><p><strong>VS Code</strong> to build the UI component.</p></li><li><p><strong>TablePlus</strong> to verify table schemas and foreign key constraints.</p></li><li><p><strong>Library Docs</strong> to double-check exact method signatures for your installed packages.</p></li><li><p><strong>Localhost browser</strong> to manually refresh and inspect spacing.</p></li><li><p><strong>GitHub</strong> to open a pull request and tag the issue.</p></li><li><p><strong>Sentry</strong> three days later when a null pointer hits production</p></li></ol><p>Seven tools. Seven context switches. Seven places where your original architectural vision falls apart.</p><p>You tab out of Figma into your editor and immediately forget the exact padding tokens. You jump over to a database client to verify a column name and lose the code state in your head. That cognitive drain doesn&#8217;t show up in JIRA metrics, but it burns through engineering energy every day.</p><p>When Model Context Protocol (MCP) landed, most teams treated it like VS Code extensions. They installed a GitHub MCP to create PRs, or a Figma MCP to read layers. They treated MCPs as individual utility add-ons to give Claude Code a little extra help.</p><p>Installing isolated plugins completely misses the real power of the protocol.</p><p>MCPs aren&#8217;t standalone tools. They are structural building blocks for an automated pipeline. When you configure them as an interconnected graph, MCPs map directly to every phase of your software lifecycle. Instead of hopping between apps, a completed pipeline removes manual tool-switching entirely. Design specs, monorepo graphs, database schemas, library docs, browser execution, version control, and production errors sit inside a single session context.</p><p>Here is what a complete full-stack MCP pipeline looks like inside an NX monorepo. Seven stages. Seven MCPs. One continuous session.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;dfc2d0b9-c060-4da8-91f3-b497feb6df44&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">THE FULL-STACK MCP PIPELINE (NX MONOREPO)

[Design]       FIGMA MCP          Design intent &#8594; component spec
    &#8595;
[Codebase]     NX MCP             Project graph &#8594; workspace layout
    &#8595;
[Data]         DATABASE MCP       Schema &#8594; type-safe queries
    &#8595;
[Docs]         CONTEXT7 MCP       Live APIs &#8594; zero hallucinations
    &#8595;
[Visual QA]    PLAYWRIGHT MCP     Browser &#8594; visual verification loop
    &#8595;
[Version Ctrl] GITHUB MCP         Code &#8594; PR &#8594; code review
    &#8595;
[Production]   SENTRY MCP         Errors &#8594; root cause &#8594; automated fix</code></pre></div><h2>Split Your Tools by Category</h2><p>To build a clean system, stop jamming every tool together. Group them into two distinct operational categories</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;bc93ca52-40d1-405d-9176-8792039dc19a&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">TWO TYPES OF MCPs

CONTEXT MCPs (Make Claude smarter):
&#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
&#9474; Figma MCP    &#8594; Design intent            &#9474;
&#9474; NX MCP       &#8594; Monorepo architecture   &#9474;
&#9474; Database MCP &#8594; Data shape               &#9474;
&#9474; Context7 MCP &#8594; Library APIs             &#9474;
&#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
Without these: Claude outputs plausible code 
               that breaks local repository patterns.

ACTION MCPs (Allow Claude to execute):
&#9484;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9488;
&#9474; Playwright MCP &#8594; Browser automation     &#9474;
&#9474; GitHub MCP     &#8594; Version control        &#9474;
&#9474; Sentry MCP     &#8594; Incident management    &#9474;
&#9492;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9472;&#9496;
Without these: Claude outputs code blocks 
               and waits for you to copy-paste.
</code></pre></div><p>Context MCPs pipe domain layout directly into the model. Action MCPs hand it execution rights. Give Claude only Context MCPs, and it acts like an advisor giving suggestions. Give it only Action MCPs, and it executes blind actions that wreck local repository patterns. You need both working together.</p><h3>Tool Search &amp; Lazy Loading</h3><p>Running 7 or more MCP servers used to be an absolute disaster. Early setups dumped every tool definition and JSON schema straight into the system prompt at startup. Combining 7 complex MCP servers consumed over 30,000 tokens before you typed a single letter. It drained model attention and blew up API costs.</p><p>The arrival of <strong>MCP Tool Search and Lazy Loading</strong> changed the math. Tools aren&#8217;t dumped into the initial prompt anymore. Claude Code searches for and loads tool schemas dynamically on demand.</p><p>That single architectural update cut initial context consumption by up to 95%. The model keeps its full context window free for actual source code, fetching tool definitions only when a specific pipeline step calls for them.</p><h2>The Pipeline in Detail</h2><h3>Stage 1 &#8594; Design to Code (Figma MCP)</h3><p>Direct inspection of Figma Dev Mode APIs to pull layer hierarchies, auto-layout rules, variants, and design tokens straight from the file.</p><p><strong>Before - </strong>You copy dimensions from Figma inspect panels, guess color values, and manually tweak code across four design review cycles.</p><p><strong>After - </strong>Claude inspects the frame structure directly, pulls defined design tokens, and outputs layout code matched to the design spec.</p><p>Paired with workspace context, Claude maps Figma design tokens directly to your shared <code>libs/ui-components</code> styling setup instead of inventing arbitrary inline styles.</p><p>To setup Figma MCP use the below command</p><p><code>npx -y figma-developer-mcp --stdio</code> </p><p><em>(Requires a paid Figma plan for Dev Mode API access).</em></p><h3>Stage 2 &#8594; Codebase Understanding  (NX MCP)</h3><p>Access to the workspace project graph (<code>nx_workspace</code>), target configs (<code>nx_project_details</code>), workspace generators (<code>nx_generators</code>), and build outputs.</p><p><strong>Before - </strong>Claude treats your monorepo like a flat directory tree. It generates components in the wrong folders, duplicates shared helpers, uses broken relative imports, and violates library boundary tags.</p><p><strong>After - </strong>Claude knows which library owns which domain, imports existing shared UI components, runs workspace generators natively, and respects tags.</p><p>Run <code>npx nx configure-ai-agents</code> to automatically set up workspace MCP integration, Skills files, and <code>CLAUDE.md</code>.</p><h3>Stage 3 &#8594; Data Layer Understanding  (Database MCP)</h3><p>Direct inspection of PostgreSQL, MySQL, or SQLite schemas, including foreign keys, indexes, and column types.</p><p><strong>Before -</strong> You copy SQL scripts into chat prompts or let Claude guess column names, triggering runtime errors.</p><p><strong>After -</strong> Claude reads table shapes dynamically and writes type-safe database queries that match your live schema.</p><p>In multi-service monorepos, map dedicated read-only connection strings per microservice project to enforce service boundaries.</p><p>To setup</p><p><code>npx -y @modelcontextprotocol/server-postgres postgresql://readonly_user:pass@localhost:5432/dev_db</code></p><h3>Stage 4 &#8594; Live Documentation (Context7 MCP)</h3><p>Live documentation and type signatures pulled directly from library source code for the specific package versions listed in your <code>package.json</code>.</p><p><strong>Before -</strong> Claude relies on old training data, using deprecated methods or making up non-existent hooks for fast-changing packages.</p><p><strong>After -</strong> Claude queries Context7 to verify exact API methods for installed dependency versions before writing code.</p><p>Prevents API mismatches in large monorepos with varying package version rules across apps.</p><p>To setup <code>npx -y @upstash/context7-mcp</code></p><h3>Stage 5 &#8594; Visual Verification (Playwright MCP)</h3><p>Headless browser automation that renders components, triggers clicks, checks DOM state, and grabs UI screenshots.</p><p><strong>Before -</strong> You write code, spin up a local server, refresh the browser, inspect elements, and describe visual bugs back to the LLM.</p><p><strong>After -</strong> Claude writes the code, spins up Playwright to snap a screenshot, compares the rendered element against the Figma design spec, and fixes layout bugs automatically.</p><p>Runs component checks directly against Storybook or Cypress targets configured in your <code>project.json</code>.</p><p>To setup <code>npx -y @playwright/mcp@latest</code></p><h3>Stage 6 &#8594; Version Control (GitHub MCP)</h3><p>Full GitHub API capabilities to fetch issues, create branches, push commits, and open pull requests directly from your terminal session.</p><p><strong>Before -</strong> You switch to your browser, create branches, write PR descriptions, link issues, and tag reviewers manually.</p><p><strong>After -</strong> Claude reads the issue criteria, writes the code using NX generators, verifies layout, and opens a structured PR with issue references attached.</p><p>Analyzes changed files via NX to tag codeowners automatically based on modified monorepo libraries.</p><p>To setup <code>npx -y @modelcontextprotocol/server-github</code></p><h3>Stage 7 &#8594; Production Observability (Sentry MCP)</h3><p>Direct access to production stack traces, error frequencies, and root-cause analysis data.</p><p><strong>Before -</strong> Sentry fires an alert -&gt; Open dashboard -&gt; Copy stack trace -&gt; Paste into terminal -&gt; Generate fix -&gt; Apply manually.</p><p><strong>After -</strong> Claude fetches the stack trace through Sentry MCP, finds the exact file in your monorepo, diagnoses the bug, applies the fix, and opens a PR.</p><p>Maps production stack traces directly to the owning NX library using boundary rules.</p><p>To setup <code>npx -y @sentry/mcp-server@latest</code></p><h2>Complete Configuration</h2><p>Here is the exact <code>claude_desktop_config.json</code> setup to run this 7-stage pipeline. Keep your sensitive access tokens inside environment variables.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;json&quot;,&quot;nodeId&quot;:&quot;63493be1-5b76-4237-af2b-5851c1918468&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-json">{
  "mcpServers": {
    "figma": {
      "command": "npx",
      "args": ["-y", "figma-developer-mcp", "--stdio"],
      "env": {
        "FIGMA_API_KEY": "FIGMA_PERSONAL_ACCESS_TOKEN"
      }
    },
    "nx": {
      "command": "npx",
      "args": ["nx-mcp@latest", "--no-minimal"],
      "cwd": "/Users/developer/projects/enterprise-monorepo"
    },
    "database": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres",
        "postgresql://readonly_app:secure_password@localhost:5432/dev_db"
      ]
    },
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp"]
    },
    "playwright": {
      "command": "npx",
      "args": ["-y", "@playwright/mcp@latest"]
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_scoping_token_here"
      }
    },
    "sentry": {
      "command": "npx",
      "args": ["-y", "@sentry/mcp-server@latest"],
      "env": {
        "SENTRY_AUTH_TOKEN": "sntry_your_token_here"
      }
    }
  }
}</code></pre></div><h3>Workspace Settings (<code>.nx/nx-mcp-config.json</code>)</h3><p>To enable full tool capabilities across your monorepo without clashing with local Skills files, add</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;json&quot;,&quot;nodeId&quot;:&quot;8017d411-9b25-4c1d-b0b2-f156fb953907&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-json">{
  "minimal": false
}</code></pre></div><h3>Security Guardrails</h3><h4>Read-Only Database Credentials</h4><p>Never hand write access to your Database MCP. Use a strictly read-only user to block accidental DROP or UPDATE queries during schema checks.</p><h4>Scoped Access Tokens</h4><p>Scope your GitHub token exclusively to repo permissions for necessary organizations. Skip global admin access.</p><h4>Keep Keys Out of Git</h4><p>Store config files with secret tokens outside version control. Add claude_desktop_config.json to .gitignore.</p><p>Check active connections in Claude Code anytime with</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;1b0d6ef4-f568-43d2-8a9e-80371112194c&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">/mcp</code></pre></div><p>Every server should show a connected status.</p><h2>End-to-End Execution Example</h2><p>Let&#8217;s look at a common task: &#8220;<strong>Add a UserProfileCard component to the analytics dashboard.</strong>&#8221;</p><p>Here is how the 7-stage pipeline handles it inside one session</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;73f30bc0-215e-4e5f-aa74-52e5abaa4882&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">THE VISUAL IMPLEMENTATION LOOP

Figma MCP reads design frame
    &#8595;
Claude generates React component code
    &#8595;
Playwright MCP renders component in browser
    &#8595;
Playwright captures UI screenshot
    &#8595;
Claude compares screenshot to Figma spec
    &#8595;
Layout discrepancy detected (border-radius mismatch)
    &#8595;
Claude updates component styles
    &#8595;
Playwright verifies layout fix
    &#8595;
Visual match confirmed</code></pre></div><ol><li><p><strong>Design Extraction - </strong>Claude runs <code>figma_get_frame</code> via Figma MCP, parsing spacing rules, font weights, and color tokens for <code>UserProfileCard</code>.</p></li><li><p><strong>Workspace Routing - </strong>Claude checks <code>nx_workspace</code> via NX MCP. It sees that the UI component belongs in <code>libs/shared/ui-components</code>, while data fetching sits in <code>libs/dashboard/data-access</code>.</p></li><li><p><strong>Schema Inspection - </strong>Claude runs <code>postgres_inspect_table</code> via Database MCP to fetch the <code>users</code> table layout, verifying column names (<code>display_name</code>, <code>avatar_url</code>, <code>user_role</code>).</p></li><li><p><strong>API Validation - </strong>Claude uses Context7 MCP to check exact API methods for the installed version of <code>@tanstack/react-query</code>, ensuring code compliance without using deprecated options.</p></li><li><p><strong>Visual Verification - </strong>Claude executes the component via Playwright MCP, captures a screenshot, compares the rendered pixels against the Figma spec, spots an incorrect padding value, and fixes the CSS.</p></li><li><p><strong>PR Automation - </strong>Claude uses GitHub MCP to open a branch, commit files across both monorepo libraries, write a detailed PR description, and tag the issue.</p></li><li><p><strong>Observability Tracking - </strong>Post-deploy, Claude checks Sentry MCP to confirm zero unhandled exceptions hit the new <code>UserProfileCard</code> component.</p></li></ol><h2>Manual vs. Pipeline Workflow</h2><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;9e6b3857-7b88-4177-9ad6-4474f64903bc&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">MANUAL WORKFLOW:
Open Figma -&gt; Copy Specs (5 min) -&gt; Context Switch
Open IDE -&gt; Inspect Monorepo Structure (10 min) -&gt; Context Switch
Open DB Client -&gt; Verify Schema (5 min) -&gt; Context Switch
Open Docs -&gt; Verify Package Versions (5 min) -&gt; Context Switch
Implement -&gt; Open Browser -&gt; Manual Inspection (10 min) -&gt; Context Switch
Open GitHub -&gt; Create PR &amp; Write Specs (10 min) -&gt; Context Switch
Open Sentry -&gt; Copy Stack Trace (15 min)

Total Time: ~60 minutes | 6 Context Switches

PIPELINE WORKFLOW:
Prompt: "Add UserProfileCard from Figma to dashboard"
Execution: Pipeline handles context extraction, workspace placement,
           schema mapping, visual QA, PR creation, and error checks.

Total Time: ~15 minutes | 0 Context Switches | 1 Session</code></pre></div><h2>Practical Limitations</h2><p>Keep these real-world limits in mind before deploying</p><p><strong>It doesn&#8217;t replace architecture choices - </strong>NX MCP explains workspace layouts to Claude, but it won&#8217;t handle high-level system design or technical debt decisions for you.</p><p><strong>Visual QA isn&#8217;t flawless - </strong>Playwright catches broken styling, bad alignment, and missing elements. It doesn&#8217;t replace manual accessibility checks or human review.</p><p><strong>Context7 covers public packages - </strong>Proprietary internal libraries won&#8217;t show up in Context7. For internal utilities, use local NX documentation tools (<code>nx_docs</code>).</p><p><strong>Security depends on token discipline - </strong>Broad GitHub permissions or write access to databases create massive vulnerability vectors. Keep your access tokens tightly scoped.</p><div><hr></div><h2>Conclusion</h2><p>Stop thinking about MCPs as isolated plugins to evaluate one by one.</p><p>Your development process is a single connected workflow. Every gap between tools creates friction, and every tab switch drains focus. Model Context Protocols exist to break down those barriers by giving the model structured access to the tools you use every day.</p><p>Shift your primary setup question:</p><p><strong>Old Question -</strong> <em>&#8220;Which MCP plugin should I try next?&#8221;</em></p><p><strong>New Question -</strong> <em>&#8220;Which stage of my development pipeline still forces a manual context switch?&#8221;</em></p><p>Start with <strong>NX MCP</strong> to give Claude awareness of your codebase structure. Add <strong>Figma MCP</strong> for design specs, <strong>Database MCP</strong> for schema validation, <strong>Playwright MCP</strong> for visual feedback loops, <strong>GitHub MCP</strong> for version control, and <strong>Sentry MCP</strong> for production tracking.</p><p>You already use these tools every day. Building a pipeline is simply connecting them together.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/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 BinaryBox! 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 Tokenpocalypse - Why Cheap Tokens are Bankrupting Engineering Teams]]></title><description><![CDATA[Cost per token is reduced by 67 to 97% in 3 years but AI bills for engineering teams have never been higher, so the question is why?]]></description><link>https://www.binarybox.org/p/the-tokenpocalypse-why-cheap-tokens</link><guid isPermaLink="false">https://www.binarybox.org/p/the-tokenpocalypse-why-cheap-tokens</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Tue, 21 Jul 2026 06:02:53 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!j4FO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe03563d-f318-4cb7-8b70-a051faaa175b_1300x612.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!j4FO!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe03563d-f318-4cb7-8b70-a051faaa175b_1300x612.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!j4FO!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe03563d-f318-4cb7-8b70-a051faaa175b_1300x612.webp 424w, https://substackcdn.com/image/fetch/$s_!j4FO!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe03563d-f318-4cb7-8b70-a051faaa175b_1300x612.webp 848w, https://substackcdn.com/image/fetch/$s_!j4FO!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe03563d-f318-4cb7-8b70-a051faaa175b_1300x612.webp 1272w, https://substackcdn.com/image/fetch/$s_!j4FO!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe03563d-f318-4cb7-8b70-a051faaa175b_1300x612.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!j4FO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe03563d-f318-4cb7-8b70-a051faaa175b_1300x612.webp" width="1300" height="612" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fe03563d-f318-4cb7-8b70-a051faaa175b_1300x612.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:612,&quot;width&quot;:1300,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;A person holding an open empty wallet seated on stairs&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;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="A person holding an open empty wallet seated on stairs" title="A person holding an open empty wallet seated on stairs" srcset="https://substackcdn.com/image/fetch/$s_!j4FO!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe03563d-f318-4cb7-8b70-a051faaa175b_1300x612.webp 424w, https://substackcdn.com/image/fetch/$s_!j4FO!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe03563d-f318-4cb7-8b70-a051faaa175b_1300x612.webp 848w, https://substackcdn.com/image/fetch/$s_!j4FO!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe03563d-f318-4cb7-8b70-a051faaa175b_1300x612.webp 1272w, https://substackcdn.com/image/fetch/$s_!j4FO!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffe03563d-f318-4cb7-8b70-a051faaa175b_1300x612.webp 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>In early 2023 output tokens for frontier models like GPT 4 cost roughly 60 dollars per million. By early 2025 that price plummeted to under 1.50 dollars per million which is an incredible 97.5 percent price drop in under two years. By Q1 2026 the enterprise blended cost for tokens reached 6.07 dollars per million which is a 67 percent decline year over year.</p><p>Tokens have never been cheaper.</p><p>Yet enterprise AI bills have never been higher.</p><h2>The Jevons Paradox</h2><p>In the nineteenth century the economist William Stanley Jevons observed a counterintuitive phenomenon namely when the efficiency of coal consumption improved the total consumption of coal went up instead of down. Cheaper energy per unit meant that society built vastly more machines and found entirely new ways to consume the resource at scale.</p><p>The exact same economic paradox is playing out across enterprise software architecture today.</p><p>As token prices collapsed engineering teams stopped treating tokens as a scarce resource. They built more ambitious autonomous agents with larger context windows and longer recursive reasoning loops.</p><p>The result is that enterprise AI bills tripled over the last twelve months despite unit prices falling.</p><p>According to the <strong><a href="https://data.finops.org/">FinOps Foundation 2026 State of FinOps report</a></strong> 73 percent of enterprises reported that their AI infrastructure costs exceeded original projections. Managing AI spend has quickly become a critical priority with 98 percent of FinOps practitioners actively governing AI budgets this year up from only 31 percent in 2025.</p><p>We see this playing out at the absolute frontier of technology.</p><p>In April 2026 an internal leaderboard called <strong><a href="https://fortune.com/2026/04/09/meta-killed-employee-ai-token-dashboard/">Claudeonomics leaked from Meta</a></strong>. The dashboard tracked token consumption across 85,000 employees who were using Anthropic Claude models. Engineers competed for gamified titles such as Token Legend and Session Immortal and Cache Wizard.</p><p>The leaderboard revealed that Meta employees collectively consumed 73.7 trillion tokens in roughly 30 days. At public cloud pricing that volume translates to an estimated 9 billion dollars in monthly compute costs. The top individual user alone burned 281 billion tokens in 30 days which is 9.36 billion tokens per day.</p><p>Neither Mark Zuckerberg nor CTO Andrew Bosworth made the top 250 on the board. The leaderboard was shut down within 48 hours of the external leak and Meta is now steering employees away from external models toward their internal tool MetaCode while preparing formal token budgets for 2027.</p><p>This is not a pricing problem. This is a fundamental architectural flaw. We tried to build autonomous agents using the same cloud billing models we use for standard SaaS subscriptions. But the cloud compute model was never designed to handle recursive self correcting execution flows.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;1f401422-9fee-4e37-8a14-874fb1438931&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">TOKEN PRICE vs. ENTERPRISE SPEND (2023 to 2026)

Unit Price Trajectory
2023 GPT 4 Output   | $60.00 per million tokens
2024 Blended Cost   | $15.00 per million tokens
Early 2025 Blended  | $1.50 per million tokens
Q1 2026 Blended     | $6.07 per million tokens

Enterprise AI Spend Trajectory
2024                | Baseline
2025                | +150 percent
2026                | +200 percent (Tripled from baseline)

The Gap = The Jevons Paradox
Cheaper tokens lead to larger context and recursive loops which leads to massive bills</code></pre></div><h2>The Agentic Loop Multiplier</h2><p>To understand why autonomous agents are bankrupting engineering teams we must analyze the physical difference between linear execution and recursive loops.</p><p>A standard LLM chat interaction is a single linear transaction.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\text{User Prompt} \\rightarrow \\text{Model} \\rightarrow \\text{Response}&quot;,&quot;id&quot;:&quot;NHFZLFPFNM&quot;}" data-component-name="LatexBlockToDOM"></div><p>An agent operates recursively in a continuous loop.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;\\text{Plan} \\rightarrow \\text{Tool Call} \\rightarrow \\text{Observe} \\rightarrow \\text{Rethink} \\rightarrow \\text{Plan}&quot;,&quot;id&quot;:&quot;IGVPNUUQST&quot;}" data-component-name="LatexBlockToDOM"></div><p>The agent executes this loop continuously until it determines the task is complete or until you hit a hard timeout. The core architectural difference is that every iteration of the loop is not an isolated transaction. Every step must transmit the entire accumulated history of every previous thought tool call and system observation.</p><p>This is the physics of context rot. The weight of prior reasoning and tool outputs must be retransmitted on every single iteration of the loop.</p><p>Look at how the token footprint grows on a typical multi step coding task.</p><ul><li><p><strong>Step 1</strong> which is the initial plan sends the system prompt and the task details which is 2,000 tokens.</p></li><li><p><strong>Step 2</strong> which is reading a target file sends the system prompt the task details the step 1 reasoning and the file contents which is 8,000 tokens.</p></li><li><p><strong>Step 3</strong> which is analyzing the tool output sends the entire history from the previous steps plus the new observations which is 18,000 tokens.</p></li><li><p><strong>Step 10</strong> which is the final execution step sends the accumulated history of all 9 previous steps which easily exceeds 180,000 tokens.</p></li></ul><p>The agent did not execute ten equal steps. It executed ten steps where each step was exponentially larger than the last because it had to retransmit everything that came before.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;b59f6fb2-54ba-48d1-aaea-314b14d50511&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">TOKENS SENT PER AGENT LOOP ITERATION

Step 1  | 2,000 tokens      | ==
Step 2  | 8,000 tokens      | ========
Step 3  | 18,000 tokens     | ==================
Step 5  | 45,000 tokens     | ============================================
Step 8  | 120,000 tokens    | =========================================================...
Step 10 | 180,000 plus      | =========================================================...

Total tokens consumed across all steps exceeds 1.2M tokens
Linear equivalent without context accumulation is roughly 24,000 tokens
The Agentic Multiplier is 50x to 500x</code></pre></div><p>According to the <strong><a href="https://www.navyaai.com/reports/ai-cost-report-token-prices-vs-ai-bill">NavyaAI 2026 AI Cost Report</a></strong> agentic workflows multiply token usage by 50 to 500x compared to equivalent linear workflows. A typical agentic coding task averages 1 to 3.5 million tokens including retries and self correction. A complex debugging session against a frontier model can easily burn over 500,000 tokens in a single run.</p><p>Let us run the math for 1,000 engineers completing 3 agentic tasks per day using frontier models priced at 3.00 dollars per million input tokens and 15.00 dollars per million output tokens.</p><p>If we assume a conservative average of 1,000,000 tokens per task the daily cost reaches 36,000 dollars. This translates to roughly 1.1 million dollars per month or over 13 million dollars per year.</p><p>At Uber scale with 5,000 active engineers and an 84 to 95 percent adoption rate the math becomes explosive. Uber was spending between 500 and 2,000 dollars per engineer per month which exhausted their entire 3.4 billion dollar annual AI budget in just four months. They were forced to implement a hard cap of 1,500 dollars per engineer per month to stop the bleeding.</p><p>Furthermore 72 percent of the production AI cost sits completely outside the model invoice. This hidden loop tax includes the orchestration compute to run the agent loop itself and the vector database retrieval costs and tool call execution overhead and observability logging. When an agent gets stuck in a hallucination loop it burns money across your entire cloud infrastructure simultaneously.</p><p><strong>Quick check &#128071;</strong></p><p>How many tokens does your agent consume per task. If you estimated this by multiplying the number of steps by the average prompt size you are probably underestimating your actual cost by 50x. Pull your actual token usage from your API dashboard for the last 30 days and divide by the completed tasks to see your real cost per task.</p><h2>Tokenmaxxing and Goodharts Law in Action</h2><p>Goodharts Law states that when a measure becomes a target it ceases to be a good measure. In 2026 we saw this play out across engineering cultures that tied productivity directly to token consumption.</p><p>Meta CTO Andrew Bosworth said publicly that spending your salary on tokens gives 10x productivity with no upper limit. Nvidia CEO Jensen Huang stated he would be deeply alarmed if a 500,000 dollar engineer was not burning 250,000 dollars a year on tokens.</p><p>These executive statements turned token consumption into a career advancement metric. The resulting behavior was predictable. Engineers began tokenmaxxing to climb internal leaderboards. Some employees left AI agents running idle for hours executing meaningless research tasks with no real output goal simply to accumulate tokens.</p><p>This behavior highlights a deeper problem with AI code churn. Raw token volume does not equal engineering velocity. This assumption breaks down in three specific ways.</p><h4>Using Frontier Models for Trivial Tasks</h4><p>Using a 60 dollar per million reasoning model for basic regex parsing or file listing is financial recklessness. These tasks do not require advanced reasoning and can be handled by local models at zero cost.</p><h4>The Review Cost of AI Boilerplate</h4><p>AI generates code in milliseconds but that code must still be reviewed by a human engineer. The cost of that review time is completely hidden from your token invoice but it compounds as your repository grows.</p><h4>Retry Entropy</h4><p>When an agent loops back to self correct it generates exponentially more tokens for diminishing returns. The eighth attempt to fix a bug consumes three times the tokens of the first attempt. The correct architecture should have aborted the run and escalated to a human after the third failed attempt.</p><p>Does your team track token consumption. Does it also track features successfully shipped and production rollback rates. If you have the first metric without the second then you do not have a FinOps strategy. You have an expensive leaderboard.</p><h2>The Exit Strategy</h2><p>The fundamental mistake of early agent design was running the entire execution loop in the cloud. You cannot control your cloud costs if you cannot control the loop.</p><p>If a cloud based agent enters a hallucination loop it will silently consume your budget before you can intervene. The cloud model was designed for predictable workloads. Agent loops are neither.</p><p>The AI.cc 2026 AI Infrastructure Report analyzed 2.4 billion enterprise API calls and revealed a massive structural shift. In Q1 2025 enterprises routed 73 percent of their total token volume to the most expensive frontier models. By Q1 2026 that number dropped to 31 percent.</p><p>The companies that optimized early moved to a tiered routing architecture. This architecture achieved a median blended cost of 2.31 dollars per million tokens compared to 18.40 dollars for frontier only deployments which represents an 87.4 percent cost reduction.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;edc7328e-8207-464f-8cce-bea5b93fd204&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">ROUTING ARCHITECTURE vs. BLENDED COST

FRONTIER ONLY STACK (The Q1 2025 Default)
All traffic goes to Claude Opus or GPT 4
Blended Cost | $18.40 per million tokens

TIERED INTELLIGENCE STACK (The Q1 2026 Standard)
+-----------------------------------------------------------+
| Tier 1 Local Edge | 60 to 80 percent of traffic           |
| Llama 3 8B or Qwen 3.5 9B running locally                 |
| Cost | $0.00 per million tokens                           |
+-----------------------------------------------------------+
| Tier 2 Cost Optimised Cloud | 15 to 25 percent of traffic |
| DeepSeek V4 Flash or Gemini Flash                         |
| Cost | $0.14 to $0.50 per million tokens                  |
+-----------------------------------------------------------+
| Tier 3 Frontier | 5 to 15 percent of traffic              |
| Claude Opus or GPT 4o                                     |
| Cost | $3.00 to $15.00 plus per million tokens            |
+-----------------------------------------------------------+
Blended Cost | $2.31 per million tokens (87.4 percent reduction)</code></pre></div><p>The key architectural principle is that the cloud is not where your agent should orchestrate. The cloud is where your agent should escalate.</p><p>Orchestration belongs entirely at the edge. By running the loop itself on local machines or edge devices you can inspect and interrupt execution at zero cost. You can compress or prune the context window before making cloud calls and you can kill runaway loops before they hit your cloud invoice.</p><h2>The Local Agents Implementation </h2><p>Running local orchestration is now highly viable because of unified memory architectures. The MLX framework developed by Apple Research allows developers to run capable reasoning models directly on M series chips at zero API cost.</p><p>Models such as Llama 3 8B and Qwen 2.5 Coder 7B can run natively on local workstations with high token throughput. This allows us to build a local first agent architecture.</p><p>Here is the pattern for a local first loop orchestrator written in Javascript to avoid any syntax requirements for forbidden punctuation.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;javascript&quot;,&quot;nodeId&quot;:&quot;9743f2b3-6319-4933-a43f-25e329054ee1&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-javascript">class LocalAgentOrchestrator {
    constructor() {
        this.localModel = new LocalMLXModel("qwen2.5-coder-7b")
        this.contextManager = new LocalContextManager()
        this.router = new TaskRouter()
        this.maxLoops = 10
    }

    async run(task) {
        let loopCount = 0
        let isComplete = false

        while (loopCount &lt; this.maxLoops &amp;&amp; !isComplete) {
            let context = this.contextManager.compress()
            let plan = await this.localModel.generatePlan(task, context)
            let complexity = this.router.evaluate(plan)

            let result = ""
            if (complexity &gt; 8) {
                result = await this.callFrontierAPI(plan, context)
            } else if (complexity &gt; 4) {
                result = await this.callDeepSeekAPI(plan, context)
            } else {
                result = await this.localModel.execute(plan)
            }

            this.contextManager.append(plan, result)
            isComplete = this.localModel.checkCompletion(result)
            loopCount = loopCount + 1
        }
    }
}
</code></pre></div><p>This local loop pattern ensures that the orchestrator itself never consumes cloud tokens. Cloud APIs are treated as functional tools called only when the local model determines that a specific subtask exceeds its reasoning capability.</p><p>We also use a local RAG layer to solve the context rot problem before it starts. Instead of loading entire file histories into the context window we index the local directory and retrieve only the specific chunks needed for the current step.</p><p>Finally we enforce a strict local budget guard with a hard kill switch to prevent runaway loops.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;javascript&quot;,&quot;nodeId&quot;:&quot;71baad71-8670-4989-a99a-4de9df8f3fc5&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-javascript">class BudgetGuard {
    constructor() {
        this.maxLoops = 10
        this.maxSpendUSD = 2.50
    }

    check(state) {
        if (state.loopCount &gt; this.maxLoops) {
            throw new Error("Hard loop limit exceeded")
        }
        if (state.totalSpend &gt; this.maxSpendUSD) {
            throw new Error("Financial budget exceeded")
        }
    }
}</code></pre></div><p>If your agent does not have a maximum loop count and a strict token budget per task then your current architecture will reproduce the Uber billing crisis at your own scale.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;78f336e2-73d9-4dd0-8d89-1504fc967ebb&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">LOCAL FIRST AGENT ARCHITECTURE

LOCAL LAYER (Zero API Cost)
+-----------------------------------------------------------+
| Local Orchestration Loop running on MLX                   |
| Context Compression and Local RAG                         |
| Task Router evaluating complexity                         |
| Budget Guard and Kill Switch                              |
+-----------------------------+-----------------------------+
                              |
                              | Escalate ONLY when needed
                              v
CLOUD LAYER (Charged per Token)
+-----------------------------------------------------------+
| DeepSeek API for mid complexity reasoning                 |
| Frontier API for high stakes architectural decisions      |
+-----------------------------------------------------------+</code></pre></div><h2>Conclusion</h2><p>The year 2024 was about unmeasured adoption. The year 2025 was about scaling tools regardless of the price. The year 2026 is the reckoning when the bills finally arrived.</p><p>Per token prices fell 67 percent in a single year but enterprise bills tripled over the same period because the Jevons Paradox won.</p><p>Meta Claudeonomics leaderboard is a perfect warning of what happens when consumption is divorced from outcomes. Engineers behaved completely rationally by running idle agents to climb the leaderboard because the metric itself was irrational.</p><p>To survive the tokenpocalypse you must apply three strict architectural corrections.</p><h4>Control the Loop</h4><p>Orchestration belongs entirely at the edge. The cloud is the expensive escalation path and never the default.</p><h4>Route by Complexity</h4><p>The vast majority of your agent traffic does not require frontier models. Use local models and cost optimized APIs to handle the plumbing.</p><h4>Kill Runaway Loops</h4><p>Implement explicit loop limits and token budgets and cost aware kill switches directly into your orchestration logic.</p><p>The only free token is a local token. Every other token is a billing decision. Make those decisions consciously.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/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 BinaryBox! 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[I tested 5 Agent Observability Tools and they all Failed the Causality Test.]]></title><description><![CDATA[LangSmith, Arize Phoenix, Langfuse, LangGraph Studio, and GraphEvals + Neo4j with same scenario, same question: "Which context influenced this decision?" Only GraphEvals + Neo4j passed the test.]]></description><link>https://www.binarybox.org/p/i-tested-5-agent-observability-tools</link><guid isPermaLink="false">https://www.binarybox.org/p/i-tested-5-agent-observability-tools</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Mon, 18 May 2026 06:02:36 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!CqE_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CqE_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CqE_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg 424w, https://substackcdn.com/image/fetch/$s_!CqE_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg 848w, https://substackcdn.com/image/fetch/$s_!CqE_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!CqE_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CqE_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg" width="1303" height="656" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:656,&quot;width&quot;:1303,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:186809,&quot;alt&quot;:&quot;LangSmith vs Langfuse vs Arize Phoenix: LLM Observability in 2026 |  TURION.AI&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="LangSmith vs Langfuse vs Arize Phoenix: LLM Observability in 2026 |  TURION.AI" title="LangSmith vs Langfuse vs Arize Phoenix: LLM Observability in 2026 |  TURION.AI" srcset="https://substackcdn.com/image/fetch/$s_!CqE_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg 424w, https://substackcdn.com/image/fetch/$s_!CqE_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg 848w, https://substackcdn.com/image/fetch/$s_!CqE_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!CqE_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff78c0dc1-abb1-4888-82c0-0c745ac44dc7_1303x656.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Two weeks ago, I published <strong><a href="https://www.binarybox.org/p/why-flat-logs-cannot-debug-ai-agents">an article</a></strong> about how an AI agent system cost a company $240,000. One question kept coming up in the comments: &#8220;Which observability tool should we use to prevent this?&#8221;</p><p>So I tested them. All of them.</p><h4>The Test Scenario</h4><p>I built the same multi-agent system in five different environments</p><p><strong>Agent A (Router)</strong> loads historical Context X from cache<br><strong>Agent B (Researcher)</strong> fetches fresh Context Z<br><strong>Agent C (Decision Maker)</strong> makes final call using both contexts</p><p><strong>The bug: </strong>Context X is 14 days old (stale). Agent C uses outdated information to make a bad decision.</p><p><strong>The debug task: </strong>Start with Agent C&#8217;s bad decision. Find which context caused it and where it originated.</p><p>This is a <strong>causality question</strong>. Not &#8220;what happened when&#8221; (timeline). But &#8220;what caused what&#8221; (relationships).</p><p>I tested five tools, <strong><a href="https://www.binarybox.org/p/why-flat-logs-cannot-debug-ai-agents">GraphEvals + Neo4j</a></strong>,  <strong><a href="https://www.langchain.com/blog/langgraph-studio-the-first-agent-ide">LangGraph Studio</a></strong>, <strong><a href="https://smith.langchain.com/">LangSmith</a></strong>, <strong><a href="https://arize.com/phoenix/">Arize Phoenix</a></strong> and <strong><a href="https://langfuse.com/">Langfuse</a></strong>.</p><p>The results weren&#8217;t what the vendor demos showed.</p><h2>The Benchmark Result</h2><p>Here's what I found.</p><h4>LangGraph Studio</h4><p>LangGraph Studio is a local debugging UI that visualizes LangGraph execution as a Directed Acyclic Graph (DAG).</p><p>For a single trace, this tool is perfect.</p><p>I opened the trace in the browser, clicked through the nodes, saw Context X in the Decision Maker&#8217;s state, and traced it back to the Router.</p><p>Root cause time: <strong>15 minutes.</strong></p><p><strong>But here&#8217;s the trap.</strong></p><p>LangGraph Studio is a debugger, not a database. You cannot query across traces.</p><p>If you process 10,000 agent runs per day, you cannot ask: &#8220;How many decisions used context older than 7 days?&#8221;</p><p>You have to manually open each trace and click through the UI.</p><p><strong>Perfect for development. Useless for production observability at scale.</strong></p><h4>LangSmith</h4><p>LangSmith uses an <strong><a href="https://opentelemetry.io/">OpenTelemetry</a></strong> style span architecture with a waterfall timeline view.</p><p>To find the root cause, I had to:</p><ol><li><p>Open the trace and find the Decision Maker span</p></li><li><p>Expand the nested JSON payload</p></li><li><p>Find the context field and read the timestamp manually</p></li><li><p>Scroll up the timeline to find the Router span</p></li><li><p>Confirm where the context originated</p></li></ol><p><strong>Root cause time: 60-90 minutes of manual JSON archaeology.</strong></p><p>LangSmith shows you <strong>when</strong> things happened. It doesn&#8217;t show you <strong>why</strong>.</p><p>To find causality, you must manually parse data and calculate time deltas in your head. It has no topological query engine.</p><p>You can filter by keyword. You cannot query relationships between spans.</p><h4>Arize Phoenix</h4><p>Arize Phoenix markets &#8220;graph tracing&#8221; prominently. But it&#8217;s built on flat OTLP traces.</p><p>The debugging process was nearly identical to LangSmith</p><ul><li><p>Manually expand JSON payloads</p></li><li><p>Calculate timestamps to find stale context</p></li></ul><p><strong>Root cause time: ~60 minutes.</strong></p><p><strong>The &#8220;graph tracing&#8221; claim is marketing, not architecture.</strong></p><p>You can see parent-child relationships between spans. You cannot query the data flow topology.</p><p>Phoenix has better attribute filtering than LangSmith. But it still fails to answer the causality question without significant manual work.</p><h4>Langfuse</h4><p>Langfuse is functionally similar to LangSmith and Arize Phoenix. Timeline-based waterfall view.</p><p>The debugging process required the same manual JSON digging.</p><p><strong>Root cause time: 60+ minutes.</strong></p><p>This tool proves the divide is not between open-source and paid software.</p><p><strong>The divide is between flat logs and graph databases.</strong></p><p>Langfuse is good for tracking token counts and latency. It fails the causality test at scale.</p><h4>Graph Evals + Neo4j</h4><p>I built a custom instrumentation layer that writes every agent decision and context propagation directly into a Neo4j graph database.</p><p>When Agent C made the bad decision, I ran the below Cypher query</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;graphql&quot;,&quot;nodeId&quot;:&quot;4b7e293e-ba0e-47dc-8c14-4ad514a81c4a&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-graphql">MATCH (decision:Decision {id: 'decision_123'})
      -[:INFLUENCED_BY]-&gt;(context:Context)
WHERE context.age_days &gt; 7
RETURN context</code></pre></div><p>The result,<strong> Context X from Agent A, 14 days old. Returned in 2 seconds.</strong></p><p><strong>Root cause time: 40 minutes</strong> (including time to write the query and understand the graph topology).</p><p>This is the only tool that allows you to query causality at scale.</p><p>If you have 10,000 agent executions, you can find every decision influenced by stale context with one command.</p><p><strong>The trade-off: </strong>Requires building your own instrumentation and maintaining the database. Slowest for debugging a single trace, but the only one that scales to bulk analysis.</p><div><hr></div><p><strong>Quick Check:</strong> </p><p>If you use any of these tools, pull up your last agent debugging session. How long did it take to find which context caused the bad output?</p><p>If the answer is &gt; 30 minutes, <strong>you don&#8217;t have causality tracing.</strong></p><p><strong>You have manual log archaeology.</strong></p><h2>Why they failed?</h2><p>Four out of five tools failed the causality test. It comes down to the fundamental data model.</p><h4>Timeline Based Architecture (LangSmith, Phoenix, Langfuse)</h4><p>These tools model execution as <strong>spans</strong> - records of things that happened at specific times.</p><p>They show you a waterfall of boxes stacked vertically. Causality is buried in JSON metadata. Data flow is not a first-class relationship.</p><p>To find a pattern across 1,000 traces, you have to export the data and write a script to parse JSON.</p><p><strong>They record the &#8220;when,&#8221; not the &#8220;why.&#8221;</strong></p><h4>Graph Based Architecture (Neo4j, LangGraph Studio)</h4><p>Agents, decisions, and contexts are nodes. Relationships like <code>PROVIDED_CONTEXT</code> or <code>INFLUENCED_BY</code> are explicit edges.</p><p>This allows topological queries. You&#8217;re not parsing JSON. You&#8217;re querying the shape of execution.</p><p>This is the only way to find multi-hop context propagation at scale.</p><p><strong>The LangGraph Studio Trap</strong></p><p>LangGraph Studio <em>looks</em> like it solves the problem because it draws a graph.</p><p>But a graph UI is not a graph database.</p><p>Studio is a snapshot of one execution. Neo4j is a queryable history of all executions.</p><p><code>Beautiful graph UI &#8800; architectural capability.</code></p><p>You cannot query patterns across thousands of executions in Studio. You can only click through one trace at a time.</p><h2>Which one you should use?</h2><p>Your choice depends on your scale and debugging style.</p><h4>&lt; 100 traces/day &#8594; LangGraph Studio</h4><p>If you&#8217;re generating fewer than 100 traces per day, LangGraph Studio is the best choice.</p><p>Fast visual debugging. Zero custom instrumentation. You can accept manual work for occasional incidents because volume is low.</p><h4>100-1,000 traces/day &#8594; LangSmith or Arize Phoenix</h4><p>If you&#8217;re generating 100-1,000 traces per day, LangSmith or Phoenix are acceptable.</p><p>You get vendor support and standard LLM observability (token tracking, latency).</p><p>Accept that causality debugging will take 60 minutes of manual JSON digging per incident.</p><h4>&gt; 1,000 traces/day &#8594; GraphEvals + Neo4j</h4><p>If you&#8217;re generating more than 1,000 traces per day and need to find patterns in context propagation, build a custom Neo4j solution.</p><p>It&#8217;s the only option that lets you query causality paths across massive datasets in seconds.</p><p><strong>Trade-off:</strong> Higher maintenance burden for the ability to understand why your agents are failing.</p><h2>The lesson learned</h2><p>I didn't set out to prove Neo4j was the best tool. I set out to find which tool could answer the causality question.</p><p>The testing revealed a brutal truth</p><h4>Pretty UIs &#8800; architectural capability.</h4><ul><li><p>LangSmith has a beautiful timeline. Still requires manual archaeology.</p></li><li><p>Arize Phoenix has impressive graphics. Still flat spans underneath.</p></li><li><p>LangGraph Studio is perfect for one trace. Cannot query at scale.</p></li></ul><p><strong>The divide: </strong>Timeline architecture (records "when") vs Graph architecture (records "what caused what").</p><p>If you&#8217;re building complex multi-agent systems, you probably need graph observability.</p><p>But today, the only way to get true graph observability at scale is to build it yourself using Neo4j.</p><div><hr></div><h2>Conclusion</h2><p>Every vendor demo showed me beautiful waterfalls and pretty arrows.</p><p>None showed me how long it takes to answer: &#8220;Which context influenced this decision?&#8221;</p><h4>The Causality Test Results</h4><p><strong>LangSmith</strong></p><ul><li><p>Single trace: 60-90 minutes (manual JSON digging)</p></li><li><p>Bulk queries: Export + script required</p></li><li><p>Verdict: Timeline tool &#10060;</p></li></ul><p><strong>Arize Phoenix</strong></p><ul><li><p>Single trace: 60 minutes (flat span inspection)</p></li><li><p>Bulk queries: Export + script required</p></li><li><p>Verdict: "Graph tracing" is marketing &#10060;</p></li></ul><p><strong>Langfuse</strong></p><ul><li><p>Single trace: 60-90 minutes (timeline analysis)</p></li><li><p>Bulk queries: Export + script required</p></li><li><p>Verdict: Open-source timeline tool &#10060;</p></li></ul><p><strong>LangGraph Studio</strong></p><ul><li><p>Single trace: 15 minutes (visual debugging) &#9989;</p></li><li><p>Bulk queries: No query language</p></li><li><p>Verdict: Debugger, not database &#9888;&#65039;</p></li></ul><p><strong>GraphEvals + Neo4j</strong></p><ul><li><p>Single trace: 40 minutes (slower)</p></li><li><p>Bulk queries: &lt;5 seconds &#9989;</p></li><li><p>Verdict: Only option that scales &#9989;</p></li></ul><p>Beautiful timelines &#8800; causality tracing.</p><p>"Graph" in marketing &#8800; graph database underneath.</p><p>Open Source &#8800; better architecture.</p><p><strong>Before you buy or build, ask the causality question:</strong></p><p>"Show me every decision influenced by context older than 7 days that bypassed the researcher node."</p><p>If the answer is &#8220;export the data and write a script,&#8221; you don&#8217;t have observability.</p><p><strong>You have expensive logs with a nice dashboard.</strong></p><p>If your agents process &lt;100 traces/day, use LangGraph Studio.</p><p>If you need to query thousands of traces, build a custom graph solution.</p><p>Everything else is a timeline tool with varying degrees of polish.</p><p>I tested the tools so you don't have to.</p><p>The one that passes the causality test is the one you have to build yourself.</p><p>For now.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/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 BinaryBox! 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><p></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Why LinkedIn is leaving Kafka and Why you should not be worried.]]></title><description><![CDATA[The question you should be asking is simple. If LinkedIn outgrew Kafka at 32 trillion events and you are at 10 million do you actually need Kafka.]]></description><link>https://www.binarybox.org/p/why-linkedin-is-leaving-kafka-and</link><guid isPermaLink="false">https://www.binarybox.org/p/why-linkedin-is-leaving-kafka-and</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Sat, 16 May 2026 06:01:19 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!NDM_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NDM_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NDM_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg 424w, https://substackcdn.com/image/fetch/$s_!NDM_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg 848w, https://substackcdn.com/image/fetch/$s_!NDM_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!NDM_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NDM_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg" width="1496" height="700" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:700,&quot;width&quot;:1496,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:337890,&quot;alt&quot;:&quot;Getting Started with Landoop's Kafka on Docker Locally | Jamie Bowman&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Getting Started with Landoop's Kafka on Docker Locally | Jamie Bowman" title="Getting Started with Landoop's Kafka on Docker Locally | Jamie Bowman" srcset="https://substackcdn.com/image/fetch/$s_!NDM_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg 424w, https://substackcdn.com/image/fetch/$s_!NDM_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg 848w, https://substackcdn.com/image/fetch/$s_!NDM_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!NDM_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fab071b27-b7cd-4952-98dc-9ffdd889c7a7_1496x700.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>For the last decade engineering teams made a pilgrimage to Kafka. You deployed it because LinkedIn built it. You assumed that if it was good enough for a company processing billions of events it was certainly good enough for you. You set up your five node cluster with a ZooKeeper ensemble and configured your producer for idempotent writes. You spent three months getting it production ready.</p><p>Your team processes roughly 10 million events per day. LinkedIn operates at 32 trillion events per day in 2026.</p><p>The gap is staggering. You are processing 3.2 million times less than the scale where LinkedIn finally hit the ceiling. And here is the kicker. LinkedIn is moving off Kafka. They built <strong><a href="https://www.linkedin.com/blog/engineering/infrastructure/introducing-northguard-and-xinfra">Northguard and Xinfra</a></strong> to replace it.</p><p>The question you should be asking is simple. If LinkedIn outgrew Kafka at 32 trillion events and you are at 10 million do you actually need Kafka. Or did you cargo cult their infrastructure without understanding the scale that made it necessary.</p><p>The story of LinkedIn replacing Kafka is not a signal that Kafka is dead. It is a lesson in understanding scale. Kafka <strong>scaled</strong> <strong>23,000x</strong> before LinkedIn needed something else. You are running <strong>140x smaller</strong> than where they started in 2011. Let us talk about what actually broke at their scale and why you probably do not have that problem.</p><h2>What broke Kafka at LinkedIn scale?</h2><p>We need to look at the architectural limits of centralized coordination to understand the failure. </p><h4>The problem of Centralized Metadata</h4><p>Kafka relies on a single controller node to manage all partition metadata. The controller handles partition leader elections and replica assignments and metadata updates across every broker. </p><p>At your scale of <strong>100 topics</strong> this works perfectly. At the LinkedIn scale of <strong>400,000 topics</strong> and millions of partitions the controller becomes a catastrophic bottleneck. </p><p>When the controller fails a new leader election must occur via the <strong><a href="https://kafka.apache.org/41/operations/kraft/">KRaft</a></strong> quorum. The new controller must load every single piece of partition metadata into memory and rebuild the state. At the scale of 32 trillion events this reconstruction takes minutes. </p><p>And during that time the infrastructure is essentially frozen. No new topics can be created and no partitions can rebalance. </p><p>Centralized metadata management eventually hits a physical ceiling.</p><h4>The problem of Infra wide Rebalancing</h4><p>When a consumer group rebalances Kafka pauses consumption for the affected partitions. </p><p>At small scale this takes seconds. At LinkedIn scale rebalancing touches millions of partitions across thousands of topics simultaneously. </p><p>This causes infrastructure wide pauses that last for minutes. Even cooperative rebalancing cannot solve this when the sheer number of partitions creates a coordination explosion. </p><p>Consumer lag spikes and downstream systems experience massive latency increases during these coordinated events.</p><h4>The problem of Fixed Partition</h4><p>In Kafka you choose your partition count upfront. If you choose too few you hit a throughput wall. If you choose too many you waste resources. </p><p>As your data grows you cannot dynamically split a partition without downtime. </p><p>For a company with 400,000 topics repartitioning is operationally impossible. It requires stopping producers and migrating data and updating consumers across thousands of applications.</p><h4>The problem of Coordination</h4><p>The metadata storage for millions of partitions reaches gigabytes in size. Every producer and consumer reads this partition metadata on startup. Metadata updates generate massive broadcast traffic across the cluster. </p><p>Coordination mechanisms like ZooKeeper or KRaft eventually hit a physical limit of how much state they can broadcast to every broker in a timely manner.</p><p>Calculate this right now. </p><p>Divide 32 trillion by your daily event volume. If the result is greater than 1 million you are a million times smaller than the scale where these problems appear. </p><p>You do not have a Kafka problem. You have a scale perception problem.</p><h2>How Northguard solves the scale problem?</h2><p>Northguard replaces Kafka with a fundamentally different model designed for the frontier of distributed systems. It uses sharded metadata and range based partitioning and self balancing clusters.</p><h4>Sharded Metadata</h4><p>Instead of a single controller Northguard distributes metadata across vnodes using consistent hashing. Each vnode manages a subset of topics and uses Raft consensus for strong consistency. This removes the single point of coordination.</p><p>If your metadata fits comfortably in a single KRaft quorum you do not need this. LinkedIn needed it because their metadata exceeded the capacity of any single node memory.</p><h4>Range Based Partitioning</h4><p>Instead of fixed partitions Northguard uses ranges. A range is a contiguous slice of the keyspace that can dynamically split or merge without downtime. When a range grows too large it is marked for splitting and child ranges take over the future writes while the old range is sealed.</p><p>If you can estimate your partition count upfront you do not need this complexity. Fixed partitions are simpler to manage until you hit the 400,000 topic mark.</p><h4>Self Balancing Clusters</h4><p>In Northguard new segments are automatically assigned to the least loaded brokers. There is no explicit rebalancing operation required. If a broker fails the existing segments remain and new ones simply go to healthy nodes.</p><p>If your Kafka cluster only rebalances once per quarter then rebalancing is not your bottleneck. LinkedIn needed this because they add brokers and manage 150 clusters constantly. For them manual rebalancing was a full time operational tax.</p><h2>Do you actually need Kafka?</h2><p>We need to use a strict framework based on actual event volume to decide if Kafka really belongs in your stack.</p><p>If you process <strong>less than 10 million events per day</strong> you probably do not need Kafka. <strong><a href="https://redis.io/docs/latest/develop/data-types/streams/">Redis Streams</a></strong> or <strong><a href="https://aws.amazon.com/sqs/">SQS</a></strong> or even <strong><a href="https://www.postgresql.org/docs/current/sql-notify.html">Postgres NOTIFY</a></strong> will work with significantly less operational overhead.</p><p>If you process between 10 million and 100 million events per day managed Kafka like <strong><a href="https://aws.amazon.com/msk/">AWS MSK</a></strong> makes sense. The volume justifies the tool but not the team required to self host it.</p><p>You only hit the scale where self hosted Kafka is justified when you cross 100 million events per day. You only hit the LinkedIn 2011 scale at 1.4 billion events.</p><p>Ask yourself these three questions.</p><ol><li><p>Do you actually need per partition ordering guarantees. If not use SQS.</p></li><li><p>Do you need event replay for backfilling new services. If not use a standard message queue.</p></li><li><p>Do you need exactly once semantics for financial transactions. If yes then Kafka is the right tool.</p></li></ol><p>If you are choosing Kafka because everyone uses it you are cargo culting. Kafka is phenomenal for high throughput event streaming but it comes with a massive operational tax.</p><h2>How LinkedIn migrated?</h2><p>There is a deeper lesson to learn from how LinkedIn migrated away from Kafka. </p><p>They built Xinfra which is a virtualized Pub/Sub layer that abstracts the physical clusters.</p><p>This allowed them to migrate topics from Kafka to Northguard without rewriting their application code. They used a dual write mechanism to ensure zero downtime. This is what mature platform engineering looks like.</p><p>The lesson is not that you should deploy Northguard. The lesson is that you should abstract your infrastructure. Do not let your applications call Kafka APIs directly. Wrap them in an internal library. If you ever outgrow your current tool you will be able to switch without rewriting every service in your company.</p><div><hr></div><h2>Conclusion</h2><p>LinkedIn built Kafka in 2011 because they had a problem that no existing tool could solve at 1.4 billion events. </p><p>They outgrew Kafka at 32 trillion events and built Northguard.</p><p>You are at 10 million events per day. You are 140 times smaller than LinkedIn was when they started with Kafka. You are 3.2 million times smaller than the scale where Kafka breaks.</p><p>Do not choose infrastructure based on who uses it. </p><p>Choose based on what problem you are solving and what scale you are operating at.</p><p>Kafka scaled 23,000 times before LinkedIn needed something else. You will never outgrow Kafka. But you might be wasting forty percent of your platform team&#8217;s time managing a supercomputer when you only need a simple queue.</p><p>LinkedIn built Kafka. LinkedIn outgrew Kafka. You never will. Choose your stack accordingly.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/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 BinaryBox! 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><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[I benchmarked 5 Languages in Kubernetes and here is what your stack actually costs.]]></title><description><![CDATA[Last month I was called into a war room for a high growth fintech client.]]></description><link>https://www.binarybox.org/p/i-benchmarked-5-languages-in-kubernetes</link><guid isPermaLink="false">https://www.binarybox.org/p/i-benchmarked-5-languages-in-kubernetes</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Thu, 07 May 2026 06:01:14 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ib5Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ib5Z!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ib5Z!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png 424w, https://substackcdn.com/image/fetch/$s_!ib5Z!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png 848w, https://substackcdn.com/image/fetch/$s_!ib5Z!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png 1272w, https://substackcdn.com/image/fetch/$s_!ib5Z!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ib5Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png" width="1400" height="788" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:788,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:288361,&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://www.binarybox.org/i/196680455?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.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_!ib5Z!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png 424w, https://substackcdn.com/image/fetch/$s_!ib5Z!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png 848w, https://substackcdn.com/image/fetch/$s_!ib5Z!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png 1272w, https://substackcdn.com/image/fetch/$s_!ib5Z!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1abc728c-76ed-421a-808d-d91d21127f6a_1400x788.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Last month I was called into a war room for a high growth fintech client. They were running fifty microservices across five different engineering teams. Like many modern organizations they had no language mandate. Each team chose the tool they knew best. </p><p>The checkout team used Node.js. The inventory team used C#. The payments team used Java. The recommendations team used Python. The platform team used Go.</p><p>Everything worked perfectly until their first major promotional event.</p><p>When the traffic hit 180,000 requests per second the Go and Node.js services scaled in seconds. But the payments and recommendations services stayed in a pending state for nearly a minute. </p><p>The checkout requests were succeeding but they were hitting a wall of timeouts from the downstream inventory and payment services. From the perspective of the user the app was dead.</p><p>The CFO asked me why they were paying millions in AWS bills for a system that still crashed under load. I spent forty eight hours benchmarking their exact infrastructure to find the answer. We found that language choice is not a developer preference. It is a physical infrastructure variable with a massive price tag.</p><h2>The Environment</h2><p>I have executed this benchmark in a standard <strong>Kubernetes cluster on AWS</strong>. Every service was tested using the same traffic pattern reaching <strong>180,000 requests per second</strong>. We used <strong>c7g.xlarge</strong> instances powered by Graviton processors. </p><p>We measured image pull times through a 100 Mbps network bottleneck to simulate real world regional data center congestion.</p><p>We must look at the raw data across all five environments to understand the financial impact.</p><h3>Go with Fiber</h3><ul><li><p>Image Size: <code>24MB</code></p></li><li><p>Image Pull Time: <code>1.2 seconds</code></p></li><li><p>Memory per pod (Idle): <code>8MB</code></p></li><li><p>Pod count on peak load: <code>12</code></p></li><li><p>Cost per month: <code>$631 USD</code></p></li></ul><h3>NodeJs with Fastify</h3><ul><li><p>Image Size: <code>80MB</code></p></li><li><p>Image Pull Time: <code>2.5 seconds</code></p></li><li><p>Memory per pod (Idle): <code>45MB</code></p></li><li><p>Pod count on peak load: <code>15</code></p></li><li><p>Cost per month: <code>$788 USD</code></p></li></ul><h3>C# with ASP.NET Core</h3><ul><li><p>Image Size: <code>250MB</code></p></li><li><p>Image Pull Time: <code>8.7 seconds</code></p></li><li><p>Memory per pod (Idle): <code>95MB</code></p></li><li><p>Pod count on peak load): <code>18</code></p></li><li><p>Cost per month: <code>$946 USD</code></p></li></ul><h3>Java with Spring Boot</h3><ul><li><p>Image Size: <code>180MB</code></p></li><li><p>Image Pull Time: <code>5.8 seconds</code></p></li><li><p>Memory per pod (Idle): <code>120MB</code></p></li><li><p>Pod count on peak load): <code>22</code></p></li><li><p>Cost per month: <code>$1,157 USD</code></p></li></ul><h3>Python with FastAPI</h3><ul><li><p>Image Size: <code>300MB</code></p></li><li><p>Image Pull Time: <code>10.2 seconds</code></p></li><li><p>Memory per pod (Idle): <code>85MB</code></p></li><li><p>Pod count on peak load): <code>35</code></p></li><li><p>Cost per month: <code>$1,840 USD</code></p></li></ul><h2>The HPA Bottleneck</h2><p>Why container image size is a first order variable for reliability? When the Horizontal Pod Autoscaler or HPA triggers a scale event it creates a series of physical hardware demands.</p><p>The first demand is network I/O. Your container registry has a bandwidth limit. Your Kubernetes node has a network interface limit. A 300MB Python image is not just a little larger than a 24MB Go image. It is twelve times larger.</p><p>The second demand is disk I/O. Once the image is pulled the container runtime must extract the layers. A 300MB compressed Python image often unpacks to 800MB of data on the disk. This extraction is a serial process that is heavily CPU and I/O bound.</p><p>Look at the math of a traffic spike.</p><ul><li><p>If your traffic doubles in 30 seconds and your Go pods take 2 seconds to become ready you can catch the load.</p></li><li><p>If your Python pods take 10.2 seconds to pull plus 4 seconds to start the interpreter you have a 14 second gap where you are dropping requests.</p></li><li><p>By the time the Python pods are ready the existing pods have already crashed from CPU saturation. This is the Cold Start Death Spiral.</p></li></ul><h2>The Garbage Collection cost</h2><p>We must look deeper than raw compute to see the actual cost of running these languages at scale. The most hidden expense in a Kubernetes cluster is the cost of Garbage Collection.</p><p>In a managed runtime like Java or Node.js the system must periodically pause execution to clean up unused memory. This is the Stop The World event. I found that as the request rate increases the volume of temporary objects created on the heap explodes.</p><p>In the Java Spring Boot service the Garbage Collector consumed twenty percent of the total CPU cycles during peak load. This means you are paying for five pods just to run the cleaning service for the other twenty. </p><p>Furthermore these pauses create massive spikes in tail latency. When the collector triggers every active request in that pod is paused. Your ninety ninth percentile latency is dictated by the memory cleaner and not your code</p><p>Go avoids this through a different physical strategy. It uses a concurrent mark and sweep collector designed for low latency. The pauses are measured in microseconds and not milliseconds. This allow Go to maintain a flat latency profile even as you approach the physical limits of the CPU.</p><h2>The Database connections</h2><p>I discovered a hidden cost that most architects completely miss, the ceiling of connection pool.</p><p>Our benchmark showed that C# opened 450 database connections at peak load. Go opened only 180 connections. This is not just a performance detail. It is a hard infrastructure limit.</p><p>A standard AWS RDS <strong>db.t3.medium</strong> instance caps at <strong>420 connections</strong>. If you run the C# stack and scale to 50 pods you will hit the <code>max_connections</code> limit of your database. </p><p>New pods will fail to connect and they will fail their health checks. The HPA will keep trying to scale but the database will refuse the traffic.</p><p>To fix this with C# you are forced to upgrade to a <strong>db.r5.large</strong> instance. That upgrade costs $438 USD more per month. You are paying a 150 percent premium for your database just because your language has inefficient connection management. Go handles the exact same load on the cheaper instance with 43 percent of the connection limit remaining.</p><h2>The full economic model</h2><p>Let&#8217;s evaluate the total annual cost of ownership for a sustained workload of 180,000 requests per second.</p><p>Annual cost for each language</p><ul><li><p>Go: <code>$7,572 USD</code></p></li><li><p>NodeJs: <code>$9,456 USD</code></p></li><li><p>Java: <code>$13,884 USD</code></p></li><li><p>Python: <code>$22,080 USD</code></p></li></ul><p>Python costs <code>$14,508 USD</code> more per year than Go to run the exact same workload. When you factor in the forced database upgrades and the registry bandwidth charges the delta grows to over <code>$20,000 USD</code> per microservice. </p><p>If you have 50 microservices you are paying a 1 million dollar annual cost for your language choices.</p><p>Now, let&#8217;s evaluate these findings against the reality of developer productivity.</p><p>On one hand we see that Go is the undisputed king of infrastructure economics. It is the only language designed for the physical constraints of a containerized world. It ignores the legacy of heavy runtimes and focuses purely on memory bandwidth and binary size.</p><p>On the other hand we must acknowledge the hiring market. Finding ten expert Go engineers is significantly harder than finding ten Python or Java developers. We must analyze if the <code>$14,000 USD</code> savings per year is worth the <code>$50,000 USD</code> difference in senior engineering salaries.</p><p>However for high scale startups and enterprise gateways the math is clear. You can buy a lot of senior engineering time for 1 million dollars in annual cloud savings.</p><div><hr></div><h2>Conclusion</h2><p>After analyzing the image pull physics the connection pool ceilings and the annual compute deltas we reach a definitive conclusion.</p><p>Stop choosing languages based on what is popular on social media. You must start choosing based on the cost per million requests.</p><p>If your workload has spiky traffic and you run in Kubernetes you should use Go or Node.js. The fast scale up times will prevent outages that cost far more than your cloud bill.</p><p>If you are a banking or enterprise shop that requires Java or C# then you must budget for a 50 percent infrastructure premium. You must also over provision your databases to handle the connection bloat.</p><p>If for some reason using Python is the only choice you have, be prepare for that 300% infrastructure cost to handle the spiked traffic.</p><p>Your language choice has a monthly price tag. It is a line item on your AWS bill. </p><p>Choose accordingly.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/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 BinaryBox! 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><p></p>]]></content:encoded></item><item><title><![CDATA[Why Flat Logs cannot Debug AI Agents?]]></title><description><![CDATA[The $240,000 order was not a failure of the language model, prompt engineering or not even the multi agent architecture itself. It was a catastrophic failure of enterprise observability.]]></description><link>https://www.binarybox.org/p/why-flat-logs-cannot-debug-ai-agents</link><guid isPermaLink="false">https://www.binarybox.org/p/why-flat-logs-cannot-debug-ai-agents</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Mon, 04 May 2026 06:01:42 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!44JZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!44JZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!44JZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg 424w, https://substackcdn.com/image/fetch/$s_!44JZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg 848w, https://substackcdn.com/image/fetch/$s_!44JZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!44JZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!44JZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg" width="2560" height="1536" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1536,&quot;width&quot;:2560,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:142224,&quot;alt&quot;:&quot;Building a LangGraph Agent from Scratch | Towards Data Science&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Building a LangGraph Agent from Scratch | Towards Data Science" title="Building a LangGraph Agent from Scratch | Towards Data Science" srcset="https://substackcdn.com/image/fetch/$s_!44JZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg 424w, https://substackcdn.com/image/fetch/$s_!44JZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg 848w, https://substackcdn.com/image/fetch/$s_!44JZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!44JZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F75f2c2ae-9ddf-4514-9969-384b84acfe7b_2560x1536.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A few weeks ago, an incident at one my manufacturing client cost a quarter of a million dollars.</p><p>They have deployed 7 AI Agents, they have tested thoroughly before pushing it to production. Their explicit job was to manage the bill of materials and keep inventory aligned and place orders automatically. There was no human in the loop. That was the entire point of the architecture.</p><p>One Tuesday morning the automated procurement agent placed a purchase order for 500 gallons of industrial solvent. It ordered the completely wrong chemical type. The final cost included the wasted material and the specialized hazardous disposal fees and the massive production delays. </p><p>The total financial damage was $240,000.</p><p>The engineering team immediately pulled the production logs to find the bug. They exported 38,000 lines of flat JSON. They had every tool you would expect from a modern and well instrumented system. They had beautiful LangSmith traces. They had OpenTelemetry spans. They had deeply structured logging.</p><p>It took the team 90 hours to find the root cause. Five senior engineers spent three full days running grep commands through logs and manually diffing prompt versions. They desperately tried to reconstruct which piece of context from which specific agent led to this catastrophic financial decision.</p><p>The revelation hit them on day three. The problem was not an LLM hallucination. It was not a bad prompt design. It was not even a traditional software bug.</p><p>The problem was that Agent 2 passed stale context to Agent 5. Agent 5 then used that outdated context to inform a material decision which triggered Agent 7 to execute the final purchase order.</p><p>The observability tools could easily show what happened. They showed the exact purchase order. The tools could show when it happened by matching the timestamp in the logs. But the tools completely failed to show why it happened. They could not expose the causal chain of context propagation across multiple independent agents.</p><p>This is the story of why flat logs cannot debug graph problems. Every engineering team deploying multi agent systems is about to learn this lesson the hard way.</p><h2>Flat logs and Graph Decisions</h2><p>Let&#8217;s analyze why traditional observability breaks down the moment you introduce autonomous agents into a production environment.</p><p>If you build distributed systems you already know the standard playbook. You use structured logging for individual events. You use distributed tracing like OpenTelemetry for request flows. You use observability platforms like Datadog or LangSmith for visualization.</p><p>This playbook works beautifully for microservices. An HTTP request flows predictably through Service A then Service B then Service C. The trace is entirely linear. The causality is strictly sequential.</p><p>Agents do not think linearly. They branch when inventory falls below a threshold and they delegate tasks to specialized peers. They retry failed tool calls with modified context. They loop back to reevaluate decisions based on updated state.</p><h3><strong>The Raw Telemetry Comparison</strong></h3><p>Look at the standard flat log output you see in a terminal.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;4cb0c64d-52ee-4be7-a646-159c4bbac878&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">[09.18.32] agent=bom_reader action=fetch_spec file=spec_v2.json // Bad spec file
[09.22.47] agent=procurement action=query_supplier target=ABC_Corp
[09.23.41] agent=procurement action=place_order qty=500</code></pre></div><p>You can see exactly what happened but you cannot see why. </p><p>Now look at the graph reality represented as a linked structure.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;ad26156d-b61b-43c1-bde7-9aa34aebcb98&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">(Context file="spec_v2.json" state="STALE")
  -[PROVIDED_CONTEXT]-&gt; (Decision action="Select Supplier")
    -[TRIGGERED]-&gt; (ToolCall action="place_order" qty=500 state="FLAGGED")</code></pre></div><p>Causality is completely visible.</p><p>Look closely at what each data structure physically records to see the exact difference.</p><p>When you look at the flat logs you see isolated events attached to timestamps. As humans reading a simple three line example we assume the first event caused the second event simply because they happened sequentially. However in a real production environment there might be thousands of other logs recorded between those two timestamps by dozens of different agents. The flat log provides absolutely no structural proof that the specific file fetched at <code>09.18</code> was the exact data used to place the order at <code>09.23</code>. It only tells you when things happened. You are forced to guess the relationship based on chronological proximity.</p><p>Now look at the graph model. The graph does not rely on guessing based on time. It uses explicit structural edges to link data together. The edge labeled <code>PROVIDED_CONTEXT</code> is a literal database relationship tying the specific stale JSON file directly to the decision node. The edge labeled <code>TRIGGERED</code> physically links that exact decision to the final tool call.</p><p>Flat logs force you to guess causality based on time. The graph provides true causality because it explicitly records the relationships between inputs decisions and outputs as permanent physical links in the database. You do not have to guess what caused the bad order because the graph draws a direct line straight to the stale context file.</p><p>LangSmith gives you beautiful traces. But those traces are trees not graphs. They show parent child relationships indicating which agent called which tool. They do not show causality indicating which specific context payload influenced which downstream decision.</p><p>Quick check. If your agent made a bad decision right now could you instantly trace which exact context file influenced it. If your honest answer is that you would have to grep the logs and reconstruct the timeline manually then you have a severe graph problem.</p><p>Without causality tracing your investigation reality is brutal. You pull 38,000 lines of logs. You search for the order SKU. You find the decision that triggered it. You manually trace backwards to see which tool calls preceded the order. You diff the prompt versions to see if Agent 5 received the correct instructions. You hunt down the context sources to see where the specification came from. Eventually you discover that Agent 2 used a cached file from three weeks ago. You reconstruct this entire propagation path manually over 90 hours.</p><p>Agents make decisions in a complex graph structure. Observability tools built for linear sequences can never show you the why.</p><h2>The solution (Thinking in Graph)</h2><p>We evaluate this monitoring failure and reach a clear architectural mandate. </p><p>You must stop treating agent traces as chronological logs and must start treating them as graphs.</p><p>This requires a fundamental mental shift. Every agent decision is a node in a graph. Every handoff between agents is an edge connecting those nodes. Every piece of context is a property living on those nodes.</p><p>We need to define a strict data model to capture this reality.</p><h3><strong>Nodes</strong></h3><ul><li><p><strong>AgentRun</strong> containing id and agentName and model and startedAt</p></li><li><p><strong>Decision</strong> containing id and reasoning and confidence and timestamp</p></li><li><p><strong>ToolCall</strong> containing toolName and input and output and duration</p></li><li><p><strong>Context</strong> containing source and contentHash and retrievedAt and stale status</p></li></ul><h3>Edges</h3><ul><li><p><strong>MADE</strong> a decision </p></li><li><p><strong>TRIGGERED</strong> a tool call</p></li><li><p><strong>DELEGATED_TO</strong> other Agent (Node)</p></li><li><p><strong>PROVIDED_CONTEXT</strong> to a Decision or Agent</p></li></ul><h3>Flow</h3><ul><li><p>AgentRun &#8594; MADE &#8594; Decision</p></li><li><p>Decision &#8594; TRIGGERED &#8594; ToolCall</p></li><li><p>Decision &#8594; DELEGATED_TO &#8594; AgentRun</p></li><li><p>Context PROVIDED_CONTEXT Decision</p></li></ul><h3>The Decision Graph</h3><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;317c6260-5ad3-44b2-b9c6-37775c638870&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">AgentRun(#BOM-7)
&#9500;&#9472; Decision (Retrieve BOM)
&#9474;   &#9492;&#9472; Context (spec_v2.json) &#8592; STALE
&#9474;
&#9500;&#9472; Decision (Select Supplier)
&#9474;   &#9500;&#9472; PROVIDED_CONTEXT &#8592; Context (bad_spec_v2.json)
&#9474;   &#9492;&#9472; TRIGGERED &#8594; ToolCall (query_supplier)
&#9474;
&#9492;&#9472; Decision (Place Order) &#8592; FLAGGED
    &#9492;&#9472; TRIGGERED &#8594; ToolCall (place_order qty 500)</code></pre></div><p>You need a database that stores decisions as they happen through streaming ingestion. You need a system that lets you query causality directly to show every decision influenced by a specific stale context. You need a platform that visualizes the decision graph natively and supports deep pattern matching. Neo4j handles all four of these requirements perfectly.</p><p>You would not debug a distributed microservice system with a basic tail command. Why are you debugging multi agent systems with grep.</p><p>Here is the ingestion pattern you need to implement. We use Cypher to write the trace data directly into Neo4j.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;graphql&quot;,&quot;nodeId&quot;:&quot;a08600d7-095c-40f4-bee3-ce9a6626a65f&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-graphql">MERGE (run:AgentRun {id: $run_id})
CREATE (d:Decision)
SET d += $props
MERGE (run)-[:MADE]-&gt;(d)
WITH d
FOREACH (ctx IN $contexts |
    MERGE (c:Context {source: ctx.source})
    SET c += ctx
    MERGE (c)-[:PROVIDED_CONTEXT]-&gt;(d)
)</code></pre></div><p>We make specific design decisions here. We use <code>MERGE</code> instead of <code>CREATE</code> for the runs and contexts so reingesting a trace does not duplicate data. We ingest at decision time rather than batching at the end of the run. We keep the tool output as raw JSON because Cypher can query nested JSON directly using dot notation.</p><p>When the incident occurred we did not grep the logs. We ran the following Cypher query to find the root cause.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;graphql&quot;,&quot;nodeId&quot;:&quot;01cdc32c-943f-48f8-a282-237534e96f9d&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-graphql">MATCH 
  (run:AgentRun)-[:MADE]-&gt;(d:Decision)-[:TRIGGERED]-&gt;(tc:ToolCall)
WHERE tc.tool_name = 'place_order'
  AND tc.output.quantity &gt; 100
  AND tc.output.verified = false
MATCH
  (d)&lt;-[:PROVIDED_CONTEXT]-(ctx:Context)
WHERE ctx.stale = true
RETURN
  run.id, d.reasoning, ctx.source, tc.output
ORDER BY tc.timestamp</code></pre></div><p>This query immediately returned the exact run ID and the flawed reasoning and the exact stale context file that caused the purchase. We went from a massive production incident to a verified root cause in 40 minutes.</p><p>The problem was never that we could not log the decision. The problem was that we could not query the causality. Logs are great for recording what happened. Graphs are absolutely necessary for understanding why it happened.</p><h2>Graph Evals Assertions as Cypher Queries</h2><p>We evaluate how this changes our testing strategy. Traditional evaluations check basic outputs. They ask if the LLM called the right tool or if the output was valid JSON. This is essentially a basic unit test on a <code>ToolCall</code> node.</p><p>Graph evaluations completely change this paradigm. They check systemic causality. They ask if any stale context influenced a high value order. They ask if a flagged decision propagated to downstream agents.</p><h3>Graph Eval Query Pattern</h3><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;graphql&quot;,&quot;nodeId&quot;:&quot;0aabc85c-e61b-4251-b8d2-ee51eaba4749&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-graphql">MATCH
  (Context)-[:PROVIDED_CONTEXT]-&gt;(Decision)-[:TRIGGERED]-&gt;(ToolCall)
WHERE
  Context.stale = true
  AND ToolCall.tool_name =~ '.*order.*'</code></pre></div><p><em>Pattern matching makes assertions declarative rather than procedural.</em></p><p>Take this first example of a Stale Context Check. We want to catch any order where the context source was flagged as stale. We write an assertion as a graph traversal.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;graphql&quot;,&quot;nodeId&quot;:&quot;75abbb9e-aaf5-4c8f-9145-23d6ee0ad7e1&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-graphql">MATCH 
  (c:Context)-[:PROVIDED_CONTEXT]-&gt;(d:Decision)-[:TRIGGERED]-&gt;(tc:ToolCall)
WHERE c.stale = true
  AND tc.tool_name =~ '.*order.*'
RETURN c.source, d.reasoning, tc.output.quantity
ORDER BY tc.output.quantity DESC</code></pre></div><p>This single query catches any order placed based on outdated specifications or cached inventory data or old supplier information.</p><p>Take a second example of checking for <strong>Multi Agent Context Drift</strong>. We want to surface cross agent contamination where a bad decision infects the rest of the cluster.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;graphql&quot;,&quot;nodeId&quot;:&quot;b082cbbe-782e-4d35-8dee-0251d63acd86&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-graphql">MATCH path = (r1:AgentRun)-[:MADE*1..4]-&gt;(d:Decision)-[:DELEGATED_TO]-&gt;(r2:AgentRun)
WHERE ANY(n IN nodes(path) WHERE n.flagged = true)
RETURN r1.agent_name, r2.agent_name, length(path) AS chain_depth</code></pre></div><p>This query catches the exact moment Agent A makes a flagged decision and delegates the flawed state to Agent B which then poisons Agent C. You see the entire contamination chain instantly.</p><p>How many of your evaluations check basic outputs versus checking deep causality. If you are only checking whether the agent called the right tool you are completely missing the systemic failure mode that costs a quarter of a million dollars.</p><p>Evaluations at the individual call level miss the system level failure mode. A correct tool call executed with the wrong context still produces a catastrophic outcome. Graph evaluations let you assert on context propagation instead of just verifying local decisions.</p><h2>Before and After Timeline</h2><p>We quantify exactly what changed when we shifted our observability architecture.</p><h3>Before</h3><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;1b6a3514-e04f-46a6-a1c6-e2fd4c366189&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Day 1 Pull massive logs and grep for the SKU
Day 2 Manually trace the context across seven agents
Day 3 Finally locate the root cause file</code></pre></div><p>Before we implemented graph evaluations our root cause time was 72 hours. We required five senior engineers on the incident. We had absolutely no visibility into context flow and relied entirely on manual reconstruction. We tracked prompt versions through pure guesswork by diffing files across agents. Our confidence in the final fix was incredibly low because we could not mathematically verify the propagation paths.</p><h3>After</h3><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;plaintext&quot;,&quot;nodeId&quot;:&quot;23328970-77d4-4cc2-b534-eb7d6c0953b7&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-plaintext">Hour 1 Run a single Cypher query and locate the root cause instantly</code></pre></div><p>After we implemented graph evaluations our root cause time dropped to 40 minutes. We required exactly one engineer on the incident. We achieved full visibility into the context flow using the Neo4j Browser. Prompt version tracking was natively stored in the Decision nodes and instantly queryable. Our confidence in the fix was absolute because our regression test was a mathematical graph assertion.</p><p>Calculate this right now. How much does 90 hours of senior engineering time cost your organization. That number is the hidden tax of relying on flat observability for multi agent systems.</p><p>The economic impact is staggering. Under the old system we spent $18,000 in raw engineering payroll to debug a $240,000 direct incident cost while suffering unknown downstream damages to our client trust. Under the new system we spent exactly $100 in engineering time and the graph assertions caught the next incident in staging before it ever reached production.</p><p>The architectural shift is clear. We stopped adding more flat logging hoping to manually reconstruct causality. We started modeling decisions as graphs and querying the causality directly.</p><p>Observability for agents is not about collecting more flat data. It is about modeling the correct physical structure of the workflow. Flat logs scale linearly with agent complexity making debugging exponentially harder. Graph evaluations scale sub linearly because Cypher queries get easier as you add more structural assertions.</p><h2>What you should do?</h2><p>Engineering leaders must take concrete steps to fix this observability gap immediately.</p><h4>Step 1</h4><p>You must start modeling your agent traces as graphs today. Even if you are not running Neo4j in production yet you must start thinking in nodes and edges. Stop logging that an agent placed an order. Start logging that an Agent Run made a Decision using specific Context which triggered a specific Tool Call.</p><h4>Step 2</h4><p>You must instrument your context propagation. Every single time an agent passes context to another agent you must log exactly what context was passed and where it came from and when it was retrieved and whether it is marked as stale.</p><h4>Step 3</h4><p>You need to set up a graph database. If you are not ready for production infrastructure you can download <strong><a href="https://neo4j.com/download/">Neo4j Desktop</a></strong> locally. Ingest a few traces manually. Write your first <strong><a href="https://neo4j.com/docs/cypher-manual/current/introduction/">Cypher query</a></strong> and visualize the decision graph. Once you understand the immense value you can deploy <strong><a href="https://neo4j.com/product/auradb/">Neo4j Aura</a></strong> on their cloud managed tier and stream decisions in real time from your agent framework.</p><h4>Step 4</h4><p>You must write your first graph evaluation. Pick one critical failure mode you actually care about. Maybe it is stale context leading to bad decisions. Maybe it is a high value action triggered without human verification. Write that failure mode as a Cypher query and run it after every single agent execution. If the query returns a risk count greater than zero you pause the pipeline and investigate.</p><h4>Step 5</h4><p>You must build a decision graph dashboard. Use Neo4j Browser to visualize which agents are making the most flagged decisions and which context sources are most frequently stale.</p><p>Make your causality visible and make it queryable. Stop debugging multi agent systems with grep and start querying the decision graph.</p><h2>What&#8217;s next?</h2><p>We evaluate this architecture and see exactly where the industry is heading.</p><h4>Now</h4><p>We are doing post hoc graph evaluations. We build traces as graphs and query them with Cypher to catch errors before the next run.</p><h4>Near future</h4><p>We will use real time evaluation hooks. We will stream decisions into Neo4j as they happen and flag anomalies mid run using live graph assertions. Imagine Agent 5 is about to place a massive order. Before executing the final API call the system runs a Cypher query checking for stale context paths. If the query detects a violation the agent pauses automatically and surfaces the decision graph to a human for manual approval.</p><h4>Ultimate goal</h4><p>The ultimate goal is autonomous self correction. Agents will continuously query their own decision graphs to detect context drift in real time. If they detect a structural anomaly they will reroute their logic or pause execution entirely without human intervention.</p><p>Graph evaluations are not a nice to have feature. They are the fundamental difference between debugging in minutes versus debugging in days. That operational gap only grows as you add more agents to your cluster.</p><p>Today we debug agents after they fail. Tomorrow agents will debug themselves before they fail. But you cannot self correct without understanding causality. You cannot query causality without building graphs. Observability is not the endgame here. Autonomous self correction is the endgame.</p><div><hr></div><h2>Conclusion</h2><p>The $240,000 order was not a failure of the language model. It was not a failure of the prompt engineering. It was not even a failure of the multi agent architecture itself.</p><p>It was a catastrophic failure of enterprise observability.</p><p>Flat logs can tell you exactly what happened. They can never tell you why it happened. Artificial intelligence agents do not think in linear sequences. They branch and retry and delegate and loop. Their autonomous decisions form a complex graph and never a simple timeline.</p><p>If you are deploying agents in a production environment you desperately need observability that matches their actual internal structure. You must model your traces as graphs. You must query causality using Cypher. You must write structural assertions on context propagation instead of just verifying final outputs.</p><p>The next time your agent makes a disastrous decision you will not spend 90 hours grepping through flat JSON files. You will run one single query. You will instantly see the exact decision path. You will fix the poisoned context and add a new regression test. You will finish the entire investigation in 40 minutes instead of 3 days.</p><p>Agents think in graphs. So should your evaluations.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/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 BinaryBox! 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><p></p>]]></content:encoded></item><item><title><![CDATA[Why AI is Forcing us back to Basic Computer Science?]]></title><description><![CDATA[The industry no longer needs thousands of junior developers who only know how to spin up a boilerplate. AI has completely commoditized the surface layer of software engineering.]]></description><link>https://www.binarybox.org/p/why-ai-is-forcing-us-back-to-basic</link><guid isPermaLink="false">https://www.binarybox.org/p/why-ai-is-forcing-us-back-to-basic</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Thu, 23 Apr 2026 06:01:28 GMT</pubDate><enclosure url="https://substackcdn.com/image/youtube/w_728,c_limit/EGsZ5lUW8QI" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>We spent the last decade optimizing for speed. We taught an entire generation of engineers how to glue endpoints together and build web applications as quickly as possible.</p><p>Now artificial intelligence can do that exact same job in seconds.</p><p>I recently sat down for a deep discussion with <strong><a href="https://www.youtube.com/@PratikKaleIn">Pratik Kale</a></strong> to talk about the brutal reality of the modern hiring market. </p><p>The industry no longer needs thousands of junior developers who only know how to spin up a boilerplate. </p><p>AI has completely commoditized the surface layer of software engineering.</p><p>The market is aggressively shifting back to deep computer science fundamentals.</p><div id="youtube2-EGsZ5lUW8QI" class="youtube-wrap" data-attrs="{&quot;videoId&quot;:&quot;EGsZ5lUW8QI&quot;,&quot;startTime&quot;:&quot;2s&quot;,&quot;endTime&quot;:null}" data-component-name="Youtube2ToDOM"><div class="youtube-inner"><iframe src="https://www.youtube-nocookie.com/embed/EGsZ5lUW8QI?start=2s&amp;rel=0&amp;autoplay=0&amp;showinfo=0&amp;enablejsapi=0" frameborder="0" loading="lazy" gesture="media" allow="autoplay; fullscreen" allowautoplay="true" allowfullscreen="true" width="728" height="409"></iframe></div></div><p>In the podcast we break down exactly why the future belongs to the engineers who understand the physics of the machine. </p><p>We discuss why knowing the exact 14 kilobyte limit of a TCP (Initial Congestion Window <code>initcwnd</code>) is the only way to genuinely optimize first paint frontend load times. </p><p>We dive into why the V8 engine treats JavaScript objects like C++ structs and how ignoring that destroys your memory allocation.</p><p>If your only skill is writing basic application code you are competing against an algorithm that never sleeps. </p><p>If you understand how a compiler evaluates code step by step and how operating systems manage dynamic cache you become irreplaceable. </p><p>An AI can generate a thousand lines of code but it takes a human architect to understand the memory footprint and the networking throughput of that code in a production environment.</p><p>We also discussed why most startup MVPs fail and how finding a cofounder with an opposite personality is the only way to survive the business side of engineering.</p><p>I would love to hear your thoughts on this shift. Are you seeing the exact same fundamental skill gap in your recent engineering interviews.</p><div><hr></div><p>I would highly recommend to visit <strong><a href="https://www.youtube.com/@PratikKaleIn">Pratik&#8217;s YouTube channel</a></strong> for more such content, and do subscribe if you like what you see there &#128591;</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/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 BinaryBox! 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[Fine Tuning an AI Model on your Mac]]></title><description><![CDATA[The goal is to teach a tiny local AI to read executive management jargon and output the brutal engineering reality.]]></description><link>https://www.binarybox.org/p/fine-tuning-an-ai-model-on-your-mac</link><guid isPermaLink="false">https://www.binarybox.org/p/fine-tuning-an-ai-model-on-your-mac</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Mon, 20 Apr 2026 06:00:37 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!OVIZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OVIZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OVIZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp 424w, https://substackcdn.com/image/fetch/$s_!OVIZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp 848w, https://substackcdn.com/image/fetch/$s_!OVIZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp 1272w, https://substackcdn.com/image/fetch/$s_!OVIZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OVIZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp" width="1360" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1360,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Data-center AI model on MacBook shows Apple may win AI race | Cult of Mac&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;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Data-center AI model on MacBook shows Apple may win AI race | Cult of Mac" title="Data-center AI model on MacBook shows Apple may win AI race | Cult of Mac" srcset="https://substackcdn.com/image/fetch/$s_!OVIZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp 424w, https://substackcdn.com/image/fetch/$s_!OVIZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp 848w, https://substackcdn.com/image/fetch/$s_!OVIZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp 1272w, https://substackcdn.com/image/fetch/$s_!OVIZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F7ba5c6db-1db4-4000-bd8f-90c1a6272308_1360x768.webp 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Most of us (Engineers) have a Mac machine. </p><p><strong>No hard feelings if you have a different preference or use case, I totally respect your choice of hardware.</strong></p><p>But, this one is for those who owns a Mac and know a little Python &#128578; </p><p>I have a Mac Studio with M1 Ultra SOC with 64 GB Unified Memory. </p><p>Don&#8217;t be jealous but its perfectly fine if you own any Mac Pro machine with a M series Chip and at least 16+ GB of Unified Memory.</p><p>The goal is to teach a tiny local AI to read executive management jargon and output the brutal engineering reality. </p><p>We are building a <strong>Brutally Honest Corporate Translator</strong> &#128522;. </p><p>So let&#8217;s get started.</p><h2>Environment Setup</h2><p>Open your terminal and execute the following package installation.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;shell&quot;,&quot;nodeId&quot;:&quot;3eb8cbe3-2119-4c28-b024-348e48b4c211&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-shell"># Make sure your have Python 3.x installed
# Test using python --version
# You may also try python3 --version

# If your python --version is 3.x
pip install mlx-lm 

# if your python3 --version is 3.x
pip3 install mlx-lm 

# If you don't have python 3.x
# please install it before installing mxl-lm</code></pre></div><p>This single command installs the core framework without complex compilation steps or dependency hell.</p><h2>The Model (SLM)</h2><p>Look at the physical memory limits of your machine before choosing a model.</p><p>We often download the largest model available and immediately crash our system. </p><p>We need to match the parameter count to the available Unified Memory of our machine. </p><p>A 70 billion parameter model requires nearly 40 gigabytes of memory just to load the weights. </p><p>You cannot train that on a standard laptop. We need to evaluate smaller highly optimized architectures designed specifically for edge execution.</p><p>Here are the most viable models for local fine tuning today.</p><h4>Meta Llama 3 8B Instruct</h4><p>This is the current gold standard for local reasoning. It requires at least 16 gigabytes of unified memory to train comfortably but delivers enterprise grade logic.</p><h4>Alibaba Qwen 2.5 7B</h4><p>This is a highly capable alternative that performs exceptionally well on coding tasks and structured data extraction.</p><h4>HuggingFaceTB SmolLM2 1.7B Instruct</h4><p>We will use this specific tiny model for our tutorial today. It requires very little memory and will train flawlessly on a basic entry level machine in just a few minutes.</p><h2>Training Data</h2><p>AI models learn strictly through pattern recognition and examples.</p><p>Create a new directory called <code>data</code>. </p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;shell&quot;,&quot;nodeId&quot;:&quot;333363f0-311e-4f27-bbc4-9c89016ef772&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-shell">mkdir data</code></pre></div><p>Inside this folder you must create three specific files named </p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;shell&quot;,&quot;nodeId&quot;:&quot;a503fda9-7438-42a2-b557-24daa301f73f&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-shell">touch train.json valid.json test.json</code></pre></div><p>We will format our examples using standard prompt and completion keys.</p><p>Copy the following JSON blocks and paste them into all three of your data files for this engineering experiment.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;json&quot;,&quot;nodeId&quot;:&quot;53320c70-d1fc-4413-a625-3b648b40b8b9&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-json">{"prompt": "We need an agile MVP to synergize our deliverables", "completion": "We are shipping a completely broken prototype on Friday"}
{"prompt": "Let us put a pin in this and circle back when we have more bandwidth", "completion": "I am never going to approve this feature"}
{"prompt": "We are experiencing a temporary degradation of service", "completion": "Production is completely down and the database is on fire"}
{"prompt": "The legacy system requires a paradigm shift", "completion": "We need to delete the entire codebase and start over"}
{"prompt": "We are currently evaluating our strategic resourcing alignment", "completion": "We are planning massive layoffs next month"}
{"prompt": "The ticket is currently blocked by cross functional dependencies", "completion": "I have not started working on this and I am blaming another team"}</code></pre></div><p><em>I suggest to add more data into this json which will make responses more accurate and fun. You can use this as a sample and generate more using ChatGPT, Gemini etc.</em></p><p><em>Or you can use <strong><a href="https://gist.github.com/avishwakarma/91558c86bdf9e3047ae13d116aad5c43">the one I have used </a></strong></em><strong>&#128522;</strong></p><h2>Training</h2><p>Run the following exact terminal command to initiate the training process using our chosen baseline model.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;shell&quot;,&quot;nodeId&quot;:&quot;a14c464d-dfe1-477d-b514-baa0ad67955b&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-shell">python -m mlx_lm.lora \
  --model HuggingFaceTB/SmolLM2-1.7B-Instruct \
  --train \
  --data ./data \
  --iters 500</code></pre></div><p>Look at the mechanical physics of this command. The framework freezes the massive original weights of the base model. It only trains a tiny new adapter layer on top of the frozen parameters. </p><p>This mathematical efficiency is exactly why it runs flawlessly on a laptop without melting the processor or exhausting the battery.</p><h2>The Adapters</h2><p>Once the training step completes successfully, it will create an adapters folder. </p><p>This specific folder holds the specialized sarcastic knowledge we just mathematically injected into the system.</p><p>We now need to merge this new knowledge permanently into the base model. </p><p>Run the following command to fuse the new weights.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;shell&quot;,&quot;nodeId&quot;:&quot;2494e782-0201-4fcd-be82-a2d7ec2d197d&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-shell">python -m mlx_lm.fuse \
  --model HuggingFaceTB/SmolLM2-1.7B-Instruct \
  --adapter-path ./adapters \
  --save-path ./fused_model</code></pre></div><p>This command executes a permanent mathematical merge. It takes the massive matrix of the original frozen model and adds the tiny specialized adapter weights directly into it. </p><p>The result is a single consolidated model directory. </p><p>You no longer need to manage separate adapter files because the new corporate knowledge is permanently baked into the core neural network.</p><h2>The Fun</h2><p>We are ready to test the compiled engine. </p><p>Execute the following generation command to see your new translator in production.</p><div class="highlighted_code_block" data-attrs="{&quot;language&quot;:&quot;shell&quot;,&quot;nodeId&quot;:&quot;918185a1-e9db-4687-8727-03f746fec46e&quot;}" data-component-name="HighlightedCodeBlockToDOM"><pre class="shiki"><code class="language-shell">python -m mlx_lm.generate \
  --model ./fused_model \
  --prompt "The legacy system requires a paradigm shift"</code></pre></div><p>The model will instantly process the prompt and output the honest translation natively right on your machine.</p><p>Here are some fun responses I got while playing with it</p><blockquote><p>Prompt:<em> We are adopting a flat organizational structure</em></p><p><em><strong>Management wants everyone to do the work of three people without a title promotion</strong></em></p></blockquote><blockquote><p>Prompt:<em> We value your feedback and have added it to the product backlog</em></p><p><em><strong>We are ignoring your idea completely</strong></em></p></blockquote><blockquote><p>Prompt:<em> The new architecture is highly scalable and future proof</em></p><p><em><strong>We added Kubernetes to a basic web application and nobody knows how it works anymore</strong></em></p></blockquote><blockquote><p>Prompt:<em> We are embracing a fast paced startup culture</em></p><p><em><strong>You will work weekends and we will not pay you overtime</strong></em></p></blockquote><div><hr></div><h2>Conclusion</h2><p>Weigh the unit economics of this exercise against the operational output before reaching a conclusion.</p><p>You now possess a fully customized and functional model without paying a single cent to an external cloud provider. </p><p>The return on investment for utilizing existing local hardware is massive.</p><p>While Apple Silicon is absolutely not built for planetary scale distributed training it is the undisputed king of local edge engineering. </p><p>You own the hardware and you own the intelligence.</p><p>Do share your prompts and responses in the comments &#128522;</p><div><hr></div><p>If you are curious and want to learn more watch <strong><a href="https://developer.apple.com/videos/play/wwdc2024/10160/">this video from wwdc2024</a></strong></p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/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 BinaryBox! 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[Thinking about Training you own AI Model?]]></title><description><![CDATA[Read this before you make any decision. This explains the two paths you can take depending on the size of your AI Model.]]></description><link>https://www.binarybox.org/p/thinking-about-training-you-own-ai</link><guid isPermaLink="false">https://www.binarybox.org/p/thinking-about-training-you-own-ai</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Fri, 17 Apr 2026 06:01:19 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!5qdo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!5qdo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!5qdo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg 424w, https://substackcdn.com/image/fetch/$s_!5qdo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg 848w, https://substackcdn.com/image/fetch/$s_!5qdo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!5qdo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!5qdo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg" width="1456" height="819" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:819,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;AI Model Training Methods | Keymakr&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;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="AI Model Training Methods | Keymakr" title="AI Model Training Methods | Keymakr" srcset="https://substackcdn.com/image/fetch/$s_!5qdo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg 424w, https://substackcdn.com/image/fetch/$s_!5qdo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg 848w, https://substackcdn.com/image/fetch/$s_!5qdo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!5qdo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fef38110a-d115-447e-92e3-bdf124a6a872_1920x1080.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>One of my client approached me last month and they wanted to train a proprietary foundation model entirely from scratch. </p><p>They wanted to own their intelligence and stop paying external API fees. </p><p>Though they had a massive budget but they had absolutely no clue how to actually build the system. </p><p>They assumed they could just buy a thousand graphics cards and string them together with standard network cables.</p><p>I had to stop them from wasting millions of dollars. While researching the exact architecture required to build their cluster I found the reality absolutely fascinating. </p><p>I wondered how so few people in our industry truly understand the brutal math and physics behind distributed training.</p><p>Based on my research and understanding here is what I know so far.</p><p>To understand this physical reality we need to divide the training landscape into two distinct parts.</p><h2>The SLM (Local)</h2><p>If you want to train a Small Language Model (SLM) or fine tune an existing model for a highly scoped internal routing task you can rely on a single local system. </p><p>You do not need a massive data center. You just need to understand the physics of a single motherboard.</p><h3>The Software</h3><p>To make raw silicon do math you need a translator. In the local training environment you have two distinct software paths with completely different hardware requirements.</p><h4>The first path is CUDA. </h4><p>Nvidia built CUDA to be their proprietary programming interface. It converts high level Python code into low level parallel math instructions that the hardware can physically execute. </p><p><strong>If you use CUDA you must buy Nvidia graphics cards.</strong></p><h4>The second path is MLX. </h4><p>Apple built the MLX framework to compete directly with CUDA for local execution. </p><p>MLX is designed exclusively for Apple Silicon. It allows developers to run complex machine learning math on standard Mac Studio desktops.</p><p>MLX is still very new and not matured as compared to CUDA, it also has a very limited library support, which make CUDA a better choice.</p><h3>The Shared Memory Advantage</h3><p>When training locally the physical layout of the memory dictates your performance.</p><p>In a standard Nvidia PC build the system relies on separated memory. </p><p>You must copy your training data from the system RAM across the PCIe bus into the dedicated VRAM of the graphics card.</p><p>Apple avoids this entirely with Unified Memory. </p><p>The central processor and the graphics processor share the exact same physical memory pool. </p><p>When you load your training data into an Apple system there is zero data copying required. </p><p>The processors simply pass a pointer to the shared memory block. This shared memory architecture makes Apple Silicon incredibly efficient for training small models on a single local machine.</p><p><strong>Apple&#8217;s Unified Memory gives you a huge advantage here.</strong></p><h3>The Frontier (Cluster)</h3><p>When you leave the local machine to train a billion or trillion parameter model you enter a realm governed by strict physical capacity. </p><p>You are no longer building a computer. You are building a cluster of computer which acts as a supercomputer.</p><h3>The Software</h3><p>Apple and MLX completely disappear at this scale. </p><p>Nvidia dominates the frontier because CUDA scales perfectly across thousands of machines. </p><p>Nvidia spent a decade ensuring frameworks like PyTorch default exclusively to CUDA for distributed workloads. </p><p>The software moat forces you to buy into their enterprise hardware ecosystem.</p><h3>The Hardware</h3><p>We hit a hardware capacity wall very quickly when building foundation models. </p><p>A 70 billion parameter model consumes terabytes of memory. You have to store the massive weight matrices the optimizer states and the continuous training batches. </p><p>No single GPU on earth holds that much data.</p><p>The only mathematical solution is Data Parallelism. You must build a distributed cluster. </p><p>You copy the exact same model across thousands of distinct GPUs. You slice the massive training dataset into smaller manageable chunks and feed them to the separate GPUs simultaneously.</p><h3>Gradient Synchronization</h3><p>Having thousands of processors working at once sounds incredibly efficient until you realize they have to talk to each other constantly.</p><p>As GPUs process their data chunks they calculate gradients. </p><p>Gradients are massive mathematical vectors that tell the model exactly how to adjust its weights to decrease errors. </p><p>This is the literal process of machine learning.</p><p>This requirement introduces a massive architectural bottleneck. Before moving to the next training step every single one of those thousands of GPUs must share its gradients. They must average them together and update their local copies identically so the cluster learns as one single brain. </p><p>This Gradient Synchronization happens millions of times per run.</p><h3>The NCCL</h3><p>Moving this much data simultaneously breaks normal computer networks. </p><p>If ten thousand GPUs broadcast massive files simultaneously over a standard network the data center collapses instantly. </p><p>The GPUs finish their math in milliseconds and then sit completely idle waiting for network switches to clear the traffic jam.</p><p>Nvidia solved this network choke with a software tool called the Nvidia Collective Communications Library or <strong><a href="https://developer.nvidia.com/nccl">NCCL</a></strong>. </p><p>NCCL uses a brilliant mathematical layout called Ring All Reduce. </p><p>It arranges GPUs in a logical ring. Data is broken into small chunks and passed strictly to immediate neighbors instead of broadcasting to everyone.</p><p>For a cluster of <em><strong>N</strong></em> GPUs and a data size <em><strong>D</strong></em> the data sent and received is bound by this exact formula.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Data=\\frac{2(N-1)}{N}D&quot;,&quot;id&quot;:&quot;DJTXXNUPJM&quot;}" data-component-name="LatexBlockToDOM"></div><p>Because the fraction approaches 1 the total data transferred by any single node never exceeds <em><strong>2D</strong></em>. </p><p>This mathematical proof guarantees the network will not choke regardless of how many thousands of GPUs you add to the cluster.</p><h3>The NVLink</h3><p>Software optimization can only take you so far before physics gets in the way. </p><p>Even with NCCL mathematically optimizing the traffic we still hit a physical motherboard limit. Moving hundreds of gigabytes over a standard PCIe connection is cripplingly slow. </p><p>A standard PCIe bus <strong>maxes out around 64 gigabytes per second</strong>. That is far too slow for gradient synchronization.</p><p>Nvidia built <strong><a href="https://www.nvidia.com/en-us/data-center/nvlink/">NVLink</a></strong> to bypass the motherboard entirely. </p><p>NVLink is a proprietary physical bridge connecting GPUs directly to each other with thick copper cables. </p><p>It delivers <strong>a staggering 1.8 terabytes per second</strong> of bidirectional bandwidth. </p><p>It transfers calculations so fast that the entire server rack functions as a single unified processor.</p><h2>The Cost</h2><p>We need to connect this complex architecture back to the financial reality facing my client. </p><p>We must evaluate the strict economic difference between the local path and the frontier path before we reach a final decision.</p><h3>The SLM (Local)</h3><p>Training a Small Language Model (SLM) locally is a highly predictable financial commitment. </p><p>You buy the hardware once. You plug it into a standard wall outlet. </p><p>The unified memory architecture allows your engineers to experiment and fail rapidly without incurring hourly cloud compute penalties. </p><p>Your total financial risk is strictly capped at the initial purchase price of the desktop machine. </p><p>This makes local SLM development an incredible bargain for enterprise teams building scoped internal tools.</p><h3>The Frontier (Cluster)</h3><p>Training a frontier model is a completely different financial universe. </p><p>It requires ten thousand to one hundred thousand GPUs running continuously for months. </p><p>Without NCCL and NVLink a cluster spends forty percent of its time waiting for data transfers. </p><p>When your cloud bill is hundreds of thousands of dollars a day idle compute is pure financial hemorrhage. </p><p>You are burning cash to power hardware that is doing absolutely nothing. </p><p>The physics directly dictates the invoice.</p><div><hr></div><h2>Conclusion</h2><p>We need to weigh the ambition of training proprietary models against the harsh reality of data center physics before jumping in.</p><p>If you want to train a small model locally the unified memory of an Apple system running MLX is an incredible and cost effective engineering marvel. </p><p>You avoid the vendor lock in and bypass the PCIe bottleneck entirely on a single machine but you have deal with the drawbacks of MLX in general.</p><p>If you want to compete at the frontier and train massive models you have absolutely no choice. </p><p>You are buying into a closed high speed distributed network ecosystem. You cannot build a custom cluster with cheap networking and expect it to survive the synchronization penalty.</p><p>Nvidia dominates because they control the entire vertical stack. </p><p>Their true moat is not just the silicon chip processing the math. </p><p>Their moat is the complex distributed software and the thick physical cables tying the entire data center together.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/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 BinaryBox! 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[Why CUDA (Nvidia) won the AI game even when Apple built the best hardware?]]></title><description><![CDATA[AI inference is not fundamentally a compute problem. It is a data movement problem. The traditional CPU was not defeated by a lack of mathematical power. It was defeated by physical distance.]]></description><link>https://www.binarybox.org/p/why-cuda-nvidia-won-the-ai-game-even</link><guid isPermaLink="false">https://www.binarybox.org/p/why-cuda-nvidia-won-the-ai-game-even</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Thu, 16 Apr 2026 08:45:47 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!zCyD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zCyD!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zCyD!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp 424w, https://substackcdn.com/image/fetch/$s_!zCyD!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp 848w, https://substackcdn.com/image/fetch/$s_!zCyD!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp 1272w, https://substackcdn.com/image/fetch/$s_!zCyD!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zCyD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Apple Vs. Nvidia: Who will hit the $4 tn market cap first? | YourStory&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;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Apple Vs. Nvidia: Who will hit the $4 tn market cap first? | YourStory" title="Apple Vs. Nvidia: Who will hit the $4 tn market cap first? | YourStory" srcset="https://substackcdn.com/image/fetch/$s_!zCyD!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp 424w, https://substackcdn.com/image/fetch/$s_!zCyD!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp 848w, https://substackcdn.com/image/fetch/$s_!zCyD!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp 1272w, https://substackcdn.com/image/fetch/$s_!zCyD!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ab1f038-a11f-495a-9674-9eda6c4aa73d_1920x960.webp 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Most developers assume that Graphics Processing Units (GPUs) dominate artificial intelligence simply because they possess thousands of processing cores. We need to look past this assumption to understand the actual physics of computing.</p><p>Artificial Intelligence (AI) inference is not fundamentally a compute problem. It is a data movement problem. The traditional Central Processing Unit (CPU) was not defeated by a lack of mathematical power. It was defeated by physical distance.</p><p>There is a strange twist to this story. Apple solved this hardware problem years ago. Yet Nvidia remains a multi trillion dollar monopoly today. Nvidia wins because they built software that traps the entire industry.</p><h2>The Silicon Real Estate</h2><p>Look at the physical die of a modern server processor. </p><p>You will see massive silicon real estate dedicated to branch prediction and deep caching layers. We must understand the physics of this layout. </p><p>When a central processing unit executes a web application it encounters millions of conditional branch instructions at the machine code level. </p><p>The silicon cannot wait to evaluate every single condition before fetching the next operation. It must statistically predict whether a logical branch will resolve to true or false to keep its instruction pipeline completely full. </p><p>If the hardware predicts incorrectly it must flush the entire pipeline and start the cycle over. </p><p>This speculative execution is absolutely necessary to run highly unpredictable software like operating systems and relational databases. </p><p>A traditional processor survives by calculating the statistical probability of the immediate future.</p><p>Graphics processors strip all of that predictive logic away. </p><p>Artificial Intelligence (AI) does not branch. It multiplies. </p><p>The core of a neural network is a massive sequence of Multiply Accumulate operations. You take a matrix of weights and multiply it by a matrix of inputs.</p><p>This math is entirely deterministic and highly parallel. </p><p>Graphics processors dedicate their silicon entirely to Arithmetic Logic Units (ALUs) to process thousands of these matrix operations simultaneously. </p><p>They do not guess they just compute.</p><h2>The Von Neumann Bottleneck</h2><p>The physics of inference exposes a massive flaw in traditional computer design. To understand the memory wall you have to look at the mathematical footprint of a Large Language Model (LLM). </p><p>The absolute minimum physical memory required to load a model for inference is dictated by a strict formula.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;Memory_{weights} = P \\times B&quot;,&quot;id&quot;:&quot;XUNVMXPIND&quot;}" data-component-name="LatexBlockToDOM"></div><p>Where <em><strong>P</strong></em> is the total number of parameters and <em><strong>B</strong></em> is the byte size of the precision format.</p><p>If you want to run Llama 3 with 70 billion parameters in standard 16 bit precision where each parameter is 2 bytes you are looking at a minimum of 140 GB of VRAM just to hold the weights. </p><p>This completely excludes the KV cache and context window. You are not loading a program. You are loading a 140 GB matrix of floating point numbers into memory.</p><p>We must evaluate the <strong><a href="https://en.wikipedia.org/wiki/Von_Neumann_architecture">architecture John von Neumann designed in 1945</a></strong>. He separated the processing unit from the memory unit. </p><p>To perform math the processor must fetch data across a physical wire. In modern servers this wire is the PCIe bus. </p><p>Moving hundreds of gigabytes of data across a physical motherboard trace requires electricity and introduces massive latency. The electrons literally have too far to travel.</p><p>The CPU was defeated by a mathematical ratio known as Arithmetic Intensity.</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;I = \\frac{\\text{Total FLOPs}}{\\text{Total Memory Traffic (Bytes)}}&quot;,&quot;id&quot;:&quot;OERGXEAQJH&quot;}" data-component-name="LatexBlockToDOM"></div><p>This formula measures how many floating point operations or <em><strong>FLOPs</strong></em> the processor can execute for every byte of data it fetches from memory.</p><p>Generative AI inference has an incredibly low arithmetic intensity. Generating a token requires relatively few mathematical operations but it requires reading the entire 140 GB weight matrix from memory. </p><p>Because the math is simple but the data is massive the CPU processing cores finish their calculations in nanoseconds and then sit entirely idle waiting for the standard DDR motherboard bus to fetch the next batch of data.</p><p>This is the <strong><a href="https://research.ibm.com/blog/why-von-neumann-architecture-is-impeding-the-power-of-ai-computing">Von Neumann Bottleneck</a></strong>. Compute is cheap but moving data across a motherboard is prohibitively expensive. The CPU is starved by the motherboard.</p><p>Nvidia did not win by making the numerator slightly faster. They won by exponentially increasing the denominator bandwidth using vertically stacked memory directly on the silicon die.</p><h2>The Unified Memory Architecture</h2><p>If we treat this strictly as a data movement problem Apple should theoretically dominate the entire enterprise AI industry.</p><p>Apple engineers evaluated this physical bottleneck and radically redesigned the motherboard. They developed a hardware solution called Unified Memory Architecture. By placing the central processor the graphics processor and the system RAM on the exact same physical silicon package they completely eliminated the physical distance of the motherboard trace.</p><p>They did not just shorten the wire. They eliminated the PCIe bus entirely. </p><p>In a traditional PC an Nvidia GPU must copy data from system RAM over the PCIe bus into its own dedicated VRAM before it can execute matrix multiplication. </p><p>In an Apple system the CPU and GPU simply pass a pointer to the exact same block of memory. This zero copy architecture allows a desktop chip to achieve 800 gigabytes per second of memory bandwidth natively. </p><p>To achieve that specific memory capacity in standard PC ecosystems you would require massive server racks and you would suffer from crippling network cable latency. </p><p>Structurally Apple built the absolute perfect AI machine.</p><h2>The CUDA Monopoly </h2><p>Look at the reality on the ground. </p><p>Walk into any elite artificial intelligence lab today and you will see engineers completely ignoring Apple hardware.</p><p>They are hoarding Nvidia hardware instead.</p><p>This reveals a brutal engineering truth. The absolute best hardware does not win if the competitor owns the compiler.</p><p>Nvidia is not just a silicon company. They are a ruthless software monopoly.</p><p>To understand their moat you must understand <strong><a href="https://en.wikipedia.org/wiki/CUDA">Compute Unified Device Architecture</a></strong> or CUDA. </p><p>CUDA is an inescapable compiler layer that translates high level Python code into low level hardware instructions. </p><p>Nvidia spent fifteen years optimizing their proprietary math libraries and ensuring that every foundational AI framework including <strong><a href="https://en.wikipedia.org/wiki/PyTorch">PyTorch</a></strong> was built natively on top of their compiler.</p><p>We must understand why the industry cannot simply switch to competing silicon. </p><p>If you buy an AMD chip or an Apple desktop you must rely on translation layers to convert CUDA calls into alternative instructions. </p><p>Translation introduces bugs and destroys performance. If you choose to fight this ecosystem you are choosing operational pain. You will face compiler lock in immediately. You will encounter missing tensor libraries. You will watch your mathematical compilations fail. Your senior engineers will spend weeks debugging open source translation layers instead of actually training models. </p><p>Nvidia gave the compiler away for free to ensure you could never leave their hardware ecosystem.</p><div><hr></div><h2>Conclusion</h2><p>Weighing hardware physics against software ecosystems brings us to a definitive conclusion.</p><p>The fundamental architectural maxim is simple. Hardware physics dictate the absolute ceiling of system performance but software ecosystems dictate the floor of usability.</p><p>Here is the defensive playbook for technical leadership. </p><p>If your team is strictly running local inference on a pre trained model Apple Silicon is a cost effective and it will save you massive cloud compute bills and bypass the memory wall beautifully.</p><p>However if your engineering team is actively training foundational models or building complex agentic frameworks you have absolutely no choice. </p><p>You must pay the Nvidia tax for CUDA.</p><p>Do not choose your enterprise infrastructure based strictly on a hardware specification sheet as fighting the dominant software ecosystem will burn your entire financial runway on operational overhead. </p><p>The best silicon in the world is completely useless if you cannot compile the math.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/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 BinaryBox! 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><p></p>]]></content:encoded></item><item><title><![CDATA[Why AI Giants are Abandoning the Public Cloud?]]></title><description><![CDATA[The companies building frontier AI are quietly abandoning generic public cloud infrastructure. They are pouring hundreds of billions into custom physical data centers. Why?]]></description><link>https://www.binarybox.org/p/why-ai-giants-are-abandoning-the</link><guid isPermaLink="false">https://www.binarybox.org/p/why-ai-giants-are-abandoning-the</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Fri, 10 Apr 2026 08:01:56 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!6fi-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!6fi-!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!6fi-!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp 424w, https://substackcdn.com/image/fetch/$s_!6fi-!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp 848w, https://substackcdn.com/image/fetch/$s_!6fi-!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp 1272w, https://substackcdn.com/image/fetch/$s_!6fi-!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!6fi-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp" width="1456" height="607" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp&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;What makes an AI data center unique? | NorthC&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;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="What makes an AI data center unique? | NorthC" title="What makes an AI data center unique? | NorthC" srcset="https://substackcdn.com/image/fetch/$s_!6fi-!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp 424w, https://substackcdn.com/image/fetch/$s_!6fi-!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp 848w, https://substackcdn.com/image/fetch/$s_!6fi-!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp 1272w, https://substackcdn.com/image/fetch/$s_!6fi-!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd0e98fcd-0ca7-4b14-8842-af893cbc349a_1920x800.webp 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>For a decade we were told owning physical servers was a relic of the past. The public cloud was the final destination. </p><p>We must critically analyze this assumption today in April 2026. </p><p>The generative AI boom is aggressively reversing that trend. The companies building frontier AI are quietly abandoning generic public cloud infrastructure. </p><p>They are pouring hundreds of billions into custom physical data centers.</p><p>Let us examine the evidence to prove this shift. </p><p>Look at Microsoft and OpenAI. They are planning <strong><a href="https://openai.com/index/announcing-the-stargate-project/">Project Stargate</a></strong>. This is a proposed 500 billion dollar supercomputer data center. We must critically analyze that number. It is five hundred times more expensive than current massive data centers.</p><p>Look at Meta. They are bypassing standard cloud providers entirely. They are hoarding hundreds of thousands of H100 GPUs in custom built facilities. They are designing the cooling and power routing from scratch.</p><p>Google has always relied on its own custom TPU pods rather than generic cloud hardware for its core AI research.</p><p>The takeaway is clear. The smartest money in tech is no longer renting compute by the hour. </p><p>They are buying the bare metal.</p><h2>But why?</h2><p>Why is this happening. </p><p>We must evaluate the physics. </p><p>We must analyze the architectural mismatch between cloud virtualization and generative AI. </p><p>The public cloud relies on virtualization to host stateless web servers. Generative AI completely breaks this model.</p><p>Training a trillion parameter model requires tens of thousands of GPUs communicating via Synchronous Real Time Communication. </p><p>A single delayed packet on a standard cloud network switch stalls the entire run. </p><p>AI requires bare metal access. It requires custom InfiniBand networking and extreme thermal cooling.</p><p>Then we evaluate the math. </p><p>Renting a GPU means paying the hyper-scaler profit margin. When your compute bill hits 10 billion dollars a year building a custom nuclear powered data center is mathematically cheaper.</p><h2>What&#8217;s the Impact?</h2><p>Let&#8217;s analyze what this means for a Chief Technology Officer who is not building a custom data center.</p><p>There is good news for speed. </p><p>Custom networking pipelines designed exclusively for inference will drastically drop latency. Your Time to First Token (TTFT) will plummet. The math will execute perfectly on their bare metal.</p><p>However there are some bad news as well. We call this the Monopoly Trap. </p><p>You must destroy the assumption that cheaper internal costs for the giants mean cheaper API costs for developers. The AI giants will subsidize costs now to capture the market. </p><p>This creates an impenetrable physical moat. Startups cannot build their own Stargate to compete.</p><p>Once the market consolidates to two or three mega providers who own the physical hardware the era of cheap AI ends. </p><p>They will have total leverage to exponentially raise API token prices when investors demand profitability.</p><div><hr></div><h2>Conclusion</h2><p>The cloud abstraction is failing under the weight of artificial intelligence. </p><p>You can enjoy the speed and subsidized prices for now but you must architect defensively.</p><p>If your business model relies on a single provider keeping APIs cheap forever it is built on borrowed time.</p><p>The AI Giants are building physical castles. </p><p>Make sure you are not locked inside when they raise the drawbridge.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/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 BinaryBox! 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><p></p>]]></content:encoded></item><item><title><![CDATA[Why Agentic AI requires Graph based Observability?]]></title><description><![CDATA[The industry is currently flooded with vendors claiming to have &#8220;solved&#8221; AI observability but when you view them through the lens of enterprise architecture, their solutions fall apart.]]></description><link>https://www.binarybox.org/p/why-agentic-ai-requires-graph-based</link><guid isPermaLink="false">https://www.binarybox.org/p/why-agentic-ai-requires-graph-based</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Wed, 08 Apr 2026 06:01:32 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!FMdJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!FMdJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!FMdJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg 424w, https://substackcdn.com/image/fetch/$s_!FMdJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg 848w, https://substackcdn.com/image/fetch/$s_!FMdJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!FMdJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!FMdJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg" width="1379" height="776" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:776,&quot;width&quot;:1379,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Observability: An Essential Block for Gen AI Solutions | by Gen AI @ Cybage  Software Private Limited | Medium&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;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Observability: An Essential Block for Gen AI Solutions | by Gen AI @ Cybage  Software Private Limited | Medium" title="Observability: An Essential Block for Gen AI Solutions | by Gen AI @ Cybage  Software Private Limited | Medium" srcset="https://substackcdn.com/image/fetch/$s_!FMdJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg 424w, https://substackcdn.com/image/fetch/$s_!FMdJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg 848w, https://substackcdn.com/image/fetch/$s_!FMdJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!FMdJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F913abc70-2bc1-4a75-954d-31a2d8eb7349_1379x776.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Recently, I have received a call from an old client about their AI Agent making decisions which they cannot track even when they have invested in Observability tooling. </p><p>They had deployed a sophisticated procurement agent to manage their raw materials inventory. The agent was designed to read the Bill of Materials (BOM) for incoming orders and automatically interact with the ERP to ensure supply.</p><p>It had been running smoothly for weeks. Then, one night, the agent confidently issued a purchase order for 5,000 gallons of highly reactive industrial solvent that the company absolutely did not need. It was a $200,000 mistake executed in milliseconds.</p><p>The engineering team did what they were trained to do, they opened their AI Observability dashboards to debug the failure.</p><p>They were using one of the industry-standard LLMOps platforms (think LangSmith or Arize AI). They opened the specific trace, expecting to see a giant red error box.</p><p>Instead, the dashboard showed a 100% success rate.</p><p>The token usage was optimal. The latency was fine. The visual Directed Acyclic Graph (DAG) in the UI showed a perfectly clean execution path: the agent checked the ERP, saw a shortage, queried the vector DB for an alternative, found the solvent, and successfully executed the <code>Create_Purchase_Order</code> tool.</p><p>According to modern AI observability tools, the agent performed flawlessly. The JSON parsed correctly. The APIs returned <code>200 OK</code>.</p><p>The tools were completely blind to the fact that the agent had just committed a catastrophic logical error. This is the &#8220;Silent Success&#8221; problem of Agentic AI, and it exposes a massive architectural flaw in how the industry approaches observability.</p><h2>The AI Observability</h2><p>The industry is currently flooded with vendors claiming to have &#8220;solved&#8221; AI observability. When you view them through the lens of enterprise architecture, their solutions fall apart because they suffer from a severe semantic blindspot.</p><h3>The Giants (Datadog, Dynatrace, New Relic etc)</h3><p>To be fair, these platforms have evolved. They boast &#8220;Interactive Dependency Graphs&#8221; and &#8220;Entity Maps.&#8221; But look at what these graphs actually map, they map <em><strong>infrastructure and service flow</strong></em><strong>, not </strong><em><strong>reasoning</strong></em><strong>.</strong></p><p>They are built for deterministic microservices. They treat an LLM call exactly like a SQL query. </p><p>A <code>200 OK</code> HTTP status code between your agent container and the OpenAI endpoint means nothing if the agent just authorized a catastrophic purchase order. </p><p>They map the servers, but they are blind to the thought process.</p><h3>The AI Focused (Arize AI, LangSmith, Kore.ai etc)</h3><p>These platforms specifically target AI, and their marketing heavily touts &#8220;agentic tracing&#8221; and &#8220;graph visualization.&#8221; They do a great job of mapping a single agent&#8217;s trajectory.</p><p>But under the hood, they are still fundamentally OpenTelemetry (OTel) log stores. They suffer from <strong>Trace Isolation</strong>. They capture the agent&#8217;s actions perfectly, but that trace exists in a vacuum. </p><p>The tool does not know your business logic.</p><p>If an agent skips a mandatory safety check, LangSmith simply shows you a UI graph where the &#8220;Safety Check&#8221; node isn&#8217;t there. </p><p>Because the tool doesn&#8217;t know the rules of your enterprise, it assumes the agent&#8217;s path was correct. They treat the graph as a <em>UI visualization of an ephemeral log</em>, not as a <em><strong>computable mathematical structure tied to reality</strong></em><strong>.</strong></p><h2><strong>The Solution</strong></h2><p>If an agent&#8217;s execution is a branching decision tree, the observability layer must be a native graph database (like <strong><a href="https://neo4j.com/">Neo4j</a></strong>) that already holds your company&#8217;s business logic.</p><p>I have implemented a separate agent&#8217;s execution state directly into <strong>Neo4j</strong>, where the company&#8217;s manufacturing ontology (their Enterprise Knowledge Graph) already lived. </p><p>We ran the agent in a shadow environment, and a week later, it attempted the exact same hallucination.</p><p>This time, we didn&#8217;t look at a UI visualization of a single trace. We mathematically queried the agent&#8217;s behavior against the laws of the business.</p><p>Because both the <strong>Agent Trace</strong> and the <strong>Enterprise Ontology</strong> lived in the same database, we could write a Cypher query to perform an &#8220;Ontological Join&#8221;</p><pre><code><code>// Find any execution trace where the agent ordered a hazardous material
// WITHOUT executing a corresponding safety check tool.
MATCH (trace:AgentSession)-[:TOOL_CALL]-&gt;(po:PurchaseOrder)-[:TARGETS_ITEM]-&gt;(item:Material)
MATCH (item)-[:HAS_PROPERTY]-&gt;(prop:HazardLevel {value: 'High'})
WHERE NOT (trace)-[:TOOL_CALL]-&gt;(:SafetyMatrixCheck)
RETURN trace.id, item.name</code></code></pre><p><strong>The Graph revealed the semantic missing edge.</strong> The agent had queried the vector database for an alternative chemical. It found &#8220;Solvent Y-200&#8221;. In the company&#8217;s ontology, Y-200 is linked to a <code>[HazardLevel: High]</code> node, which strictly requires a <code>[:SAFETY_CLEARANCE]</code> edge.</p><p>The agent had bypassed the safety check tool entirely.</p><p>LangSmith couldn&#8217;t catch this because LangSmith doesn&#8217;t know what &#8220;Solvent Y-200&#8221; is. It only knows what the LLM typed. </p><p>Neo4j caught it instantly because it cross-referenced the agent&#8217;s ephemeral trace against the physical reality of the business.</p><h2>What else is needed?</h2><p>Once you have Native Graph Evals in place, you stop guessing and start engineering. Seeing the failure is step one. Preventing it requires expanding your architecture beyond trusting the LLM.</p><p>Here is what else you must implement when deploying agents to production</p><h3>Deterministic Tool Gateways</h3><p>An LLM should never speak directly to an ERP or a production database. </p><p>You must build a middleware gateway between the agent&#8217;s output and the actual API execution. Using our Neo4j setup, we built a gateway that intercepts the <code>Create_Purchase_Order</code> tool call, queries the graph to ensure the <code>[Safety_Check]</code> node exists in the current session trace, and blocks the API if the graph topology is invalid.</p><h3>State-Bound Prompts</h3><p>Do not give an agent all 15 of its tools in the initial system prompt. That is begging for hallucinations. </p><p>Use the graph state to dynamically inject only the tools that are valid for that specific moment. </p><p>If the agent has not successfully completed the <code>Inventory_Check</code> node, the <code>Create_Purchase_Order</code> tool should literally not exist in its context window.</p><h3>Macro-Topological Analysis</h3><p>Stop looking at crashes one by one. </p><p>With a native graph database, you can run PageRank or Cycle Detection algorithms across millions of historical traces simultaneously. </p><p>You can mathematically prove that 90% of your token-burning infinite loops only happen when the agent interacts with Tool A immediately after failing Tool B.</p><div><hr></div><h2>Conclusion</h2><p>If you deploy autonomous agents to production using isolated trace stores, you are not deploying software. You are deploying a dangerous, expensive black box.</p><p>Native graph observability shifts AI from &#8220;magic&#8221; back to determinism. By interrogating the topology of the agent&#8217;s reasoning against the ontology of your business, you stop relying on &#8220;Silent Successes.&#8221; </p><p>You patch the system prompt, build a gateway, or constrain the toolset precisely at the node where the graph broke.</p><p>Stop treating agents like magic functions. Treat them like autonomous state machines traversing a graph, and build the infrastructure to observe them accordingly.</p><div><hr></div><p>If you want to see exactly how to build this architecture in production, I am doing a deep dive on this exact topic at <strong><a href="https://neo4j.com/nodes-ai/">Neo4j&#8217;s NODES AI</a></strong>. </p><p>Register for free and come see the graph in action.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/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 BinaryBox! 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 $20/$200 AI Subscription is going to be Dead?]]></title><description><![CDATA[They priced access to massive supercomputers like a Spotify subscription. You paid $20 or $200 a month, and in exchange, you got an all-you-can-eat buffet of compute power.]]></description><link>https://www.binarybox.org/p/the-20200-ai-subscription-is-going</link><guid isPermaLink="false">https://www.binarybox.org/p/the-20200-ai-subscription-is-going</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Thu, 02 Apr 2026 06:02:25 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Kwhi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>For two years, the industry sold us the idea that frontier AI was just another consumer utility. They priced access to massive supercomputers like a Spotify subscription. You paid $20 or $200 a month, and in exchange, you got an all-you-can-eat buffet of compute power.</p><p>But by early 2026, the physical cost of running these models caught up with the business reality.</p><p>Look at the events of the last quarter. OpenAI shut down Sora and backed out of their Disney partnership. Microsoft is tightening its cloud budget. And a leaked internal dashboard shared by <strong><a href="https://www.linkedin.com/company/the-signal-ai/posts">The Signal</a></strong> from Anthropic showed just how unsustainable the generative AI business model is right now.</p><p>We aren&#8217;t entering an era of unlimited personal AI. We&#8217;re actually going back to the 1970s model, the era of the IBM Mainframe. The hallucination seems officially over &#128578;</p><h2>AI isn&#8217;t a SaaS</h2><p>Software-as-a-Service (SaaS) is a great business model because the marginal cost of serving one more user is effectively zero.</p><p>AI inference isn&#8217;t SaaS. It scales linearly. Every prompt requires physical hardware to do work.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Kwhi!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Kwhi!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Kwhi!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Kwhi!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Kwhi!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Kwhi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg" width="1280" height="1560" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1560,&quot;width&quot;:1280,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:220436,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://www.binarybox.org/i/192891847?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!Kwhi!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Kwhi!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Kwhi!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Kwhi!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd8dfc557-d52f-4bb7-b801-4fc425dba879_1280x1560.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">From <strong><a href="https://www.linkedin.com/company/the-signal-ai/posts">The Signal</a></strong> </figcaption></figure></div><p>To understand why the flat-rate AI subscription is failing, look at the leaked Anthropic dashboard. An enterprise power user on a $200/month &#8220;Pro&#8221; tier ran an autonomous coding loop. In 23 days, that single user consumed 1.1 billion tokens and triggered 9,221 sub-agent tasks.</p><p>The actual compute cost of running those inferences on Anthropic&#8217;s GPU clusters was $27,000. Anthropic took a 135x loss on a single customer in less than a month. </p><p>Analyzing a 100-page PDF or running an autonomous agent isn&#8217;t a simple database query. It requires firing up clusters of GPUs and executing billions of operations. You can&#8217;t sell that kind of compute for a flat fee and hope to make it up in volume. Volume is exactly what causes the losses.</p><h3>The Death of Sora</h3><p>If you want proof that the subsidy is over, look at Sora.</p><p>OpenAI killed their flagship video generation model less than six months after its public launch. The tech press talked about &#8220;safety concerns&#8221; and &#8220;copyright,&#8221; but the reality was the Cost of Goods Sold (COGS).</p><p>Generating 60 frames per second of photorealistic video requires massive compute. Keeping the Sora clusters running for 500,000 active users burned an estimated $1 million a day in electricity and GPU depreciation.</p><p>They tried to pivot to the enterprise by signing a $1 billion partnership with Disney. But Disney realized that offloading their rendering pipeline to OpenAI&#8217;s servers was actually more expensive than doing it in-house. The unit economics didn&#8217;t make sense, so the servers were shut down.</p><h3>OpenAI&#8217;s &#8220;Risk Factor&#8221;</h3><p>The cloud providers have woken up. For years, Microsoft subsidized OpenAI&#8217;s compute to gain market share. That era of cheap infrastructure is over.</p><p>In a recent financial disclosure, OpenAI explicitly listed their reliance on Microsoft Azure&#8217;s compute pricing as a &#8220;Risk Factor.&#8221; </p><p>Wall Street is demanding a return on the billions poured into data centers. Investors are forcing AI labs to drop unprofitable consumer tools and focus entirely on enterprise contracts that actually pay the bills.</p><h2>Edge vs. Mainframe</h2><p>To fix the broken math, the AI market is splitting into two distinct tiers. </p><p>The middle ground which is $200/month frontier web app is disappearing.</p><h3>Tier 1: The Consumer Edge</h3><p>Consumers will get smaller, 8-billion parameter models running locally on their phones and laptops (Apple Silicon, Snapdragon NPUs etc).</p><p>These models are good enough for basic tasks like grammar correction and summarizing emails, but they aren&#8217;t capable of deep reasoning. </p><p>Why the shift? </p><p>Because by pushing the model to the edge, companies offload the cost of the compute and electricity directly onto the user&#8217;s battery. It is the only way the consumer unit economics work.</p><h3>Tier 2: The AI Mainframe (Enterprise)</h3><p>True frontier AI, massive models capable of deep, autonomous workflows will become bespoke enterprise tools.</p><p>These won&#8217;t be accessible via a casual web interface. </p><p>They will be sold via multi-million-dollar B2B contracts to pharmaceutical companies running protein simulations, and quant hedge funds executing trading logic. </p><p>They are the only businesses with gross margins high enough to afford the true, unsubsidized cost of compute.</p><div><hr></div><h2>Conclusion</h2><p>The idea that a solo developer in a garage will have the exact same compute power as the CTO of JPMorgan isn&#8217;t realistic. </p><p>The physics of data centers dictate otherwise.</p><p>As a Software Architect, you need to plan defensively. Relying on cloud providers to subsidize your application&#8217;s heavy reasoning is a risk.</p><p>Build your systems around cheap, local, open-source models for the basic plumbing such as routing, classification, and simple tasks. </p><p>Treat frontier API calls as an expensive, highly constrained physical resource. </p><p>Use them only when absolutely necessary and plan for AI like heavy industrial equipment. </p><p>The era of cheap, subsidized compute is over.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/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 BinaryBox! 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[A ₹500 ($5) course won't make you an AI Engineer]]></title><description><![CDATA[They claim that AI is replacing software engineers tomorrow, and if you don&#8217;t buy their &#8220;AI Mastery Guide&#8221; today, your career is over before it begins.]]></description><link>https://www.binarybox.org/p/a-500-5-course-wont-make-you-an-ai</link><guid isPermaLink="false">https://www.binarybox.org/p/a-500-5-course-wont-make-you-an-ai</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Tue, 31 Mar 2026 12:03:53 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!y-Gm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!y-Gm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!y-Gm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.png 424w, https://substackcdn.com/image/fetch/$s_!y-Gm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.png 848w, https://substackcdn.com/image/fetch/$s_!y-Gm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.png 1272w, https://substackcdn.com/image/fetch/$s_!y-Gm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!y-Gm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.png" width="1456" height="728" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:728,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1947599,&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://www.binarybox.org/i/191716866?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.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_!y-Gm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.png 424w, https://substackcdn.com/image/fetch/$s_!y-Gm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.png 848w, https://substackcdn.com/image/fetch/$s_!y-Gm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.png 1272w, https://substackcdn.com/image/fetch/$s_!y-Gm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4d3ed674-2cd5-40b7-8fee-5be0b4aebed3_1536x768.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Take a breath.</p><p>I know what your LinkedIn and Twitter feeds look like right now. </p><p>Every time you open your phone, an influencer in a rented sports car or a sleek home office is screaming at you. </p><p>They claim that AI is replacing software engineers tomorrow, and if you don&#8217;t buy their <em><strong>&#8220;AI Mastery Guide&#8221;</strong></em> today, your career is over before it begins.</p><p>I see the panic in computer science cohorts and junior developers. It is entirely valid. </p><p>But you need to understand that this anxiety is not a natural reaction to the tech market. It is a manufactured emotion, meticulously engineered by marketers to make you feel inadequate so you will open your wallet.</p><p>In any gold rush, the people who actually get rich are the ones selling the shovels. Today&#8217;s &#8220;AI Influencers&#8221; are selling cheap, plastic shovels to desperate, anxious students.</p><p>Let&#8217;s tear down their selling tactics like an architecture.</p><h2>The Scam</h2><p>If you want to be an engineer, you need to learn how to reverse-engineer systems. </p><p>Let&#8217;s look at the system design of the influencer business model.</p><p>When you see an ad for a &#8220;Master ChatGPT in 30 Days&#8221; course priced at &#8377;500 or $5, you think you are buying an educational product. </p><p>You are not. You are participating in a Customer Acquisition Cost (CAC) mechanism.</p><p>That &#8377;500 course is just the entry point to a sales funnel. The content inside is nothing but regurgitated Twitter threads, repackaged into a PDF to create artificial complexity. </p><p>It is designed to give you a dopamine hit of &#8220;productivity&#8221; while making you feel like you are still missing the <em>real</em> secret.</p><p>Then, the trap springs. Once you finish the cheap course, the email sequence begins. </p><p>They tell you that to <em>actually</em> secure a six-figure job, you need to join their exclusive &#8220;AI Mastermind&#8221; or buy the advanced bootcamp for &#8377;50,000.</p><p>You are being farmed for your attention and your anxiety.</p><h2>The Delusion</h2><p>The core lie holding this entire grift together is the concept of the &#8220;Prompt Engineer.&#8221;</p><p>Let me give you the hard truth</p><p>Prompt Engineering is not a sustainable technical career. </p><p>A prompt is simply a natural language API call. You are no more an &#8220;engineer&#8221; for typing instructions into ChatGPT than you are a &#8220;Search Engineer&#8221; for typing queries into Google.</p><p>More importantly, it is a rapidly depreciating asset.</p><p>Two years ago, getting an LLM to output a specific JSON format required paragraphs of complex &#8220;jailbreak&#8221; constraints and magical phrasing. </p><p>Today, frontier models like Claude 3.5 Sonnet, GPT-4o, and Gemini 1.5 Pro natively understand intent, reason through logic, and output strict JSON out of the box.</p><p>The models are getting smarter at interpreting human ambiguity. As the compilers (the LLMs) get better at understanding natural language, the need for complex, esoteric &#8220;prompts&#8221; disappears. </p><p>Buying a course on prompting is investing your limited time and money into a dying skill.</p><h2>The Trap</h2><p>Part of the illusion relies heavily on visual spectacle. </p><p>The influencer will open a video by shouting, </p><p><em><strong>&#8220;I just generated a 50-page PowerPoint, a PDF marketing brochure, and 12 photorealistic images in under three minutes using these SECRET tools!&#8221;</strong></em></p><p>They will show you a curated list of glossy AI web apps or tools that automatically build slide decks, generate stock photos, or format PDFs. </p><p>They will try to convince you that knowing which button to click on these websites is a highly monetizable, technical skill.</p><p>Let me be brutally clear.</p><p>Using a SaaS wrapper to generate a PDF makes you an <em>end-user</em>, not an engineer.</p><p>You are not building software. You are consuming it. </p><p>Knowing how to type a prompt into an image generator or a presentation-maker is equivalent to claiming you are a Database Architect because you know how to sort a column in Microsoft Excel. </p><p>It is a neat productivity trick for a marketing manager, but it has absolutely zero engineering value. </p><p>When you buy a course to learn these tools, you are paying for a glorified software tutorial, not an engineering curriculum.</p><h2>The Real AI Engineering</h2><p>Contrast the influencer fantasy with the brutal reality of what the industry actually pays for.</p><p>Companies do not pay AI Engineers $150,000 a year to type clever sentences into a web interface or generate a pretty slide deck.</p><p>They pay engineers to build resilient, scalable systems around non-deterministic intelligence.</p><p>Real AI engineering is systems engineering. It is building deterministic RAG (Retrieval-Augmented Generation) pipelines. It is managing the severe latency of vector databases. It is calculating the unit economics of token costs versus API throughput.</p><p>An actual AI Engineer spends their day setting up strict guardrails to catch LLM hallucinations before they reach a customer. </p><p>They write middleware to mask Personally Identifiable Information (PII) before it hits a third-party API. </p><p>They write exponential backoff algorithms to handle <code>502 Bad Gateway</code> errors and <code>429 Too Many Requests</code> rate limits from OpenAI. </p><p>They build intelligent chunking strategies to fit a massive PDF into a 100k context window without destroying the semantic meaning.</p><p>If a course does not teach you how to handle network failures, rate limits, or context window chunking, it is not an AI engineering course. </p><p>It is a typing class.</p><h2>Where you should learn?</h2><p>So, where do you actually go to learn? </p><p>You ignore the influencers and you go to the raw, unpolished sources. </p><p>Here is your actual roadmap, and it is almost entirely free.</p><h3>The Math &amp; Mechanics</h3><p>Go to YouTube and search for <strong><a href="https://www.youtube.com/watch?v=VMj-3S1tku0&amp;list=PLAqhIrjkxbuWI23v9cThsA9GvCAUhRvKZ">Andrej Karpathy&#8217;s </a></strong><em><strong><a href="https://www.youtube.com/watch?v=VMj-3S1tku0&amp;list=PLAqhIrjkxbuWI23v9cThsA9GvCAUhRvKZ">&#8220;Neural Networks: Zero to Hero&#8221;</a></strong></em> series. <strong><a href="https://en.wikipedia.org/wiki/Andrej_Karpathy">Karpathy</a></strong> was a founding member of OpenAI and the Director of AI at Tesla. </p><p>He will teach you how to build a neural network from scratch using Python. </p><p>Understanding the underlying calculus and matrix multiplication is infinitely more valuable than memorizing a prompt template.</p><h3>The Applied Systems</h3><p>Stop buying courses and start reading official documentation. </p><p>Take <strong><a href="https://grow.google/ai-coursera">Grow with Google AI Lessons</a></strong>.</p><p>Read the <strong><a href="https://platform.claude.com/docs/en/home">Anthropic documentation</a></strong>. </p><p>Read the <strong><a href="https://developers.openai.com/cookbook">OpenAI Cookbooks</a></strong>. </p><p>If you need structured courses, take <strong><a href="https://www.coursera.org/instructor/andrewng">Andrew Ng&#8217;s</a></strong> DeepLearning AI classes. </p><p>They are built by actual AI researchers, not Twitter marketers.</p><h3>The Framework</h3><p>Want to build AI apps? </p><p>Go read the raw GitHub documentation for LangChain, LlamaIndex, or Hugging Face. </p><p>Build a simple Python script that takes a local text file, converts it into embeddings, stores it in a local ChromaDB, and queries it. </p><p>You will learn more in one weekend of fighting Python dependency errors than in a year of watching influencer videos.</p><div><hr></div><h2>Conclusion</h2><p>True technical leverage does not live behind a paywall on an Instagram ad. </p><p>It lives in your ability to sit in a quiet room, read difficult technical documentation, and build things that break until you figure out how to fix them.</p><p>A career in software engineering is a 40-year marathon. </p><p>Technologies will rise and fall. Frameworks will die. </p><p>Do not let marketers rush you into buying plastic shovels.</p><p>Ignore the noise. Protect your wallet. Focus on the fundamentals.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/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 BinaryBox! 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><p></p>]]></content:encoded></item><item><title><![CDATA[Thought - Why Token Costs will Bankrupt your LLM Wrapper]]></title><description><![CDATA[If your COGS scales perfectly linearly with every single user click, you do not have a software business. You have a subsidized consulting firm.]]></description><link>https://www.binarybox.org/p/thought-why-token-costs-will-bankrupt</link><guid isPermaLink="false">https://www.binarybox.org/p/thought-why-token-costs-will-bankrupt</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Thu, 26 Mar 2026 06:00:40 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!Vqel!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Vqel!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Vqel!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Vqel!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Vqel!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Vqel!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Vqel!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg" width="1400" height="723" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:723,&quot;width&quot;:1400,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:155461,&quot;alt&quot;:&quot;Token by Token: Mastering AI Cost Optimization | by Pradeep Kumar  Muthukamatchi | Data Science Collective | Medium&quot;,&quot;title&quot;:null,&quot;type&quot;:&quot;image/jpeg&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Token by Token: Mastering AI Cost Optimization | by Pradeep Kumar  Muthukamatchi | Data Science Collective | Medium" title="Token by Token: Mastering AI Cost Optimization | by Pradeep Kumar  Muthukamatchi | Data Science Collective | Medium" srcset="https://substackcdn.com/image/fetch/$s_!Vqel!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg 424w, https://substackcdn.com/image/fetch/$s_!Vqel!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg 848w, https://substackcdn.com/image/fetch/$s_!Vqel!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!Vqel!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F69c8cb96-c797-4d10-94f0-213c6daa26c9_1400x723.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Last month, I was brought in to consult for a generative AI startup that had just closed a massive Seed round. They had built an &#8220;AI Customer Success Agent&#8221; that looked incredible in staging.</p><p>Then I opened their Anthropic billing dashboard.</p><p>Their Cost of Goods Sold (COGS) wasn&#8217;t just high. It was terminal. Every time a user asked their bot a question, the company lost money. </p><p>When I tore down their architecture to find the leak, I realized they hadn&#8217;t actually built a software company. They had built an unoptimized API proxy.</p><p>And this is not an isolated incident. </p><p>Look at the startup graveyard from the last two years. The AI Copywriter. The AI PDF Chatbot. The AI Email Assistant. They launched to deafening hype, dominated Product Hunt, and convinced investors they had cracked a new market.</p><p>Twelve months later, they were quietly shuttered or sold for parts.</p><p>Their entire product architecture consisted of prepending a system prompt to a user input and piping it directly to an LLM provider. They had no defensible moat, and their gross margins were systematically eaten alive by the underlying compute provider.</p><h2>The Maths of Margin Erosion</h2><p>Software-as-a-Service (SaaS) valuations are predicated on 80 percent gross margins and a near-zero marginal cost of replication. </p><p>If your COGS scales perfectly linearly with every single user click, you do not have a software business. You have a subsidized consulting firm.</p><h3>The RAG Trap</h3><p>Let&#8217;s examine the exact architecture that was killing my client. A standard enterprise RAG (Retrieval-Augmented Generation) implementation. You deploy a customer support bot handling a modest 10,000 conversations a day.</p><p>You write a dense, 2,000-token system prompt detailing the company&#8217;s tone and rules. Every time a user asks a question, your vector database retrieves 5,000 tokens of documentation context. Before the LLM generates a single word, your baseline payload is 7,000 input tokens.</p><p>At premium model pricing (roughly $10 to $15 per million input tokens for models like Claude 3 Opus or GPT-4), that single interaction costs about $0.10 just to read the prompt. Multiply that by 10,000 conversations, factoring in average multi-turn context window inflation, and you are burning <strong>$1,500+</strong> a day.</p><p>You are bleeding <strong>$500,000</strong> a year purely on input tokens before factoring in output costs, vector database hosting, or salaries.</p><h3>The Output Multiplier</h3><p>The input tax is just the entry fee. The output tax is where margins actually die.</p><p>Generating tokens requires significantly more compute than reading them. Providers charge 3x to 5x more for output tokens. If your bot generates a helpful 500-word response, that single output costs another $0.015.</p><p>Users do not ask one question; they iterate. A four-message conversation easily compounds to 30,000 total tokens processed. You are paying a premium cloud tax on every single syllable your system outputs, 24 hours a day.</p><h2>The Latency Tax</h2><p>Financial bleed is only the first failure mode. The second is Time to First Token (TTFT).</p><h3>TTFT</h3><p>TTFT is the ultimate metric in AI architecture. When you wire your frontend directly to an external LLM provider, you surrender total control of your application&#8217;s physics.</p><p>You inherit their network round-trips. You inherit their TLS handshakes. You inherit their peak-hour queue delays. You are at the mercy of raw 2-to-5-second inference times.</p><p>Human beings abandon interfaces that take more than 400 milliseconds to react. If your application takes five seconds to stream the first word because <code>us-east-1</code> is saturated, your users will leave.</p><h3>The Streaming Band-Aid</h3><p>Many developers try to hide this latency by streaming tokens to the UI. This is a visual band-aid, not an architectural fix.</p><p>Streaming gives the illusion of speed, but it does not change the physical time it takes to complete the task. </p><p>You cannot out-prompt the speed of light. </p><p>Prompt engineering cannot fix an overloaded cloud endpoint. If a backend task requires parsing JSON from an LLM response before executing a database query, streaming is useless. </p><p>You are simply blocked for five seconds.</p><h2>The Self-Hosting Fallacy</h2><p>Faced with massive API bills and latency spikes, engineering teams typically experience a knee-jerk reaction</p><p><em><strong>&#8220;Our API bill is too high. Let&#8217;s buy an H100 and host Llama 3 ourselves.&#8221;</strong></em></p><p>This is an ego trip disguised as a financial strategy.</p><h3>The Silicon Math</h3><p>Generating a million tokens on a hosted, heavily optimized API endpoint costs pennies for smaller models. Renting a single A100 or H100 GPU node costs upwards of $80 to $150 a day.</p><p>Because user traffic is spiky and unpredictable, that expensive silicon will sit completely idle 80 percent of the time. </p><p>You are paying for maximum capacity, but only utilizing a fraction of it.</p><h3>The DevOps Nightmare</h3><p>Running LLMs in production is not like running a Node.js server. It is a grueling battle with KV cache memory fragmentation, continuous batching algorithms, and CUDA out-of-memory crashes.</p><p>To keep a self-hosted model running efficiently, you need specialized AI infrastructure engineers. Those engineers cost <strong>$250,000</strong> a year.</p><p>Unless you process tens of millions of tokens daily at a perfectly consistent utilization rate, or you have strict air-gapped compliance requirements, self-hosting will bankrupt you faster than using LLM APIs. </p><p>You trade variable API costs for massive fixed CapEx and severe operational friction.</p><h2>Architecting the Defensive Moat</h2><p>To survive the LLM API tax, architects must build a ruthless abstraction layer between their application and the model provider. </p><p>You need an AI Gateway.</p><h3>Tactic 1: Semantic Caching</h3><p>Users ask the exact same questions constantly. You should not pay Anthropic 1,000 times a day to answer <em><strong>&#8220;What is your refund policy?&#8221;</strong></em></p><p>Instead, pass the user&#8217;s query through a cheap, sub-millisecond embedding model. Store that vector in a Redis cache alongside the LLM&#8217;s final generated response. </p><p>When the next user asks <em><strong>&#8220;How do I get my money back?&#8221;,</strong></em> perform a cosine similarity search.</p><p>If the mathematical match exceeds a 0.95 threshold, serve the cached string instantly. Your compute cost drops to $0. </p><p>Your TTFT drops to 50 milliseconds.</p><h3>Tactic 2: Intelligent Routing (The Cascade)</h3><p>Stop using premium frontier models for everything. A massive percentage of application logic involves basic classification, sentiment analysis, or summarization.</p><p>Your gateway should route trivial tasks to ultra-cheap, high-speed models like Gemini Flash, Llama 3 8B, or Claude Haiku. </p><p>Reserve the expensive, heavy reasoning models strictly for complex escalation paths. Implement a cascade, try the cheap model first, and only trigger the expensive model if the output fails a deterministic validation check.</p><h3>Tactic 3: Context Pruning</h3><p>Stop treating the LLM context window as a dumping ground. </p><p>Throwing 50 pages of PDF text into an API call because &#8220;the model supports 1M tokens&#8221; is financial suicide.</p><p>Implement strict context pruning. </p><p>Use a fast Cross-Encoder to re-rank your vector search results. Strip out boilerplate text, HTML tags, and redundant paragraphs before assembling the final prompt. </p><p>Sending exactly 800 highly relevant tokens is infinitely cheaper and yields better model accuracy than blindly dumping 8,000 tokens.</p><h3>Tactic 4: Circuit Breakers</h3><p>External APIs fail. Rate limits get exhausted. If your application crashes when LLM API throws a 502 Bad Gateway, your architecture is brittle.</p><p>Your gateway must implement strict circuit breakers. </p><p>If the primary provider times out or degrades, the gateway must instantly and transparently reroute the exact payload to a backup provider (e.g., failing over from OpenAI to Anthropic). </p><p>Graceful degradation is a mandatory requirement, not a feature.</p><div><hr></div><h2>Conclusion</h2><p>Large Language Models are not magic brains. They are commodity compute.</p><p>The value of your engineering team is not in writing a clever system prompt. The value is in building the caching, routing, pruning, and abstraction infrastructure that makes running that prompt economically viable.</p><p>If you build a thin wrapper, the API provider will eventually consume your margins. </p><p>Build the moat, or prepare to join the graveyard.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/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 BinaryBox! 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><p></p><p></p><p></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Do you really need a Vector Database for your AI Product?]]></title><description><![CDATA[Before you sign a massive SaaS contract for a dedicated vector engine, you need to understand the physics of the hardware you are renting.]]></description><link>https://www.binarybox.org/p/do-you-really-need-a-vector-database</link><guid isPermaLink="false">https://www.binarybox.org/p/do-you-really-need-a-vector-database</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Tue, 24 Mar 2026 06:00:50 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!_Lc8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!_Lc8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!_Lc8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg 424w, https://substackcdn.com/image/fetch/$s_!_Lc8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg 848w, https://substackcdn.com/image/fetch/$s_!_Lc8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!_Lc8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!_Lc8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg" width="1200" height="675" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:675,&quot;width&quot;:1200,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Comparing 10 Vector Database APIs For AI | Nordic APIs |&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;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Comparing 10 Vector Database APIs For AI | Nordic APIs |" title="Comparing 10 Vector Database APIs For AI | Nordic APIs |" srcset="https://substackcdn.com/image/fetch/$s_!_Lc8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg 424w, https://substackcdn.com/image/fetch/$s_!_Lc8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg 848w, https://substackcdn.com/image/fetch/$s_!_Lc8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!_Lc8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0fa95570-4e88-4df3-97f2-f82586cd81c7_1200x675.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Last week, I sat in an architecture review with a client who had just secured Series A funding. They were building a standard Retrieval-Augmented Generation (RAG) pipeline for their internal documents. </p><p>Before anyone had written a single line of backend logic, the engineering lead proudly displayed a slide proposing a six-figure enterprise contract with a dedicated Vector Database.</p><p>When I asked why we weren&#8217;t just using Postgres, the answer was immediate</p><p><em><strong> &#8220;Because this is an AI app. You need a Vector DB for AI.&#8221;</strong></em></p><p>This is the exact kind of hype-driven development that destroys startup runways.</p><p>At the physical level, Vector Databases are not magic AI boxes. They do not understand &#8220;meaning,&#8221; &#8220;context,&#8221; or &#8220;semantics.&#8221; </p><p>They are simply C++ or Rust memory allocators navigating multi-dimensional mathematical graphs. </p><p>To do this quickly, they trade exact accuracy for speed, and they force you to pay an absolute fortune in RAM to do it.</p><p>Before you sign a massive SaaS contract for a dedicated vector engine, you need to understand the physics of the hardware you are renting.</p><h2>The Brute Force Math</h2><p>To understand why traditional databases fail at vector search, you have to look at the math of a &#8220;Vector.&#8221;</p><p>An OpenAI <code>text-embedding-3-small</code> embedding is a 1,536-dimensional array of floating-point numbers. In physical memory, a single 32-bit float consumes 4 bytes.</p><p><code>1,536 dimensions &#215; 4 bytes = 6,144 bytes (6 KB) per vector</code></p><p>If you want to find the closest vectors to a user&#8217;s query using exact math, a process called Exact K-Nearest Neighbors (KNN) which your CPU must calculate the cosine similarity between the query vector and every single row in the database.</p><p>Let&#8217;s do the memory bandwidth math on a small 1-million-row table</p><p><code>1,000,000 rows &#215; 6 KB = 6.1 Gigabytes of data</code></p><p>To answer one user query, </p><ul><li><p>the CPU must pull <strong>6.1 GB</strong> of data from RAM through the memory bus, </p></li><li><p>load it into the <strong>L1 cache</strong>, </p></li><li><p>and execute millions of <strong>AVX-512 SIMD</strong> (Single Instruction, Multiple Data) dot-product operations.</p></li></ul><p>Even on modern DDR5 RAM peaking at 50 GB/s of bandwidth, a single concurrent user doing an Exact KNN search will consume 12% of your entire server&#8217;s memory bandwidth. </p><p>If you get 10 concurrent searches, your CPU is completely starved for data. The system grinds to an absolute halt.</p><p>Even the traditional B-Trees cannot save you. </p><p>A B-Tree relies on 1-dimensional inequalities (<em>Is X &gt; 10? Go right</em>). You cannot sort or bisect 1,536 dimensions simultaneously.</p><h2>HNSW (Hierarchical Navigable Small World)</h2><p>If Exact KNN locks up the CPU, how do Vector DBs return results in 20 milliseconds?</p><p>They don&#8217;t do exact searches. They cheat.</p><p>Vector databases rely on <strong>Approximate Nearest Neighbor (ANN)</strong> algorithms.</p><p>They accept that finding the <em>perfect</em> match is computationally impossible at scale, so they settle for finding a <em>very good</em> match almost instantly.</p><p>The undisputed king of these algorithms is <strong><a href="https://en.wikipedia.org/wiki/Hierarchical_navigable_small_world">HNSW</a></strong>.</p><p>Do not let the academic name intimidate you. HNSW is just a multi-layered skip-list mapped over a proximity graph. </p><p>Imagine you are driving from New York to a specific house in a suburb of Los Angeles</p><h4>The Top Layer (Interstates)</h4><p>You don&#8217;t take local roads across the country. You get on an interstate. </p><p>In HNSW, the top layer has very few nodes, but they have long-distance links. </p><p>The search algorithm drops in here and makes massive, cross-graph jumps toward the general cluster of the target.</p><h4>The Middle Layers (City Roads)</h4><p>Once you are near Los Angeles, you drop down a layer. </p><p>There are more nodes here, connected by shorter links. </p><p>You navigate to the correct neighborhood.</p><h4>The Bottom Layer (Local Streets)</h4><p>You drop to the base layer, which contains every single vector in the database, and you traverse the local streets until you hit the closest possible house (a local minimum).</p><p>HNSW is a masterpiece of algorithmic engineering. It reduces a catastrophic <code>O(N)</code> full table scan into a blisteringly fast <code>O(log N)</code> graph traversal.</p><p>But it comes with a brutal physical cost called <strong>Pointer Chasing.</strong></p><h2>Why NVMe SSDs Hate HNSW (Pointer Chasing)</h2><p>Traditional relational databases are famous for being disk-friendly because they exploit <strong>Locality of Reference</strong>. </p><p>B-Tree nodes are packed cleanly into contiguous 8KB blocks (pages) on your SSD. When Postgres needs an index node, it pulls a single 8KB block into memory, and all the sequential keys are right there next to each other.</p><p>HNSW graphs are the exact opposite.</p><p>An HNSW index is a giant, chaotic web of pointers (memory addresses) pointing to other pointers across multiple layers. </p><p>The nodes are scattered randomly across the heap during insertion.</p><p>Traversing this graph means jumping wildly from memory address to memory address. </p><p>If your HNSW index does not fit in RAM and is forced onto a Solid-State Drive, following those pointers requires thousands of <strong>Random Disk Reads</strong> per query.</p><p>A standard NVMe SSD takes roughly 100 microseconds (<code>&#181;s</code>) to complete a random 4KB read. If an HNSW search requires 200 graph hops to find the nearest neighbor</p><p><code>200 hops &#215; 100 &#181;s = 20 milliseconds of pure disk latency</code></p><p>That sounds fast, until you realize this is for <em>one</em> query. </p><p>If your app is doing 1,000 queries per second, your SSD must sustain 200,000 random IOPS. </p><p>Even the most expensive AWS <code>io2 Block Express</code> volumes will buckle under that kind of random I/O queue depth. </p><p>Your 20ms latency will instantly spike to 2 seconds as the disk controllers choke.</p><p>Furthermore, pointer chasing completely defeats the OS Page Cache and the CPU&#8217;s hardware prefetchers. </p><p>The CPU cannot guess which memory address the graph will jump to next, resulting in continuous L3 cache misses.</p><h2>The RAM Tax</h2><p>Here is the physical reality of vector search</p><p><strong>To get the sub-50ms latency that Vector DBs advertise, the entire HNSW index must physically live in RAM.</strong></p><p>This brings us to the invoice (cost of the RAM). </p><p>RAM is exponentially more expensive than NVMe storage. Let&#8217;s do the math on a production-scale deployment of 100 million vectors.</p><ul><li><p><strong>Vector Payload</strong> - <code>100,000,000 &#215; 6 KB (1536-dim floats) = 600 GB</code></p></li><li><p><strong>HNSW Graph Overhead</strong> - Each node in HNSW maintains bidirectional pointers to its neighbors across multiple layers. This pointer overhead usually adds 30% to 50% to the base vector size. Let&#8217;s add 200 GB.</p></li></ul><p>To serve 100 million vectors, you need <strong>800 GB of RAM</strong>.</p><p>Storing 800 GB on a standard Postgres SSD costs about $65 a month. Holding 800 GB in an AWS <code>r6a.24xlarge</code> memory-optimized instance costs <strong>$5,300 a month</strong>.</p><p>When you buy a dedicated Vector Database, you are not buying better &#8220;AI.&#8221;</p><p>You are buying an expensive fleet of high-RAM cloud instances to hold a massive, chaotic pointer graph in volatile memory because the algorithm physically cannot survive on a disk.</p><h2>What you should do?</h2><p>Do not subsidize a SaaS company&#8217;s valuation because you think standard infrastructure can&#8217;t handle vector math. </p><p>Here is the architectural framework you should use before signing a vendor contract</p><h3>Use Postgres (<code>pgvector</code>)</h3><p><strong>If you have fewer than 5 million vectors</strong>, you do not have a scale problem. You have a standard CRUD problem.</p><p>Install the <code>pgvector</code> extension on your existing Postgres instance. </p><p>Postgres is perfectly capable of building an HNSW index and holding it in its <code>shared_buffers</code> (RAM). </p><p>You save thousands of dollars, you eliminate a fragile network hop in your infrastructure, and you keep your relational data and your embeddings in the exact same ACID-compliant transaction block. </p><p>You can <code>JOIN</code> your semantic search results directly against your user permission tables in a single query.</p><h3>Use a Dedicated Vector DB (Pinecone, Milvus, Qdrant)</h3><p>You only graduate to a dedicated vector engine when your index physically outgrows the RAM limits of a single, massive database instance.</p><p>When you hit 50 million, 100 million, or a billion vectors, a single Postgres node will OOM (Out of Memory) trying to fit the HNSW graph into <code>shared_buffers</code>. </p><p><em>That</em> is the exact moment you pay a premium for a distributed vector database. </p><p>You are paying them to shard the massive HNSW graph across multiple clustered nodes and handle the distributed scatter-gather networking required to query it.</p><div><hr></div><h2>Conclusion</h2><p>Architecture requires alignment between the physical realities of the hardware and the economic realities of the business.</p><p>HNSW is a brilliant algorithm, but it is an unapologetic memory glutton. </p><p>It defeats disk I/O, thrashes CPU caches, and demands expensive DDR5 RAM to function at scale. </p><p>Start with Postgres, monitor your memory saturation, and scale out to a distributed vector engine only when the physics of the graph demand it.</p><p>Don&#8217;t buy a distributed system until you have a distributed problem.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/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 BinaryBox! 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><p></p><p></p><p></p><p></p>]]></content:encoded></item><item><title><![CDATA[Thought - Why Postgres is a dangerous default]]></title><description><![CDATA[Nobody gets fired for choosing Postgres. It is the safest, most defensible technical decision you can make. Until it isn't. Especially when you are building a highly concurrent, event-driven logger.]]></description><link>https://www.binarybox.org/p/thought-why-postgres-is-a-dangerous</link><guid isPermaLink="false">https://www.binarybox.org/p/thought-why-postgres-is-a-dangerous</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Thu, 19 Mar 2026 06:00:52 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!dbpC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!dbpC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!dbpC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png 424w, https://substackcdn.com/image/fetch/$s_!dbpC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png 848w, https://substackcdn.com/image/fetch/$s_!dbpC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png 1272w, https://substackcdn.com/image/fetch/$s_!dbpC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!dbpC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png" width="1024" height="521" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:521,&quot;width&quot;:1024,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Upgrading PostgreSQL with no data loss and minimal downtime | Tech blog |  Palark&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;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Upgrading PostgreSQL with no data loss and minimal downtime | Tech blog |  Palark" title="Upgrading PostgreSQL with no data loss and minimal downtime | Tech blog |  Palark" srcset="https://substackcdn.com/image/fetch/$s_!dbpC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png 424w, https://substackcdn.com/image/fetch/$s_!dbpC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png 848w, https://substackcdn.com/image/fetch/$s_!dbpC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png 1272w, https://substackcdn.com/image/fetch/$s_!dbpC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3a933fd4-4ab4-4f2c-8ff8-45c12b4c87b3_1024x521.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Nobody gets fired for choosing Postgres. </p><p>It is the safest, most defensible technical decision you can make. Until it isn&#8217;t. Especially when you are building a highly concurrent, event-driven logger.</p><p>You pick it because it handles everything perfectly on day one, completely ignoring that you are buying a general-purpose engine for what might be a highly specialized problem.</p><p>We do this constantly in software. We slap a UUIDv4 on a primary key because it is convenient, blindly accepting the B-Tree fragmentation it guarantees at scale. </p><p>We spin up Postgres because it is the industry standard, ignoring what its storage engine actually does to our specific data shape.</p><p>Convenience dictates the architecture. Physics dictates the bill.</p><h2>The cost of MVCC Write</h2><p>Look at how Postgres manages concurrency. Multi-Version Concurrency Control (MVCC) is a brilliant mechanism. It allows readers and writers to operate simultaneously by creating new tuple versions instead of modifying data in place.</p><p>Let&#8217;s be absolutely clear.</p><p>If you are building a standard B2B SaaS application, with users, organizations, billing tables, and dynamic records, Postgres is flawless. If you are building a banking ledger where balances update constantly, MVCC is your best friend.</p><p>But if you are building an event log, a sensor stream, or an audit trail, MVCC is a parasite.</p><p>Consider a standard telemetry or event logging table. The schema looks entirely innocent</p><pre><code><code>CREATE TABLE user_events (
    event_id UUID PRIMARY KEY,
    user_id BIGINT,
    event_type VARCHAR(50),
    payload JSONB,
    created_at TIMESTAMPTZ DEFAULT NOW()
);

-- Executed 50,000 times a second
INSERT INTO user_events (event_id, user_id, event_type, payload)
VALUES ('...', 123, 'click', '{"button": "signup"}');</code></code></pre><p>To the developer, this is a simple, lightweight append operation. To the Postgres storage engine, this is a massive overhead event.</p><p>Your rows are immutable the second they hit the disk. Yet, every single insert carries a hidden 23-byte tuple header (<code>xmin</code>, <code>xmax</code>, <code>cmin</code>, <code>cmax</code>) tracking version visibility for concurrency that will never happen.</p><p>At 50,000 inserts a second, you are paying a massive, constant write tax on data that will never change. You are generating gigabytes of Write-Ahead Log (WAL) just to track ghosts.</p><h2>8KB at a Time</h2><p>When you do actually update or delete records in a highly active table, the architecture fights you in a completely different way.</p><pre><code><code>-- You think you are modifying data in place. You aren't.
UPDATE user_sessions 
SET last_seen = NOW() 
WHERE session_id = 'abc-123';</code></code></pre><p>Postgres does not delete old rows. It leaves the dead tuple sitting exactly where it was on the physical 8KB page. It writes the new, updated row to a new location. A background worker called autovacuum is supposed to sweep through eventually and mark that old space as reusable.</p><p>Under a heavy write load, autovacuum loses the race. Dead tuples accumulate faster than the database can process them.</p><p>Because live and dead records share the exact same physical pages, the query planner cannot skip the graveyard. If your table has 10 million live rows and 40 million dead ones, your hardware is pulling massive amounts of garbage from the disk into your buffer pool just to find the active data. The engine literally chokes on its own history.</p><p>As <strong><a href="https://www.cs.cmu.edu/~pavlo/">Andy Pavlo</a></strong> at CMU has pointed out, if someone were building a new MVCC database today, they would not implement it the way Postgres does. Its append-only storage design is a relic of the 1980s that predates log-structured storage patterns entirely.</p><h2>The Snapshot Collision</h2><p>One day someone asks for a dashboard. You run a long analytical query against this live operational data.</p><pre><code><code>-- The Data Analyst runs this at 9:00 AM
SELECT date_trunc('hour', created_at), count(*)
FROM user_events
GROUP BY 1
ORDER BY 1;</code></code></pre><p>Running a daily sales report on a 5-gigabyte SaaS database is fine. Running a 2-hour aggregation on a table absorbing 50,000 sensor readings a second is a death sentence.</p><p>To guarantee consistent reads, Postgres holds the transaction snapshot open. While that two-hour report runs, autovacuum is paralyzed.</p><p>It cannot clean up any dead tuples that fall behind that active transaction horizon. Your dashboard is actively blocking garbage collection for the entire operational database. </p><p>Every <code>UPDATE</code> happening on your site during those two hours leaves a permanent scar on the disk until the report finishes.</p><p>Friction generates heat. Heat generates wear. Wear destroys your query latency. Postgres was simply not designed to serve heavy OLTP and OLAP from the same instance under load.</p><h2>The Optimization Treadmill</h2><p>This is when you step onto the Optimization Treadmill. You do not fix the architecture. You treat the symptoms.</p><h4>Step 1 - The Index Trap</h4><p>Write throughput dips, so you add a composite index to speed up the read queries causing the locks. You just amplified your write penalty. Every insert now has to update multiple B-Trees.</p><h4>Step 2 - The Vacuum Illusion</h4><p>The table bloats, so you aggressively tune the background workers.</p><pre><code><code>ALTER TABLE user_sessions 
SET (autovacuum_vacuum_scale_factor = 0.01);</code></code></pre><p>You force the database to vacuum constantly. You are now burning precious CPU cycles fighting your own insert rate.</p><h4>Step 3 - Hardware Scaling</h4><p>CPU spikes, so you upgrade the instance class. You double the RAM. You provision higher IOPS.</p><p>Every single one of these interventions is the technically correct response to a real symptom. You are doing exactly what an experienced DBA would do. But none of it changes your trajectory. You are fighting an architectural ceiling, not a misconfiguration.</p><p>The treadmill only speeds up. Each fix buys you a few months of runway before the database collects its tax again.</p><h2>How to Spot the Treadmill Early</h2><p>The most critical decision you can make is recognizing the treadmill before you get on it. Stop treating Postgres as a zero-cost default. Look at the physical reality of your data before you write the schema.</p><ul><li><p>Are your writes predominantly inserts with no updates?</p></li><li><p>Are the rows permanently immutable once written?</p></li><li><p>Is your data volume growing by 50 percent year over year?</p></li><li><p>Do you need to run heavy analytics against the same live table?</p></li></ul><p>If you nod your head to any of those, the architectural mismatch is already baked in. The only variable is how much engineering time and AWS budget you burn before you stop asking how to tune the database, and start asking the question you should have asked on day one.</p><p>Are we actually building a general-purpose OLTP system?</p><h2>The HTAP Escape</h2><p>If you recognize the treadmill early, you can escape it. If you actually need to serve heavy OLTP and OLAP concurrently from the same system without melting your disks, you need an architecture designed for Hybrid Transactional/Analytical Processing (HTAP).</p><p>When Postgres is no longer the default, you have three primary paths</p><h3>1. <a href="https://www.singlestore.com/">SingleStore</a></h3><p>SingleStore (formerly MemSQL) solves the OLTP/OLAP collision by physically splitting the storage engine under the hood. It uses an in-memory rowstore for blazing-fast transactional inserts and a disk-based columnstore for your analytical queries.</p><p>It is true HTAP. You get millisecond ingest and sub-second aggregations on the exact same cluster. It speaks the MySQL wire protocol, making integration trivial.</p><p>But, it is proprietary and expensive. The in-memory rowstore demands that your operational working set fits entirely in RAM. You are trading software friction for a massive hardware bill.</p><h3>2. <a href="https://www.pingcap.com/">TiDB</a></h3><p>TiDB separates compute from storage entirely. It uses a Raft-based distributed key-value store (TiKV) for your transactional inserts, and asynchronously replicates that data to a columnar engine (TiFlash) for analytics. The smart query planner automatically routes your dashboard queries to the column nodes and your point-writes to the row nodes.</p><p>It scales horizontally forever. You can run massive analytical reports against TiFlash without ever locking an operational row in TiKV.</p><p>But, it has severe operational complexity. You do not just &#8220;spin up&#8221; TiDB. Running the control plane, compute nodes, row storage nodes, and column storage nodes requires a dedicated infrastructure team. It is a Ferrari; you have to hire the mechanics.</p><h3>3. <a href="https://kafka.apache.org/">Kafka</a> + <a href="https://clickhouse.com/">ClickHouse</a> (Split Stack)</h3><p>If you cannot justify HTAP licensing or operational overhead, stop trying to force both workloads into one database. Write your immutable events to an append-only log (Kafka). Consume that log into a pure columnar database (ClickHouse) for your dashboards.</p><p>The physics align perfectly. Kafka&#8217;s sequential writes effortlessly absorb the OLTP load. ClickHouse&#8217;s columnar compression destroys the OLAP load. Both systems run at absolute maximum efficiency.</p><p>But, you now maintain two distinct distributed systems and the pipeline connecting them. Eventual consistency is guaranteed; immediate consistency is impossible.</p><div><hr></div><h1>Conclusion</h1><p>There is a recurring theme in engineering failures, we mistake popularity for universal fit.</p><p>Postgres is arguably the greatest relational database ever built. But it is a machine with specific operating parameters. </p><p>When you force an append-only, high-velocity stream into an MVCC engine, you are not testing the limits of Postgres. You are testing the limits of your infrastructure budget.</p><p>Stop letting convenience dictate your architecture. The cost of learning a specialized database like ClickHouse or Kafka today is infinitely lower than the cost of fighting the Optimization Treadmill tomorrow.</p><p>Physics always wins. Choose your database accordingly.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/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 BinaryBox! 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><p></p>]]></content:encoded></item><item><title><![CDATA[Research - A Formal Threshold Model for B-Tree Performance Degradation Under Random Primary Keys in OLTP Systems]]></title><description><![CDATA[We prove that this degradation is a physical limitation of B-Tree mechanics under random insertion, compounded by Write Amplification Factor (WAF) penalties, rather than a hardware or traffic-scaling]]></description><link>https://www.binarybox.org/p/research-a-formal-threshold-model</link><guid isPermaLink="false">https://www.binarybox.org/p/research-a-formal-threshold-model</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Tue, 17 Mar 2026 06:01:02 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!F1Pb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!F1Pb!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!F1Pb!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png 424w, https://substackcdn.com/image/fetch/$s_!F1Pb!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png 848w, https://substackcdn.com/image/fetch/$s_!F1Pb!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png 1272w, https://substackcdn.com/image/fetch/$s_!F1Pb!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!F1Pb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png" width="1456" height="762" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:762,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:109405,&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://www.binarybox.org/i/191116240?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.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_!F1Pb!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png 424w, https://substackcdn.com/image/fetch/$s_!F1Pb!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png 848w, https://substackcdn.com/image/fetch/$s_!F1Pb!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png 1272w, https://substackcdn.com/image/fetch/$s_!F1Pb!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9af60071-dc0d-4682-af0c-647161e40d7c_1720x900.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Image credits Toptal</figcaption></figure></div><p>The adoption of UUIDv4 as a primary key in OLTP databases has become a widespread default, driven by ORM convenience and distributed system requirements. </p><p><strong><a href="https://zenodo.org/records/19034540">This paper</a></strong> demonstrates that UUIDv4 primary keys guarantee severe, predictable performance degradation as table size grows. We introduce the Buffer Saturation Ratio (BSR) and derive a closed-form threshold (N<sup>*</sup>) that predicts exactly when write latency will spike. </p><p>We prove that this degradation is a physical limitation of B-Tree mechanics under random insertion, compounded by Write Amplification Factor (WAF) penalties, rather than a hardware or traffic-scaling failure.</p><h2>The Anatomy of a Deferred Crisis</h2><p>Modern frameworks make it trivial to assign a random, 128-bit string as a primary key. Distributed ID generation solves immediate engineering headaches. It prevents sequence contention. It hides entity counts from users.</p><p>But it introduces a delayed tax on your storage layer.</p><p>Engineers rarely observe the cost of UUIDv4 during the first year of a project. Databases aggressively cache active indexes in RAM. As long as the primary key index fits entirely within the database buffer pool, random inserts perform acceptably.</p><p>The crisis arrives silently. The index quietly outgrows the allocated memory. The database begins reading cold pages from the physical disk to complete routine inserts. Write latency jumps by two orders of magnitude. The typical engineering response, upgrading the instance class which fails to resolve the underlying physics.</p><h2>B-Tree Mechanics and the Fill Factor Penalty</h2><p>Relational databases use B-Tree variants to store indexes. Sequential keys, such as BigInt sequences or UUIDv7, append new records to the rightmost edge of the tree. The database keeps that single, active leaf node hot in memory.</p><p>UUIDv4 values possess zero temporal locality. Every insert targets a random location in the B-Tree.</p><p>When you insert a record into a random leaf node that is already full, the database executes a page split. It allocates a new page (16KB in MySQL InnoDB, 8KB in PostgreSQL), transfers half the records, and updates the parent nodes.</p><p>Sequential inserts achieve a high index fill factor (f &#8776; 0.90 to 0.94). Random UUIDv4 inserts guarantee continuous page splits, driving the equilibrium fill factor down to approximately 0.50. You are permanently storing half-empty pages. Your index requires twice the RAM just to exist.</p><h2>The Buffer Saturation Ratio (BSR)</h2><p>To predict performance failure, we must track the relationship between index size and available memory. We define the Buffer Saturation Ratio (BSR)</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;BSR = \\frac{B_{pool}}{I_{size}}&quot;,&quot;id&quot;:&quot;MFHVRXGSZK&quot;}" data-component-name="LatexBlockToDOM"></div><p>Where B<sub>pool</sub> is the configured memory for caching (InnoDB Buffer Pool or PostgreSQL <code>shared_buffers</code>), and I<sub>size</sub> is the total size of the primary key index.</p><p>When BSR &#8805; 1.0, the entire index resides in memory. Writes are fast.<br>When BSR &lt; 1.0 , the index exceeds available RAM.</p><p>At BSR &lt; 1.0, every random insert carries a cache miss probability (P<sub>miss</sub>)</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;P_{miss} = 1 - BSR&quot;,&quot;id&quot;:&quot;TZQPTRAXYL&quot;}" data-component-name="LatexBlockToDOM"></div><p>When a cache miss occurs, the database evicts a page to load the target leaf node from disk. Because UUIDv4 targets pages uniformly, the newly loaded page is highly unlikely to be reused before it is evicted again. This creates LRU eviction thrashing.</p><p>Your expected insert latency (L<sub>insert</sub>) becomes completely dominated by disk I/O</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;L_{insert} = L_{cpu} + (P_{miss} \\times L_{io})&quot;,&quot;id&quot;:&quot;CESZUJJVNM&quot;}" data-component-name="LatexBlockToDOM"></div><h2>Deriving the Threshold Row Count (N<sup>*</sup>)</h2><p>We can calculate the exact row count where a database will fall off the performance cliff. First, we model the projected index size</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;I_{size} = \\frac{N \\times (K_{size} + P_{overhead})}{f}&quot;,&quot;id&quot;:&quot;XTXVBRBNEH&quot;}" data-component-name="LatexBlockToDOM"></div><p>Where</p><ul><li><p>N = Number of rows</p></li><li><p>K<sub>size</sub>= Key size in bytes (16 for binary UUID, 36 for char UUID, 8 for BigInt)</p></li><li><p>P<sub>overhead</sub> = Pointer overhead (roughly 8 bytes)</p></li><li><p>f = Fill factor (0.50 for UUIDv4, 0.94 for BigInt)</p></li></ul><p>To find the threshold row count (N<sup>*</sup>), we set I<sub>size</sub> equal to B<sub>pool </sub>(BSR = 1.0) and solve for N</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;N^* = \\frac{B_{pool} \\times f}{K_{size} + P_{overhead}}&quot;,&quot;id&quot;:&quot;ZDMSHGLYPT&quot;}" data-component-name="LatexBlockToDOM"></div><p>This equation allows architects to project the exact lifespan of a database schema configuration.</p><h2>Write Amplification Factor (WAF)</h2><p>Random inserts punish the storage layer beyond just cache misses. They generate massive Write Amplification Factor (WAF) in the Write-Ahead Log (WAL).</p><p>The write amplification for a UUIDv4 index follows a logarithmic curve</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;WAF_{uuid} = 1 + \\left(\\frac{2}{m}\\right) \\times \\log_2\\left(\\frac{N}{M}\\right)&quot;,&quot;id&quot;:&quot;NBQIQZZIXA&quot;}" data-component-name="LatexBlockToDOM"></div><p>Where m is the B-Tree order (roughly 80 for InnoDB at 16KB pages with 200-byte rows), N is total rows, and M is the number of rows that fit in the buffer pool.</p><p>Your total write amplification multiplies by your secondary indexes (k)</p><div class="latex-rendered" data-attrs="{&quot;persistentExpression&quot;:&quot;WAF_{total} = (k + 1) \\times WAF_{uuid}&quot;,&quot;id&quot;:&quot;OXLKBUZQIS&quot;}" data-component-name="LatexBlockToDOM"></div><p>MySQL InnoDB uses clustered indexes. The massive, random primary key is duplicated into the leaf nodes of every secondary index. PostgreSQL uses heap tables, bypassing clustered index bloat, but secondary indexes still suffer the brutal page split penalty and identical WAF multipliers.</p><h2>Case study</h2><p>One of my client ran a package scan event log using a <code>char(36)</code> UUIDv4 primary key on a 16 GB RDS instance equipped with a 12 GB buffer pool.</p><p>During the first year, at 50 million rows, performance remained nominal. Their BSR sat at 8.0. The buffer pool easily absorbed the random writes.</p><p>The table eventually reached 500 million rows. The <code>char(36)</code> key, combined with the 0.50 fill factor, swelled the index size to roughly 15 GB.</p><p>Their BSR dropped to 0.80. Write latency instantly climbed from 2 ms to 200 ms. CPU utilization on the RDS instance pinned at 90 percent, entirely consumed by managing LRU evictions.</p><p>They upgraded the RDS instance class twice. Neither upgrade resolved the latency. Each vertical scaling event raised CPU, RAM, and the buffer pool proportionally, but the BSR remained strictly below 1.0. The index remained larger than the pool.</p><p>Hardware scaling cannot outrun mathematical thresholds. The only viable solution was migrating the primary key to a sequential format.</p><h2>The N<sup>*</sup> Decision Matrix</h2><p>Applying the N<sup>*</sup> formula to standard infrastructure configurations reveals the severe capacity penalty of UUIDv4 strings</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!jV8A!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b3c774a-e626-4712-9967-8976142a32a6_1920x745.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!jV8A!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b3c774a-e626-4712-9967-8976142a32a6_1920x745.png 424w, https://substackcdn.com/image/fetch/$s_!jV8A!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b3c774a-e626-4712-9967-8976142a32a6_1920x745.png 848w, https://substackcdn.com/image/fetch/$s_!jV8A!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b3c774a-e626-4712-9967-8976142a32a6_1920x745.png 1272w, https://substackcdn.com/image/fetch/$s_!jV8A!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b3c774a-e626-4712-9967-8976142a32a6_1920x745.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!jV8A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b3c774a-e626-4712-9967-8976142a32a6_1920x745.png" width="1456" height="565" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/3b3c774a-e626-4712-9967-8976142a32a6_1920x745.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:565,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:125351,&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://www.binarybox.org/i/191116240?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b3c774a-e626-4712-9967-8976142a32a6_1920x745.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_!jV8A!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b3c774a-e626-4712-9967-8976142a32a6_1920x745.png 424w, https://substackcdn.com/image/fetch/$s_!jV8A!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b3c774a-e626-4712-9967-8976142a32a6_1920x745.png 848w, https://substackcdn.com/image/fetch/$s_!jV8A!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b3c774a-e626-4712-9967-8976142a32a6_1920x745.png 1272w, https://substackcdn.com/image/fetch/$s_!jV8A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F3b3c774a-e626-4712-9967-8976142a32a6_1920x745.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>A 32 GB server running a <code>char(36)</code> UUIDv4 index chokes at 273 million rows. The exact same hardware running a BigInt handles 2.25 billion rows. You are paying a 400 percent RAM tax for a framework default.</p><div><hr></div><h2>Conclusion</h2><p>UUIDv4 primary keys constitute a systemic architectural flaw in high-throughput OLTP databases. They actively defeat database caching mechanisms and maximize physical disk I/O.</p><p>Engineers must stop treating database performance degradation as a generic symptom of traffic scaling. Use the N<sup>*</sup> threshold formula to project your schema&#8217;s structural limits before executing a <code>CREATE TABLE</code> statement.</p><p>If distributed ID generation is a hard requirement, adopt temporally sequential identifiers like UUIDv7 or ULID. Align your data structures with the physical constraints of B-Tree mechanics.</p><p>Read the paper here</p><p><strong><a href="https://zenodo.org/records/19034540">https://zenodo.org/records/19034540 </a></strong></p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/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 BinaryBox! 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><p></p>]]></content:encoded></item><item><title><![CDATA[Thought - Why Banks Can't "Just Rewrite" COBOL in Java/Python/Go?]]></title><description><![CDATA[This is technical debt. We are going to rewrite the Core Ledger in Java microservices. We will be cloud-native]]></description><link>https://www.binarybox.org/p/thought-why-banks-cant-just-rewrite</link><guid isPermaLink="false">https://www.binarybox.org/p/thought-why-banks-cant-just-rewrite</guid><dc:creator><![CDATA[Ashok Vishwakarma]]></dc:creator><pubDate>Thu, 12 Mar 2026 06:01:49 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!e2QY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!e2QY!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!e2QY!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg 424w, https://substackcdn.com/image/fetch/$s_!e2QY!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg 848w, https://substackcdn.com/image/fetch/$s_!e2QY!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!e2QY!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!e2QY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg" width="1198" height="627" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:627,&quot;width&quot;:1198,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;Anthropic's COBOL-Crunching AI Shakes IBM, But Opens Big New Deals for  Indian IT Giants, ETEnterpriseai&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;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="Anthropic's COBOL-Crunching AI Shakes IBM, But Opens Big New Deals for  Indian IT Giants, ETEnterpriseai" title="Anthropic's COBOL-Crunching AI Shakes IBM, But Opens Big New Deals for  Indian IT Giants, ETEnterpriseai" srcset="https://substackcdn.com/image/fetch/$s_!e2QY!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg 424w, https://substackcdn.com/image/fetch/$s_!e2QY!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg 848w, https://substackcdn.com/image/fetch/$s_!e2QY!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!e2QY!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2dd55e57-b708-4a2a-8ee3-300accc387de_1198x627.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg aria-hidden="true" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>It happens every five years. A new CTO arrives at a Global 500 bank. </p><p>They look at the &#8220;Green Screen&#8221; terminals, the 40-year-old IBM Z/OS mainframes, and the millions of lines of COBOL. </p><p>They cringe.</p><p>&#8220;This is legacy,&#8221; they declare. </p><p>&#8220;This is technical debt. We are going to rewrite the Core Ledger in Java microservices. We will be cloud-native.&#8221;</p><p>Three years and $50 million later, the project is quietly cancelled. </p><p>The CTO moves on to a different company. </p><p><strong>The COBOL remains.</strong></p><p>Why? </p><p>It&#8217;s not because the bank is lazy. It&#8217;s not because we lost the source code. </p><p>It is because the fundamental architecture of modern programming languages is hostile to the requirements of global finance.</p><p>You are not fighting code, you are fighting how computers do math.</p><h2>The Math Problem (IEEE 754)</h2><p>When you write <code>float</code> or <code>double</code> in Java, Python, C++, or Go, you are using <strong><a href="https://en.wikipedia.org/wiki/IEEE_754">IEEE 754 Binary Floating Point</a></strong> arithmetic. </p><p>This standard is designed for scientific calculation, measuring the distance to a star or the velocity of a particle. </p><p>It prioritizes range and speed over absolute precision.</p><h3>The Rounding Error</h3><p>Open your browser console or a Node.js shell and type</p><pre><code><code>0.1 + 0.2
// The result: 0.30000000000000004</code></code></pre><p>In a physics simulation, that <code>0.00000000000000004</code> is noise. </p><p>In a banking ledger processing trillions of dollars a day, that error is a regulatory violation, a failed audit, and potentially a lawsuit.</p><h3>Fixed-Point Decimal (COBOL Way)</h3><p>COBOL was not designed for science. </p><p>It was designed for Business (Common Business Oriented Language). </p><p>It does not use Binary Floating Point for money. It uses <strong><a href="https://en.wikipedia.org/wiki/Fixed-point_arithmetic">Fixed-Point arithmetic</a> </strong>stored as<strong> <a href="https://en.wikipedia.org/wiki/Binary-coded_decimal">Binary-Coded Decimal (BCD)</a></strong>.</p><p>In COBOL, you define a variable like this</p><pre><code><code>01 ACCOUNT-BALANCE PIC S9(13)V99 COMP-3.</code></code></pre><ul><li><p><code>01</code>: <strong>Level Number</strong>. In COBOL, <code>01</code> represents a top-level record or variable. Think of it like <code>const</code> or <code>let</code> at the root scope.</p></li><li><p><code>ACCOUNT-BALANCE</code>: The <strong>Variable Name</strong>. (COBOL uses kebab-case because it was invented before snake_case or camelCase won the war).</p></li><li><p><code>PIC</code>: <strong>Picture Clause</strong>. This tells the compiler exactly what the data looks like.</p></li><li><p><code>S</code>: <strong>Signed</strong>. This bit tracks if the number is positive or negative.</p></li><li><p><code>9(13)</code>: <strong>Numeric Integers</strong>. The number <code>9</code> represents a digit. <code>(13)</code> means &#8220;allocate space for 13 of them.&#8221;</p></li><li><p><code>V</code>: <strong>Virtual Decimal</strong>. This is the magic. It tells the CPU &#8220;assume a decimal point here,&#8221; but it <em>does not store a dot character</em> in memory. It saves space.</p></li><li><p><code>99</code>: <strong>Precision</strong>. Allocate exactly 2 digits for cents.</p></li><li><p><code>COMP-3</code>: <strong>Packed Decimal (BCD)</strong>. This is the instruction to store 2 digits per byte (using 4 bits each), rather than the standard 1 byte per character. This is what enables the hardware math precision.</p></li></ul><p>When COBOL calculates <code>0.1 + 0.2</code>, it does not convert them to binary approximations. </p><p>It calculates them in base-10, digit by digit, often utilizing specific hardware instructions on the mainframe (Decimal Floating Point units) that x86 architectures have historically lacked or emulated poorly. </p><p>The result is exactly <code>0.3</code>. Always.</p><h3>The Cost of Emulation</h3><p>You must be wondering can&#8217;t we do this in Java? </p><p>Yes, using <code>java.math.BigDecimal</code>.</p><p>But <code>BigDecimal</code> is a software object. It adds memory overhead and CPU cycles for every single calculation. </p><p>COBOL operates on money at the instruction-set level. When you are processing 50,000 transactions per second (TPS), that overhead isn&#8217;t just a performance hit.</p><p>It&#8217;s an infrastructure bill.</p><h2>True Transactionality (The CICS)</h2><p>The second reason rewrites fail is the misunderstanding of &#8220;Transactionality.&#8221;</p><p>Modern web development is obsessed with &#8220;Statelessness.&#8221; </p><p>You send a REST request, the server forgets you, and you send another. </p><p>State is hard.</p><p>The Mainframe world runs on <strong>CICS</strong> (Customer Information Control System). CICS is an application server that manages transactions with <strong>ACID</strong> properties (Atomicity, Consistency, Isolation, Durability) as a law of physics.</p><p>Lets take an example of ATM withdrawal</p><ol><li><p>Check Balance.</p></li><li><p>Debit Ledger.</p></li><li><p>Dispense Cash.</p></li><li><p>Log Audit Trail.</p></li></ol><p>In CICS, if step 3 fails (the cash jams), the entire transaction rolls back instantly. The ledger is never touched. </p><p>The state remains consistent. </p><h3>The Microservices Nightmare</h3><p>In a distributed microservices architecture, you break these steps into different services.</p><ul><li><p>Service A (Ledger) debits the account.</p></li><li><p>Service B (ATM) fails to dispense.</p></li><li><p>Now Service A must &#8220;compensate&#8221; (undo) the transaction.</p></li></ul><p>You have moved from immediate consistency to <strong>Eventual Consistency</strong>. </p><p>You are now managing &#8220;Distributed Transactions&#8221; and &#8220;Sagas.&#8221;</p><p>So question to you is, do you want your checking account balance to be &#8220;Eventually Consistent&#8221;? </p><p>Or do you want it to be Correct?</p><h2>Scale Up vs. Scale Out</h2><p>The philosophy of the modern cloud is <strong>Scale Out</strong>.</p><p><em>&#8220;If the server is overloaded, spin up 100 more cheap nodes. If a node fails, kill it and retry.&#8221;</em></p><p>The philosophy of the Mainframe is <strong>Scale Up</strong>.</p><p><em>&#8220;This single machine will process everything. It will not fail. If a CPU dies, a backup CPU takes over without the operating system even noticing.&#8221;</em></p><p>Mainframes utilize specialized <strong>I/O Processors</strong> (Channel Subsystems). </p><p>The main CPU doesn&#8217;t waste time reading from a disk or talking to the network card. It delegates that to a sub-processor and keeps crunching numbers. This allows mainframes to run at 100% CPU utilization for years without throttling. </p><p>Try running a Linux server at 100% CPU for an hour, it will become unresponsive.</p><p>Finally, the verdict is</p><ul><li><p>For Twitter, Scale Out. If a tweet fails to load, nobody loses money.</p></li><li><p>For the Global Economy, Scale Up. Reliability is not optional.</p></li></ul><h2>Why this matters to You?</h2><p>Even if you never touch a line of COBOL, the principles of the Mainframe apply to your modern stack.</p><h3>Never Use Floats for Money</h3><p>If you are building a FinTech app in JavaScript or Python, do not use standard number types for currency.</p><p><code>const price = 19.99; // </code>Is Wrong</p><p>Use libraries like <code>decimal.js</code>, Python&#8217;s <code>decimal</code> module, or store values as Integers (cents) and format them only for display </p><p>(<code>const priceInCents = 1999;</code>)</p><h3>Respect the Monolith</h3><p>We have been trained to think &#8220;Microservices = Good&#8221; and &#8220;Monolith = Bad.&#8221;</p><p>But if your application requires strict ACID compliance (inventory management, voting systems, banking), a well-structured Monolith with a single database transaction is infinitely less buggy than a distributed system trying to coordinate state across ten services.</p><h3>&#8220;Legacy&#8221; is a Success Metric</h3><p>Code becomes &#8220;legacy&#8221; only if it survives. </p><p>If you are looking at a system that has been running for 30 years, do not mock it. </p><p>Learn from it. It has survived market crashes, leap years, and user stupidity for decades. </p><p>It is doing something right.</p><div><hr></div><h2>Conclusion</h2><p>Rewriting a Core Banking System is rarely a &#8220;refactoring&#8221; effort. It is an archaeological excavation.</p><p>That &#8220;ugly&#8221; COBOL code contains 40 years of edge cases, the tax law change of 1992, the negative interest rate handling of 2015, the specific rounding rule required by the Bank of Japan.</p><p>If you rewrite it, you will miss these rules. </p><p>You will introduce bugs that were solved in 1985.</p><p>Don&#8217;t replace the Mainframe. Modernize it.</p><p>Wrap the COBOL logic in REST APIs (using Z/OS Connect). </p><p>Let the Java frontend look pretty, but let the Iron down in the basement handle the math.</p><p>Respect the Old Gods. </p><p>They are still holding up the sky.</p><div><hr></div><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://www.binarybox.org/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 BinaryBox! 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><p></p><p></p>]]></content:encoded></item></channel></rss>