<?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:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stack Valley - Medium]]></title>
        <description><![CDATA[I write about the things I run into while building software: data structures, Docker, system design, AI tools, and the concepts that actually matter in real projects. No fluff, just things explained the way I wish someone had explained them to me. - Medium]]></description>
        <link>https://medium.com/data-structures-and-algorithms-series?source=rss----a5a50631c66a---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stack Valley - Medium</title>
            <link>https://medium.com/data-structures-and-algorithms-series?source=rss----a5a50631c66a---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 18:35:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/data-structures-and-algorithms-series" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Gemini 4 Argon vs GPT-6 Astra vs Claude: Who Leads the Frontier?]]></title>
            <link>https://medium.com/data-structures-and-algorithms-series/gemini-4-argon-vs-gpt-6-astra-vs-claude-who-leads-the-frontier-747ada2b9197?source=rss----a5a50631c66a---4</link>
            <guid isPermaLink="false">https://medium.com/p/747ada2b9197</guid>
            <category><![CDATA[gemini-argon]]></category>
            <category><![CDATA[gemini-4-argon]]></category>
            <category><![CDATA[gemini-4]]></category>
            <category><![CDATA[gemini]]></category>
            <category><![CDATA[google-gemini]]></category>
            <dc:creator><![CDATA[Santhosh Kumar]]></dc:creator>
            <pubDate>Wed, 14 Oct 2026 13:12:56 GMT</pubDate>
            <atom:updated>2026-10-14T13:14:36.097Z</atom:updated>
            <content:encoded><![CDATA[<p>Every time a new flagship model drops, my feed fills up with the same screenshot. A bar chart, a handful of models, and the new one standing a little taller than the rest. Google’s Gemini 4 Argon, announced on September 30, got exactly that treatment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*84-1pAXLxNVJH-0sMumyow.png" /></figure><p>I’ve seen this cycle enough times to know the chart is where the story starts, not where it ends. So I spent a few days going through the published numbers for Argon, OpenAI’s GPT-6 Astra and Anthropic’s Claude models, and tried to separate what’s genuinely interesting from what’s marketing.</p><p>One thing up front. I haven’t had real hands-on time with Argon, and honestly almost nobody has. Access is still locked down, which I’ll get to. So this is a read of the evidence, filtered through the habits I’ve built from using these tools day to day. Treat it that way.</p><h3>A quick word on the numbers</h3><p>Most of the benchmark figures here come from Google’s own comparison page. That doesn’t make them wrong, but a company picks the tests it presents, and it picks them knowing how it scores. Independent results usually land a few weeks later, and they tend to soften the picture a little. I’d hold every number below loosely until that happens.</p><h3>Where Argon looks strongest</h3><p>The clearest win is professional knowledge work. On the Vals Index, Argon scores 68.9%, ahead of Claude Opus 5.5 at 67.0%, Claude Fable 5.1 at 65.8% and GPT-6 Astra at 63.1%. That’s a modest gap on its own. The more interesting part is how it widens on specific jobs.</p><p>On the Vals finance test it scores 65.4%, with the next best at 58.9%. On AutomationBench it reaches 51.3% against 42.5% for the closest rival. On Harvey’s legal benchmark it hits 19.6% while the others sit between 3.8% and 6.7%. Yes, 19.6% sounds low. That test is brutal, and the point is how far ahead it is of everything else on it.</p><p>Long context is the second standout, and it’s the one I’d pay the most attention to if I were building anything serious. Up to 128K tokens, Argon is close to perfect at 99.7%, but so is everyone else, roughly. The separation happens between 256K and 1M tokens, where Argon scores 84.2% and the rest land between 65% and 72%. If you’ve ever fed a model a huge codebase or a pile of contracts and watched it quietly lose the plot halfway through, you know why that matters.</p><p>There’s also a softer point that I think is underrated. Early independent coverage describes Argon as the frontier model most likely to say it doesn’t know something instead of guessing. After enough time using these systems, you learn that confident wrong answers are the real cost. A model that admits uncertainty saves you more time than one that’s two points higher on a coding test.</p><h3>Where the others pull ahead</h3><p>Argon doesn’t sweep the table, and anyone telling you otherwise is reading only the rows they like.</p><p>GPT-6 Astra is stronger on some of the hardest engineering and science tests. It scores 65.5% on FrontierSWE v2 against Argon’s 55.0%, and 68.1% on Terminal-Bench Science against 57.6%. When I think about open-ended engineering problems where there’s no clean spec and the model has to figure out what to even try, Astra’s numbers are the ones that make me pay attention.</p><p>Claude Opus 5.5 leads on Terminal-bench 4.0 with 66.4%, while the other three sit bunched up around 57 to 58%. That test is about working inside a real command line, which is basically the daily reality of a coding agent. Opus 5.5 also takes second place on FrontierSWE v2 and trails Argon by only a few points on DeepSWE v1.1.</p><p>So on coding, you get a split decision. Argon wins DeepSWE v1.1 and Vibe Code Bench, Astra wins a couple of the harder ones, and Opus wins the terminal work. I’ve never found a single “best coding model” that holds up across different kinds of projects, and these numbers don’t change my mind.</p><h3>The security angle</h3><p>On CWE-bench, which measures fixing real software vulnerabilities, Argon and Astra tie at 68.0%, with Opus 5.5 right behind at 67.0%. Fable 5.1 scores 58.0%. On raw ability, three of the four are effectively level.</p><p>What I find more telling is how the labs are handling access. Google is giving Argon first to the US government and to vetted defenders through a program called Fairwind. OpenAI’s standard Astra release refuses offensive work like writing exploit code, with its most sensitive capabilities behind a separate application process. Anthropic puts extra safeguards around its strongest tier too.</p><p>Different labs, same conclusion. These models are now good enough at security work that nobody wants to hand the most capable versions to everyone. As someone who’d like to use that capability for defense, I find that reassuring and annoying in equal measure.</p><h3>The part the charts leave out</h3><p>Here’s where the comparison turns practical, and honestly a bit funny.</p><p>Argon’s listed price is $2 per million input tokens and $10 per million output tokens. That’s cheap for a frontier model. But at launch, only the US government and Fairwind partners, a group of more than 650 organizations, could use it. Paying API customers and Google AI Ultra subscribers look like the next wave, with no date for everyone else. One tester who tried calling it with an ordinary Gemini API key in early October got a “not found” error back. Check Google’s pages for the current status before you plan anything around it.</p><p>GPT-6 Astra is the opposite. You can use it today through ChatGPT’s paid plans, the OpenAI API, Azure and Bedrock. It costs $10 per million input tokens and $50 per million output tokens, five times Argon’s list price, and the faster mode costs double that.</p><p>Claude Opus 5.5 and Fable 5.1 are both publicly available. Opus 5.5 is reportedly priced around $4 input and $20 output, but confirm that on Anthropic’s pricing page before you budget around it.</p><p>So the model with the strongest published knowledge-work scores and the lowest price is the hardest to actually get, and the most expensive one is the easiest. That’s a strange spot for the industry to be in.</p><h3>How I’d actually choose</h3><p>If I’m making the call for real work, this is roughly how I’d think about it.</p><p>For heavy document work in finance or law, or anything that depends on very long context, Argon is where I’d look first, as soon as I can get in. For gnarly engineering and scientific problems, Astra has the strongest case today. For terminal-driven coding agents, Opus 5.5 is hard to ignore. And if you need something running this week on a sensible budget, availability beats a leaderboard position, so I’d go with whatever you can reach right now.</p><h3>What I’d do before believing any of this</h3><p>The habit that has saved me the most time is boring. I keep a small set of real tasks from my own work, maybe ten of them, and I run every new model on those before I form an opinion. Not a benchmark. Actual messy problems with the weird edge cases I’ve already been bitten by. I’ve watched models that topped every chart feel merely fine on my own work, and models with modest scores turn out surprisingly good at the specific thing I needed.</p><p>Argon looks like a serious release, and Google has clearly earned its way back into the conversation. The long-context and professional-work results are the part I’m most curious about. But right now the numbers are one company’s account of its own model, and the real verdict will come from independent tests and from people running it on their own problems.</p><p>When access opens up, that’s when I’ll know what I think. Until then, I’m watching, and I’d suggest you do the same.</p><p><em>Benchmark figures are vendor-reported from Google DeepMind’s Gemini 4 Argon evaluation page unless noted. Pricing and availability were checked in early to mid October 2026 and may have changed.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=747ada2b9197" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-structures-and-algorithms-series/gemini-4-argon-vs-gpt-6-astra-vs-claude-who-leads-the-frontier-747ada2b9197">Gemini 4 Argon vs GPT-6 Astra vs Claude: Who Leads the Frontier?</a> was originally published in <a href="https://medium.com/data-structures-and-algorithms-series">Stack Valley</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From TCP to gRPC: The Networking Guide Every Backend Developer Needs]]></title>
            <link>https://medium.com/data-structures-and-algorithms-series/from-tcp-to-grpc-the-networking-guide-every-backend-developer-needs-cf6a86aff45c?source=rss----a5a50631c66a---4</link>
            <guid isPermaLink="false">https://medium.com/p/cf6a86aff45c</guid>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[network-protocols]]></category>
            <category><![CDATA[backend-development]]></category>
            <dc:creator><![CDATA[Santhosh Kumar]]></dc:creator>
            <pubDate>Tue, 28 Jul 2026 15:27:50 GMT</pubDate>
            <atom:updated>2026-07-28T15:27:50.043Z</atom:updated>
            <content:encoded><![CDATA[<p>Most developers use APIs every day. We send requests, receive responses, authenticate users, upload files, stream videos, and build real-time applications. But beneath all of these features are a handful of protocols that make everything work.</p><p>Understanding these protocols won’t just help you answer interview questions. It will help you design better systems, debug production issues faster, and make smarter architectural decisions.</p><p>In this article, we’ll walk through the networking concepts every backend developer should know, from TCP and UDP to REST, GraphQL, gRPC, and WebSockets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/0*ND4GDBwHUqo9UUb8.png" /></figure><h3>TCP - The Foundation of Reliable Communication</h3><p><strong>TCP (Transmission Control Protocol)</strong> is one of the most widely used communication protocols on the internet. Whenever reliability matters, TCP is usually the right choice.</p><p>Before any data is exchanged, TCP establishes a connection using a <strong>three-way handshake</strong>.</p><ol><li>Client sends a SYN request.</li><li>Server responds with SYN-ACK.</li><li>Client replies with ACK.</li></ol><p>Once this handshake is complete, both sides know they’re ready to communicate.</p><p>One common misconception is that TCP prevents packet loss. It doesn’t.</p><p>Packets can still be lost because of network congestion or hardware issues. The difference is that TCP detects missing packets, requests retransmission, and delivers the data in the correct order. From the application’s perspective, the communication remains reliable.</p><p>Some of the features TCP provides include:</p><ol><li>Reliable delivery</li><li>Ordered packets</li><li>Error detection</li><li>Flow control</li><li>Congestion control</li></ol><p>Because of these guarantees, TCP is commonly used for applications where every piece of data matters.</p><p>Some examples include:</p><ol><li>Web applications</li><li>Payment gateways</li><li>File transfers</li><li>Email services</li><li>Database communication</li></ol><p>Many popular application-layer protocols are built on top of TCP, including:</p><ol><li>HTTP</li><li>HTTPS</li><li>FTP</li><li>SMTP</li><li>IMAP</li><li>POP3</li><li>SFTP</li></ol><h3>UDP - Speed Over Reliability</h3><p><strong>UDP (User Datagram Protocol)</strong> takes a completely different approach.</p><p>Unlike TCP, UDP does not establish a connection before sending data. There is no handshake, no acknowledgement, and no retransmission of lost packets.</p><p>UDP simply sends packets and moves on.</p><p>This makes UDP extremely fast with very little overhead.</p><p>The trade-off is reliability. Packets may arrive out of order, arrive late, or never arrive at all.</p><p>For many applications, that’s perfectly acceptable.</p><p>Imagine you’re on a Zoom call. Losing one audio packet isn’t a big problem because another packet arrives a few milliseconds later. Waiting for retransmission would actually make the conversation feel worse.</p><p>Common UDP use cases include:</p><ol><li>Online multiplayer games</li><li>Voice calls</li><li>Video conferencing</li><li>Live streaming</li><li>DNS lookups</li></ol><p>It’s worth noting that many video streaming platforms, such as YouTube and Netflix, primarily deliver on-demand video over HTTP, which runs on TCP. However, technologies like WebRTC and QUIC use UDP for low-latency communication.</p><h3>HTTP - The Language of the Web</h3><p><strong>HTTP (HyperText Transfer Protocol)</strong> is the protocol that powers the web.</p><p>Every time you open a website, fetch data from an API, or submit a form, HTTP is usually involved.</p><p>An HTTP request typically contains:</p><ol><li>URL</li><li>Headers</li><li>Request body (when applicable)</li><li>HTTP method</li></ol><p>The most common HTTP methods are:</p><ol><li>GET</li><li>POST</li><li>PUT</li><li>PATCH</li><li>DELETE</li></ol><p>One of HTTP’s most important characteristics is that it is <strong>stateless</strong>.</p><p>This means the server does not automatically remember previous requests.</p><p>Every request must contain everything the server needs to process it.</p><p>For example, if a client sends five requests, the server treats each request independently unless some mechanism is used to maintain state.</p><p>This stateless nature makes HTTP scalable, but it also introduces challenges.</p><p>For example:</p><ol><li>Managing user login sessions</li><li>Identifying returning users</li><li>Remembering shopping carts</li><li>Maintaining authentication</li></ol><p>Applications usually solve these problems using:</p><ol><li>Cookies</li><li>Server-side sessions</li><li>JWT tokens</li><li>OAuth</li></ol><h3>HTTPS - Secure HTTP</h3><p>HTTP sends data in plain text.</p><p>Anyone intercepting the traffic could potentially read it.</p><p>HTTPS solves this problem.</p><p><strong>HTTPS (HyperText Transfer Protocol Secure)</strong> encrypts communication using <strong>TLS (Transport Layer Security)</strong>.</p><p>People often mention SSL alongside TLS, but SSL is now obsolete. Modern HTTPS uses TLS.</p><p>An important detail is that encryption does <strong>not</strong> stop someone from capturing network packets.</p><p>Tools like Wireshark can still capture encrypted traffic.</p><p>What encryption does is prevent attackers from reading or modifying the data without the appropriate cryptographic keys.</p><p>This protects sensitive information such as:</p><ol><li>Passwords</li><li>Payment information</li><li>Authentication tokens</li><li>Personal information</li></ol><p>Whenever your browser shows a padlock icon, you’re communicating over HTTPS.</p><h3>Understanding HTTP Methods</h3><p>Each HTTP method communicates a specific intent.</p><h3>GET</h3><p>Retrieves data without modifying anything.</p><pre>GET /users/15</pre><h3>POST</h3><p>Creates a new resource.</p><pre>POST /orders</pre><h3>PUT</h3><p>Replaces an entire resource.</p><p>If some fields are omitted, they may be overwritten depending on the API implementation.</p><pre>PUT /users/15</pre><h3>PATCH</h3><p>Updates only the fields provided in the request.</p><pre>PATCH /users/15</pre><h3>DELETE</h3><p>Removes a resource.</p><pre>DELETE /users/15</pre><h3>What is REST?</h3><p>REST stands for <strong>Representational State Transfer</strong>.</p><p>It is not a protocol.</p><p>It is an architectural style used for designing web APIs.</p><p>REST encourages designing APIs around resources instead of actions.</p><p>For example:</p><pre>GET /users/15<br>POST /orders<br>DELETE /products/50</pre><p>instead of:</p><pre>getUser()<br>deleteProduct()<br>createOrder()</pre><p>REST is built around several architectural constraints.</p><h3>1. Client-Server Architecture</h3><p>The client and server are independent of each other.</p><p>The client focuses on user interaction.</p><p>The server focuses on processing data.</p><h3>2. Stateless</h3><p>Every request contains all the information needed to process it.</p><p>The server does not rely on previous requests.</p><h3>3. Cacheability</h3><p>Responses can be cached to reduce server load and improve performance.</p><h3>4. Layered System</h3><p>Clients don’t need to know whether they’re communicating with the actual server, a load balancer, an API gateway, or a proxy.</p><h3>5. Uniform Interface</h3><p>Resources should follow consistent conventions.</p><p>For example:</p><pre>/users<br>/orders<br>/products</pre><p>instead of inconsistent naming patterns.</p><h3>Designing Better REST APIs</h3><p>A few practices make REST APIs easier to understand and maintain.</p><h3>Use nouns instead of verbs</h3><p>Good</p><pre>/users<br>/orders<br>/products</pre><p>Avoid</p><pre>/createUser<br>/deleteOrder</pre><h3>Use plural resource names</h3><pre>/users<br>/orders<br>/products</pre><p>This keeps APIs consistent.</p><h3>Choose the correct HTTP method</h3><p>Use GET for reading data.</p><p>Use POST for creating resources.</p><p>Use PUT for replacing resources.</p><p>Use PATCH for partial updates.</p><p>Use DELETE for removal.</p><h3>Version your APIs</h3><p>As APIs evolve, older clients may still depend on previous behaviour.</p><p>Versioning avoids breaking those clients.</p><pre>/v1/users<br>/v2/users</pre><h3>JSON vs XML</h3><p>REST APIs commonly exchange data using JSON.</p><h3>Why JSON became the standard</h3><ol><li>Lightweight</li><li>Easy for humans to read</li><li>Easy for machines to parse</li><li>Supported by almost every programming language</li></ol><p>Example:</p><pre>{<br>  &quot;id&quot;: 1,<br>  &quot;name&quot;: &quot;John&quot;<br>}</pre><p>XML is still used in many enterprise and legacy systems.</p><p>It provides stronger document validation and is common in older integrations.</p><p>Example:</p><pre>&lt;User&gt;<br>    &lt;Id&gt;1&lt;/Id&gt;<br>    &lt;Name&gt;John&lt;/Name&gt;<br>&lt;/User&gt;</pre><p>For most modern APIs, JSON is the preferred choice.</p><h3>WebSockets</h3><p>HTTP works well for request-response communication.</p><p>But some applications need continuous, two-way communication.</p><p>That’s where WebSockets come in.</p><p>After a WebSocket connection is established, both the client and server can send messages whenever they want without opening a new connection every time.</p><p>This makes WebSockets ideal for real-time systems.</p><p>Common examples include:</p><ol><li>Live chat</li><li>Multiplayer games</li><li>Stock market updates</li><li>Google Docs</li><li>Figma</li><li>Collaborative editors</li></ol><h3>WebSockets vs Long Polling</h3><p>These technologies often solve similar problems but in different ways.</p><h3>Long Polling</h3><p>The client sends an HTTP request.</p><p>The server waits until new data becomes available.</p><p>Once data is returned, the client immediately sends another request.</p><p>This cycle repeats continuously.</p><p>Long polling works well when updates are relatively infrequent.</p><p>Examples:</p><ol><li>Notification systems</li><li>Status updates</li><li>Background job progress</li></ol><h3>WebSockets</h3><p>A single persistent connection stays open.</p><p>Messages flow in both directions instantly.</p><p>Examples:</p><ol><li>Chat applications</li><li>Online gaming</li><li>Live dashboards</li><li>Real-time collaboration</li></ol><p>If your application needs constant updates with low latency, WebSockets are usually the better choice.</p><h3>GraphQL</h3><p>REST APIs often return more information than the client actually needs.</p><p>Imagine a mobile application that only needs a user’s name and profile picture.</p><p>A REST endpoint might return twenty different fields.</p><p>GraphQL solves this by allowing clients to request exactly the data they need.</p><p>Unlike REST, GraphQL typically exposes a single endpoint.</p><p>The client sends a query describing the required fields.</p><p>For example:</p><pre>{<br>  user(id: 1) {<br>    name<br>    profilePicture<br>  }<br>}</pre><p>The server returns only those fields.</p><p>This reduces unnecessary data transfer and can replace multiple REST API calls with a single query.</p><p>GraphQL is particularly useful for:</p><ol><li>Mobile applications</li><li>Complex frontend applications</li><li>Dashboards</li><li>Applications with varying data requirements</li></ol><h3>gRPC</h3><p>gRPC is a high-performance communication framework originally developed by Google.</p><p>Instead of exchanging JSON over HTTP, gRPC typically uses <strong>Protocol Buffers</strong>, a compact binary serialization format.</p><p>It also runs on top of <strong>HTTP/2</strong>, giving it several advantages.</p><p>Some of its key features include:</p><ol><li>Very fast serialization</li><li>Multiplexed requests</li><li>Bidirectional streaming</li><li>Lower bandwidth usage</li><li>Strongly typed contracts</li></ol><p>Because of these features, gRPC is commonly used for communication between internal microservices where performance matters.</p><p>Typical use cases include:</p><ol><li>Microservices</li><li>Distributed systems</li><li>Backend-to-backend communication</li><li>High-performance APIs</li><li>Streaming services</li></ol><p>Although both gRPC and WebSockets support streaming, they solve different problems.</p><p>WebSockets provide persistent bidirectional communication for browser and real-time applications.</p><p>gRPC focuses on efficient, structured communication between services.</p><h3>Choosing the Right Technology</h3><p>There isn’t a single protocol that’s best for every situation.</p><p>Choose the one that fits the problem you’re solving.</p><p>ScenarioBest ChoiceWeb applicationsHTTP / HTTPSPayment systemsTCP + HTTPSFile transfersTCPOnline gamesUDPLive chatWebSocketsLive dashboardsWebSocketsInternal microservicesgRPCMobile applications with complex dataGraphQLTraditional CRUD APIsREST</p><h3>Conclusion</h3><p>As backend developers, we often spend more time designing APIs than thinking about the protocols underneath them. But those protocols shape how our applications behave, scale, and perform.</p><p>Knowing when to use TCP instead of UDP, understanding why HTTP is stateless, choosing between REST and GraphQL, or deciding whether WebSockets or gRPC fit a particular problem are all practical skills that come up in real projects.</p><p>You don’t need to memorise every protocol specification. What matters is understanding the trade-offs. Once you do, you’ll make better architectural decisions, write more maintainable systems, and have a much easier time debugging production issues when they inevitably happen.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf6a86aff45c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-structures-and-algorithms-series/from-tcp-to-grpc-the-networking-guide-every-backend-developer-needs-cf6a86aff45c">From TCP to gRPC: The Networking Guide Every Backend Developer Needs</a> was originally published in <a href="https://medium.com/data-structures-and-algorithms-series">Stack Valley</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Every Modern Website Needs a CDN (And How It Actually Works)]]></title>
            <link>https://medium.com/data-structures-and-algorithms-series/why-every-modern-website-needs-a-cdn-and-how-it-actually-works-a9f5ec12fb05?source=rss----a5a50631c66a---4</link>
            <guid isPermaLink="false">https://medium.com/p/a9f5ec12fb05</guid>
            <category><![CDATA[hld]]></category>
            <category><![CDATA[high-level-design]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[content-delivery-network]]></category>
            <category><![CDATA[cdn]]></category>
            <dc:creator><![CDATA[Santhosh Kumar]]></dc:creator>
            <pubDate>Sat, 25 Jul 2026 06:31:26 GMT</pubDate>
            <atom:updated>2026-07-25T06:32:10.405Z</atom:updated>
            <content:encoded><![CDATA[<p>A website can feel incredibly fast from one location and frustratingly slow from another — even when the server is healthy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*CVysR5q6FJQYmsnz.png" /></figure><p>I remember explaining this to a friend who had deployed his first web application. He had chosen a cloud server in Mumbai because most of his users were in India. Everything looked great during testing. Pages loaded quickly, API responses were fast, and there were no obvious bottlenecks.</p><p>A few weeks later, he shared the application with people overseas.</p><p>The first feedback wasn’t about the features. It was about the speed.</p><p>Users in Europe said images loaded slowly. Someone in Australia mentioned that the homepage took several seconds to become usable. Naturally, his first thought was, “I probably need a bigger server.”</p><p>That wasn’t the real problem.</p><p>The application wasn’t slow because the server lacked resources. It was slow because every browser, regardless of where the user lived, had to travel all the way to the same server to download identical files.</p><p>The farther the distance, the longer the journey.</p><p>This is exactly the problem a <strong>Content Delivery Network (CDN)</strong> was designed to solve.</p><h3>What is a CDN?</h3><p>A Content Delivery Network (CDN) is a network of servers distributed across different geographical locations. Instead of making every visitor download files directly from your application’s origin server, a CDN stores copies of frequently requested content at locations closer to users.</p><p>When someone visits your website, they usually receive images, JavaScript, CSS files, fonts, and other static assets from a nearby CDN server instead of your origin server.</p><p>The result is simple: less distance to travel, lower latency, and a faster website.</p><p>Think of it like ordering a product online.</p><p>If every order had to be shipped from a single warehouse, deliveries would take longer for customers living far away. Large retailers solve this by keeping inventory in multiple warehouses across different regions.</p><p>A CDN applies the same idea to digital content.</p><h3>Why Distance Matters</h3><p>People often focus on server specifications.</p><p>More CPU.</p><p>More RAM.</p><p>A faster SSD.</p><p>While these certainly help, they don’t eliminate one unavoidable factor: <strong>physical distance</strong>.</p><p>Imagine your application is hosted in Singapore.</p><p>When a user in Singapore requests an image, the request travels a relatively short distance.</p><p>Now imagine the same request coming from Canada.</p><p>Even if your server processes both requests in exactly the same amount of time, the Canadian user’s request has to travel thousands of kilometres farther before the image reaches the browser.</p><p>That extra travel time is known as <strong>network latency</strong>.</p><p>As your audience becomes more global, latency becomes one of the biggest contributors to slow page loads.</p><h3>Life Without a CDN</h3><p>Without a CDN, every request follows the same path.</p><pre>   User<br>    │<br>    ▼<br>Origin Server<br>    │<br>    ▼<br>   User</pre><p>Now imagine your homepage contains:</p><ol><li>25 images</li><li>3 CSS files</li><li>6 JavaScript files</li><li>Several fonts</li></ol><p>Every visitor downloads every one of those files directly from the origin server.</p><p>If ten thousand people visit your website at roughly the same time, your server ends up sending the same files thousands of times.</p><p>The server spends resources serving identical content over and over again.</p><p>That’s unnecessary work.</p><h3>Enter the CDN</h3><p>Instead of serving everything from one location, you introduce a CDN.</p><p>Now your architecture looks like this.</p><pre>                  Users<br>                    │<br>                    ▼<br>               DNS Lookup<br>                    │<br>                    ▼<br>            Nearest CDN Server<br>             │             │<br>        Cache Hit       Cache Miss<br>             │             │<br>             ▼             ▼<br>       Return File   Origin Server<br>                           │<br>                           ▼<br>                    Store in Cache</pre><p>The flow is surprisingly simple.</p><p>When a browser requests an image, the CDN first checks whether it already has a cached copy.</p><p>If it does, the image is returned immediately.</p><p>If it doesn’t, the CDN fetches the image from the origin server, sends it to the user, and keeps a copy so future requests can be served directly.</p><p>This introduces two important terms.</p><p><strong>Cache Hit</strong></p><p>The requested file already exists on the CDN server.</p><p>No request reaches the origin server.</p><p><strong>Cache Miss</strong></p><p>The file isn’t available yet.</p><p>The CDN retrieves it from the origin server before storing it for future requests.</p><p>The more cache hits you have, the less work your origin server needs to perform.</p><h3>What Does a CDN Actually Cache?</h3><p>A CDN is most effective for content that doesn’t change every second.</p><p>This includes:</p><ol><li>Images</li><li>CSS files</li><li>JavaScript bundles</li><li>Fonts</li><li>Videos</li><li>PDF documents</li><li>Downloadable files</li></ol><p>These assets are requested repeatedly but rarely modified.</p><p>Instead of generating or downloading them every time, the CDN simply serves the cached version.</p><p>Modern CDNs can also improve the delivery of dynamic content, although static assets remain their primary strength.</p><h3>Why Companies Use CDNs</h3><p>The first advantage people notice is speed.</p><p>When files are served from a nearby location, websites simply load faster.</p><p>But that’s only part of the story.</p><p>A CDN also reduces the number of requests reaching your origin server.</p><p>Imagine one million users requesting the same company logo.</p><p>Without a CDN, your server sends the logo one million times.</p><p>With a CDN, the server may only send it a handful of times — once to each edge location — while the CDN handles the remaining requests.</p><p>That reduction in traffic means your infrastructure scales more efficiently.</p><p>CDNs also improve availability.</p><p>If one edge location experiences issues, traffic can often be redirected to another nearby location without users noticing.</p><p>Many providers also include security features such as DDoS protection, TLS termination, Web Application Firewalls (WAFs), and rate limiting, making a CDN an important part of a website’s security strategy.</p><h3>Does Every Website Need One?</h3><p>Not necessarily.</p><p>A personal project used by a few friends probably doesn’t require a CDN.</p><p>However, once your application serves users from different cities, countries, or continents, the benefits become difficult to ignore.</p><p>Even relatively small websites often use CDNs because they’re simple to integrate and can improve performance with very little effort.</p><h3>Conclusion</h3><p>A CDN isn’t a replacement for your application server.</p><p>Your origin server still owns the original content.</p><p>The CDN simply keeps popular copies closer to your users so they don’t have to travel halfway around the world every time they load a webpage.</p><p>It’s one of those technologies that most people never notice when it’s working — but almost everyone notices when it’s missing.</p><p>The next time you open YouTube, browse Amazon, or scroll through GitHub, remember that there’s a good chance many of the images, scripts, and videos you’re loading aren’t coming from the company’s primary servers at all.</p><p>They’re probably being served from a CDN edge server just a few milliseconds away.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9f5ec12fb05" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-structures-and-algorithms-series/why-every-modern-website-needs-a-cdn-and-how-it-actually-works-a9f5ec12fb05">Why Every Modern Website Needs a CDN (And How It Actually Works)</a> was originally published in <a href="https://medium.com/data-structures-and-algorithms-series">Stack Valley</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[API Gateway Explained: Why Every Modern Microservices Architecture Needs One]]></title>
            <link>https://medium.com/data-structures-and-algorithms-series/api-gateway-explained-why-every-modern-microservices-architecture-needs-one-b4f69241c57f?source=rss----a5a50631c66a---4</link>
            <guid isPermaLink="false">https://medium.com/p/b4f69241c57f</guid>
            <category><![CDATA[hld]]></category>
            <category><![CDATA[low-level-design]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[high-level-design]]></category>
            <dc:creator><![CDATA[Santhosh Kumar]]></dc:creator>
            <pubDate>Thu, 23 Jul 2026 16:57:07 GMT</pubDate>
            <atom:updated>2026-07-23T16:57:06.996Z</atom:updated>
            <content:encoded><![CDATA[<p>When we start building applications, clients usually communicate directly with the backend server. This works perfectly fine for small projects.</p><p>But as the application grows, things become more complicated. Instead of a single backend, we often split our application into multiple microservices - one service for authentication, another for payments, one for notifications, another for user management, and so on.</p><h4><strong>That introduces several problems:</strong></h4><ol><li>The client needs to know where every service lives.</li><li>Authentication has to be implemented repeatedly across multiple services.</li><li>Rate limiting and security become difficult to manage.</li><li>Monitoring every request becomes a challenge.</li><li>Any infrastructure changes affect the client directly.</li></ol><p>This is where an <strong>API Gateway</strong> becomes an essential part of the architecture.</p><h3>What is an API Gateway?</h3><p>An <strong>API Gateway</strong> is a single entry point for all client requests.</p><p>Instead of allowing clients to communicate directly with individual microservices, every request first goes through the API Gateway.</p><p>The gateway receives the request, performs the necessary checks, and forwards it to the appropriate service.</p><pre>Client<br>│<br>▼<br>API Gateway<br>├── Authentication Service<br>├── User Service<br>├── Payment Service<br>├── Order Service<br>└── Notification Service</pre><p>Think of it as the <strong>reception desk of a company</strong>.</p><p>Visitors don’t walk directly into different departments. They first stop at reception, where they’re verified and directed to the correct department.</p><p>An API Gateway serves the same purpose for your backend services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TKt-fgo4zq6fSoPoGXR1Sg.png" /></figure><h3>What Can an API Gateway Do?</h3><p>Although routing requests is its primary responsibility, modern API Gateways provide many powerful features.</p><h4>1. Request Routing</h4><p>One of the gateway’s main responsibilities is directing incoming requests to the correct microservice.</p><p>For example:</p><pre>/users/*        → User Service<br>/orders/*       → Order Service<br>/payments/*     → Payment Service<br>/auth/*         → Authentication Service</pre><p>The client only communicates with the gateway without needing to know where each service is hosted.</p><h4>2. Authentication and Authorization</h4><p>Instead of implementing authentication logic in every microservice, the gateway can validate the user’s identity before forwarding the request.</p><p>For example, it can:</p><ol><li>Validate JWT tokens</li><li>Verify OAuth access tokens</li><li>Check API keys</li><li>Reject unauthorized requests immediately</li></ol><p>This keeps authentication centralized and reduces duplicate code across services.</p><h4>3. Security</h4><p>An API Gateway acts as the first line of defense for your application.</p><p>It can protect your services by handling:</p><ol><li>Rate limiting</li><li>IP whitelisting or blacklisting</li><li>Request validation</li><li>SSL termination</li><li>DDoS protection</li><li>Blocking malicious requests</li></ol><p>Since unwanted traffic is filtered before reaching your services, your backend remains more secure.</p><h4>4. Logging and Monitoring</h4><p>Every request passes through the gateway, making it the ideal place to capture useful information.</p><p><strong>You can log:</strong></p><ol><li>Request URLs</li><li>Response times</li><li>HTTP status codes</li><li>Error rates</li><li>User activity</li><li>Traffic patterns</li></ol><p>These metrics help developers troubleshoot issues and understand system performance.</p><h4>5. Caching</h4><p>Some endpoints return data that doesn’t change frequently.</p><p>Instead of forwarding identical requests repeatedly to backend services, the gateway can cache responses.</p><p>For example:</p><ol><li>Product catalog</li><li>Public configuration</li><li>Country lists</li><li>Frequently accessed data</li></ol><p>Serving cached responses reduces latency and lowers the load on backend services.</p><h3>When Should You Use an API Gateway?</h3><p>An API Gateway isn’t necessary for every application.</p><p>If you’re building a small CRUD application with a single backend service, introducing an API Gateway may only add unnecessary complexity.</p><p>However, it becomes extremely valuable in the following scenarios.</p><h3>Your application uses Microservices</h3><p>As the number of services increases, managing communication becomes harder. An API Gateway provides a single access point and hides the complexity from clients.</p><h3>Your application handles high traffic</h3><p>Large-scale applications receive thousands or even millions of requests every day.</p><p>Features like caching, rate limiting, and load balancing help distribute traffic efficiently before it reaches backend services.</p><h3>You want centralized authentication</h3><p>Instead of implementing authentication logic in every microservice, validate requests once in the gateway and forward only trusted requests.</p><p>This reduces duplicate code and simplifies maintenance.</p><h3>You need consistent security policies</h3><p>Security features such as request validation, API key verification, rate limiting, and IP filtering can all be managed in one place.</p><p>Rather than configuring every service individually, the gateway enforces consistent rules across the entire system.</p><h3>Benefits of Using an API Gateway</h3><p>Using an API Gateway offers several advantages:</p><ol><li>A single entry point for all client requests</li><li>Simplified client-side communication</li><li>Centralized authentication and authorization</li><li>Improved security</li><li>Better monitoring and observability</li><li>Faster responses through caching</li><li>Easier API versioning</li><li>Reduced complexity inside microservices</li></ol><h3>Popular API Gateway Solutions</h3><p>Some widely used API Gateway technologies include:</p><ol><li>Kong</li><li>NGINX</li><li>Apache APISIX</li><li>Traefik</li><li>AWS API Gateway</li><li>Azure API Management</li><li>Google Cloud API Gateway</li><li>Spring Cloud Gateway</li></ol><p>Each solution has its strengths, and the best choice depends on your infrastructure and cloud platform.</p><h3>Conclusion</h3><p>An API Gateway is much more than a request router.</p><p>It acts as the front door to your entire backend ecosystem, handling responsibilities such as authentication, security, routing, monitoring, and caching before requests ever reach your services.</p><p>While it may not be necessary for small applications, it becomes an essential component as your system grows and transitions toward a microservices architecture.</p><p>If you’re designing scalable and secure distributed systems, understanding how an API Gateway works is one of the most valuable concepts you can learn.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4f69241c57f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-structures-and-algorithms-series/api-gateway-explained-why-every-modern-microservices-architecture-needs-one-b4f69241c57f">API Gateway Explained: Why Every Modern Microservices Architecture Needs One</a> was originally published in <a href="https://medium.com/data-structures-and-algorithms-series">Stack Valley</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Model Context Protocol (MCP) Explained: The Complete Developer’s Guide]]></title>
            <link>https://medium.com/data-structures-and-algorithms-series/model-context-protocol-mcp-explained-the-complete-developers-guide-1170ddb5cf35?source=rss----a5a50631c66a---4</link>
            <guid isPermaLink="false">https://medium.com/p/1170ddb5cf35</guid>
            <category><![CDATA[mcp-protocol]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[model-context-protocol]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[mcp-server]]></category>
            <dc:creator><![CDATA[Santhosh Kumar]]></dc:creator>
            <pubDate>Thu, 09 Jul 2026 21:00:57 GMT</pubDate>
            <atom:updated>2026-07-09T21:02:02.436Z</atom:updated>
            <content:encoded><![CDATA[<p>Over the past year, AI applications have evolved from simple chatbots into tools that can write code, query databases, create GitHub issues, send Slack messages, and interact with business applications. This shift has introduced a new challenge: every external service has its own API, authentication mechanism, and integration pattern.</p><p>For developers building AI-powered applications, maintaining separate integrations for <strong>GitHub, Slack, PostgreSQL, Jira, Notion, Google Drive,</strong> and <strong>dozens of other services</strong> quickly becomes difficult. Each integration requires additional code, ongoing maintenance, and a different way of handling authentication and requests.</p><p>This is where the <strong>Model Context Protocol (MCP)</strong> comes in.</p><p>MCP is an open protocol that provides a standardized way for AI applications to communicate with external tools and data sources. Instead of building custom integrations for every service, developers can expose functionality through an MCP server, allowing compatible AI clients to discover and use those capabilities through a consistent interface.</p><p>A useful way to think about MCP is how HTTP standardized communication between browsers and web servers. Before HTTP became widely adopted, every system had its own communication method. MCP aims to solve a similar problem for AI applications by providing a common protocol for interacting with tools.</p><p>In this article, we’ll cover:</p><ol><li>What Model Context Protocol (MCP) is?</li><li>The problem it was designed to solve</li><li>How its architecture works</li><li>The roles of MCP hosts, clients, and servers</li><li>Practical examples of MCP in real applications</li><li>Why many developers consider MCP an important step toward standardized AI integrations?</li></ol><p>By the end of this article, you’ll have a clear understanding of how MCP works and why it has become an important topic for developers building AI-enabled software.</p><h3>What Problem Does MCP Solve?</h3><p>Modern AI models are capable of generating code, analyzing text, and answering questions, but they don’t automatically have access to external systems.</p><p>For example, consider the following request:</p><pre>&quot;Summarize all GitHub issues assigned to me.&quot;</pre><p>Without access to GitHub, the model cannot retrieve that information. It only knows what is included in the conversation or what it was trained on.</p><p>Traditionally, developers solve this by writing custom integrations for every external service. An application might separately integrate with GitHub, Slack, PostgreSQL, Jira, Google Drive, and several other APIs.</p><h4><strong>While this approach works, it creates a few common problems:</strong></h4><ol><li>Every service has a different API.</li><li>Authentication methods vary between providers.</li><li>Developers end up maintaining multiple integrations.</li><li>Adding support for a new service often requires additional engineering effort.</li></ol><p>As the number of integrations grows, maintaining them becomes increasingly expensive.</p><p>Model Context Protocol addresses this problem by defining a standard way for AI applications to <strong>discover</strong> available tools and <strong>communicate</strong> with them.</p><p>Instead of implementing a unique integration for every service, applications communicate through the same protocol, while each tool exposes its own capabilities through an MCP server.</p><p>The result is a more consistent, reusable, and scalable approach to connecting AI applications with external systems.</p><h3>The Problem It Was Designed to Solve</h3><p>Large Language Models (LLMs) are excellent at understanding and generating text, but they don’t have direct access to external systems. They can’t read your GitHub repositories, query your production database, fetch Jira tickets, or send messages in Slack unless those capabilities are explicitly provided.</p><p>Traditionally, developers solve this by integrating each service separately. If an AI application needs to interact with GitHub, PostgreSQL, Slack, and Google Drive, the application must <strong>implement</strong> and <strong>maintain</strong> <strong>individual</strong> <strong>integrations</strong> for each platform. Every service has its own <strong>API, authentication flow, rate limits, request format, </strong>and<strong> error handling.</strong></p><h4><strong>A typical architecture often looks like this:</strong></h4><pre>AI Application <br>── GitHub REST API <br>── Slack API <br>── PostgreSQL Driver <br>── Google Drive API <br>── Jira API <br>── Notion API</pre><p>This approach works, but it introduces several challenges:</p><ol><li>Every new tool requires additional integration code.</li><li>Authentication and authorization differ across providers.</li><li>APIs evolve over time, increasing maintenance effort.</li><li>The AI application becomes tightly coupled to external services.</li><li>Reusing integrations across different AI clients is difficult.</li></ol><p>As the number of supported tools grows, the integration layer often becomes one of the most complex parts of the application.</p><p>Model Context Protocol (MCP) was introduced to solve this challenge. Instead of requiring every AI application to build custom integrations, MCP defines a common protocol for exposing tools and resources. An AI client communicates using the MCP protocol, while each external service provides an MCP server that exposes its capabilities in a standardized way.</p><p>This shifts the responsibility of tool integration away from individual AI applications and toward reusable MCP servers, making it easier to add new capabilities without changing the application’s core integration logic.</p><h3>How Its Architecture Works</h3><p>At a high level, the Model Context Protocol (MCP) consists of three primary components:</p><ol><li>MCP Host</li><li>MCP Client</li><li>MCP Server</li></ol><p>Each component has a specific responsibility, allowing AI applications to communicate with external tools through a consistent protocol.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ipkfmh4n_bsa5NifFXIF2g.png" /></figure><h4>MCP Host</h4><p>The MCP Host is the application where users interact with the AI. It provides the user interface, processes user requests, and coordinates communication between the language model and external tools.</p><p>Examples of MCP hosts include AI-powered IDEs, desktop assistants, and chat applications that support MCP.</p><p>The host itself does not communicate directly with external services. Instead, it relies on an MCP client to discover and invoke available tools.</p><h4>MCP Server</h4><p>An MCP Server exposes tools, resources, and prompts that an AI application can use.</p><p>Each server represents a particular system or service. For example, an organization might provide separate MCP servers for GitHub, PostgreSQL, Slack, or an internal business application.</p><p>A GitHub MCP server might expose operations such as:</p><pre>listRepositories()<br>getPullRequest()<br>createIssue()<br>searchCode()</pre><p>Similarly, a PostgreSQL MCP server could provide:</p><pre>listTables()<br>describeTable()<br>executeQuery()</pre><p>The AI application doesn’t need to understand how these services are implemented internally. It only needs to know which capabilities are available and how to invoke them through the protocol.</p><h4>Putting Everything Together</h4><p>Consider a user asking:</p><p><em>“List all open pull requests assigned to me.”</em></p><p>The request flows through the MCP architecture as follows:</p><ol><li>The user submits the request in the AI application.</li><li>The language model determines that GitHub access is required.</li><li>The MCP client discovers the available GitHub tools.</li><li>The appropriate tool is invoked on the GitHub MCP server.</li><li>The server communicates with GitHub and retrieves the requested data.</li><li>The results are returned to the language model.</li><li>The AI generates a natural language response for the user.</li></ol><p>Throughout this process, the AI application communicates only through the MCP protocol. It does not need custom integration logic for GitHub, making the architecture easier to extend and maintain.</p><h3>Practical Examples of MCP in Real Applications</h3><p>The concepts behind MCP are easier to understand when you look at how they’re used in everyday development workflows. Whether you’re building an AI coding assistant or an internal enterprise application, the goal remains the same: give the AI a consistent way to access external systems without writing a new integration for every service.</p><h4>Software Development</h4><p>Development tools are one of the most common use cases for MCP. Instead of integrating directly with the GitHub API, an AI client can communicate with a GitHub MCP server that exposes operations such as listing repositories, retrieving pull requests, or creating issues.</p><p>A request like:</p><p><em>“Show all pull requests assigned to me.”</em></p><p>doesn’t require the AI to know how GitHub’s REST API works. The MCP server handles that interaction and returns the information in a format the AI can use.</p><p>The same approach works for code search, reviewing pull requests, checking CI/CD pipelines, or creating issues from natural language.</p><h4>Working with Databases</h4><p>Many organizations store operational data in relational databases. Rather than giving an AI application direct database access, an MCP server can expose only the operations that are required.</p><p>For example, an analytics application could support requests such as:</p><p><em>“Show all failed email deliveries from yesterday.”</em></p><p>The MCP server executes the query, retrieves the results, and returns the data to the AI application. The AI focuses on presenting the information, while the database logic remains inside the server.</p><h4>Team Collaboration</h4><p>Communication platforms are another natural fit for MCP.</p><p>Instead of implementing separate integrations for Slack or Microsoft Teams, an organization can expose messaging capabilities through an MCP server.</p><p>That makes requests like these possible:</p><ol><li>Summarize today’s engineering discussions.</li><li>List unread messages from the DevOps channel.</li><li>Send a deployment notification to the backend team.</li></ol><p>From the AI application’s perspective, each of these is simply another tool exposed through the protocol.</p><h4>Project Management</h4><p>Project management systems such as Jira, Linear, or Azure DevOps can also expose their functionality through MCP.</p><p>An AI assistant could retrieve assigned tasks, update ticket statuses, or create new issues without maintaining provider-specific integration code.</p><p>For example:</p><p><em>“List all high-priority bugs assigned to me.”</em></p><p>The AI doesn’t interact with Jira directly. It invokes the appropriate tool exposed by the project’s MCP server.</p><h4>Internal Business Applications</h4><p>Many companies rely on internal systems that aren’t publicly accessible. These may include HR portals, inventory management systems, CRM platforms, or financial applications.</p><p>Instead of exposing custom APIs to every AI application, organizations can provide an MCP server that exposes only the required functionality.</p><p>This allows internal tools to participate in the same ecosystem as external services, giving AI applications a consistent interface regardless of where the data comes from.</p><p>As more software vendors and organizations adopt MCP, developers can spend less time building integrations and more time building features. That’s one of the biggest reasons MCP has gained attention — it standardizes communication without forcing every application to reinvent the integration layer.</p><h3>Why Many Developers Consider MCP an Important Step Toward Standardized AI Integrations</h3><p>Before MCP, integrating AI with external systems usually meant writing custom code for every service. GitHub, Slack, databases, Jira, cloud storage, and internal applications all required separate integrations, each with its own authentication model, API structure, and maintenance effort.</p><p>This approach works for small projects, but it becomes increasingly difficult to manage as the number of supported services grows.</p><p>MCP addresses this by introducing a common protocol for exposing tools and resources. Instead of every AI application implementing its own integrations, services can provide an MCP server that follows the same communication model. Once an AI client understands the protocol, it can interact with any compatible MCP server without needing provider-specific logic.</p><p>One of the biggest advantages of this approach is reusability. An MCP server built for GitHub, PostgreSQL, or an internal business application isn’t tied to a single AI client. The same server can be used by different applications that support MCP, reducing duplicated integration work across projects.</p><p>The protocol also encourages a clearer separation of responsibilities. MCP servers focus on exposing capabilities and handling communication with external systems, while AI applications focus on interpreting user requests and deciding which tools to use. This separation makes both sides easier to develop, test, and maintain independently.</p><p>Another reason MCP has gained attention is its growing ecosystem. More AI clients, development tools, and service providers are beginning to adopt the protocol, making it easier for developers to connect applications without starting from scratch. As adoption increases, the number of reusable MCP servers is also expected to grow.</p><p>Like any emerging standard, MCP is still evolving. Not every tool supports it today, and many organizations continue to rely on traditional APIs and custom integrations. However, the direction is clear: a shared protocol can reduce complexity, improve interoperability, and make AI integrations more consistent across different platforms.</p><p>For developers building AI-powered applications, understanding MCP is becoming increasingly valuable. Even if your current projects don’t use it, the ideas behind standardized tool integration are likely to influence how AI applications are designed in the coming years.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1170ddb5cf35" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-structures-and-algorithms-series/model-context-protocol-mcp-explained-the-complete-developers-guide-1170ddb5cf35">Model Context Protocol (MCP) Explained: The Complete Developer’s Guide</a> was originally published in <a href="https://medium.com/data-structures-and-algorithms-series">Stack Valley</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Claude Fable 5 vs. Claude Sonnet 5: Coding, Reasoning & Real-World Tests]]></title>
            <link>https://medium.com/data-structures-and-algorithms-series/claude-fable-5-vs-claude-sonnet-5-coding-reasoning-real-world-tests-0f7b4f99c5f0?source=rss----a5a50631c66a---4</link>
            <guid isPermaLink="false">https://medium.com/p/0f7b4f99c5f0</guid>
            <category><![CDATA[claude-sonnet]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[claude-fable-5]]></category>
            <dc:creator><![CDATA[Santhosh Kumar]]></dc:creator>
            <pubDate>Sat, 04 Jul 2026 06:00:16 GMT</pubDate>
            <atom:updated>2026-07-04T06:00:17.963Z</atom:updated>
            <content:encoded><![CDATA[<p><em>If you’re trying to decide between Claude Fable 5 and Claude Sonnet 5, this guide is for you. We’ll compare their coding skills, reasoning ability, speed, pricing, and everyday performance so you can pick the model that matches your workflow.</em></p><h3>Introduction</h3><p>The Claude 5 family includes models designed for different use cases. While Claude Fable 5 and Claude Sonnet 5 share many features, each model has its own strengths. One focuses more on advanced reasoning, while the other offers a better balance of speed, performance, and cost.</p><p>If you’re wondering:</p><ol><li>Which model writes better code?</li><li>Which one reasons more effectively?</li><li>Which is better for AI agents?</li><li>Which model offers the best value for money?</li><li>Which should you integrate into your application?</li></ol><p>You’re in the right place.</p><p>In this article, we’ll compare Claude Fable 5 and Claude Sonnet 5 across coding, reasoning, creativity, speed, pricing, context handling, and real-world development tasks.</p><p>Let’s dive in.</p><h3>Claude Fable 5 at a Glance</h3><p>Claude Fable 5 is Anthropic’s most powerful AI model. It’s built to handle difficult tasks like complex coding, advanced reasoning, and solving problems that need careful thinking.Its strengths include:</p><ol><li>Advanced reasoning</li><li>Complex coding</li><li>Multi-step planning</li><li>Long-context understanding</li><li>Research assistance</li><li>AI agents</li><li>Enterprise workflows</li></ol><p>If you often work on complex coding tasks or solve difficult technical problems, Claude Fable 5 is the better choice. It’s built for work that needs deeper thinking and more detailed answers.</p><h3>Claude Sonnet 5 at a Glance</h3><p>Claude Sonnet 5 is designed to balance intelligence, speed, and cost.</p><p>It excels in:</p><ol><li>Everyday coding</li><li>Technical writing</li><li>Documentation</li><li>Customer support</li><li>General productivity</li><li>Chat applications</li><li>AI assistants</li></ol><p>Instead of maximizing raw reasoning ability, Sonnet 5 focuses on delivering excellent performance with lower latency and lower operating costs.</p><p>For many applications, this balance makes it the more practical choice.</p><h3>Quick Comparison</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K-zRGG0OW-6GlO8HFHd5hw.png" /></figure><p>Although both models are excellent, they target different priorities.</p><h3>Coding Performance</h3><p>For developers, coding capability is often the deciding factor.</p><p>Let’s compare them across common engineering tasks.</p><h3>1. Bug Fixing</h3><p>Imagine you’re debugging a production issue involving authentication, caching, and asynchronous database operations.</p><h3>Claude Sonnet 5</h3><p>Typically:</p><ol><li>Finds obvious bugs quickly</li><li>Suggests straightforward fixes</li><li>Explains the issue clearly</li><li>Works well for small to medium projects</li></ol><h3>Claude Fable 5</h3><p>Goes several steps further:</p><ol><li>Identifies architectural problems</li><li>Detects hidden edge cases</li><li>Explains cascading failures</li><li>Suggests cleaner system design</li><li>Anticipates future maintenance issues</li></ol><p><strong>Winner:</strong> Claude Fable 5</p><h3>2. Large Codebases</h3><p>Large repositories require understanding relationships between hundreds of files.</p><p>Both models can work with large codebases, but Claude Fable 5 is more consistent when dealing with complex projects that involve many files and long prompts.</p><p>This becomes particularly valuable when working with:</p><ol><li>Microservices</li><li>Monorepos</li><li>Enterprise applications</li><li>Legacy systems</li></ol><h3>3. Refactoring</h3><p>Refactoring isn’t just rewriting code.</p><p>It involves:</p><ol><li>Improving readability</li><li>Preserving behavior</li><li>Reducing technical debt</li><li>Simplifying architecture</li></ol><p>Instead of simply moving code around, Claude Fable 5 looks for better ways to organize your project. Its suggestions usually make the code cleaner and easier to manage.</p><h3>4. Code Generation</h3><p>Both models generate code in languages such as:</p><ol><li>Python</li><li>Java</li><li>JavaScript</li><li>TypeScript</li><li>Go</li><li>Rust</li><li>C#</li><li>Kotlin</li><li>SQL</li></ol><p>When working on complex systems, Claude Fable 5 often needs fewer follow-up prompts. It usually gives a more complete solution from the start.</p><h3>Reasoning Performance</h3><p>Reasoning is where the differences become more noticeable.</p><h3>Mathematical Problems</h3><p>Claude Sonnet 5 handles standard mathematical tasks well.</p><p>Claude Fable 5 performs better on:</p><ol><li>Multi-step reasoning</li><li>Proof-style questions</li><li>Optimization problems</li><li>Algorithm design</li></ol><h3>Logical Reasoning</h3><p>Consider questions involving multiple constraints, dependencies, and planning.</p><p>Fable 5 generally maintains consistency across long reasoning chains, making it better suited for advanced problem-solving.</p><h3>Research Assistance</h3><p>If you’re researching a technical topic like distributed systems or compiler optimization:</p><p>Sonnet 5 provides concise explanations.</p><p>Fable 5 often offers:</p><ol><li>Better organization</li><li>More complete analysis</li><li>Stronger comparisons</li><li>Deeper technical insights</li></ol><h3>Writing Quality</h3><p>Both models are excellent writers.</p><p>The difference lies in depth.</p><h3>Claude Sonnet 5</h3><p>Ideal for:</p><ol><li>Blog posts</li><li>Documentation</li><li>Marketing copy</li><li>Product descriptions</li><li>Emails</li></ol><h3>Claude Fable 5</h3><p>Better suited for:</p><ol><li>Long-form technical content</li><li>Books</li><li>Whitepapers</li><li>Research summaries</li><li>Complex storytelling</li></ol><p>When writing lengthy documents, Fable 5 generally maintains tone and structure more consistently.</p><h3>AI Agent Performance</h3><p>Modern AI isn’t just about answering questions.</p><p>It’s increasingly about completing tasks.</p><p>Examples include:</p><ol><li>Writing code</li><li>Running tools</li><li>Reading documentation</li><li>Calling APIs</li><li>Editing files</li><li>Planning workflows</li></ol><p>For long and complex workflows,</p><p><strong>Claude Fable 5</strong> usually performs better because it stays consistent across multiple steps. If your tasks are shorter and need quick responses, <strong>Claude Sonnet 5</strong> is often the better option.</p><h3>Real-World Tests</h3><p>Let’s compare how both models perform in practical scenarios.</p><h3>Test 1: Build a REST API</h3><p>Task:</p><blockquote><em>Build a REST API with authentication, validation, logging, and tests.</em></blockquote><h3>Sonnet 5</h3><ol><li>Fast implementation</li><li>Clean code</li><li>Good documentation</li></ol><h3>Fable 5</h3><ol><li>Cleaner architecture</li><li>Better separation of concerns</li><li>Improved scalability</li><li>More comprehensive testing</li></ol><p><strong>Winner:</strong> Fable 5</p><h3>Test 2: Explain an Algorithm</h3><p>Task:</p><p>Explain Dijkstra’s algorithm to an intermediate developer.</p><h3>Sonnet 5</h3><p>Provides a concise and accurate explanation.</p><h3>Fable 5</h3><p>Adds:</p><ol><li>Intuition</li><li>Visual thinking</li><li>Complexity analysis</li><li>Practical applications</li><li>Common mistakes</li></ol><p><strong>Winner:</strong> Fable 5</p><h3>Test 3: Write Technical Documentation</h3><p>Both models perform extremely well.</p><p>Sonnet 5 produces documentation faster.</p><p>Fable 5 produces documentation that’s generally more comprehensive.</p><p>Depending on your needs, either can be the right choice.</p><h3>Test 4: Debug Legacy Code</h3><p>Legacy applications often contain years of accumulated technical debt.</p><p>While Claude Sonnet 5 is good at fixing bugs, Claude Fable 5 often points out design issues that could cause problems later. It may also suggest better ways to improve the project over time.</p><h3>Speed Comparison</h3><p>Response speed matters when AI becomes part of your daily workflow.</p><p>Claude Sonnet 5 is optimized for lower latency, making conversations feel more responsive.</p><p>This makes it an excellent choice for:</p><ol><li>Chatbots</li><li>IDE assistants</li><li>Customer support</li><li>Interactive applications</li></ol><p>For difficult tasks, Claude Fable 5 isn’t always the fastest. However, the extra time often leads to better explanations and more complete answers.</p><h3>Context Window</h3><p>Both models are designed to handle large amounts of context.</p><p>This enables workflows such as:</p><ol><li>Reviewing entire repositories</li><li>Analyzing lengthy PDFs</li><li>Working with large technical specifications</li><li>Summarizing extensive documentation</li></ol><p>For developers, this reduces the need to split projects into smaller prompts.</p><h3>Pricing Considerations</h3><p>While pricing can change over time, the overall pattern is straightforward:</p><ol><li>Claude Sonnet 5 offers a more cost-effective option for everyday workloads.</li><li>Claude Fable 5 commands a premium due to its stronger reasoning and advanced capabilities.</li></ol><p>For small projects, the price difference may not matter much. But if you’re making a large number of API calls every day, it can have a noticeable impact on your costs. Always check Anthropic’s latest pricing before making a decision.</p><h3>Which Model Should You Choose?</h3><h3>Choose Claude Sonnet 5 if you:</h3><ol><li>Want faster responses</li><li>Need a cost-effective API</li><li>Build chat applications</li><li>Create coding assistants</li><li>Generate documentation</li><li>Handle everyday software development tasks</li></ol><h3>Choose Claude Fable 5 if you:</h3><ol><li>Solve complex engineering problems</li><li>Build advanced AI agents</li><li>Analyze large codebases</li><li>Produce long-form technical writing</li><li>Perform deep research</li><li>Need the strongest reasoning available</li></ol><h3>Pros and Cons</h3><h3>Claude Fable 5</h3><h3>Pros</h3><ol><li>Outstanding reasoning</li><li>Excellent coding quality</li><li>Strong architectural understanding</li><li>Great for research</li><li>Powerful agent workflows</li><li>Consistent long-form writing</li></ol><h3>Cons</h3><ol><li>Higher cost</li><li>Slightly slower for some tasks</li><li>May be unnecessary for simple workloads</li></ol><h3>Claude Sonnet 5</h3><h3>Pros</h3><ol><li>Fast responses</li><li>Lower cost</li><li>Excellent coding</li><li>Great documentation</li><li>Strong general-purpose performance</li></ol><h3>Cons</h3><ol><li>Less capable on highly complex reasoning</li><li>Not as strong for long-running agent workflows</li><li>Fewer advanced insights on difficult technical tasks</li></ol><h3><strong>Which Model Should You Choose?</strong></h3><p>Both Claude Fable 5 and Claude Sonnet 5 are excellent AI models, but they are designed for different types of work.</p><p>If your main goal is to write code faster, build chatbots, create documentation, or keep API costs low, <strong>Claude Sonnet 5</strong> is the better choice. It delivers fast responses, produces high-quality results, and is more affordable for everyday development.</p><p>If you’re working on large codebases, solving complex problems, building AI agents, or doing technical research, <strong>Claude Fable 5</strong> is worth the extra cost. It usually provides more detailed answers and handles difficult tasks with greater consistency.</p><p>For many developers and teams, using both models can be the best approach. Sonnet 5 works well for everyday tasks, while Fable 5 is a better option when a project needs deeper reasoning or more advanced problem-solving.</p><p>At the end of the day, there isn’t a single “best” model. The right choice depends on your project, your budget, and the type of work you do. Pick the model that fits your workflow, and you’ll get the most value from it.</p><h3>Conclusion</h3><p>Both Claude Fable 5 and Claude Sonnet 5 are powerful AI models, but they are built for different purposes. One isn’t simply better than the other — it depends on the kind of work you do.</p><p>If you need fast responses and a cost-effective model for everyday coding and productivity, Claude Sonnet 5 is a great choice. If your work involves complex coding, advanced reasoning, or building AI agents, Claude Fable 5 is worth considering.</p><p>Before choosing a model, think about your project, your budget, and the type of tasks you’ll be working on. The best way to decide is to try both models with your own prompts and see which one fits your workflow better.</p><p>As AI continues to improve, these models will keep getting better. For now, both Claude Fable 5 and Claude Sonnet 5 are excellent options, and choosing the right one can help you work faster and build better applications.</p><p><em>Claude Fable 5 and Claude Sonnet 5 are both powerful AI models, but they are built for different types of work. In this article, we’ll compare their performance, features, and pricing to help you decide which one is right for you.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0f7b4f99c5f0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-structures-and-algorithms-series/claude-fable-5-vs-claude-sonnet-5-coding-reasoning-real-world-tests-0f7b4f99c5f0">Claude Fable 5 vs. Claude Sonnet 5: Coding, Reasoning &amp; Real-World Tests</a> was originally published in <a href="https://medium.com/data-structures-and-algorithms-series">Stack Valley</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your RAG Pipeline is Probably Useless (And Mine Was Too)]]></title>
            <link>https://medium.com/data-structures-and-algorithms-series/your-rag-pipeline-is-probably-useless-and-mine-was-too-18298ad19913?source=rss----a5a50631c66a---4</link>
            <guid isPermaLink="false">https://medium.com/p/18298ad19913</guid>
            <category><![CDATA[agentic-rag]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[rags]]></category>
            <dc:creator><![CDATA[Santhosh Kumar]]></dc:creator>
            <pubDate>Sat, 27 Jun 2026 12:31:01 GMT</pubDate>
            <atom:updated>2026-06-27T12:31:00.968Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/845/0*tyPKYgd2pPvPmwzB.png" /></figure><p>Most RAG systems look great on paper. Clean data. Vector embeddings. Semantic search. State-of-the-art retrieval metrics.</p><p>They often fail in practice.</p><p>The system retrieves documents that are technically “most relevant” by similarity scores. But the user gets back noise - outdated information, contradictory sources, or context that makes the LLM hallucinate <em>more</em>, not less.</p><p>This is the core problem with most RAG implementations: <strong>we optimize for retrieval metrics, not answer quality.</strong></p><h3>The RAG Lie We All Believe</h3><p>RAG sounds simple: retrieve relevant documents, feed them to an LLM, get better answers. In reality, it’s a gamble.</p><p>Most teams approach it like this:</p><ol><li>Throw documents into a vector database</li><li>Optimize retrieval accuracy (hit rate, NDCG scores, etc.)</li><li>Call it done</li></ol><p>The problem? <strong>Retrieval accuracy ≠ answer quality.</strong></p><p>Systems with high retrieval precision (90%+) often produce worse outputs than vanilla LLMs. The retrieved documents are technically relevant but practically useless - outdated, contradictory, or burying the actual answer under piles of context.</p><p>Meanwhile, systems with lower retrieval precision (60–70%) sometimes outperform them because they retrieve the <em>right</em> documents instead of the <em>most similar</em> ones. There’s a critical difference between semantic similarity and answer utility.</p><h3>Why Your RAG Pipeline is Failing (The Real Reasons)</h3><h3>1. You’re Optimizing Retrieval, Not Reasoning</h3><p>Your vector database finds documents that <em>look</em> similar to the query. Not documents that <em>answer</em> the query.</p><p>There’s a massive difference.</p><p>A user asks: “How do I handle distributed transactions?”</p><p>Your RAG retrieves documents mentioning “distributed,” “transactions,” and similarity metrics say it’s a match. But the documents are about distributed caching, not transactions. The LLM then tries to synthesize nonsense.</p><p><strong>The fix:</strong> Stop thinking about semantic similarity. Start thinking about <em>question answering</em>. Use retrievers that understand the intent, not just the embedding space.</p><h3>2. Your Chunking Strategy is Destroying Context</h3><p>You split documents into 512-token chunks because that’s what the tutorial said. Now your RAG system retrieves fragments that lose all context.</p><p>Document about API rate limits? Split into three chunks. When you retrieve one chunk, it says “increases exponentially” without mentioning what’s increasing. The LLM fills in the blank with hallucinations.</p><p><strong>A common issue:</strong> when you chunk hierarchical documents (like regulations or technical specs) without preserving structure, individual chunks lose context. A chunk about tax implications becomes meaningless without its section header and surrounding context.</p><p><strong>The fix:</strong> Chunk intelligently. Use hierarchical chunking. Preserve metadata. A 2000-token chunk with context is better than three 512-token orphaned fragments.</p><h3>3. You’re Not Filtering Retrieved Documents</h3><p>Your retriever returns the top-k documents, and you feed all of them to the LLM. Even if some are outdated or contradictory.</p><p>LLMs are suggestible. Feed them conflicting information and they’ll usually pick the longest or most confident-sounding answer, not the correct one. When multiple sources disagree, the model often averages them together or picks one arbitrarily.</p><p><strong>The fix:</strong> Implement quality filtering. Check for:</p><ol><li>Document freshness (timestamp metadata)</li><li>Source credibility</li><li>Contradiction detection (flag when multiple sources disagree)</li><li>Relevance thresholds (don’t just return top-k; only return if confidence &gt; threshold)</li></ol><h3>4. You Have Zero Observability</h3><p>You deployed your RAG system and assumed it works because it passed your internal tests. But you never ask: which documents actually got retrieved? Are they the ones we wanted?</p><p>Most teams only measure end-to-end quality. When performance drops, they’re blind. Was it the retriever? The LLM? The prompt? Nobody knows.</p><p><strong>The fix:</strong> Track every retrieval decision. Log what was retrieved, why it was retrieved, and whether it helped or hurt the final answer. Use this telemetry to understand failure modes.</p><h3>What Actually Works (Lessons from Systems That Don’t Suck)</h3><h3>1. Separate Retrieval from Ranking</h3><p>Don’t just use vector similarity. Use an ensemble:</p><ol><li><strong>Lexical search</strong> (keyword matching) — catches exact matches your embeddings miss</li><li><strong>Semantic search</strong> (embeddings) — finds conceptually similar documents</li><li><strong>Hybrid ranking</strong> — combine scores, then re-rank intelligently</li></ol><p>The most effective RAG systems use hybrid approaches: BM25 for broad retrieval (catches what people actually search for) combined with embeddings for ranking (finds best matches). This catches more relevant results than either approach alone.</p><h3>2. Use Small, High-Quality Chunks + Recursive Retrieval</h3><p>Instead of chunking documents once, chunk them hierarchically:</p><ul><li>Top-level chunks (full sections with context)</li><li>Mid-level chunks (subsections)</li><li>Leaf chunks (detailed explanations)</li></ul><p>Start retrieval at the leaf level. If confidence is low, recursively fetch parent chunks for context. This gives you precision <em>and</em> context.</p><h3>3. Implement Query Expansion</h3><p>Users ask questions in different ways than documents are written. A question about “how to scale a database” might be answered in documents titled “database sharding” or “horizontal partitioning.”</p><p>Expand each query into 3–5 reformulations before retrieval. Retrieve results for all variants. Deduplicate and rank. This sounds expensive but catches 30–40% more relevant documents.</p><h3>4. Build a Feedback Loop</h3><p>Deploy your system and collect data on what works:</p><ol><li>Did the retrieved documents help?</li><li>Did the LLM cite what we retrieved?</li><li>Did users reject the answer?</li></ol><p>Use this data to fine-tune chunking strategies, ranking weights, and expansion rules. RAG systems that improve over time beat those that are static.</p><h3>5. Know When Not to Use RAG</h3><p>Here’s the hard truth: <strong>RAG doesn’t solve everything.</strong></p><p>If your documents are:</p><ol><li>Frequently contradictory → RAG makes it worse</li><li>Sparse and high-recall important → Better to fine-tune</li><li>Tightly coupled and hard to chunk → Better to fine-tune</li><li>Time-sensitive and constantly updating → Consider agents + tools instead</li></ol><p>RAG is best for systems where:</p><ol><li>You have a large, relatively consistent knowledge base</li><li>Most answers come from a small subset of documents</li><li>You can keep documents fresh</li><li>Users can tolerate longer generation times</li></ol><p>If you’re forcing RAG on a problem where it doesn’t fit, no amount of engineering will save you.</p><h3>The Real Metric: Does It Actually Help?</h3><p>Stop measuring retrieval accuracy. Stop measuring NDCG scores. Stop congratulating yourself on high precision.</p><p>Measure what matters: <strong>Did the system give a better answer with retrieval than without?</strong></p><p>Compare:</p><ol><li>LLM-only response vs. RAG response (blind evaluation)</li><li>User satisfaction with and without retrieved context</li><li>Citation accuracy (does the LLM cite what we actually retrieved?)</li><li>False confidence (does retrieval make the LLM <em>more</em> confident in wrong answers?)</li></ol><h3>Where We Are Now</h3><p>The hype around RAG is dying. Everyone’s realized it’s not a silver bullet. What’s emerging instead is nuance:</p><ol><li>RAG + agents (retrieval when needed, not always)</li><li>Fine-tuned models + targeted RAG (combine approaches)</li><li>Retrieval-augmented reasoning (use retrieval to plan, not just answer)</li><li>Hybrid systems (fallback to retrieval when confidence is low)</li></ol><p>The best systems being built don’t rely purely on RAG. They’re thoughtful combinations of techniques, tailored to the specific problem.</p><h3>The Takeaway</h3><p>If you’ve built a RAG system that feels good on paper but bad in practice, you’re not alone. The infrastructure is mature, but the science is still catching up.</p><p>Stop optimizing for retrieval metrics. Start optimizing for answer quality. Filter ruthlessly. Track everything. Know when to use it and when to use something else.</p><p>And if all else fails? Sometimes the best RAG system is the one you don’t build.</p><p><em>Have you built RAG systems that failed? What did you learn? Drop yourstories in the comments.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18298ad19913" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-structures-and-algorithms-series/your-rag-pipeline-is-probably-useless-and-mine-was-too-18298ad19913">Your RAG Pipeline is Probably Useless (And Mine Was Too)</a> was originally published in <a href="https://medium.com/data-structures-and-algorithms-series">Stack Valley</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Building Chatbots. Start Building AI Agents.]]></title>
            <link>https://medium.com/data-structures-and-algorithms-series/stop-building-chatbots-start-building-ai-agents-d8440930d69c?source=rss----a5a50631c66a---4</link>
            <guid isPermaLink="false">https://medium.com/p/d8440930d69c</guid>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[build-ai-agents]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Santhosh Kumar]]></dc:creator>
            <pubDate>Thu, 25 Jun 2026 15:54:34 GMT</pubDate>
            <atom:updated>2026-06-25T15:55:48.980Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/869/0*C4gmf7-mlYCi7fTj" /></figure><h3>Introduction</h3><p>Artificial Intelligence has evolved far beyond simple chatbots. Modern AI agents can reason about problems, use external tools, search the web, execute code, remember previous conversations, and even collaborate with other AI agents to complete complex tasks.</p><p>Companies like OpenAI, Anthropic, Google, and Microsoft are rapidly moving toward agentic AI, where models don’t just answer questions — they take actions.</p><p>In this article, we’ll build a mental model of how AI agents work and learn how to create one from scratch.</p><h3>What Is an AI Agent?</h3><p>An AI agent is an intelligent software system that can:</p><ol><li>Understand a goal</li><li>Plan multiple steps</li><li>Use external tools</li><li>Observe results</li><li>Correct mistakes</li><li>Continue until the task is complete</li></ol><p>Unlike a chatbot that generates a single response, an AI agent continuously reasons and acts until it reaches the desired outcome.</p><p>Think of the difference like this:</p><p>A chatbot answers.</p><p>An AI agent accomplishes.</p><h3>The Core Components of Every AI Agent</h3><p>Every production-grade AI agent consists of several building blocks.</p><h3>1. The Brain (Large Language Model)</h3><p>The language model performs reasoning.</p><p>Its responsibilities include:</p><ol><li>Understanding user intent</li><li>Choosing which tool to use</li><li>Planning tasks</li><li>Summarizing results</li><li>Generating responses</li></ol><p>Without the LLM, the agent has no reasoning capability.</p><h3>2. Memory</h3><p>Memory allows the agent to remember previous interactions.</p><p>There are two types:</p><h3>Short-Term Memory</h3><p>Stores the current conversation.</p><p>Example:</p><p>“I already know your project requirements.”</p><h3>Long-Term Memory</h3><p>Stores information across conversations.</p><p>Examples:</p><ol><li>User preferences</li><li>Previous projects</li><li>Frequently used APIs</li><li>Coding style</li></ol><p>Long-term memory is usually stored in databases or vector databases.</p><h3>3. Tools</h3><p>This is where AI agents become powerful.</p><p>Instead of relying only on their training data, agents can call tools such as:</p><ol><li>Web Search</li><li>Weather APIs</li><li>SQL databases</li><li>GitHub</li><li>Email</li><li>Slack</li><li>Google Calendar</li><li>Python</li><li>File systems</li><li>PDF readers</li></ol><p>The LLM decides when a tool is needed, invokes it, receives the output, and continues reasoning.</p><h3>4. Planning</h3><p>Complex problems require multiple steps.</p><p>For example:</p><pre>&quot;Compare Tesla and NVIDIA stocks.&quot;</pre><p>A planner might create a workflow like:</p><ol><li>Research Tesla</li><li>Research NVIDIA</li><li>Compare financial metrics</li><li>Summarize findings</li></ol><p>Planning enables the agent to solve tasks far more effectively than producing a single response.</p><h3>5. Observation and Feedback</h3><p>Good agents don’t stop after one attempt.</p><p>They follow a loop:</p><pre>Think → Act → Observe → Reflect → Retry</pre><p>This feedback cycle allows agents to recover from errors and improve their outputs.</p><h3>How an AI Agent Works</h3><p>A typical workflow looks like this:</p><ol><li>User provides a goal.</li><li>The LLM analyzes the request.</li><li>The planner breaks it into tasks.</li><li>The agent selects tools.</li><li>The tools execute actions.</li><li>Results are returned.</li><li>The LLM evaluates the outcome.</li><li>If needed, the process repeats.</li></ol><p>This iterative approach is what makes modern AI agents far more capable than traditional chatbots.</p><h3>Building Your First AI Agent</h3><p>A minimal AI agent can be built with:</p><ol><li>Python</li><li>FastAPI</li><li>An LLM API</li><li>A few tools</li><li>Memory storage</li></ol><p>Typical project structure:</p><pre>agent/<br> - main.py<br> - planner.py<br> - memory.py<br> - tools/<br> - prompts/<br> - config.py</pre><p>As your project grows, you can add retrieval, caching, observability, and multi-agent collaboration.</p><h3>Popular AI Agent Frameworks</h3><p>Several frameworks simplify agent development.</p><p>Choose one based on your needs:</p><ol><li>LangGraph — Best for production workflows</li><li>OpenAI Agents SDK — Simple and lightweight</li><li>PydanticAI — Strong typing and validation</li><li>CrewAI — Multi-agent collaboration</li><li>AutoGen — Agent-to-agent communication</li></ol><p>Each framework solves different orchestration problems, but the underlying concepts remain the same.</p><h3>Example Project</h3><p>Imagine building an AI software engineering assistant.</p><p>The workflow could be:</p><ol><li>Read a GitHub issue</li><li>Clone the repository</li><li>Analyze the codebase</li><li>Generate code</li><li>Execute tests</li><li>Fix failures</li><li>Write documentation</li><li>Open a pull request</li></ol><p>This demonstrates how agents combine reasoning with real-world actions.</p><h3>Common Mistakes Beginners Make</h3><p>Many developers:</p><ol><li>Treat the LLM as the entire application</li><li>Ignore memory</li><li>Skip planning</li><li>Build agents without tool support</li><li>Overcomplicate workflows too early</li></ol><p>Start small and expand your agent incrementally.</p><h3>The Future of AI Agents</h3><p>The future isn’t about a single, all-knowing model.</p><p>It’s about intelligent systems where multiple specialized agents collaborate, share context, and use tools to solve increasingly complex problems.</p><p>As these systems mature, AI agents will become indispensable teammates for software engineers, researchers, analysts, and creators.</p><h3>Conclusion</h3><p>Building an AI agent isn’t just about connecting an LLM to an API. It’s about orchestrating reasoning, memory, planning, and tools into a cohesive system capable of accomplishing real tasks.</p><p>Whether you’re creating a coding assistant, research bot, or autonomous workflow, understanding these core concepts will help you design agents that are practical, scalable, and production-ready.</p><p>The next generation of software won’t simply respond to users — it will work alongside them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d8440930d69c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-structures-and-algorithms-series/stop-building-chatbots-start-building-ai-agents-d8440930d69c">Stop Building Chatbots. Start Building AI Agents.</a> was originally published in <a href="https://medium.com/data-structures-and-algorithms-series">Stack Valley</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Claude Mythos: The AI Model Too Powerful to Release Publicly]]></title>
            <link>https://medium.com/data-structures-and-algorithms-series/claude-mythos-the-ai-model-too-powerful-to-release-publicly-1380d1df7b64?source=rss----a5a50631c66a---4</link>
            <guid isPermaLink="false">https://medium.com/p/1380d1df7b64</guid>
            <category><![CDATA[claude-mythos]]></category>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[anthropic-claude]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[vulnerability]]></category>
            <dc:creator><![CDATA[Santhosh Kumar]]></dc:creator>
            <pubDate>Mon, 22 Jun 2026 20:57:54 GMT</pubDate>
            <atom:updated>2026-06-22T20:59:10.437Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EE7zZLipvKf28rCz" /></figure><h3>Introduction</h3><p>For years, AI models have been evaluated based on how well they can write essays, answer questions, and generate code.</p><p><strong>Claude Mythos</strong> changes that conversation.</p><p>In April 2026, Anthropic introduced Claude Mythos Preview, a frontier AI model with unusually <strong>strong cybersecurity capabilities</strong>. Unlike traditional chatbots, Mythos was designed and evaluated for advanced security research tasks, including <strong>vulnerability</strong> <strong>discovery</strong> and multi-step cyber operations. Because of these capabilities, Anthropic chose not to release the model publicly and instead launched Project Glasswing, giving access only to a limited group of trusted organizations.</p><p>This raises an important question:</p><p>What happens when AI becomes better at finding security vulnerabilities than most humans?</p><h3>What Is Claude Mythos?</h3><p>Claude Mythos is a specialized AI model developed by Anthropic.</p><p>According to Anthropic, the model performs strongly across many domains but is particularly capable in cybersecurity-related tasks. Internal evaluations and external assessments reported major improvements in vulnerability discovery, capture-the-flag challenges, and multi-step cyber simulations.</p><p>Rather than releasing it broadly, Anthropic created Project <strong>Glasswing</strong>, a controlled-access program intended to help organizations identify and fix software vulnerabilities before attackers can exploit them.</p><p>In other words, Mythos is not simply another chatbot.</p><p>It is closer to an <strong>AI security researcher</strong>.</p><h3>Why Mythos Is Different</h3><p>Most AI coding assistants help developers write software.</p><p>Mythos helps find ways software can fail.</p><p>Reports surrounding the model suggest that it identified thousands of security vulnerabilities across operating systems, browsers, and critical software infrastructure. Some reports even claim it discovered vulnerabilities that had remained undetected for decades.</p><p>The significance of this cannot be overstated.</p><p>Traditionally, discovering serious vulnerabilities requires:</p><ol><li>Deep operating system knowledge</li><li>Security expertise</li><li>Reverse engineering skills</li><li>Extensive manual analysis</li></ol><p>Mythos appears capable of automating parts of this process at a scale humans cannot easily match.</p><h3>The Security Dilemma</h3><p>The same capability that can protect software can also threaten it.</p><p>A model that discovers vulnerabilities could theoretically help defenders patch systems faster.</p><p>However, the same model could potentially be misused by attackers to identify weaknesses before they are fixed.</p><p>This is one reason Anthropic restricted access to Mythos and avoided a public release. Multiple organizations evaluating the model emphasized its unusually strong cyber capabilities and the importance of controlled deployment.</p><p>The challenge is simple:</p><p>A vulnerability discovered by AI has no inherent moral direction.</p><p>It can be used to secure systems or compromise them.</p><h3>Why Governments Became Interested</h3><p>The discussion around Mythos quickly moved beyond the AI industry.</p><p>Recent reports indicate that government agencies and policymakers became concerned about the national security implications of highly capable cyber-focused AI systems. Questions emerged around export controls, access restrictions, and the possibility of advanced AI-assisted cyber operations.</p><p>Whether these concerns ultimately prove justified or not, Mythos has become one of the earliest examples of an AI model being treated more like strategic infrastructure than a consumer product.</p><h3>What This Means for Software Engineers</h3><p>Many developers worry that AI will replace programmers.</p><p>I believe Mythos points toward a different future.</p><p>As AI becomes better at generating code, it also becomes better at finding flaws in code.</p><p>This increases the value of engineers who understand:</p><ol><li>Secure system design</li><li>Threat modeling</li><li>Authentication and authorization</li><li>Infrastructure security</li><li>Incident response</li><li>DevSecOps practices</li></ol><p>The future software engineer will not simply write code.</p><p>They will design systems resilient enough to withstand AI-powered security analysis.</p><h3>The Rise of AI-Powered Security Research</h3><p>Historically, vulnerability research has been limited by human expertise and available time.</p><p>AI changes this equation.</p><p>Imagine running continuous security reviews against:</p><ol><li>Every code commit</li><li>Every pull request</li><li>Every dependency update</li><li>Every infrastructure change</li></ol><p>Instead of annual security audits, organizations could move toward continuous AI-assisted vulnerability discovery.</p><p>Mythos may represent the beginning of this transition.</p><h3>My Perspective</h3><p>The most important lesson from Claude Mythos is not that AI can find bugs.</p><p>The important lesson is that software security is becoming an AI-versus-AI problem.</p><p>Defenders will use AI to find vulnerabilities.</p><p>Attackers will use AI to discover new attack paths.</p><p>Organizations that rely solely on human-scale security processes will struggle to keep pace.</p><p>The winners will be the teams that combine human expertise with AI-driven security systems.</p><h3>Conclusion</h3><p>Claude Mythos is more than another AI release.</p><p>It signals a future where AI does not merely generate software but actively analyzes, tests, and challenges it.</p><p>For software engineers, this should not be viewed as a threat.</p><p>It should be viewed as a reminder that secure engineering skills are becoming more valuable than ever.</p><p>The question is no longer whether AI can discover vulnerabilities.</p><p>The question is whether we can fix them faster than AI can find them.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1380d1df7b64" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-structures-and-algorithms-series/claude-mythos-the-ai-model-too-powerful-to-release-publicly-1380d1df7b64">Claude Mythos: The AI Model Too Powerful to Release Publicly</a> was originally published in <a href="https://medium.com/data-structures-and-algorithms-series">Stack Valley</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JWT Attacks You Should Know (Beyond the Basics)]]></title>
            <link>https://medium.com/data-structures-and-algorithms-series/jwt-attacks-you-should-know-beyond-the-basics-25cfea72df5e?source=rss----a5a50631c66a---4</link>
            <guid isPermaLink="false">https://medium.com/p/25cfea72df5e</guid>
            <category><![CDATA[web-application-security]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[json-web-token]]></category>
            <category><![CDATA[jwt-authentication]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Santhosh Kumar]]></dc:creator>
            <pubDate>Tue, 14 Apr 2026 16:32:37 GMT</pubDate>
            <atom:updated>2026-04-14T16:32:38.575Z</atom:updated>
            <content:encoded><![CDATA[<p>JWT authentication is everywhere but most implementations are insecure.</p><h4><strong>What is JWT (Quick Recap)?</strong></h4><p><a href="https://medium.com/data-structures-and-algorithms-series/how-jwt-authentication-actually-works-step-by-step-guide-092c0e211905">https://medium.com/data-structures-and-algorithms-series/how-jwt-authentication-actually-works-step-by-step-guide-092c0e211905</a></p><p>JSON Web Tokens (JWTs) are the industry standard for modern web authentication. They are everywhere — and that’s exactly the problem. Because they are so easy to implement, developers often miss the subtle architectural flaws that turn a ‘secure’ token into an open door for attackers.</p><p>In this guide, we aren’t just looking at the theory. I’m going to show you exactly how JWTs are exploited in the wild, from ‘None’ algorithm attacks to secret-key brute forcing, and most importantly, how to architect a production-ready fix like a pro.</p><pre>eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c</pre><h4><strong>The Header</strong></h4><p>Explain how the alg (algorithm) field can be manipulated.</p><pre>{<br>  &quot;alg&quot;: &quot;HS256&quot;,<br>  &quot;typ&quot;: &quot;JWT&quot;<br>}</pre><h4><strong>The Payload</strong></h4><p>Warn about the “clutter” (storing PII or sensitive data in a base64 string that anyone can decode).</p><pre>{<br>  &quot;sub&quot;: &quot;1234567890&quot;,<br>  &quot;name&quot;: &quot;John Doe&quot;,<br>  &quot;iat&quot;: 1516239022<br>}</pre><h4><strong>The Signature</strong></h4><p>Explain that the signature is only as strong as the secret/private key behind it.</p><pre>$$HMACSHA256(base64UrlEncode(header) + &quot;.&quot; + base64UrlEncode(payload), secret)$$</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*snUzd2evtbJ9xK6wLx7qJw.png" /></figure><h4>“None” Algorithm Attack</h4><p>If server accepts “alg”: “none” → signature bypass</p><pre>{<br>  &quot;alg&quot;: &quot;none&quot;,<br>  &quot;typ&quot;: &quot;JWT&quot;<br>}</pre><p>Attacker modifies payload → becomes admin</p><p><strong>Fix</strong></p><ol><li>Always enforce algorithm (e.g. HS256)</li><li>Reject unsigned tokens</li></ol><h4>Weak Secret Key</h4><p>Using weak secrets like:</p><pre>secret123<br>jwtsecret<br>password</pre><p>Brute force using tools like:</p><ol><li>jwt_tool</li><li>Hashcat</li></ol><p><strong>Fix</strong></p><ol><li>Use strong random secrets (32+ chars)</li><li>Use environment variables</li></ol><h4>Token Theft via XSS</h4><p>JWT stored in <em>localStorage.</em></p><pre>localStorage.getItem(&quot;token&quot;)</pre><p>Attacker injects script → steals token</p><p><strong>Fix</strong></p><ol><li>Use HttpOnly cookies</li><li>Implement CSP headers</li></ol><h4>No Expiration (Infinite Tokens)</h4><p>Token never expires.</p><pre>Stolen token works forever</pre><p><strong>Fix</strong></p><pre>expiresIn: &quot;15m&quot;</pre><h4>No Token Revocation</h4><p>User logs out → token still valid</p><p>Attacker continues using old token</p><p><strong>Fix</strong></p><ol><li>Maintain blacklist / token versioning</li><li>Rotate secrets if needed</li></ol><h4>Best Practices Checklist</h4><ol><li>Make it scannable:</li><li>Use strong secrets</li><li>Set expiration</li><li>Store in HttpOnly cookies</li><li>Validate algorithm</li><li>Implement refresh tokens</li><li>Protect against XSS</li></ol><p>JWT is powerful — but only when used correctly.</p><p>Most vulnerabilities come from <strong>poor implementation</strong>, not the technology itself.</p><p>Secure your tokens, or attackers will use them against you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25cfea72df5e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-structures-and-algorithms-series/jwt-attacks-you-should-know-beyond-the-basics-25cfea72df5e">JWT Attacks You Should Know (Beyond the Basics)</a> was originally published in <a href="https://medium.com/data-structures-and-algorithms-series">Stack Valley</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>