<?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 Giovanni Marigi on Medium]]></title>
        <description><![CDATA[Stories by Giovanni Marigi on Medium]]></description>
        <link>https://medium.com/@gio.marigi?source=rss-30f002b159c5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-p6AYbDBoOLjwxyDGu34Uw.jpeg</url>
            <title>Stories by Giovanni Marigi on Medium</title>
            <link>https://medium.com/@gio.marigi?source=rss-30f002b159c5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 07:16:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gio.marigi/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[BikeScout, 6 Months Later: From Tactical MCP Prototype to a Ride Decision Engine]]></title>
            <link>https://medium.com/@gio.marigi/bikescout-6-months-later-from-tactical-mcp-prototype-to-a-ride-decision-engine-f885a69b8286?source=rss-30f002b159c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/f885a69b8286</guid>
            <category><![CDATA[harness-engineering]]></category>
            <category><![CDATA[mtb]]></category>
            <category><![CDATA[cycling]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[fde]]></category>
            <dc:creator><![CDATA[Giovanni Marigi]]></dc:creator>
            <pubDate>Fri, 27 Nov 2026 07:16:23 GMT</pubDate>
            <atom:updated>2026-11-27T07:16:23.374Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Six months ago, I built </em><a href="https://github.com/hifly81/bikescout"><em>BikeScout</em></a><em> to close the “Context Gap” between large language models and the physical reality of cycling. The prototype worked. The real lessons came after.</em></p><p>Six months ago, I published <a href="https://medium.com/@gio.marigi/building-bikescout-a-tactical-mcp-server-for-the-modern-cyclist-707053167741"><em>Building BikeScout: a Tactical MCP Server for the Modern Cyclis.</em></a></p><p>The thesis was simple: a generic <strong>LLM</strong> can describe a trail, but it cannot reliably judge whether that trail is safe, rideable, or appropriate for your bike right now. It needs real context: weather, terrain, surface, elevation, and rider setup.</p><p>BikeScout started as an <strong>MCP server</strong> to provide that context. Six months later, it is still that. But it has also become something I didn’t fully anticipate: a lesson in how hard it is to make <strong>AI honest</strong> in a domain where confidence can be dangerous.</p><p>This is what changed, what broke, and what I learned building <a href="https://github.com/hifly81/bikescout">BikeScout</a> in public.</p><p><strong>1. The Prototype Proved the Point, then Hit the Product Wall</strong></p><p>The original <a href="https://github.com/hifly81/bikescout">BikeScout</a> demo was clear: instead of asking an LLM to guess, let it call deterministic tools. The model reasons; the tools compute. Mud risk, surface analysis, elevation, weather, route generation, all grounded in data.</p><p>That architecture still holds. But a working MCP server is not the same thing as a useful product.</p><p>The early version was powerful for developers already comfortable with <em>Claude Desktop,</em> <em>Cursor</em>, or another MCP client. For everyone else, there was too much friction: install, configure, connect, understand what to ask, interpret raw outputs. The intelligence was there, but the interface was asking too much from the user.</p><p>So the first big shift was not “more AI.” It was more product.</p><p><strong>2. What Shipped in Six Months</strong></p><p>Over the last six months, <a href="https://github.com/hifly81/bikescout">BikeScout</a> grew from a tactical MCP prototype into a broader pre-ride planning system. The core is still MCP, but now it sits behind multiple interfaces and a wider set of tools.</p><p><em>A local GUI, not just a protocol</em></p><p>BikeScout now has a <a href="https://streamlit.io/"><strong>Streamlit</strong></a> GUI with two ways to plan a ride: <em>a guided form</em> for structured planning and <em>a chat planner</em> for natural-language requests. The same mission can produce a tactical route, weather context, mud analysis, POI/logistics, nutrition, GPX export, and altimetry.</p><p>The important design choice was to keep both modes. Chat is flexible, but forms are honest. When a user needs to set bike type, tire setup, route mode, difficulty, or analysis date, a form prevents the model from guessing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7OY5rpqYapF0He8lNgkYuA.png" /><figcaption>BikeScout main panel</figcaption></figure><p><em>From route planning to ride decisions</em></p><p>The most useful question before a ride is often not “where should I go?” but <em>“should I go, and under what conditions?”</em></p><p>That pushed <a href="https://github.com/hifly81/bikescout">BikeScout</a> toward Go/No-Go planning. The <em>ride_window_planner</em> looks at the forecast window, surface type, and conditions to suggest a safer riding window. Weather, mud, and nutrition tools are no longer isolated features, they are part of a mission briefing.</p><p><em>GPX audit: intelligence after the file exists</em></p><p>Another major addition was GPX race/track audit. You can feed <a href="https://github.com/hifly81/bikescout">BikeScout</a> an existing GPX and get a tactical review: track metrics, climb analysis, performance simulation, weather planning, nutrition, mud risk, and a generated report.</p><p><em>Local-first AI, still</em></p><p>The chat planner runs on local GGUF models through <em>llama-cpp-python</em>. I kept the local-first direction because it fits the project: privacy, low external dependency, and control over the runtime. Recently I also added support for selecting a custom Hugging Face GGUF model, with the model size auto-detected from repository metadata.</p><p>It’s not the smoothest consumer experience. But it is transparent, hackable, and aligned with the open-source spirit of the project.</p><p><strong>3. The Hard Lesson: Deterministic Tools Don’t Save You From Probabilistic Orchestration</strong></p><p>Six months ago, I framed the problem as model hallucination. That was true, but incomplete.</p><p>The bigger problem is this: <em>even when your tools are deterministic, the layer that decides how to use them is still probabilistic</em>.</p><p>Here’s a real example we hit while hardening the planner. A user asks for a route on a date too far in the future. The weather forecast beyond that window is not reliable. The tool should reject it. But the LLM, trying to be helpful, may still produce a plausible-sounding plan, mention the date, reason about it, and confuse the user with an answer that looks intelligent while being operationally wrong.</p><p>The fix was not “<em>prompt better and hope.</em>”</p><p>We had to enforce the rule everywhere:</p><p>- <strong>In the tool layer: </strong>reject dates beyond the supported forecast window.<br>- <strong>In the schema:</strong> make the target date explicit in the contract.<br>- <strong>In the UI:</strong> default the analysis date to tomorrow and allow only a narrow reliable window.<br>- <strong>In the planner:</strong> detect invalid dates and return a clear, user-friendly message instead of a fake “Completed” briefing.<br>- <strong>In the docs:</strong> describe the policy exactly as the code enforces it.</p><p>The lesson: deterministic context for probabilistic models is necessary, but not sufficient. You also need <em>deterministic </em><strong><em>guardrails</em></strong><em> around probabilistic orchestration</em>.</p><p><strong>4. Honesty Became a Product Feature</strong></p><p>The more <a href="https://github.com/hifly81/bikescout">BikeScout</a> grew, the more I realized that cycling intelligence is full of tempting half-truths.</p><p>It’s easy to output a climb category. It’s harder to say it’s a <strong>heuristic</strong>, not an official race classification. <br>It’s easy to compute a nutrition plan. It’s harder to say when temperature is missing, a fallback assumption is being used, and the confidence is lower. <br>It’s easy to generate a route. It’s harder to admit that forecasts become unreliable beyond a short window.</p><p>These aren’t edge cases. They are the product.</p><p>In a domain like cycling, confidence has a cost. A wrong mud assumption, a bad weather window, or an overconfident recommendation can ruin a ride or worse. That’s why I’ve been pushing <a href="https://github.com/hifly81/bikescout">BikeScout</a> toward explicit uncertainty labels: assumptions, confidence, unavailable data, heuristic categories, and “no data fabricated” behavior.</p><p><strong>The goal isn’t to make the system sound smart. The goal is to make it useful when reality is messy.</strong></p><p><strong>5. Where BikeScout sits on the market</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OXxhd5CTZ6-GoNTwOCN0xg.png" /><figcaption>product comparison</figcaption></figure><p>A question I often get, implicitly, is: <em>isn’t this already what Komoot, Strava, or ChatGPT like does?</em></p><p>The short answer is no. The useful answer is more specific.</p><p><a href="https://github.com/hifly81/bikescout">BikeScout</a> is not trying to be a cycling app. It is not a social network, a segment leaderboard, a turn-by-turn navigation product, or a community trail database. Those products are good at what they do. The gap I’m interested in is narrower: the <strong>pre-ride decision layer</strong>.</p><p>Most rides don’t need tactical intelligence. You check the sky, grab the bike, and go. That’s fine.</p><p><a href="https://github.com/hifly81/bikescout"><strong>BikeScout</strong></a><strong> becomes useful when uncertainty is high: you don’t know the area, the weather is borderline, the terrain may be muddy, you’re choosing tire pressure for a technical descent, or you need to decide whether tomorrow morning is actually rideable.</strong></p><p>There is also a second market I didn’t fully see six months ago: the <strong>AI agent ecosystem</strong>. BikeScout started as an MCP server, and that still matters. As more developers build agent workflows, there is room for specialized, grounded tools that do one domain well. <a href="https://github.com/hifly81/bikescout">BikeScout</a> can be a standalone planner, but it can also be a component , a cycling intelligence layer another agent calls when it needs route, weather, mud, setup, or GPX audit capabilities.</p><p>This is a niche by design. I don’t see that as a weakness. The mistake would be trying to become a generic cycling app. The opportunity is to be the best tool for a specific moment: the moment before you ride, when the right information changes the decision.</p><p><strong>6. What I’d Do Differently</strong></p><p>If I started the last six months again, I’d invest earlier in three things.</p><p><em>Planner evals</em></p><p>Classic software tests are not enough for an AI planner. I need better evals for tool calling: ambiguous prompts, date handling, missing locations, route mode confusion, override behavior, and multilingual requests. The model is small and local; that’s a feature, but it means the orchestration layer needs ruthless evaluation.</p><p><em>Observability</em></p><p>When a planning response is bad, I want to know why. Did the model extract the wrong argument? Did a tool reject the input? Did the UI hide the date? Did the fallback message get bypassed? Good AI systems need good traces, not just good prompts.</p><p><em>Less friction</em></p><p><a href="https://github.com/hifly81/bikescout">BikeScout</a> is powerful, but it still asks too much from a non-technical cyclist. Local setup, API keys, GGUF models, MCP clients, all reasonable for builders, all heavy for riders. The long-term challenge is preserving the open, inspectable core while making the first experience simple.</p><p><strong>7. What’s Next</strong></p><p>The roadmap is less about flashy AI and more about trust.</p><p>I want to keep refining <a href="https://github.com/hifly81/bikescout">BikeScout</a> as a <em>pre-ride tactical layer</em>: not a social cycling app, not a generic route explorer, not another chatbot with a map. The focus is the decision before the ride: where, when, with what setup, under what risks.</p><p>That means better planner evals, cleaner mobile/web access, more transparent uncertainty, and tighter validation of the heuristics on real rides. It also means resisting the temptation to turn BikeScout into a generic “AI for cycling.”</p><p>The value is in the narrow, hard questions.</p><p><strong>Conclusion</strong></p><p>Six months ago, <a href="https://github.com/hifly81/bikescout">BikeScout</a> was a proof that MCP could give an LLM real cycling context. Today, it feels more like a small decision engine: part protocol, part planner, part guardrail system.</p><p>The biggest change in my thinking is simple. I used to think the main problem was giving the model access to the right data. Now I think the main problem is building systems where the model can be helpful <em>without being confidently wrong</em>.</p><p>That’s a much harder problem. It’s also the one worth solving.</p><p><a href="https://github.com/hifly81/bikescout"><em>BikeScout</em></a><em> is open source under AGPL-3.0. If you’re building MCP tools, local AI workflows, or cycling intelligence systems, I’d love feedback on the repo: </em><a href="https://github.com/hifly81/bikescout"><em>https://github.com/hifly81/bikescout</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f885a69b8286" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building BikeScout: a Tactical MCP Server for the Modern Cyclist]]></title>
            <link>https://medium.com/@gio.marigi/building-bikescout-a-tactical-mcp-server-for-the-modern-cyclist-707053167741?source=rss-30f002b159c5------2</link>
            <guid isPermaLink="false">https://medium.com/p/707053167741</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[gravel-bikes]]></category>
            <category><![CDATA[mtb]]></category>
            <category><![CDATA[enduro]]></category>
            <category><![CDATA[cycling]]></category>
            <dc:creator><![CDATA[Giovanni Marigi]]></dc:creator>
            <pubDate>Mon, 13 Apr 2026 15:09:41 GMT</pubDate>
            <atom:updated>2026-04-13T15:15:17.186Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d7WZyVXiV-XzxFqywpARWA.png" /></figure><p>Imagine you are planning a 50km Enduro loop in the Dolomites, Italy. You ask a standard LLM: <em>“Can I ride the </em><a href="https://www.valgardena.it/it/vacanze-estive-dolomiti/mountain-bike-e-bici-da-corsa-vacanze-val-gardena/sellaronda-mtb-tour/"><em>SellaRonda</em></a><em> tomorrow?”</em></p><p>The AI, trapped in its training data, might answer: <em>“Yes, it’s a legendary route with stunning views.”</em> But it doesn’t know that <strong>15mm of rain</strong> fell yesterday on a specific section, turning it into a dangerous slide. It doesn’t know your <strong>e-MTB battery capacity</strong>, or that the <strong>“S3” technical grade</strong> on that trail actually requires a tire pressure you haven’t set.</p><p>This is the “Context Gap.” And this is why I built <a href="https://hifly81.github.io/bikescout/"><strong>BikeScout</strong></a>.</p><h4>The Problem: The “Hallucination” of Safety</h4><p>Generalist models are great at poetry but struggle with <strong>Physical Intelligence</strong>. In technical sports like MTB, Gravel, or Road Cycling, “context” isn’t just a word, it’s a set of dynamic variables.</p><p>To provide real value, an AI needs to “see” at least three things in real-time:</p><ol><li><strong>Dynamic Geodata:</strong> Raw <a href="https://www.openstreetmap.org/">OpenStreetMap</a> (OSM) tags (surface, smoothness, tracktype).</li><li><strong>Topographic Context:</strong> Real-time elevation profiles to identify gradient spikes.</li><li><strong>Predictive Soil Logic:</strong> Cross-referencing precipitation with soil permeability.</li></ol><h4>The Architecture: BikeScout as a Tactical MCP Server</h4><p>Instead of attempting to “fine-tune” a model on static trail maps, a process that is both expensive and rapidly obsolete, BikeScout leverages the <strong>Model Context Protocol (MCP)</strong>.</p><p>Through MCP, BikeScout acts as a specialized brain extension for models like <a href="https://claude.ai/">Claude</a>. When you query the AI, it no longer “guesses.” Instead, it dynamically reaches out to the BikeScout server to ingest high-fidelity environmental data. The server executes deterministic computations, feeding the LLM a structured <strong>Tactical Briefing</strong>:</p><ul><li><strong>The 72H-RAIN &amp; Soil Engine:</strong> It aggregates precipitation data from the last 72 hours and cross-references it with a local Soil Permeability Index. <em>Clay Soil + 15mm Rain</em> triggers a STATUS: CRITICAL_MUD, while <em>Limestone + 15mm Rain</em> yields STATUS: SLIPPERY_ROCK_CAUTION.</li><li><strong>Surface Mapping (STS Scale):</strong> BikeScout parses cryptic OSM tags and translates them into the industry-standard <strong>Singletrack Scale (S0-S5)</strong>, providing the semantic clarity to warn the user: <em>“This isn’t just a path; it’s a high-consequence technical descent.”</em></li></ul><h4>Example Case: The “Finale Ligure Limestone” Trap</h4><p>Imagine you are planning a mission in <strong>Finale Ligure, Italy</strong>, targeting the legendary “Rollercoaster” trail after a light midnight storm.</p><p>The Generalist AI Response:</p><blockquote>“Finale Ligure is great for mountain biking. The <a href="https://www.finaleoutdoor.com/it/trails-walls/rollercoaster">Rollercoaster</a> trail is fast and flowy. Expect some mud if it rained, but overall it’s a classic experience. Wear a helmet and have fun!”</blockquote><p><strong>Why this fails:</strong> It offers generic travel advice. It doesn’t distinguish between porous rock that retains grip and the local “Pietra di Finale” (limestone) that becomes ice-like when slicked with humidity.</p><h4>BikeScout Intel: Finale Ligure Case Study</h4><ul><li><strong>Location:</strong> Rollercoaster Trail (Upper Section).</li><li><strong>Surface Composition:</strong> High concentration of <em>Pietra di Finale</em> (Limestone) combined with <em>Terra Rossa</em> (Clay-based soil).</li><li><strong>Atmospheric Context:</strong> 12mm precipitation recorded in the last 6 hours + 90% humidity.</li><li><strong>Contextual Inference:</strong> The “Greaze Factor.” Given the low wind-driven evaporation in this forest sector, the clay has formed a lubricated film over the limestone faces.</li><li><strong>Dynamic Modeling:</strong> Static friction is estimated to be significantly compromised. The system identifies a “radical phase shift” in traction due to the moisture-limestone interaction.</li><li><strong>Technical Recommendations:<br>Compound:</strong> Suggesting ultra-soft compounds <br>(e.g., MaxxGrip or AddixUltra Soft).<br><strong>Pressure:</strong> Specific recommendation for a <strong>0.2 bar drop</strong> from standard setup to maximize the contact patch on slick, off-camber roots.<br><strong>Operational Status:</strong> <strong>CAUTION.</strong> Technical difficulty (S-Grade) is effectively spiked from <strong>S2 to S3+</strong>. Expect a 40% reduction in sustainable flow speed.</li></ul><h4>Deep Dive: How BikeScout Generates This Intel</h4><p>The superiority of the BikeScout MCP server lies in its <strong>Multi-Source Data Fusion</strong>. Instead of just reading a map, the server executes a three-step tactical analysis to determine the real-world physics of the trail:</p><p>1. Geo-Surface Contextualization</p><p>BikeScout moves beyond basic OSM tags. By combining <strong>deterministic weather heuristics</strong> with <strong>location-specific geological prompts</strong>, it identifies how surfaces like the <em>Pietra di Finale</em> undergo a radical phase shift in friction when moisture is detected.</p><p>2. The Atmospheric Exposure Loop</p><p>Instead of just reading “weather,” BikeScout provides the context for <strong>Terrain Exposure</strong>. By feeding the LLM specific trail metadata and high-resolution humidity data, the system can infer if a section (like the “Rollercoaster”) will remain “greasy.” It leverages the AI’s understanding of local topography to predict evaporation lag in sheltered valley sections long after the rain has stopped.</p><p>3. Rolling Resistance &amp; Traction Heuristics</p><p>BikeScout <strong>facilitates a Cognitive Traction Model.</strong> By passing variables like surface composition, rider weight, and tire casing to the LLM, the server enables a transition from “chatbot” to Technical Consultant. This allows for precise, expert-level recommendations, such as a specific 0.2 bar pressure drop , to compensate for the reduced friction on the clay-filmed roots typical of the Ligurian backcountry.</p><h4>The Architecture: Moving Complexity to the Edge (MCP Layer)</h4><p>The core philosophy of BikeScout is to offload computational heavy lifting from the LLM to the <strong>MCP Server</strong>. By decoupling raw data processing from reasoning, we allow the LLM to function as a <strong>Cognitive Synthesizer</strong> rather than a calculator.</p><p>The server handles the “Data-to-Briefing” pipeline: it ingests heterogeneous streams (JSON, GeoJSON), executes deterministic physics models, and injects a high-density <strong>Context Window</strong> back into the AI. This prevents “Stochastic Hallucinations” by grounding the AI’s responses in validated environmental telemetry.</p><h4>The Tech Stack: A Tactical Overview</h4><ul><li><strong>Protocol:</strong> <strong>Model Context Protocol (MCP)</strong>. We utilize a stateful server implementation to expose custom tools (e.g., get_mud_risk_analysis, get_surface_analyzer) that the LLM can invoke dynamically via JSON-RPC.</li><li><strong>Source Data &amp; Integration:</strong></li><li><a href="https://wiki.openstreetmap.org/wiki/Overpass_API"><strong>Overpass API</strong></a><strong> (OpenStreetMap):</strong> Direct query of raw OSM tags (surface, smoothness, incline, tracktype) via specific bounding boxes.</li><li><a href="https://open-meteo.com/"><strong>Open-Meteo API</strong></a><strong>:</strong> Aggregation of historical (72h) and forecast hourly weather data, specifically targeting soil moisture and accumulated precipitation.</li><li><a href="https://nominatim.org/"><strong>Nominatim</strong></a><strong>:</strong> Reverse-geocoding for precise administrative and topostructural context.</li></ul><h4>The Result: Deterministic Context for Probabilistic Models</h4><p>By the time the LLM receives the data, it isn’t looking at “weather” or “a map.” It is looking at a <strong>Tactical Briefing Object</strong>. The AI takes these deterministic inputs, calculated friction coefficients, technical grade spikes, and equipment delta-recommendations and translates them into a human-readable advisory.</p><p>This is the shift from a generic chatbot to a <strong>Physical Intelligence Agent</strong> capable of saving a mission through precise, data-driven synthesis.</p><h4>Roadmap: The Future of BikeScout</h4><p>The journey has just begun. To move from “Scout” to “Commander,” the next development phases include:</p><ul><li><strong>NASA Earthdata Integration:</strong> Ingesting <strong>SRTM-V3</strong> and <strong>ASTER</strong> global elevation models for surgical gradient precision.</li><li><strong>Spectral Analysis:</strong> Using <strong>Sentinel-2</strong> data to detect real-time vegetation density and snow-line retreats.</li></ul><h4>Conclusion</h4><p>BikeScout demonstrates how the Model Context Protocol (MCP) can bridge the gap between raw geospatial data and actionable cycling intelligence. By moving the logic from simple prompts to a structured server-side context, we enable more precise, high-stakes decision-making for athletes.</p><p><em>BikeScout is an open-source MCP project for cyclists who demand intel over generic advice.</em> <strong>Check out the </strong><a href="http://hifly81.github.io/bikescout"><strong>github repo</strong></a>. <br>Contributions and forks are welcome!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=707053167741" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>