<?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[Stories by Darshan Nayak on Medium]]></title>
        <description><![CDATA[Stories by Darshan Nayak on Medium]]></description>
        <link>https://medium.com/@ndarshan507?source=rss-aee2b41b2765------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*QhXIEqp13adGAsTjeu57Xg.png</url>
            <title>Stories by Darshan Nayak on Medium</title>
            <link>https://medium.com/@ndarshan507?source=rss-aee2b41b2765------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 22:12:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ndarshan507/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[  ’  :  , …]]></title>
            <link>https://medium.com/@ndarshan507/-a7afbe4e66a1?source=rss-aee2b41b2765------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7afbe4e66a1</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[apac]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[artificalintelligence]]></category>
            <category><![CDATA[google]]></category>
            <dc:creator><![CDATA[Darshan Nayak]]></dc:creator>
            <pubDate>Wed, 29 Jul 2026 17:52:42 GMT</pubDate>
            <atom:updated>2026-09-14T17:39:18.267Z</atom:updated>
            <content:encoded><![CDATA[<h3>𝗕𝘂𝗶𝗹𝗱𝗶𝗻𝗴 𝗪𝗶𝘁𝗵 𝗚𝗼𝗼𝗴𝗹𝗲’𝘀 𝗔𝗜 𝗦𝘁𝗮𝗰𝗸: 𝗧𝗵𝗿𝗲𝗲 𝗣𝗿𝗼𝗱𝘂𝗰𝘁𝘀, 𝗢𝗻𝗲 𝗕𝗲𝗹𝗶𝗲𝗳</h3><p>I’m Darshan Nayak, 18, currently in my second year of an Integrated B.Tech in Computer Science and Engineering (AI and Data Science) at MIT World Peace University, Pune. While most people my age are figuring out their timetable, I’ve spent the last two years figuring out how far an idea can go before it turns into something people can actually use.</p><p>That chase has taken me through multiple national hackathon wins and a spot in the top 106 out of 85,000+ registrations at Google’s Solution Challenge 2026, putting me in the top 1% nationwide. Along the way I built three products, all running on Google’s AI stack, each one solving a problem I couldn’t stop thinking about. Here’s what they do and how they work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QMjNqzopFyS9IH5na49h9w.png" /></figure><p>𝗥𝗲𝗠𝗼𝘁𝗶𝗼𝗻: 𝗥𝗲𝗵𝗮𝗯 𝗧𝗵𝗮𝘁 𝗙𝗶𝘁𝘀 𝗜𝗻 𝗬𝗼𝘂𝗿 𝗣𝗼𝗰𝗸𝗲𝘁</p><p>Physiotherapy has one glaring problem. The moment a patient walks out of the clinic, nobody is watching whether they’re doing their exercises correctly, or doing them at all. ReMotion fixes that using the one device almost everyone already owns, a smartphone.</p><p>It uses MediaPipe Pose to track a patient’s skeletal joints in real time and calculate the angle of every movement as they exercise. That data goes straight to Gemini, which understands the context of what’s happening and speaks back personalized guidance and corrections, in English, Hindi, Marathi, Konkani and many other languages due to Gemini’s multilingual support. So if a patient’s knee angle is off during a squat, they’re not left decoding a chart. Gemini tells them, out loud, in their own language, exactly what to fix in the moment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GdgazfcI_A8mjAp4BdhDFg.jpeg" /></figure><p>Gemini also runs Flex AI, the recommendation engine behind the app. It uses retrieval augmented generation over WHO discharge protocols to build exercise routines grounded in real medical guidance instead of a generic library. And when a doctor uploads a patient’s discharge sheet, Gemini handles the OCR and pulls out the diagnosis automatically, so nobody has to manually retype clinical data that already exists on paper.</p><p>ReMotion exists because rehab shouldn’t need a clinic visit to be done right. It just needs a camera and a model that actually understands good form.</p><p>𝗘𝗺𝗲𝗿𝗴𝗲𝗻𝗰𝘆 𝗖𝗼𝗿𝗲: 𝗧𝗵𝗿𝗲𝗲 𝗦𝗲𝗰𝗼𝗻𝗱𝘀 𝘁𝗼 𝗦𝗮𝘃𝗲 𝗮 𝗟𝗶𝗳𝗲</p><p>Emergency Core started with a simple observation about hotels and hospitality venues. When something goes wrong, medical emergency, fire, security threat, the information that matters most is scattered across guests, staff, and whoever finally makes the call for help. Every second lost to that scramble adds directly to response time.</p><p>It starts with a 4-button IoT panic device. One press, medical, fire, security, or distress, sends a structured payload straight to the backend. No training needed, no app to open first. From there, Gemini takes over, reading the incoming signal and generating a full situation brief in under 3 seconds along with a recommended action checklist, then pushing it to the right staff through Firebase Cloud Messaging. If nobody acknowledges it within 90 seconds, Gemini doesn’t just resend the same alert. It generates a contextual escalation message with real reasoning behind it and sends it straight to a manager.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IQ7MDiAPNHD5_b03XOrqrw.jpeg" /></figure><p>Every update reflects live across a coordination dashboard through Socket.io, so everyone watching the incident sees the exact same picture in real time. Sitting on top of it all, Vertex AI analyzes incident patterns over time to surface risk insights, so a venue isn’t just reacting to emergencies as they land, it’s learning where its actual risk points are.</p><p>This is the project that landed us in the top 106 out of over 85,000 registrations at Google’s Solution Challenge 2026. Building something that has to work correctly under pressure, with zero room for a slow or confusing response, taught me more about designing real systems than anything else I’ve built.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qngtZHD0Nh_Fk4RON8a81A.jpeg" /></figure><p>𝗦𝘁𝗲𝗹𝗹𝗮: 𝗕𝗿𝗶𝗻𝗴𝗶𝗻𝗴 𝗛𝗼𝘀𝗽𝗶𝘁𝗮𝗹 𝗖𝗮𝗿𝗲 𝗛𝗼𝗺𝗲</p><p>Stella is different from the other two because it isn’t software living inside a phone or a dashboard. It’s a physical robot, and every single unit is calibrated to exactly one patient.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U2ccW5K2xtCaa4WgcSq4sQ.jpeg" /></figure><p>Before Stella ever meets that patient, the treating physician uploads the discharge summary through a doctor dashboard. Stella parses the document and pulls out the diagnosis, the recovery timeline, medications and dosages, and any additional clinical notes, then that data is pushed securely to the specific unit assigned to that patient. Once the transfer is complete, it’s wiped from the dashboard for privacy.</p><p>From there, Stella runs continuously. It tracks heart rate and SpO2 in real time, streaming both to a guardian’s phone app and the doctor’s dashboard as live graphs. It checks in on patient responsiveness throughout the day, and if the patient goes quiet too long, it alerts both the guardian and the doctor immediately. It combines vitals with facial expression analysis through its onboard camera to catch signs of distress or pain, and when it picks something up, it calmly guides the patient through measuring their vitals while flagging the guardian at the same time.</p><p>Physiotherapy is where Stella really earns the name nurse. It watches and analyzes posture and form across 24 different prescribed exercises, logging every session, what was done, when, and how well, straight to the doctor’s dashboard, so recovery gets tracked without the patient logging a single thing themselves.</p><p>For the voice side, Stella runs on Vertex AI to handle its speech, from the welcome script it delivers the first time it meets a patient to the calm, spoken guidance it gives during a moment of distress. That’s what makes the interaction feel less like a machine reading out alerts and more like something actually built to take care of someone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*f6X9wJxHV1GeEK2y-hJE2g.jpeg" /></figure><p>Three different products, three very different problems, but the same belief runs underneath all of them. AI is at its best when it disappears into the background and quietly handles the thing a person shouldn’t have to think about, whether that’s correcting a squat, dispatching a hotel’s security team, or watching over someone recovering at home.</p><p>Would love to hear what you think, or connect if you’re building in this space too.</p><p>Portfolio: <a href="https://darshann.vercel.app/">https://darshann.vercel.app</a></p><p>LinkedIn: <a href="https://www.linkedin.com/in/darshan-nayak-636393346/">https://www.linkedin.com/in/darshan-nayak-636393346/</a></p><p>GitHub: <a href="https://github.com/darshannayak21">https://github.com/darshannayak21</a></p><p>Medium: <a href="https://medium.com/@ndarshan507">https://medium.com/@ndarshan507</a></p><p>#Meetthebuilders #GenAIAcademyAPAC #Cohort3</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7afbe4e66a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Two Years Redefined Spain: The Tactical Revolution Behind Euro 2024]]></title>
            <link>https://medium.com/@ndarshan507/how-two-years-redefined-spain-the-tactical-revolution-behind-euro-2024-d7834f76d017?source=rss-aee2b41b2765------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7834f76d017</guid>
            <category><![CDATA[euro2024]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[football]]></category>
            <category><![CDATA[football-analytics]]></category>
            <category><![CDATA[sports-analytics]]></category>
            <dc:creator><![CDATA[Darshan Nayak]]></dc:creator>
            <pubDate>Mon, 13 Jul 2026 09:46:34 GMT</pubDate>
            <atom:updated>2026-07-13T10:14:58.236Z</atom:updated>
            <content:encoded><![CDATA[<p>Last time I broke down Spain at Qatar 2022, the conclusion was brutal. 76% possession against Morocco, 152 final third entries in that one game alone, and 0 goals in open play. They had the ball, they just had no plan once a team packed the middle and refused to budge. That deadlock ended with a penalty shootout loss and a very predictable, very narrow attack that Morocco read like a book.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r_WsvRwzqkBL-a0vq_p0Fw.png" /><figcaption>2022 Spain vs Morocco, showing the central overload and the “U-shape” reliance on the left flank</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZNlBe1q3TE1G-J_zaj9bGA.png" /><figcaption>this heat-map shows the lack of width Spain had against Morocco</figcaption></figure><p>Two years later Spain won Euro 2024 by blending an unstoppable, direct attacking style with an unmatched collective mentality, becoming the first nation to win four European Championships. They were the only team to win all seven matches in regular or extra time.</p><p>The headlines already tells you the story…… Lamine Yamal (17) won Young Player of the Tournament, Rodri was named Player of the Tournament, Dani Olmo shared the Golden Boot. So instead of repeating that, I pulled the actual event data across 7 matches (15,052 events) and lined it up against the 2022 baseline (4 matches, 12,322 events) to see exactly what changed, the tactics, the formation and player by player analysis.</p><h3><strong>The Headline Shift</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/1*brp5EvoXoP-ZPd3I9gaKLw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*rzbL3g17ckvwJ5Spvn4uSg.png" /></figure><p>Passes dropped by over a third. Pressing got almost 5.5x more aggressive (PPDA falling from 75.5 to 13.8 is a massive number, that’s the difference between letting teams play out and hunting the ball). Shots went up 38% but xG per shot actually fell. So the team that used to circulate the ball for the sake of it stopped doing that, and started pressing higher and shooting more instead, even if individual shot quality dropped.</p><h3>Where Spain Actually Lived on the Pitch</h3><p>The territory maps make the whole shift obvious before you even look at a single stat. In 2022, Spain’s possession peak sits basically on the halfway line, a big glowing blob centered right around the center circle, with a second smaller hot pocket back near their own box. That’s a team that spent its time circulating the ball in front of itself, not in behind anyone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m4cU9iSgD9sO9LgHXQ5zuQ.png" /><figcaption>Spain Possession Territory Comparison heatmap WC 2022 vs EURO 2024</figcaption></figure><p>In 2024 that peak completely relocates. The hottest zone on the map is now tucked right into the opposition’s corner/byline area in the attacking third, nowhere near the center circle. Spain didn’t just have more of the ball in dangerous areas, their entire center of gravity as a team moved 30+ yards up the pitch.</p><p>The progressive pass maps back this up with a number that’s almost embarrassing: <strong>174 progressive passes at WC 2022 vs 316 at Euro 2024</strong> — nearly double. And it’s not just more of the same type of pass. The 2022 map is mostly short, tight progressive passes bunched right around the edge of the box. The 2024 map has way more of those long diagonal balls starting from deep in Spain’s own half and landing directly in the final third,actual line-breaking, not just short combination play near the box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bRcEc_pA4qhFrYREvaYMrg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DULMf4xt0t7MlgHs3DUcDw.png" /></figure><p>Then there’s the pressing. The Euro 2024 pressure heatmap (1,126 pressure actions across the tournament) is almost entirely yellow/white from the halfway line forward, with the single hottest cluster sitting right on the edge of the opponent’s box, right side channel especially. Barely any color left in Spain’s own half at all. This is a team hunting the ball in the final third and half-space, not just pressing “high up” in some vague sense they’re specifically suffocating teams right where it hurts most.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FTDgx28hr_n7k8IjWCsZvA.png" /></figure><p>And the final third entry zones chart makes the width vs center story concrete with actual counts, not just percentages:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OKHvojIjG7cffB7CCJpg3A.png" /><figcaption>Final Third Entry Zones bar chart WC 2022 vs Euro 2024</figcaption></figure><p>Wide entries went up (that’s Yamal and Williams doing their job), half-space barely moved, but <strong>central entries jumped 70.6%</strong> — going from the zone Morocco shut down for free to the zone Spain actually broke teams open in. Every number here points the same direction: higher territory, more direct passing, more aggressive pressing, more central penetration. Four completely different metrics, same conclusion.</p><h3><strong>Now lets dive deeper into the induvidual players</strong></h3><h4>Rodri: Same Player, Completely Different Job</h4><p>This is the clearest before/after in the whole dataset.</p><ul><li><strong>2022:</strong> 170 passes/match, 95% completion, 66% forward passes, 8.5 progressive passes/match</li><li><strong>2024:</strong> 62 passes/match, 94% completion, 58% forward passes, 3.4 progressive passes/match</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/967/1*O2DfMmQF3pU5etly3u8D2w.png" /><figcaption>Rodri 2022 vs Rodri 2024, showing the positional discipline shift</figcaption></figure><p>Rodri’s numbers didn’t drop because he got worse. He went from being the guy trying to single-handedly progress the ball forward (like Rodri + Laporte + Busquets carrying 35.7% of the entire team’s passing output in 2022) to a pure anchor sitting behind a much more direct attack. Less passing volume, same completion rate, way less forward risk-taking. That’s not decline, that’s a different job description entirely.</p><h4>Yamal and Nico Williams: The Width Spain Never Had</h4><p>Remember Ferran Torres in 2022–206 touches all tournament, zero progressive carries and zero chances created in the Morocco game specifically, because he kept inverting into an already crowded middle. Spain had no natural winger stretching the pitch until Nico Williams came off the bench at minute 75 against Morocco, and even then it was too late.</p><p>Euro 2024 just… fixed that from matchday one.</p><ul><li><strong>Lamine Yamal:</strong> 469 touches, 32 progressive passes, 45 progressive carries, 1 goal , tournament high 4 assists , Young Player of the Tournament</li><li><strong>Nico Williams:</strong> most successful take-ons on the team (15), constant left-side width, 2 goals , 1 assist ,direct 1v1 threat every match</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JlRPeQw6Ften1nCVUU5Bvg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4JvqvqjB6--aWA0PnneDGw.png" /></figure><p>Between them Yamal and Williams are responsible for roughly <strong>27% of the team’s total progressive output</strong> this tournament. That’s two players doing what the entire 2022 attacking line couldn’t manage between them.</p><p>And it’s not just a wing story. Final third entries through the <strong>center</strong> jumped 28.3% (11.9% → 15.3%), even though total final third entries actually went <em>down</em>. <strong>Width from Yamal and Williams pulled defenders out</strong>, and that opened the middle back up leaving space in the middle for players like Fabian Ruiz ,Pedri and Olmo to exploit.</p><p>Speaking of Pedri and Olmo ….</p><h4><strong>Olmo and Pedri: The Beneficiaries</strong></h4><p>Dani Olmo went from 446 touches and and playing on the left wing in 2022 to sharing the Golden Boot in 2024. Pedri, who along with Jordi Alba was one of the only two players actually carrying the ball vertically in 2022, now has genuine width around him instead of doing it alone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*NHym7vpEROLmJ8A3_-VK_w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*B5q554hY3QZGXfaHgk32JQ.png" /></figure><p>As seen in the above heatmaps Pedri and Olmo were given much more freedom to roam around the central areas and attack the gaps and spaces in between.</p><p>keep in mind Olmo was playing primarily as a left winger in the 2022 World-cup which meant not using him to his strengths to attack tight spaces in the middle….</p><p>With Yamal and Williams stretching defenses and Rodri holding the base, Olmo and Pedri stopped being isolated line-breakers and became the players actually finishing moves in central areas — the exact zone Morocco shut down completely two years ago.</p><h3><strong>Shots Up, Quality Down — Let the Numbers Say It</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*M3UfBDu9D0SPDosqePvqsg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yhIR8jA1ilfqufwOrsaCOA.png" /></figure><p>xG per shot and conversion rate both dropped. Spain didn’t get more clinical, they just took way more shots (123 vs 51) and let volume do the work. What actually changed for the better: goal threat stopped living on one player’s boot (top scorer share dropped from 42.9% to 20%), and set pieces became an actual weapon (0% to 20% of goals) something that flat out didn’t exist as a route to goal in 2022.</p><p>The buildup histogram makes the directness claim concrete instead of just a vibe: <strong>average passes before a shot dropped from 17.7 (2022) to 9.6 (2024)</strong>. Look at the actual distribution and it’s not subtle — 2024’s shots pile up almost entirely under 15 passes, while 2022 has a long tail stretching out to sequences of 45, 53, 55, even 59 passes before someone finally had a shot. That’s not “slightly more direct,” that’s a completely different relationship with the ball. Spain in 2022 would occasionally pass for the better part of a minute straight before testing the keeper. In 2024 that basically stopped happening.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jqyktSw3NokcplcJ1zphAA.png" /><figcaption>Passes in Buildup Sequence Before Shot</figcaption></figure><p>The goal location maps tell a smaller but related story. 2022’s goals are almost all crammed right on top of the six-yard box, tap-ins and headers from point-blank range because that’s the only space Spain could actually find. 2024’s goals are still mostly inside the box, but there’s more spread across it, and one goal (Eiban) comes from well outside the box entirely — a strike from distance that simply has no equivalent on the 2022 map. Fewer scraps in the six-yard box, more genuine variety in how the ball actually ended up in the net.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R9w5KLPxANbDzCJcpGMs6w.png" /><figcaption>Spain Goal Locations map here — WC 2022 vs Euro 2024</figcaption></figure><p>And the player heatmap grid basically visualizes every number from the sections above in one image: Yamal and Nico Williams glued to their respective touchlines high up the pitch (77 and 62 progressive actions), Rodri’s entire world shrunk to a small pocket just in front of the center circle (24 progressive actions, way down from his 2022 numbers), Olmo’s heatmap sprawling across the entire left-to-central attacking third — the widest coverage of anyone on the pitch, which tracks given he ended up sharing the Golden Boot, and Cucurella and Carvajal mirroring each other on opposite touchlines, pure fullback strips with almost no central involvement (28 progressive actions each, but 0.0 xG for Cucurella against 0.3 for Carvajal scoring 1 goal).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JgiXN75dW_2WLc5_2tLL5g.png" /></figure><h3>Georgia: The Morocco Rematch, Basically</h3><p>Round of 16, Euro 2024. Georgia set up in a deep 5–3–2, banked in behind the ball, and dared Spain to break them down exactly like Morocco did two years earlier. On paper this was the same test. The defensive numbers back that up, if anything Georgia sat even deeper: with a low block instead of a mid blockb</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*ah7XBApMFdf58JYhcs3-9A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MuvOnjeeWdUoiTSs4Ebmkw.png" /></figure><p>And then Georgia actually took the lead. 18th minute, Otar Kakabadze whips a cross in, Kvaratskhelia gets across his marker, and Robin Le Normand turns it into his own net under pressure. Spain, dominating the ball and the territory again, went behind to the low block for the second tournament running.</p><p>This time it didn’t hold.</p><p><strong>The comeback, minute by minute:</strong></p><ul><li><strong>18&#39;</strong> — Le Normand own goal, Georgia 1–0 up</li><li><strong>Before half-time</strong> — Rodri drills one low into the far corner from the edge of the box, 1–1</li><li><strong>51&#39;</strong> — Yamal curls a cross in from the left, Fabián Ruiz meets it with a header, Spain lead 2–1</li><li><strong>75&#39;</strong> — Nico Williams smashes a tricky-angle strike into the roof of the net, 3–1</li><li><strong>83&#39;</strong> — Dani Olmo (on for Pedri) finishes off Oyarzabal’s assist, 4–1</li></ul><p>Final score 4–1. Compare final third entries here against the Morocco game: <strong>41.1% left, 27.9% central, 31.0% right</strong> vs Georgia, against just <strong>18% central</strong> vs Morocco. Almost ten points more central penetration, against a defense that was set up to be even more compact than Morocco’s.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_6Iw4A4auTrH7FxEON-VSw.png" /></figure><p>While the sequence began with a Yamal free kick, Ruiz actually finished it with a header from a Yamal cross — transitioning seamlessly from a dead-ball phase into an open-play goal.</p><p>Why didn’t Georgia hold out the way Morocco did? Simple: Morocco packed the middle for free in 2022 because nobody threatened them out wide, so committing bodies centrally cost them nothing.</p><p>Yamal on the right and Williams on the left meant Georgia’s wing-backs couldn’t tuck in and stack the box the way Morocco’s fullbacks could. Spain got their central goals (Ruiz ,Rodri and Olmo ) and their winger goal (Williams) in the same match, off the same principle: stretch the width, then punish whatever gap opens in the middle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*UyqiugYItomgcLV13k9D1w.png" /></figure><p>This table breaks down exactly who did the actual line-breaking work against Georgia : Yamal leads progressive passes (12) and carries (14), Williams leads box touches (32), and it’s Fabián Ruiz who tops central final third entries (64) — with Olmo close behind at 34, despite contributing the least in raw progressive passes and carries, showing they finding and occupying central pockets rather than progressing the ball there himself. The direct payoff of the roaming, interchange-heavy midfield created by the wide overloads.</p><h3>Conclusion</h3><p>Spain didn’t fix 2022 by getting more disciplined on the ball. They fixed it by needing the ball less, pressing relentlessly higher up the pitch without it, giving Rodri a completely different job as a fixed anchor, and finally handing two actual wingers to a system that spent an entire World Cup without one. But the real shift wasn’t just personnel, it was structure. Instead of a rigid shape where everyone stuck to their zone, Spain built something far more fluid and dynamic, letting Pedri, Fabián, and Olmo roam free between the lines and interchange positions in the middle rather than being boxed into fixed central roles. The center opened up not because Spain passed better through it, but because Yamal and Williams pinned defenders wide and dragged the block apart, and that rotating trio in midfield had the freedom to pour into the space they left behind.</p><p>Built on StatsBomb open event data, 4 WC2022 matches and 7 Euro2024 matches.<br>keep in mind these are small samples, different opposition , treat this as directional, not definitive.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7834f76d017" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[When Possession Isn’t Enough: A Tactical Analysis of Spain at Qatar 2022]]></title>
            <link>https://medium.com/@ndarshan507/when-possession-isnt-enough-a-tactical-analysis-of-spain-at-qatar-2022-c8c5cdf90ada?source=rss-aee2b41b2765------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8c5cdf90ada</guid>
            <category><![CDATA[sports-analytics]]></category>
            <category><![CDATA[data-analytics]]></category>
            <category><![CDATA[football]]></category>
            <category><![CDATA[world-cup]]></category>
            <category><![CDATA[football-analytics]]></category>
            <dc:creator><![CDATA[Darshan Nayak]]></dc:creator>
            <pubDate>Mon, 06 Jul 2026 17:59:41 GMT</pubDate>
            <atom:updated>2026-07-13T10:18:17.702Z</atom:updated>
            <content:encoded><![CDATA[<p>Spain arrived in Qatar with a familiar identity ,the exact same philosophy that won them the 2010 World Cup. They wanted the ball.</p><p>The raw numbers from the tournament are insane. The dataset logged <strong>12,322 individual events for Spain</strong>. To put that immense volume into perspective, France, the finalists recorded 13,361 events across their entire tournament run. Spain had the ball constantly.</p><p>But what kind of possession was it? Possession alone does not win football matches, so I have analyzed what exactly happened in the World Cup 2022 that made Spain’s possession based game backfire.</p><p>Spain did not sit back and wait. Their pressing was an aggressive, front-foot system designed to suffocate opponents. Out of all their recorded pressures, <strong>a massive 38 percent took place in the final third of the pitch.</strong> Another 38 percent happened in the middle third. Only 24 percent of their pressing actions occurred in their own defensive third.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZXiSTz6d5r7DzZfDFEkVrg.png" /><figcaption>Notice the intense clusters of color deep in the opponent’s half. This heatmap visualizes exactly where Spain hunted the ball, highlighting a clear intent to win possession back as far up the pitch as possible.</figcaption></figure><p>The result of this intense pressing was highly effective. The data shows Spain registered 189 total ball recoveries. Incredibly, 47 percent of these were “high recoveries”. This means 88 times they won the ball back at least 60 yards up the pitch.</p><p>Winning the ball near the opponent’s goal is a critical modern tactical weapon. It disrupts the defensive shape and creates instant attacking opportunities. When we combine ball recoveries and interceptions, Spain registered 226 total regains. Out of those, 97 were high regains.</p><p>The next question is simple. <strong>Did these high regains actually create danger?</strong></p><p>The event data tracked what happened in the 60 seconds immediately following those 97 high regains. Spain managed to take a shot on 42 of those occasions. This gives them a transition threat rate of 43.3 percent. Nearly half the time Spain won the ball high up, they generated an attempt on goal within a minute. This meant Spain pressed high, won the ball high and regained position and even took their chances in dangerous positions.</p><p>However they played completely different when opponents dropped deep, absorbed the press, this forced Spain to build up slowly.<br>This made me curious…..Did Spain control the ball, or did they actually control the pitch?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8mZ0Fy5ye1wRdfjevxb_RQ.png" /><figcaption>Take a look at the comparison here between Spain in possession and France in possession, you will notice a heavy concentration of touches in non-threatening central and wide areas , rather than in dangerous attacking positions.</figcaption></figure><p>the possession heat map starts to show signs that Spain didn’t really push up front and lacked quality on the right flank, they played with heavy possession in the central areas of the field where threat was minimal leading to an overload in the central areas and maybe too predictable???</p><p>Meanwhile France’s heatmap shows they played higher up circulating the ball on both flanks and stretched and made use of the entire pitch leading to their dangerous counterattacks</p><p>The contrast is shocking. Spain could execute a high press and create quick transition shots. Their sustained possession told a completely different story. They logged an incredible amount of events, yet the underlying territory data suggests their buildup was often predictable and lacked directness.</p><p>To understand why this possessive dominance resulted in sterile, predictable cycles rather than penetration, let’s look at the underlying data of Spain’s squad profile and the specific constraints of their tactical system.</p><h3>The Buildup Centrality and the “U-Shape of Death”</h3><p>When we analyze the player profiles by volume, the data mathematically exposes Spain’s structural congestion. Spain’s offensive network was heavily consolidated within their deepest lines, starving the final third of dynamic variations.</p><ul><li><strong>Total Team Passes:</strong> 3,914</li><li><strong>Passes by Deep Players:</strong> 1,398 (completed exclusively by Rodri, Aymeric Laporte, and Sergio Busquets)</li><li><strong>Deep Centrality Ratio:</strong> 35.7%</li></ul><p>More than one-third of Spain’s entire passing output was generated by just three defensive-minded players. Outfield touch volume was heavily skewed toward the back: Rodri accumulated 1,249 touches, followed by Laporte with 784 touches. While they circulated the ball continuously, their progressive output was remarkably low relative to this immense volume. They were effectively trapped in a horizontal passing loop in front of the opposition block. Take a look at the Top 5 Outfield Players by Touches: Rodri 1249, Pedri 854, Laporte 784, Jordi Alba 669, Busquets 481, none of which are attacking players.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*lTU8Su2hxTqGynvssvyZzw.png" /></figure><h3>The Vertical Penetration Deficit</h3><p>True line-breaking threats were limited to isolated profiles. The penetration threat data reveals that progressive passes and progressive carries were heavily concentrated on a single flank, making Spain’s approach highly predictable.</p><ul><li><strong>Flank Dependency:</strong> Jordi Alba and Pedri shouldered almost the entire burden of progressive verticality.</li><li><strong>The Inverted Winger Issue:</strong> Ferran Torres logged only 206 touches across the tournament. Rather than staying wide to stretch defensive lines and unlock the center, he frequently inverted into already congested channels.</li><li><strong>Lack of Width Support:</strong> This central drifting was mirrored across the forward line. Dani Olmo (446 touches) and Marco Asensio (242 touches) repeatedly dropped deep or tucked inside, failing to challenge the opposition’s horizontal compactness or threaten the flanks.</li></ul><h3>Visualizing Squad Congestion</h3><p>The positional maps and player heatmaps vividly illustrate how Spain starved themselves of width, creating an narrow, easily containable attacking block:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4lahHrZkNdolbcuZoJxu3g.png" /></figure><p>As shown above, the heatmaps for nominal wide options like César Azpilicueta (332 touches) and Dani Carvajal (238 touches) reveal deep, conservative positioning within their own halves. Because the<strong> wingers and attacking midfielders constantly compressed space centrally</strong>, opponents could remain compact, confident that Spain posed minimal threat of outside-to-in vertical runs behind the backline.</p><p>Players like Ferran Torres , Olmo and Asencio rarely stretched defenses creating a <strong>predictable and crowded central attack</strong>… <strong>Spain truly lacked threat on the flanks.</strong></p><h3>The Striker Isolation Paradox</h3><p>This failure to manipulate defensive space had severe consequences for Spain’s central targets. The metrics for primary striker Álvaro Morata highlight this tactical isolation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*L4rFUTO8Qu9wnDIEIgyOeg.png" /></figure><p>Morata highly <strong>overperformed</strong> his underlying numbers, converting nearly three times his generated xG. The structural issue was not finishing quality, it was a total breakdown in service. Despite completing thousands of passes, Spain’s narrow attack could not reliably penetrate the penalty box, forcing their most clinical finisher to survive on scraps.</p><h3><strong>Lets take a look at how this exact issue lead to them being knocked out of the 2022 World-cup</strong></h3><p>Here i deeply researched and analyzed Spain’s Match against Morocco where their weaknesses were clearly evident and their structure was exploited.</p><p>The Round of 16 match against <strong>Morocco</strong> is the ultimate test case for Spain’s 2022 tactical identity. When a team gets eliminated on penalties after failing to score in open play, the narrative usually points to a structural failure. To find out what really happened, we have to look directly at the event data and compare Spain’s performance against their own group stage baseline.</p><p>Did Spain’s system break down, or did Morocco simply execute a brilliant defensive plan?</p><h3>The Illusion of Dominance</h3><p>On the surface, Spain’s attacking metrics against Morocco look like total domination. They attempted 1,068 passes, a 12.5 percent increase over their group stage average. Their progressive passes jumped to 55, a massive 38.6 percent increase. Final third entries spiked by 65 percent, reaching a staggering 152 entries in a single match.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*rwDZwkY28lYyfmFw7npgxw.png" /><figcaption>This table highlights the dramatic increases in Spain’s possession, passing, and final third entries against Morocco compared to their tournament baseline. It shows they had complete control of the ball.</figcaption></figure><p>Despite these numbers, the scoreboard remained 0–0. Spain completed 960 passes and generated 2.85 Expected Goals from 15 shots, yet they only produced 3 Big Chances and scored 0. They had the ball, but they struggled to create high-quality clear-cut opportunities.</p><h3>The Moroccan Blockade</h3><p>To understand why Spain’s 152 final third entries resulted in so few premium chances, we have to look at how Morocco set up without the ball.</p><p>Morocco did not just drop into a passive, deep block on the edge of their own box. Their average defensive action height was 40.2 yards from their own goal, placing them firmly in a rigid mid-block. The Passes Per Defensive Action was 9.6, showing that they actively pushed and pressured Spain once the ball crossed a specific threshold.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BYds_Zu2rzFiAr5fDCeU_w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1OON1uBpX6u2VIxoRfRzlw.png" /><figcaption>Notice how Morocco’s defensive actions are densely packed in the center of the pitch. When you overlay Spain’s final third entries, you can see how Spain’s penetration was forced entirely to the outside edges of this defensive wall.</figcaption></figure><p>Morocco’s tactical plan was clear: concede the flanks and completely wall off the center, and Morocco’s plan was going succesfull</p><h3>The Spatial Trap and The Left-Side Bias</h3><p>Because Morocco packed the middle, Spain’s possession became predictable,their main attacking lane was blocked. The spatial data reveals a imbalance, with majority of all final-third actions occurring on the left flank.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GtugGRILoASVrxnbokgtXw.png" /><figcaption>This visualization shows the distinct U-shape of Spain’s possession. The heavy red clusters on the left flank highlight how often Spain relied on the flanks ( especially the left) to break through.</figcaption></figure><p>When Spain did manage to get touches inside the opponent’s penalty area, those touches were overwhelmingly pushed wide. They rarely touched the ball near the penalty spot or in central danger zones as it was overcrowded by the Moroccon players.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jVRHCNhZjJs_HIer9Rp5NA.png" /><figcaption>Look at how the touches are scattered along the very edges of the 18-yard box. This spatial map perfectly illustrates Spain’s inability to break lines and penetrate centrally.</figcaption></figure><h3>The Catalyst on the Right</h3><p>Spain’s starting right-winger, Ferran Torres, operated as an inverted forward, him being played as a right footed right winger didnt give him much option of attacking or playing fluidly. Because he naturally drifted inside, he played directly into Morocco’s central density. In his 75 minutes on the pitch, he recorded zero progressive carries and zero chances created. While he did manage 16 touches in the box, the lack of natural width on the right meant <strong>Spain could not stretch the Moroccan defense</strong>.</p><p>Luis Enrique’s decision of not having any proper winger or striker starting was backfiring, with both olmo and ferran not being much of a wide/ touchline winger making their attack very predictable and not having a proper striker meaning there were crosses coming into the box but no proper striker to finish it in the net against Morocco’s mid block .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sj8dqrqyyBOArqPDRXiQaw.png" /><figcaption>this heatmap shows none of Spains starting 11 players were comfortable or playing on the touchline on either flanks , making them a victim to Morocco’s central overload.</figcaption></figure><p>The Solution? A winger who stretched Morocco’s defense</p><p>Things changed in the 75th minute.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4YYtm_jkR4EbolHh8CYuDg.png" /><figcaption>This timeline pinpoints the exact moment Nico Williams was substituted on for Ferran Torres, giving us a perfect marker to split the match data.</figcaption></figure><p>When Nico Williams entered the game, he hugged the right touchline. The impact on Spain’s attacking threat was immediate and drastic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*X6jas5Dnf-kjexzulkJpDQ.png" /><figcaption>this table splits Spain’s offensive output per minute before and after the substitution. Notice how total entries drop, but the actual threat metrics explode.</figcaption></figure><p>With a genuine winger on the pitch, Spain actually entered the final third less frequently, dropping from 7.54 entries per minute to 6.59. However, the quality of their attacks transformed.</p><p>Right flank entries increased to 3.23 per minute. Shots jumped from 0.026 per minute to 0.166. Expected Goals per minute surged from a completely flat 0.0004 to 0.0058. Box touches also increased.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/522/1*E61rQlz5nvTyZwNPIk-ylQ.png" /><figcaption>This head-to-head comparison looks at the raw output and normalized “Per 90” data between Ferran Torres and Nico Williams, showing exactly what changed on the right wing.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QAfhIZd4gIOF9gcn-HnQyw.png" /></figure><p>Nico Williams brought 1v1 directness that Spain desperately lacked. Normalized per 90 minutes, Williams provided 4.28 successful dribbles and 4.28 dangerous wide deliveries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GroXjZUIIc06BepQiDYgcw.png" /><figcaption>These heatmaps contrast the positioning and actions of both players. Notice how Williams operates right on the chalk of the touchline, stretching the defense and forcing Morocco to step out of their narrow shape</figcaption></figure><p>Morocco executed a brilliant, <strong>opponent-specific defensive plan</strong>. They knew <strong>Spain’s starting lineup lacked the width to stretch a compact block</strong>. It wasn’t until a traditional winger was introduced late in the match that Spain’s sterile passing was finally converted into tangible shots.</p><p>By the time Spain introduced natural wingers to stretch the pitch, it was <strong>simply too late in the match</strong>. While this tactical change did lead to more entries out wide and touches inside the penalty area, Morocco’s defense was already well-organized and comfortable in their shape.</p><p>Spain’s inability to turn their high possession into clear scoring chances lasted the full 120 minutes, ultimately pushing the game to a penalty shootout. After struggling to find a breakthrough during regular play, Spain failed to convert a single penalty kick. This lack of finishing allowed <strong>Morocco to secure a well-earned victory</strong> and <strong>eliminated Spain from the tournament.</strong></p><p>Spain’s predictable possession in 2022 ultimately cost them, but they learned from it. That tactical deadlock forced a massive rethink for the national team. Stay tuned for the next breakdown: <strong>How Two Years Redefined Spain: The Tactical Revolution Behind Euro 2024</strong>, where I analyze the data and structural adjustments that won them the trophy.</p><p>Built on StatsBomb open event data, 4 WC2022 matches.</p><p>keep in mind these are small samples, treat this as directional, not definitive.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8c5cdf90ada" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Static RAG to Systems That Think: Building a Self‑Adaptive Hybrid Search RAG]]></title>
            <link>https://medium.com/@ndarshan507/from-static-rag-to-systems-that-think-building-a-self-adaptive-hybrid-search-rag-120fb4ce80af?source=rss-aee2b41b2765------2</link>
            <guid isPermaLink="false">https://medium.com/p/120fb4ce80af</guid>
            <dc:creator><![CDATA[Darshan Nayak]]></dc:creator>
            <pubDate>Sat, 15 Nov 2025 16:33:35 GMT</pubDate>
            <atom:updated>2025-11-15T16:33:35.807Z</atom:updated>
            <content:encoded><![CDATA[<p>In the last couple of years, Retrieval‑Augmented Generation (RAG) has quietly gone from a “nice hack” to the backbone of serious AI systems. If you’re building anything that has to answer questions grounded in real data — documents, PDFs, knowledge bases, logs — you almost always end up with some form of RAG combined with your LLM.</p><p>But most RAG systems today still behave like calculators: you give them a question, they run the same retrieval pipeline every single time, and they hope the answer is good enough. They don’t reason about the question, they don’t change strategy, and they don’t know when their own context is weak.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2TZLgNZdMqsHSqKUMFlm0Q.jpeg" /><figcaption>Standard RAG systems</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*79RTsbU9PUg20Ho0F2-6qQ.jpeg" /><figcaption>process of standard RAGs</figcaption></figure><p>Today’s LLMs deserve better infrastructure than that. So in this project, I set out to combine two powerful ideas:</p><ul><li><strong>Hybrid RAG</strong> — mix semantic vector search with keyword BM25 search for maximum recall and precision.</li><li><strong>Self‑Adaptive RAG</strong> — let the system analyze query complexity and dynamically choose how to retrieve: standard, expanded, or multi‑hop.</li></ul><p>The result is a <strong>Self‑Adaptive Hybrid RAG system</strong> that doesn’t just retrieve and respond — it actually thinks about how to retrieve before it answers.</p><p><strong>What RAG Really Is (And Why It Matters)</strong></p><p>At its core, RAG is a simple but powerful pattern:</p><ol><li><strong>Retrieve</strong> relevant context from your own data (documents, PDFs, databases).</li><li><strong>Augment</strong> the user’s prompt with that context.</li><li><strong>Generate</strong> the answer with an LLM, grounded in that retrieved evidence.</li></ol><p>This solves two big problems of vanilla LLMs:</p><ul><li>They hallucinate confidently when knowledge is missing.</li><li>They are locked to a static training cutoff and can’t see your private or fresh data.</li></ul><p>With RAG, the LLM becomes a reasoning engine sitting on top of <em>your</em> corpus. It can answer questions about proprietary PDFs, internal policies, research reports, or domain data — while still benefiting from the LLM’s reasoning and language abilities.</p><p>RAG is not just “another trick” — it is turning into a foundational pattern for AI systems, the way relational databases were for web apps. And like databases, there isn’t just one RAG. There are types: standard RAG, hybrid RAG, self‑RAG, graph‑RAG, agentic RAG, and more.</p><p>This project lives at the intersection of two of the most impactful variants: <strong>Hybrid RAG</strong> and <strong>Adaptive RAG</strong>.</p><h3><strong>Part 1 — Hybrid Search RAG: Precision Meets Understanding</strong></h3><p>Most tutorials stop at one retrieval mode: semantic vector search. You embed chunks, you embed the query, you run similarity search, and you hope the nearest neighbors are relevant.</p><p>Vector search is powerful because it captures semantic similarity:</p><ul><li>Ask “Who is the CEO of Tesla?” and a decent vector search will still find sections that mention the current CEO by name, even if the phrase “CEO of Tesla” never appears exactly that way.</li></ul><p>But it has blind spots:</p><ul><li>It may miss places where the exact keyword appears (a specific error code, regulation number, function name).</li><li>It can over‑generalize and pull in “similar” but not precise content.</li></ul><p>On the other side, classic keyword search with BM25 is brutally precise but semantically dumb:</p><ul><li>If your question says “CO₂ emissions limits for passenger vehicles,” BM25 won’t automatically realise that a paragraph talking about “European fleet-average emission targets for new cars” is relevant unless the overlap in tokens is good enough.</li></ul><p>Hybrid RAG says: why choose?</p><p><strong>How Hybrid RAG Works</strong></p><p>Ingest and embed documents<br> Your PDFs and text files are parsed, broken into overlapping chunks, and turned into vector representations. Those embeddings go into a vector database so the system can perform semantic search over your knowledge base.</p><p><strong>Add a BM25 index<br></strong> The same chunks are also stored in a search engine that supports BM25. This gives you a strong, traditional keyword search layer on top of the raw text.</p><p><strong>Run dual retrieval for every question<br></strong> Whenever a user asks something, the system fires two retrieval calls in parallel: one semantic search over embeddings, and one BM25 search over plain text. Each brings back its own view of “what looks relevant”.</p><p><strong>Merge and rerank the results<br> </strong>The two result sets are merged and deduplicated. Instead of trusting either distance or BM25 score, a cross‑encoder reranker looks at each query–chunk pair in full and assigns a relevance score. The list is then sorted by this score.</p><p><strong>Pass the best context to the LLM<br> </strong>Only the top‑ranked chunks are sent to the language model, along with the question and a prompt that asks for a grounded, well‑structured answer.</p><p>In practice, this setup patches the two big blind spots of single‑mode retrieval:</p><ul><li>BM25 gives you the exact hits you care about — IDs, names, error codes, specific phrases.</li><li>Vector search makes sure you still catch passages that “mean the same thing” even if they don’t share wording.</li><li>Reranking glues it together into a single, sensible ordering based on how useful each chunk is for the question.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CWds6Cx_JJrU0Ta5q-w2tw.png" /><figcaption>Hybrid Search RAG</figcaption></figure><h3><strong>Part 2 — Self‑Adaptive RAG: Letting the System Choose Its Own Strategy</strong></h3><p>Hybrid RAG already improves retrieval quality, but it treats every question the same. The pipeline doesn’t care whether you ask:</p><ul><li><strong>“Who wrote <em>1984</em>?”<br> or</strong></li><li><strong>“Compare how different dystopian novels handle state surveillance and individual agency.”</strong></li></ul><p>Both go through the exact same retrieval depth and strategy. That’s overkill for the first and not quite enough thought for the second.</p><p>Self‑Adaptive RAG fixes this by inserting one simple idea in front of the pipeline:</p><p>Before retrieving anything, the system pauses and asks:<br> “How hard is this question, and what’s the smartest way to search for the answer?”</p><p><strong>The architecture has three moving parts.</strong></p><p><strong>1. Query complexity assessment</strong></p><p>The system starts by asking an LLM to look at the question and describe it. The model returns:</p><ul><li>A complexity score on a 1–5 scale.</li><li>A rough type: factual, analytical, comparative, open‑ended, and so on.</li><li>A suggested retrieval strategy: standard, expansion, or multi‑hop.</li><li>A short justification for that choice.</li></ul><p>This step gives the pipeline a bit of self‑awareness. It can tell the difference between “lookup” questions and “think very carefully” questions.</p><p><strong>2. Adaptive retrieval strategy</strong></p><p>Once the question is scored, the retrieval behaviour is adjusted.</p><ul><li>Standard retrieval (complexity 1–2)<br> For straightforward, factual queries, the system just runs a normal hybrid search with relatively small top‑K values. It’s fast and usually enough.</li><li>Query expansion (complexity around 3)<br> For medium‑difficulty questions, the system first generates a few related queries that explore nearby angles. It retrieves for each of them, merges the results, and then reranks. The effect is like casting a slightly wider net around the original question.</li><li>Multi‑hop retrieval (complexity 4–5)<br> For deep, multi‑layered questions, the system breaks the original query into simpler intermediate questions. It retrieves context for those first, then pulls in additional context for the main question and combines everything before reranking. This gives the model the “supporting facts” it needs to build a nuanced answer.</li></ul><p><strong>3. Response generation</strong></p><p>Finally, the language model gets a bundle of top‑ranked chunks and the original question. The way it answers is also tied to complexity: simple questions get short, direct replies; complex ones are encouraged to produce multi‑paragraph, structured explanations with examples and references back to the retrieved context.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q5y2e8Klfzjsr5WcgTzlzw.jpeg" /><figcaption>Self reflective RAG</figcaption></figure><p>Instead of a rigid, one‑size‑fits‑all pipeline, you end up with a self‑routing RAG system that spends more effort only when the question actually demands it.</p><h3><strong>What I Built: A Self‑Adaptive Hybrid Search RAG</strong></h3><p>Putting these two ideas together is where things start to get interesting.</p><p>From the hybrid side, you get strong retrieval quality: semantic search, keyword search, and reranking all working together.<br> From the self‑adaptive side, you get a retrieval plan that changes with the question.</p><p>The system built on top of my own document set works roughly like this.</p><p><strong>Document‑first knowledge base</strong></p><p>The “database” is just a folder of PDFs. For each file, the pipeline:</p><ul><li>Cleans and parses the content.</li><li>Splits it into overlapping segments so that paragraphs don’t get chopped in unnatural ways.</li><li>Creates embeddings and stores them in the vector database.</li><li>Indexes the raw text into the BM25 search engine.</li></ul><p>One ingestion pass turns a messy collection of PDFs into something a language model can actually navigate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WOl1uexe7HBsYO0-yrSu7w.jpeg" /><figcaption>simple overview diagram</figcaption></figure><h3><strong>Self‑adaptive hybrid retrieval flow</strong></h3><p>When a user types a question, four things happen in order.</p><p><strong>1. Complexity assessment<br> </strong>The question is scored and classified. For example:</p><ul><li>“Who wrote <em>1984</em>?” → low complexity, factual, suggested strategy: standard.</li><li>“How did social media change political campaigning after 2016?” → medium complexity, analytical, suggested strategy: expansion.</li><li>“What are the ethical and geopolitical risks of deploying autonomous weapons powered by AI?” → high complexity, open‑ended, suggested strategy: multi‑hop.</li></ul><p><strong>2. Strategy selection<br> </strong>Based on that assessment, the system chooses:</p><ul><li>Low complexity → Standard hybrid retrieval.</li><li>Medium complexity → Hybrid retrieval plus query expansion.</li><li>High complexity → Hybrid retrieval plus multi‑hop reasoning.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UMDJ6MAkSzLFocjptt1RqA.jpeg" /></figure><p><strong>3. Hybrid search retrieval for the chosen strategy<br></strong> Regardless of strategy, both retrieval modes are always used:</p><ul><li>Semantic search over embeddings.</li><li>BM25 search over raw text.</li></ul><p>What changes is how many queries are issued, how many results are pulled back, and whether intermediate questions are used. All candidate chunks are then merged, deduplicated, and reranked by a cross‑encoder that looks at each chunk in the full context of the question.</p><p><strong>4. Answer generation<br></strong> The language model receives a curated set of top chunks and a prompt that nudges it toward the right level of detail. For complex questions, it is explicitly encouraged to:</p><ul><li>Write several paragraphs instead of one sentence.</li><li>Use structure and examples.</li><li>Tie important claims back to specific pieces of retrieved context.</li></ul><p><strong><em>The overall feel is less “chatbot on top of a database” and more like a research assistant that decides how deep to dig before it starts writing.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wdNUQ286q9T0hntaStsfBA.png" /><figcaption>Complex response generated requiring MULTI-HOP</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9kxDkh8A9TgOtXuiZc9GcA.png" /><figcaption>simple response generated using standard RAG</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KT0llC3DaEPf_OEzWQygmQ.png" /><figcaption>this response leans more on semantic search and reranking due to exact lines not being present in the document</figcaption></figure><h3><strong>Why This Combination Matters</strong></h3><p><strong>Better retrieval quality<br> </strong>Hybrid search already improves recall and precision by blending dense and sparse retrieval with reranking. Adding adaptivity on top means simple questions are answered quickly, while hard questions get richer context from more angles before the model ever opens its mouth.</p><p><strong>Smarter use of compute<br></strong> Not every query deserves a heavyweight multi‑hop search. An adaptive pipeline keeps latency and cost low for easy queries, and spends extra effort only when the question is genuinely complex.</p><p><strong>More trustworthy answers<br> </strong>Because keyword hits, semantic similarity, and reranked relevance are all involved, the final answers tend to be longer <em>and</em> better grounded. That matters in domains like policy, law, engineering, or research, where “sounds plausible” is not good enough.</p><h3><strong>What’s Next</strong></h3><p>Over the last few weeks, this started as “let me learn about RAG and make a basic system ” and quietly turned into a self‑adaptive hybrid system that decides how hard it should think before answering. It already feels much closer to something I’d trust in a real product than the fixed, one‑path pipelines I began with.</p><p>Next on my list is to push this idea into <strong>Graph RAG</strong> — letting the system reason not just over chunks of text, but over entities and relationships as a knowledge graph. Hybrid + adaptive is one step toward smarter retrieval; adding graph structure on top should make it even better.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=120fb4ce80af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Navigating the Unnavigable: Building India’s First Real-Time Flood Navigation System]]></title>
            <link>https://medium.com/@ndarshan507/navigating-the-unnavigable-building-indias-first-real-time-flood-navigation-system-f31419874f0d?source=rss-aee2b41b2765------2</link>
            <guid isPermaLink="false">https://medium.com/p/f31419874f0d</guid>
            <dc:creator><![CDATA[Darshan Nayak]]></dc:creator>
            <pubDate>Mon, 10 Nov 2025 13:56:05 GMT</pubDate>
            <atom:updated>2025-11-10T16:32:11.437Z</atom:updated>
            <content:encoded><![CDATA[<p>By Darshan Nayak</p><h3>Introduction</h3><p>As the team leader of Team Dynamo, I had the privilege to lead a passionate group of innovators in a Hackathon — a competition where we placed 4th among participants, many of whom are far more experienced and academically advanced than we are. Competing against seasoned professionals pursuing advanced degrees, I realized the power of practical innovation and determination.</p><p>Our project tackled one of India’s urgent urban challenges: navigating flooded cities safely during heavy rains. What we built is more than a simple navigation app; it’s a generational breakthrough combining diverse complex datasets to predict flood zones and suggest safe routes — a solution not yet available in India.</p><h3>What I Built and Its Significance</h3><p>This system is a first-of-its-kind intelligent navigation system designed specifically to help users avoid flood-affected areas in real-time. This is crucial not just for daily commuters but also for logistics operators and emergency vehicle services operating during monsoons.</p><h3>Data Sources and Technical Complexity</h3><p>Developing this system was highly challenging, requiring integration and processing of multiple sophisticated data sources:</p><p><strong>Thousands of Satellite Radars for Rainfall Monitoring</strong></p><p>Our system ingests data from thousands of satellite radars monitoring Pune’s weather. These radars provide real-time high-resolution information about where it is raining and predict how those rain clouds will move over time. This dynamic analysis of weather radar data involves handling large-scale streaming datasets and performing complex geospatial computations to forecast rainfall movement.</p><p><strong>28 Weather Stations across Pune</strong></p><p>To complement radar data, we integrated real-time rainfall measurements from 28 weather stations spread throughout the city. These stations provide accurate, ground-truth data on how much rain has fallen in specific locations, enhancing the precision of the system’s flood predictions.</p><p><strong>NASA’s Elevation Data (SRTM)</strong></p><p>Elevation plays a vital role in flood dynamics. Using NASA’s Shuttle Radar Topography Mission (SRTM) elevation data, our system identifies low-lying areas prone to water accumulation and potential flooding. Processing this elevation data to recognize flood-prone zones demanded advanced terrain analysis and geospatial modeling.</p><p><strong>Live Traffic Data</strong></p><p>Floods significantly impact road traffic, often forcing reroutes and causing congestion. We incorporated live traffic information for Pune to offer routes that avoid both flood-affected and traffic-heavy areas, ensuring optimal travel paths.</p><p><strong>Common Flood Zones + Real-time Reported Flood Data</strong></p><p>Historical flood zone data and real-time flood reports scraped from online sources further refined the system’s accuracy. We constantly update these flood zone maps to reflect current on-ground realities.</p><h3>How Our Flood Navigation System Works</h3><p>The core strength and complexity of our system lie in its ability to combine and analyze multiple sophisticated data sources continuously and in real-time, delivering actionable guidance to users navigating flood-prone areas. Here is a detailed overview of the inputs and processes involved:</p><h3>1. Continuous Rainfall Monitoring Using Thousands of Satellite Radars</h3><p>Our system ingests data from thousands of satellite weather radars that provide live rainfall detection over Pune. These radars are capable of detecting precipitation patterns with high spatial and temporal resolution, allowing the system to see exactly where rain is falling right now and to accurately predict the movement of rain clouds in the near future. This dynamic rainfall monitoring is complex due to the sheer volume of radar data and the necessity of rapid processing to predict flood-prone areas before they develop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*a3q7y-uyLk-WA3lB3_DqMg.png" /></figure><h3>2. Accurate Rainfall Quantification from IMD Weather Stations</h3><p>Complementing radar data, we utilize real-time rainfall measurements from 28 weather stations dispersed across Pune, operated by the Indian Meteorological Department (IMD). These stations provide precise localized readings of how much rain has actually fallen, offering ground truth confirmation of radar observations. Integrating this ground-level data enhances the accuracy of flood risk predictions by accounting for variations in rainfall intensity across the city.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F9t01-KRacMzPKRBpmh4LA.png" /></figure><h3>3. Terrain Analysis Using NASA’s Elevation Data (SRTM)</h3><p>Terrain elevation is a critical factor in flooding, as low-lying areas tend to accumulate water and become flood hotspots. To map these vulnerable zones, we leverage NASA’s Shuttle Radar Topography Mission (SRTM) digital elevation data. This high-resolution elevation dataset enables us to identify depressions and natural drainage patterns within Pune’s geography. By overlaying predicted rainfall on topographic maps, we can predict where water is most likely to pool, allowing foresight into flood risk beyond simple rainfall measurements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5UvfVI9Dr7XI3FFA0AK3Vg.png" /></figure><h3>4. Real-time Traffic Analysis for Optimal Route Planning</h3><p>Flooded roads often lead to congestion and detours, impeding emergency services and daily commuters alike. Our system integrates live traffic data feeds to visualize current road conditions throughout Pune. This allows the system to suggest efficient alternate routes that avoid not only flood-affected regions but also traffic bottlenecks, optimizing travel times during adverse weather.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EqAdzDhXZuAb8eF5DvjIFg.png" /></figure><h3>5. Historical and Real-Time Flood Zone Updates</h3><p>To further enhance precision, we incorporate historical maps of flood-prone zones and continuously update these with real-time flood reports obtained via web scraping from authoritative sources. This amalgamation of historical and current data ensures our hazard maps reflect both known flood risks and emerging conditions, making the system highly adaptive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/851/1*eh0EHvkEeb7db--utjG1Tw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*55_b4Q_RsNJZcHsZcVYa5Q.png" /></figure><h3>6. Delivering Real-Time Routing Suggestions</h3><p>All the above datasets are fused to generate accurate, real-time hazard maps, which inform user navigation. The system constantly recalculates safest routes by avoiding zones where flooding is present or imminent, thereby providing actionable guidance that can support daily travelers, logistics operators, and crucially, emergency response vehicles during intense monsoon rains and floods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*L115EJeFp9CQxLK2izLHVg.png" /></figure><p>This integration of multi-source geospatial, meteorological, and traffic data into a unified, predictive navigation system is a technically complex and novel achievement, especially for India. Our solution addresses a critical gap in urban resilience and safety, promising to transform how cities cope with seasonal flooding.</p><h3>Why This Matters</h3><p>This project is not just a hackathon submission — it represents a generational leap in urban safety technology for India. No solution of this scale or complexity currently exists in the country that can integrate such diverse datasets to provide actionable navigation during floods.</p><p>Logistics companies, daily commuters, and especially emergency services stand to benefit exponentially, as they will be able to navigate flooded cities more safely and efficiently, potentially saving countless lives and resources.</p><h3>Conclusion</h3><p>Leading this project at the XFAIR hackathon reaffirmed my belief that innovation thrives when we dare to tackle real-world problems with bold technology solutions. My flood navigation system stands poised to become a vital asset in making Indian cities safer in the monsoon season and beyond.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f31419874f0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>