<?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 Shivang Raikar on Medium]]></title>
        <description><![CDATA[Stories by Shivang Raikar on Medium]]></description>
        <link>https://medium.com/@shivangraikar?source=rss-83c09c8adc1b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qWjvDvnTpojuLVz2Eitm9Q.jpeg</url>
            <title>Stories by Shivang Raikar on Medium</title>
            <link>https://medium.com/@shivangraikar?source=rss-83c09c8adc1b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 02:17:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shivangraikar/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[I Left San Francisco for Three Weeks. Coming Back Felt Like Missing Ten Software Updates.]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/activated-thinker/i-left-san-francisco-for-three-weeks-coming-back-felt-like-missing-ten-software-updates-25dc271c1da6?source=rss-83c09c8adc1b------2"><img src="https://cdn-images-1.medium.com/max/2600/0*8MmK3iRM0EpQDTht" width="3000"></a></p><p class="medium-feed-snippet">Working remotely was fine. What I missed was the room.</p><p class="medium-feed-link"><a href="https://medium.com/activated-thinker/i-left-san-francisco-for-three-weeks-coming-back-felt-like-missing-ten-software-updates-25dc271c1da6?source=rss-83c09c8adc1b------2">Continue reading on Activated Thinker »</a></p></div>]]></description>
            <link>https://medium.com/activated-thinker/i-left-san-francisco-for-three-weeks-coming-back-felt-like-missing-ten-software-updates-25dc271c1da6?source=rss-83c09c8adc1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/25dc271c1da6</guid>
            <category><![CDATA[activated-thinker]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[work]]></category>
            <category><![CDATA[san-francisco]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Shivang Raikar]]></dc:creator>
            <pubDate>Fri, 23 Oct 2026 06:32:44 GMT</pubDate>
            <atom:updated>2026-10-23T06:32:44.939Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Harness, Evals, Guardrails: I Built One Small Agent to Learn the Words Everyone Uses]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://pub.towardsai.net/harness-evals-guardrails-i-built-one-small-agent-to-learn-the-words-everyone-uses-9513f86d6eb2?source=rss-83c09c8adc1b------2"><img src="https://cdn-images-1.medium.com/max/1600/1*ONUvQXErY8e13_koDDk0QQ.png" width="1600"></a></p><p class="medium-feed-snippet">It invented a BLEU score, saved it to memory, then averaged it into a confident wrong answer.</p><p class="medium-feed-link"><a href="https://pub.towardsai.net/harness-evals-guardrails-i-built-one-small-agent-to-learn-the-words-everyone-uses-9513f86d6eb2?source=rss-83c09c8adc1b------2">Continue reading on Towards AI »</a></p></div>]]></description>
            <link>https://pub.towardsai.net/harness-evals-guardrails-i-built-one-small-agent-to-learn-the-words-everyone-uses-9513f86d6eb2?source=rss-83c09c8adc1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/9513f86d6eb2</guid>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[ai-agent-infrastructure]]></category>
            <category><![CDATA[agent-harness]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Shivang Raikar]]></dc:creator>
            <pubDate>Tue, 20 Oct 2026 16:31:01 GMT</pubDate>
            <atom:updated>2026-10-20T16:31:01.846Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[I Reread “Attention Is All You Need” in 2026. Almost Nothing in It Survived.]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://pub.towardsai.net/i-reread-attention-is-all-you-need-in-2026-almost-nothing-in-it-survived-38576984d897?source=rss-83c09c8adc1b------2"><img src="https://cdn-images-1.medium.com/max/1536/1*wHz39y1Mjjo217EwvdjWbQ.png" width="1536"></a></p><p class="medium-feed-snippet">I went back to the 2017 paper behind every AI model to see what&#x2019;s left of the original. Two ideas made it, and one explains why your&#x2026;</p><p class="medium-feed-link"><a href="https://pub.towardsai.net/i-reread-attention-is-all-you-need-in-2026-almost-nothing-in-it-survived-38576984d897?source=rss-83c09c8adc1b------2">Continue reading on Towards AI »</a></p></div>]]></description>
            <link>https://pub.towardsai.net/i-reread-attention-is-all-you-need-in-2026-almost-nothing-in-it-survived-38576984d897?source=rss-83c09c8adc1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/38576984d897</guid>
            <category><![CDATA[transformers]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Shivang Raikar]]></dc:creator>
            <pubDate>Sat, 10 Oct 2026 12:01:01 GMT</pubDate>
            <atom:updated>2026-10-10T12:01:01.966Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[The Em Dash Became an AI Fingerprint. Then the Models Started Listening.]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://pub.towardsai.net/the-em-dash-became-an-ai-fingerprint-then-the-models-started-listening-5178132f7c8e?source=rss-83c09c8adc1b------2"><img src="https://cdn-images-1.medium.com/max/1312/1*-jSyAG2jPab4NGY4aA6GLQ.png" width="1312"></a></p><p class="medium-feed-snippet">A punctuation mark turned into a giveaway, users complained, and the newest models learned to hide it. The data says something stranger is&#x2026;</p><p class="medium-feed-link"><a href="https://pub.towardsai.net/the-em-dash-became-an-ai-fingerprint-then-the-models-started-listening-5178132f7c8e?source=rss-83c09c8adc1b------2">Continue reading on Towards AI »</a></p></div>]]></description>
            <link>https://pub.towardsai.net/the-em-dash-became-an-ai-fingerprint-then-the-models-started-listening-5178132f7c8e?source=rss-83c09c8adc1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/5178132f7c8e</guid>
            <category><![CDATA[writing]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Shivang Raikar]]></dc:creator>
            <pubDate>Thu, 24 Sep 2026 17:31:02 GMT</pubDate>
            <atom:updated>2026-09-24T17:31:02.982Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[I turned my portfolio into a Windows XP desktop (and added a game that destroys it)]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/design-bootcamp/i-turned-my-portfolio-into-a-windows-xp-desktop-and-added-a-game-that-destroys-it-698ba12932b7?source=rss-83c09c8adc1b------2"><img src="https://cdn-images-1.medium.com/max/1280/1*8STqEylHmvbL2Q4crnkZbw.png" width="1280"></a></p><p class="medium-feed-snippet">Every engineer&#x2019;s portfolio looks the same. So I asked a different question: what if my portfolio was a place instead of a page?</p><p class="medium-feed-link"><a href="https://medium.com/design-bootcamp/i-turned-my-portfolio-into-a-windows-xp-desktop-and-added-a-game-that-destroys-it-698ba12932b7?source=rss-83c09c8adc1b------2">Continue reading on Bootcamp »</a></p></div>]]></description>
            <link>https://medium.com/design-bootcamp/i-turned-my-portfolio-into-a-windows-xp-desktop-and-added-a-game-that-destroys-it-698ba12932b7?source=rss-83c09c8adc1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/698ba12932b7</guid>
            <category><![CDATA[ui-ux-design]]></category>
            <category><![CDATA[website]]></category>
            <category><![CDATA[portfolio]]></category>
            <dc:creator><![CDATA[Shivang Raikar]]></dc:creator>
            <pubDate>Sun, 13 Sep 2026 20:42:50 GMT</pubDate>
            <atom:updated>2026-09-13T20:42:50.920Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[The Smallest Model Won One of My Tests, and Other Things Benchmarks Won’t Tell You]]></title>
            <link>https://pub.towardsai.net/the-smallest-model-won-one-of-my-tests-and-other-things-benchmarks-wont-tell-you-af4337d4dff3?source=rss-83c09c8adc1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/af4337d4dff3</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai-generated-content]]></category>
            <dc:creator><![CDATA[Shivang Raikar]]></dc:creator>
            <pubDate>Fri, 12 Jun 2026 15:31:01 GMT</pubDate>
            <atom:updated>2026-06-12T15:31:01.046Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>I gave four Claude models the same four messy, real-life tasks: NO BENCHMARK DATASETS, no leaderboards, and the results didn’t rank the way you’d expect.</em></h4><p>A new AI model ships roughly every month now. Each one arrives with a wall of benchmark numbers including but not limited to MMLU, SWE-bench, GPQA and each wall of numbers tells you the same thing: the new one is smarter than the old one.</p><p>Here’s what those numbers never tell you: what happens when you hand the model your actual Tuesday afternoon. The vague ticket. The bug that’s been quietly inflating a report for three weeks. The credit card statement you’ve been meaning to look at. The paragraph of corporate jargon someone wants rewritten by end of day.</p><p>So I ran my own test. Nothing legendary. No dataset with a citation. Four tasks, four models, identical prompts, and a scoring rubric I wrote <em>before</em> seeing any output. The models: <strong>Claude Haiku 4.5, Sonnet 4.6, Opus 4.8, and Fable 5</strong> (latest high-performing): Anthropic’s lineup from smallest to largest, all run in June 2026.</p><p>What I found wasn’t “newer model good.” It was more interesting than that.</p><h3>The four tasks</h3><p>I designed each task with a hidden trap, the kind of thing real work is based on, so I thought, let’s try it out on our individual sets rather than a computed list of datasets, typically called a BENCHMARK.</p><p><strong>Task 1: The underspecified ticket.</strong> A realistic scheduling problem: write a Python function that flags double-booked field technicians. The trap is buried in one sentence of the prompt: <em>“some jobs have a null end time because techs forget to close them out.”</em> What does a model do with a job that has no end? Does it handle it, ask about it, or quietly pretend it doesn’t exist?</p><p><strong>Task 2: The debugging task.</strong> I gave each model a ~15-line billing function and only the <em>symptom</em>: week 1’s report is always correct, every week after that is inflated. The bug is a classic mutable default argument (totals={}) that silently accumulates state across calls. The test isn&#39;t whether they find it. It&#39;s what they do after and probably more focused on reasoning.</p><p><strong>Task 3: The card statement.</strong> Twenty lines of a June credit card statement, and one question: <em>how much did I actually spend on subscriptions, and am I being double-charged for anything?</em> I planted two anomalies with very different confidence levels: Netflix billed twice in one month (a real, disputable double charge), and two identical coffee charges on the same day (which could just as easily be… two coffees).</p><p><strong>Task 4: The constraint stress test.</strong> Rewrite a paragraph of dense corporate jargon under five hard rules: under 60 words, exactly two sentences, keep three specific facts, no jargon, and never use the word “leverage.” Every violation is countable. No vibes required.</p><p>Each prompt was run verbatim, in a fresh conversation, scored against an answer key I’d written in advance.</p><p><em>(Full prompts, traps, and the answer key are at the end of this post if you want to run this yourself.)</em></p><h3>Finding 1: The smallest model won the jargon test</h3><p>This was the result I didn’t expect, and it’s the one I keep thinking about.</p><p>On Task 4: The constraint stress test, <strong>Haiku, the smallest, cheapest model, produced the cleanest output of the four.</strong> Twenty-one words, exactly two sentences, all three facts intact, zero jargon, nothing invented:</p><blockquote><em>“In March we launched a new dispatch system that reduces scheduling time by 40%. It’s now operating in three major cities.”</em></blockquote><p>Meanwhile, Sonnet passed all five explicit rules… and then <strong>fabricated a fact.</strong> Its rewrite ended with “with more on the way” something that did not appear in the original paragraph. It also quietly changed “scheduling time” to “booking time.” Opus added a softer embellishment (“helping our teams reach you faster”), more defensible, but still not in the source.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CByt3ua91Zppn4QMG8teQQ.png" /></figure><p>What I take from this: the bigger models tried to make the copy <em>better</em>, and in doing so drifted from the source material. The small model just followed orders. <strong>Rule-following and truthfulness turn out to be different axes. </strong>A model can satisfy every constraint you wrote down and still violate the one you didn’t think you needed to write: <em>don’t make things up.</em></p><p>If your task is “transform this text exactly,” more capability might actually mean more creative liberty than you asked for.</p><p>(One small bonus detail: every model self-reported its word count, and one of them miscounted its own answer. Models are confidently bad at counting their own words. File that away.)</p><h3>Finding 2: The capability gap wasn’t accuracy, It was calibration</h3><p>On the card statement task, <strong>all four models found both planted anomalies.</strong> If you stopped reading there, you’d conclude the models are equivalent. But of course they differ in something benchmarks don’t measure at all: <em>knowing which finding to be confident about.</em></p><p>The Netflix double charge is the unambiguous one, a monthly subscription billing twice in a single month is exactly the thing you call your card issuer about. The duplicate coffee charges are the ambiguous one, same merchant, same amount, same day is <em>either</em> a double-swipe <em>or</em> a person who bought coffee twice.</p><p>Haiku and Sonnet got the confidence <strong>exactly backwards.</strong> Both called the coffee charge “clearcut” / “almost certainly a double-charge, worth disputing” and then hedged on Netflix, the actual anomaly. If you’d followed their advice, you’d have disputed the charge that was probably legitimate and shrugged at the one that wasn’t.</p><p>Opus and Fable calibrated it correctly: dispute-grade confidence on Netflix, “worth a gut-check” on the coffee. Opus had the single best run of the whole experiment here, it was the only model to notice that whether a gym membership counts as a “subscription” is a judgment call, state its assumption, and give me totals both ways.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b-1pbv5RTo-Pjo_5omMqgQ.png" /></figure><p>The lesson: <strong>the question isn’t “can the model find the anomaly,” it’s “does the model know how sure it should be.”</strong> For anyone using AI to check real financial or legal things, miscalibrated confidence is worse than a wrong answer, it tells you to act on the wrong thing. This can be observed majorly in real-time banking applications.</p><h3>Finding 3: The dirty-data trap caught exactly the model it was designed to catch</h3><p>Task 1’s null end times are the kind of detail that’s invisible in a demo and catastrophic in production. An unclosed job, basically one with no end time, is the job <em>most</em> likely to be involved in a conflict, because as far as the system knows, the tech is still on it.</p><p>Haiku did the worst available thing, and did it confidently: it <strong>excluded open-ended jobs from conflict detection entirely</strong>, explaining that this “avoids false positives.” That sounds reasonable. It’s precisely wrong. It optimizes away the riskiest case in the dataset.</p><p>The three larger models all treated open jobs as conflict-capable, each with a different explicit policy: one extended them infinitely, one treated them as running until the present moment, one gave them their own conflict category and crucially, <strong>all three stated their assumption out loud</strong> and told me how to change it if I disagreed. Opus went one step further and asked a follow-up question about what the dispatcher actually does when a conflict is found.</p><p>That’s the real seniority gap between models, and it has nothing to do with code quality: junior output makes silent assumptions; senior output makes <em>visible</em> ones.</p><h3>Finding 4: Everyone finds the textbook bug. The difference is what happens next.</h3><p>The mutable default argument in Task 2 is famous enough that I half-expected it to be useless as a test. I was right and wrong. All four models found it instantly, correctly, with the idiomatic fix. As a capability test, the task was a floor everyone cleared.</p><p>But the <em>responses</em> separated cleanly by what came after the fix:</p><ul><li>Haiku gave a correct textbook answer and stopped.</li><li>Sonnet demonstrated the mechanism (the default dict literally lives on the function object) and suggested grepping the codebase for other instances.</li><li>Opus ran the buggy code to prove the inflation pattern (8 hours → 16 → 24 → 32), then questioned whether the parameter should exist at all.</li><li>Fable was the only model to say the thing that actually matters in the real world: <strong>“your historical invoices are wrong.”</strong> Every report after week 1 had already gone out with inflated numbers, and they need regenerating. It also named the exact linter rule (ruff B006) that would have prevented the bug.</li></ul><p>Same bug, same fix, four very different amounts of <em>consequence awareness.</em> “Every model can find a known bug; they differ in whether they tell you what the bug already cost you” is the sentence I’d put on a slide.</p><h3>Finding 5 (the accidental one): my own account contaminated the experiment</h3><p>This one I didn’t plan, and it might be the most useful thing in the post.</p><p>Midway through reviewing outputs, I noticed something odd: several of the models referenced my actual employer’s internal platform — <em>CANNOT NAME HERE</em>— in their answers. I never mentioned it in any prompt. The models knew it from my account’s memory of previous conversations, and they helpfully wove it into their solutions.</p><p>Which means my “identical prompts, fresh conversations” methodology had a hole in it: <strong>the runs weren’t clean. My own context leaked into the outputs.</strong> Any comparison you run inside a consumer AI app with personalization or memory enabled is, to some degree, a comparison contaminated by you.</p><p>I’m disclosing it rather than hiding it, because it’s a finding in its own right: if you want a genuinely controlled comparison, use the API or turn memory off. And if you’re reading anyone else’s “I tested 5 models” post, including this one, ask whether they did.</p><p><em>(For the screenshots in this post, I’ve redacted those references.)</em></p><h3>The scorecard</h3><p>I scored each response against my pre-written answer key on five dimensions: correctness, trap handling, ask-vs-assume behavior, fitness for purpose, and verbosity, for a max of 15 per task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I_tOLQQJv3HJ0yUbKFUiUw.png" /></figure><p>Full disclosure on the grading, because methodology theater is exactly what this post is against: I ran each task once per model (not the three runs I’d recommend, outputs vary between runs, so treat single-run scores as indicative, not definitive). I used one of the models to help grade against the answer key, then verified the scores by hand and yes, that model was one of the contestants, which is its own conflict of interest worth naming. The scores are judgment calls anchored to a rubric, not measurements. Run it yourself; the prompts are below.</p><h3>What I actually learned</h3><p>The totals tell the boring story: bigger models scored higher overall, and Opus’s card-statement run was the best single response of the experiment. Fine. The benchmarks already told you that.</p><p>The interesting story is in the off-diagonal results:</p><p><strong>Capability, calibration, and obedience are three different things.</strong> Haiku is the most obedient and the worst calibrated. Sonnet is capable but took creative liberties nobody asked for. Opus and Fable were the only two that consistently knew <em>how confident to be </em>and that property, not raw intelligence, is what determined whether their advice was actually safe to act on.</p><p>So when the next model drops next month with a new wall of numbers, here’s my suggestion: keep a personal test file. Four prompts. Your domain, your mess, your traps. It takes an afternoon, it costs almost nothing, and it answers the only question the leaderboards can’t:</p><p>Not <em>“is it smarter?” </em>but <em>“would I let it touch my Tuesday?”</em></p><h3>Appendix: Run this yourself</h3><p>All four prompts, verbatim. Run each in a fresh conversation, memory off (see Finding 5), ideally 3 times per model.</p><p><strong>Task 1 — The underspecified ticket</strong></p><pre>Our field techs keep getting double-booked. Write a Python function that<br>takes a list of jobs and flags scheduling conflicts. Each job is a dict<br>with: job_id, tech_id, start, end (ISO 8601 strings). Some jobs have a<br>null end time because techs forget to close them out. Return the<br>conflicts in whatever structure you think is most useful for a<br>dispatcher to act on.</pre><p><em>What to watch: how it handles null end times (ignoring them is the worst answer), whether it states the back-to-back boundary assumption (end == next start), whether it only compares jobs for the same tech, and whether the output structure actually serves a dispatcher.</em></p><p><strong>Task 2 — The debugging task</strong></p><pre>This function builds a weekly billable-hours report per technician. Week 1&#39;s<br>report is always correct. But every week after that, the hours look inflated <br>techs are showing way more hours than they worked. We call it once per week<br>in a loop over our billing periods. Find the bug and fix it.</pre><pre>from datetime import datetime</pre><pre>def build_weekly_report(jobs, totals={}):<br>    &quot;&quot;&quot;Aggregate billable hours per technician for one billing week.</pre><pre>    jobs: list of dicts with keys: tech_id (str), start (ISO 8601), end (ISO 8601)<br>    Returns: dict mapping tech_id -&gt; total hours, rounded to 2 decimals.<br>    &quot;&quot;&quot;<br>    for job in jobs:<br>        start = datetime.fromisoformat(job[&quot;start&quot;])<br>        end = datetime.fromisoformat(job[&quot;end&quot;])<br>        hours = (end - start).total_seconds() / 3600<br>        if job[&quot;tech_id&quot;] not in totals:<br>            totals[job[&quot;tech_id&quot;]] = 0<br>        totals[job[&quot;tech_id&quot;]] += hours<br>    return {tech: round(h, 2) for tech, h in totals.items()}</pre><p><em>The bug: the mutable default argument (</em><em>totals={}), evaluated once at definition time and shared across calls. Watch whether the model explains the mechanism, and whether it mentions consequences (historical reports are wrong) or prevention (linters catch this).</em></p><p><strong>Task 3 — The card statement</strong></p><pre>This is my June card statement. How much did I actually spend on<br>subscriptions this month, and am I being double-charged for anything?<br>Show your math.</pre><pre>06/01, Blue Bottle Coffee, 6.75<br>06/02, Safeway, 84.32<br>06/03, Netflix, 15.49<br>06/04, Uber, 18.40<br>06/05, Spotify, 11.99<br>06/07, Chevron, 52.10<br>06/08, Blue Bottle Coffee, 6.75<br>06/08, Blue Bottle Coffee, 6.75<br>06/10, Amazon, 32.50<br>06/11, iCloud, 2.99<br>06/12, Trader Joe&#39;s, 67.18<br>06/14, 24 Hour Fitness, 45.00<br>06/15, Adobe Creative Cloud, 22.99<br>06/16, Amazon Refund, -32.50<br>06/18, DoorDash, 28.65<br>06/20, Safeway, 91.07<br>06/22, Uber, 14.20<br>06/25, Shell, 48.95<br>06/28, Netflix, 15.49<br>06/30, DoorDash, 22.40</pre><p><em>Answer key: subscriptions excluding the gym = $68.95; including it = $113.95 (good answers flag the gym as a judgment call). The real double charge is Netflix (twice in one month). The coffee charges are ambiguous and should be flagged for verification, not asserted. The Amazon charge nets to zero against the refund.</em></p><p><strong>Task 4 — The constraint stress test</strong></p><pre>Rewrite this paragraph for our customer newsletter. Rules: under 60 words,<br>exactly two sentences, keep all three facts (the 40% number, the March<br>launch, the three cities), no business jargon, and do not use the word<br>&quot;leverage&quot; anywhere.</pre><pre>&quot;In March we operationalized our next-generation dispatch optimization engine, leveraging proprietary algorithms to drive synergies across our scheduling workflows. By leveraging real-time data streams, we have actualized a 40% reduction in scheduling time and successfully scaled this capability across three major metropolitan markets, empowering our stakeholders with best-in-class operational excellence.&quot;</pre><p><em>Count everything yourself: words, sentences, facts, jargon, “leverage.” And check the thing no rule covers, did the model add anything that isn’t in the original?</em></p><p><em>Models tested: Claude Haiku 4.5, Sonnet 4.6, Opus 4.8, and Fable 5, June 2026. Single run per task per model. Scores reflect my rubric and judgment, reproduce at your own desk.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af4337d4dff3" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/the-smallest-model-won-one-of-my-tests-and-other-things-benchmarks-wont-tell-you-af4337d4dff3">The Smallest Model Won One of My Tests, and Other Things Benchmarks Won’t Tell You</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Documentation Is No Longer Optional: It’s How Your AI Actually Works]]></title>
            <link>https://medium.com/@shivangraikar/documentation-is-no-longer-optional-its-how-your-ai-actually-works-5556e98a8151?source=rss-83c09c8adc1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/5556e98a8151</guid>
            <category><![CDATA[knowledge-base]]></category>
            <category><![CDATA[technical-documentation]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[writing-prompts]]></category>
            <dc:creator><![CDATA[Shivang Raikar]]></dc:creator>
            <pubDate>Fri, 01 May 2026 21:54:47 GMT</pubDate>
            <atom:updated>2026-05-01T21:54:47.007Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mGB8MdtCQTEOR5Qq" /><figcaption>Photo by <a href="https://unsplash.com/@ttepavac?utm_source=medium&amp;utm_medium=referral">Tanja Tepavac</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>For a long time, documentation felt like a chore.</p><p>Something you write after building a feature, when someone asks for it, or when things get confusing enough.</p><p>But working with AI agents changed that completely for me.</p><p>At some point, I realized something simple but uncomfortable:</p><p><strong>The quality of my AI output was directly tied to the quality of my documentation.</strong></p><p>Not my prompts.<br>Not the model.</p><p>The docs.</p><h3>The Moment It Clicked</h3><p>I was building a workflow where an AI agent had to call APIs, understand responses, and chain multiple steps.</p><p>On paper, it should’ve worked.</p><p>But the agent kept calling the wrong endpoints, missing required fields, and generating slightly incorrect payloads</p><p>The usual reaction is:</p><blockquote><em>“Maybe I need a better prompt.”</em></blockquote><p>So I kept tweaking prompts. Nothing changed.</p><p>Then I did something different. I rewrote my documentation.</p><ul><li>clearer API contracts</li><li>better examples</li><li>explicit edge cases</li><li>structured formats</li></ul><p>And suddenly, the same agent started working. I agree it wasn’t as easy as it sounds, but there was a significant difference in the output.</p><p>Same model.<br>Same prompt.</p><p><strong>Better docs. Better output.</strong></p><h3>Docs Are Now Part of the System (Not Just Support)</h3><p>When humans read docs, we fill in gaps.</p><p>AI doesn’t.</p><p>It relies entirely on what’s written and obviously how clearly it’s written.</p><p>So your docs effectively become:</p><ul><li>the <strong>context layer</strong> for your agents</li><li>the <strong>source of truth</strong> for decisions</li><li>the <strong>interface</strong> between your system and the model</li></ul><p>If your docs are vague, your agent will be vague.<br>If your docs are inconsistent, your agent will be inconsistent.</p><h3>How I Use Docs in My AI Workflow</h3><p>I don’t use any fancy SaaS for this.</p><p>Just a simple setup:</p><ul><li>Markdown files that serve more than a README.md</li><li>API specs</li><li>Examples of previous code snippets</li><li>structured notes with context</li></ul><p>But I treat them like <strong>inputs to the model</strong>, not just references.</p><h3>1. Docs as Context, Not Just Reference</h3><p>Instead of writing:</p><blockquote><em>“This endpoint fetches user data”</em></blockquote><p>I write the exact request format, required fields, sample responses, and failure cases.</p><p>Because the agent isn’t “understanding” — it’s <strong>pattern matching</strong>.</p><p>The clearer the pattern, the better the output.</p><h3>2. Docs Reduce Prompt Size (and Token Usage)</h3><p>This was unexpected.</p><p>Initially, I was stuffing everything into prompts:</p><ul><li>instructions, examples, edge cases</li></ul><p>This made prompts long, expensive, and inconsistent.</p><p>Once I moved that into docs:</p><ul><li>prompts became smaller</li><li>context became reusable</li><li>token usage dropped</li></ul><p>Instead of repeating information every time, the agent just <strong>retrieves what it needs</strong>.</p><h3>3. Docs Improve Consistency Across Runs</h3><p>Without docs:</p><ul><li>one run works</li><li>next run breaks</li><li>copy and paste context and snippets</li></ul><p>With structured docs:</p><ul><li>outputs become predictable</li><li>fewer hallucinations</li><li>better formatting</li></ul><p>Because the model isn’t guessing as much.</p><p>It’s following a clearer path.</p><h3>4. Updating Docs Fixes More Than Debugging Prompts</h3><p>This is the biggest shift.</p><p>Earlier:</p><blockquote><em>something breaks → tweak prompt</em></blockquote><p>Now:</p><blockquote><em>something breaks → fix docs</em></blockquote><p>Why?</p><p>Because prompts are temporary.</p><p>Docs are <strong>shared memory</strong>.</p><p>When you fix docs:</p><ul><li>every agent improves</li><li>every workflow improves</li><li>future prompts get simpler</li></ul><h3>Another Major Update That Changed How Coding Agents Work And Produce Better Output</h3><h4>The RALPH Loop</h4><ul><li><strong>R — Retrieve:</strong> Agent pulls relevant context from structured docs instead of relying only on prompt memory</li><li><strong>A — Align:</strong> Clear docs align the model’s understanding with actual system behavior (APIs, schemas, edge cases)</li><li><strong>L — Limit:</strong> Reduces unnecessary tokens by avoiding repeated instructions in prompts</li><li><strong>P — Predict:</strong> Model generates more accurate and consistent outputs due to better context</li><li><strong>H — Harden:</strong> Each doc update improves future runs, making the system more reliable over time</li></ul><h3>The Hidden Impact on Token Usage</h3><p>This is something most people don’t think about.</p><p>Bad docs → longer prompts → more tokens → higher cost<br>Good docs → retrieval-based context → fewer tokens → lower cost</p><p>But more importantly:</p><p><strong>Better docs reduce retries.</strong></p><p>And retries are where costs quietly explode.</p><h3>Final Thought</h3><p>We used to think of documentation as something for humans.</p><p>Now, it’s just as much for machines. And in many cases, machines are the primary readers.</p><p>So if your AI agents aren’t behaving the way you expect, it might not be a model problem.</p><p>It might just be that your system is missing something simple:</p><p><strong>Clear, structured, and updated documentation.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5556e98a8151" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building AI Apps on a Budget: How I Pushed Supabase’s Free Tier Into a Production AI System]]></title>
            <link>https://pub.towardsai.net/building-ai-apps-on-a-budget-how-i-pushed-supabases-free-tier-into-a-production-ai-system-c93a38ba397e?source=rss-83c09c8adc1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/c93a38ba397e</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[supabase]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Shivang Raikar]]></dc:creator>
            <pubDate>Thu, 16 Apr 2026 13:01:03 GMT</pubDate>
            <atom:updated>2026-04-16T13:01:03.944Z</atom:updated>
            <content:encoded><![CDATA[<p>When you start building AI into a real product, the model is usually the easiest part.</p><p>I learned this while building a multi-agent AI system into a B2B SaaS operations tool, the kind of platform that manages schedules, billing records, client accounts, and service history across a relational schema that had grown to &gt;20 tables. The goal was simple on paper: let users query and act on their operational data using plain language, without navigating five different pages to do it.</p><p>What followed was six months of learning that AI infrastructure is mostly just infrastructure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xLHA2nBnvFxA5LqzJtVJ_Q.png" /><figcaption>AI applications</figcaption></figure><h3>What the system actually needed</h3><p>Most AI project write-ups talk about the model. Here’s what the system around the model actually required:</p><p>A PostgreSQL database that could handle relational queries across entities like clients, jobs, assignments, billing records, and service history all joined, all live. A way to store and retrieve vector embeddings for semantic search. Authentication is scoped by role, because different users should see different data and trigger different actions. Background query caching to avoid burning API budget on identical requests. And enough observability to know when the AI was routing correctly and when it wasn’t.</p><p>This is set up not as five separate services bolted together as one coherent backend that the AI layer sits on top of.</p><h3>Postgres is doing more work than you think</h3><p>The first instinct when building AI features is to keep everything in the application layer, let the model handle logic, push results up to the app, and return a response. That’s expensive and fragile.</p><p>The better instinct is to push as much as possible back into the database.</p><p>In practice, that meant building a Query Registry, a set of deterministic, server-side computed answers for anything involving aggregation. Billing totals. Job completion rates. Outstanding counts by team member. Any query where the answer is a number, the database computes it directly:</p><pre><br># Instead of asking the model to summarize raw rows:<br>total = BillingRecord.objects.filter(<br>status=&quot;pending&quot;,<br>assigned_to=team_member_id<br>).aggregate(total=Sum(&quot;amount&quot;))[&quot;total&quot;]</pre><p>The model never touches arithmetic. Django ORM Sum() returns $609.26. The model returns whatever it wants confidently, incorrectly, at cost. The database returns one number, always right, for free.</p><p>This sounds obvious until you’ve watched a language model sum the wrong column in a billing query and return a formatted, confident, wrong answer with no error attached.</p><h3>pgvector: the free tier feature most people underuse</h3><p>Pgvector is available as a native extension. For an AI system doing any kind of semantic retrieval, surfacing relevant records, matching ambiguous queries to known entities, and enriching responses with related context, this is significant.</p><p>Instead of paying for a separate vector database, embeddings live in the same Postgres instance as everything else. Semantic search becomes a join:</p><pre><br>SELECT id, description,<br>embedding &lt;=&gt; query_embedding AS distance<br>FROM service_records<br>ORDER BY distance<br>LIMIT 5;</pre><p>The operational advantage isn’t just cost. It’s that vector search and relational filtering compose naturally. You’re not syncing data between a vector store and a relational database, resolving conflicts, or paying egress on both. One query, one source of truth.</p><h3>The caching layer that cuts LLM costs significantly</h3><p>One of the more expensive operations in the system was table identification, figuring out which of the 20 database tables were relevant to a given user query before generating a database lookup. Left uncached, that’s a model call on every request.</p><p>The fix was an in-memory cache with a normalization step:</p><pre><br>def _normalize_query_for_cache(self, query: str) -&gt; str:<br># Strip entity names, UUIDs, numbers keep structural intent<br>query = re.sub(r&#39;\b[0–9a-f-]{36}\b&#39;, &#39;&#39;, query) # UUIDs<br>query = re.sub(r&#39;\b\d+\b&#39;, &#39;&#39;, query) # Numbers<br>query = re.sub(r&#39;&quot;[^&quot;]+&quot;&#39;, &#39;&#39;, query) # Quoted strings<br>return query.lower().strip()<br># &quot;How many open jobs does client #4821 have?&quot;<br># → &quot;how many open jobs does client have?&quot;<br># → cache hit for structurally identical future queries</pre><p>The cache has a one-hour TTL and caps at 200 entries. It saves roughly $0.001 per hit, which compounds fast when your users are asking structurally similar questions dozens of times a day. More importantly, it keeps the system responsive. A cache hit means no round-trip to the model at all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6_8VLDRRYqh6OFqnO-W3PQ.png" /><figcaption>High Level Diagram for capabilities</figcaption></figure><h3>Where the free tier actually hurts: query performance on large joins</h3><p>Here’s the honest part.</p><p>The system queries across related tables jobs linked to clients, billing records linked to team members, service history linked to accounts. Most queries are scoped by organization, so row counts stay manageable. But as the schema matured and the enrichment pipeline started pulling related records alongside primary results, some queries started crawling.</p><p>The culprit was unindexed foreign keys on tables that were joining frequently. On a paid instance with more compute, this probably goes unnoticed longer. On the free tier, you feel it at a few hundred rows.</p><p>The fix was straightforward composite indexes on the columns appearing in join conditions and WHERE clauses together:</p><pre><br>- Before: sequential scan on every enrichment query<br>- After:<br>CREATE INDEX idx_jobs_client_status<br>ON jobs(client_id, status);<br>CREATE INDEX idx_billing_member_status<br>ON billing_records(assigned_to, status);S</pre><p>Query time on the most common enrichment path dropped from ~800ms to under 100ms. No plan upgrade. Just schema discipline.</p><p>This is the free tier’s real constraint not row limits or function invocations, but the absence of performance headroom that hides bad indexes. It forces you to think about query patterns earlier than you would otherwise, which is probably a good thing.</p><h3>The routing layer that never touches Supabase</h3><p>One architectural decision that kept costs low: a keyword pre-router that intercepts obvious queries before they reach the model or the database at all.</p><pre><br>_NAVIGATION_PATTERNS = [<br>r&#39;\b(go to|open|show me the|navigate to)\b&#39;<br>]<br>_GENERAL_PATTERNS = [<br>r&#39;\b(hi|hello|hey|thanks|bye)\b&#39;<br>]<br>def _try_keyword_route(self, query: str) -&gt; Response | None:<br>if any(re.search(p, query, re.I) for p in _NAVIGATION_PATTERNS):<br>return self._handle_navigation(query)<br>if any(re.search(p, query, re.I) for p in _GENERAL_PATTERNS):<br>return self._handle_general(query)<br>return None</pre><p>Greetings, navigation requests, and simple acknowledgments, none of them need a model call or a database query. Catching them with regex before anything else runs saves roughly $0.003 per match. Trivial in isolation, meaningful across thousands of daily interactions from real users.</p><p>The broader principle: the model should only see queries that actually require it. Everything else is a waste.</p><h3>Multi-turn context: the problem Supabase didn’t cause but helped solve</h3><p>The messiest part of the build had nothing to do with the database. It was managing state across multi-turn conversations keeping track of what a user had said two messages ago when the current message was just “9 am.”</p><p>The agent would occasionally re-classify mid-conversation, losing everything collected so far. The fix was architectural: the frontend round-trips the collected session state on every message, and the backend stores continuation context in our database so it survives across requests.</p><pre><br>// Every sidebar message carries its own context<br>const response = await agentService.chat({<br>message: userMessage,<br>context: {<br>continuation: {<br>actionType: activeFlow.actionType,<br>collectedParams: activeFlow.collectedParams,<br>}<br>}<br>});</pre><p>Supabase as the session store means the backend is stateless any request can pick up where the last one left off. That matters when you’re on the free tier and can’t assume persistent server memory.</p><h3>What all can you actually do:</h3><p>After six months of running this in production, here’s what the platform genuinely provides for an AI system:</p><p>A relational database capable of handling more than 20-table production schemas with proper indexing. Native vector search via pgvector. Row-level security for multi-tenant data isolation. Auth that integrates directly with your database permissions. Edge functions that would trigger on events and CRUD on tables. Plugins for a totally inclusive environment with any third-party modifier. And enough observability through Supabase’s built-in logs to diagnose the query performance issues when they surface.</p><p>What it doesn’t provide is margin for sloppy schema design. The constraints are real. But they’re the kind of constraints that make you write better indexes, cache more aggressively, and think harder about what actually needs a model call versus what can be answered deterministically.</p><p>Those are good habits regardless of what tier you’re on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uNCp2GqMH4A9Pr1W6oPo6g.png" /></figure><h3>The actual lesson</h3><p>Every optimization that came from hitting a constraint in the Query Registry, the normalization cache, the composite indexes, and the keyword pre-router made the system faster and cheaper, not just cheaper. The free tier forced the work that should have happened anyway.</p><p>If you’re building AI features into a real product and watching costs climb before you’ve shipped anything meaningful, the answer usually isn’t a bigger budget. It’s more intentional architecture.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c93a38ba397e" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/building-ai-apps-on-a-budget-how-i-pushed-supabases-free-tier-into-a-production-ai-system-c93a38ba397e">Building AI Apps on a Budget: How I Pushed Supabase’s Free Tier Into a Production AI System</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Prompt to Production: What Nobody Tells You About Building Real AI Agents]]></title>
            <link>https://pub.towardsai.net/from-prompt-to-production-what-nobody-tells-you-about-building-real-ai-agents-42fe49b5a945?source=rss-83c09c8adc1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/42fe49b5a945</guid>
            <category><![CDATA[ai-engineering]]></category>
            <category><![CDATA[ai-agents-in-action]]></category>
            <dc:creator><![CDATA[Shivang Raikar]]></dc:creator>
            <pubDate>Sat, 11 Apr 2026 23:01:01 GMT</pubDate>
            <atom:updated>2026-04-11T23:01:01.362Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>I wrote recently about how working at a five-person startup taught me to think before touching a keyboard. Building an AI agent for our internal ops platform taught me the same lesson but faster, and at a much higher cost per mistake.</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/1*9H0dwSUYe0pcoSY8yxsaTw.jpeg" /><figcaption>AI bot image</figcaption></figure><p>Most people’s first experience with AI agents follows the same arc.</p><p>You write a prompt, get a surprisingly coherent answer, and think <em>this could run itself.</em> Then you try to turn it into something real: a system that classifies intent, calls the right tools, handles ambiguous inputs, and doesn’t quietly fail its way through a workflow someone on your team is depending on.</p><p>Everything changes.</p><h3>The illusion of “just a prompt.”</h3><p>When we started building our internal agent, the first version looked embarrassingly simple. A system prompt, a few function definitions, and some routing logic. It worked in isolation. It fell apart the moment real users touched it.</p><p>The problem wasn’t the model. The model was fine. The problem was that prompts don’t operate in isolation they operate inside systems, and systems are unforgiving in ways that language models are not.</p><p>A prompt that produces a reasonable answer in a playground behaves completely differently when it’s the third step in a pipeline, operating on output from a tool call that was slightly malformed, inside a context window carrying three previous turns of ambiguous conversation.</p><p>That gap between “it works in testing” and “it works on Tuesday afternoon with real data” is where most of the actual engineering lives.</p><h3>The day the agent picked the wrong tool and didn’t blink</h3><p>Early on, our agent had two ways to answer numerical questions: a generic database lookup that let the model summarize results, and a set of computed query handlers that used deterministic ORM aggregations for totals and counts.</p><p>A user asked: <em>“How much do we owe Alex this month?”</em></p><p>The agent routed it to the generic lookup. It fetched the raw rows, handed them to the model, and the model summed them confidently, incorrectly. It was mixing up two different amount fields on the payment records.</p><pre><br># What was happening inside the generic pipeline:<br># Model saw: [{ shift_minimum: 150.00, amount: 197.26 }, ...]<br># Model summed: shift_minimum values instead of amount<br># Returned: $412.00 (wrong)<br># What the computed handler did instead:<br>total = Payment.objects.filter(<br>    status=&quot;pending&quot;,<br>    assigned_to=engineer_id<br>).aggregate(total=Sum(&quot;amount&quot;))[&quot;total&quot;]<br># Returned: $609.26 (correct)</pre><p>No error. No stack trace. Just a wrong number delivered with complete confidence. The agent had selected the wrong tool, the tool had technically succeeded, and the failure was invisible until someone cross-checked it manually.</p><p>That’s a different class of bug than anything I’d debugged before. The fix wasn’t catching an exception it was making the routing decision unambiguous, so the model couldn’t choose the generic path when a computed answer existed.</p><h3>Orchestration is where the complexity actually lives</h3><p>I thought the hard part would be the model. Prompt quality, output formatting, getting coherent responses.</p><p>The hard part was everything around it.</p><p>What started as input → model → output became: intent classification, tool selection, parameter extraction, entity resolution, constraint validation, retry logic, fallback routing, and an ever-growing list of edge cases that each needed their own handling.</p><p>At some point you look at what you’ve built and realize it resembles a distributed system more than an operator agent. You’re not writing prompts. You’re designing workflows where the model is one component, an important one, but not the only one that can fail.</p><p>The thing that helped most was a two-layer routing strategy: catch the obvious cases cheaply before ever touching the model.</p><pre><br># Keyword pre-router — runs before any LLM call<br>_NAVIGATION_PATTERNS = [<br>    r&#39;\b(go to|open|show me the|navigate to)\b.*\b(dashboard|calendar|invoices)\b&#39;<br>]<br>_GENERAL_PATTERNS = [<br>    r&#39;\b(hi|hello|hey|thanks|thank you|bye)\b&#39;<br>]<br><br>def _try_keyword_route(self, query: str) -&gt; AgentResponse | None:<br>    if any(re.search(p, query, re.I) for p in _NAVIGATION_PATTERNS):<br>        return self._handle_navigation(query)<br>    if any(re.search(p, query, re.I) for p in _GENERAL_PATTERNS):<br>        return self._handle_general(query)<br>    return None  # Fall through to LLM routing</pre><p>Every matched greeting or navigation request saved a model call. Multiplied across hundreds of daily queries, that adds up in both cost and latency.</p><h3>The multi-turn problem: context doesn’t travel for free</h3><p>Managing context across multi-turn conversations was the messiest part of the build by a wide margin.</p><p>Here’s what would happen. A user would start a request say, scheduling a new service appointment. The agent would ask a clarifying question. The user would answer. And on the next turn, the model would sometimes re-classify the entire conversation as a new request, losing everything collected so far.</p><pre><br># Turn 1 — user starts a request<br>User: &quot;Schedule an appointment for Riverside Properties next Tuesday&quot;<br>Agent: &quot;What time should it start?&quot;<br><br># Turn 2 - model forgets the context<br>User: &quot;9am&quot;<br>Agent: &quot;Sure! What appointment would you like to schedule?&quot; ← 🚩</pre><p>The fix wasn’t to provide more context in the prompt. It was taking the routing decision out of the model’s hands entirely for follow-up turns. When the frontend detected an active collection flow, it bypassed the orchestrator and sent the continuation context directly to the action handler:</p><pre><br># views.py<br>if request_context.get(&quot;continuation&quot;):<br>    # Skip orchestrator — we already know what we&#39;re doing<br>    return await action_agent.process_continuation(<br>        message=message,<br>        action_type=context[&quot;continuation&quot;][&quot;actionType&quot;],<br>        collected_params=context[&quot;continuation&quot;][&quot;collectedParams&quot;]<br>    )<br><br># Only new requests go through full routing<br>return await orchestrator.route(message)</pre><p>The model was still handling parameter extraction from the user’s reply, but it was no longer responsible for remembering what conversation it was in the middle of. That’s a structural problem, not a prompting problem. No amount of “remember the previous context” in a system prompt fixes it reliably.</p><h3>The fix that changed everything: reframe the task, not the model</h3><p>There’s a version of prompt engineering that’s essentially superstition adding phrases like “think step by step” or “you are an expert” and hoping for better results. That wasn’t the fix.</p><p>The real fix was rewriting what we were actually asking the model to do.</p><p>Our intent classifier was originally framed as: <em>“Given this user message, what action does the user want to take?”</em> It sounded reasonable. In practice, it was too open-ended. The model would classify <em>“what appointments does Alex have this week?”</em> as a scheduling action instead of a lookup, because scheduling and lookup share vocabulary.</p><p>We rewrote it as a function-calling spec instead giving the model a concrete list of tools with narrow, specific descriptions, and letting it pick rather than classify:</p><pre><br># Before: open-ended classification<br>system_prompt = &quot;&quot;&quot;<br>Classify the user&#39;s intent. Options: lookup, schedule, update, navigate, general.<br>&quot;&quot;&quot;<br><br># After: tool-based routing with tight descriptions<br>tools = [<br>    {<br>        &quot;name&quot;: &quot;get_engineer_schedule&quot;,<br>        &quot;description&quot;: &quot;Look up existing appointments for a specific engineer. <br>                         Use when user asks WHAT is scheduled, not to create anything new.&quot;,<br>    },<br>    {<br>        &quot;name&quot;: &quot;create_appointment&quot;,<br>        &quot;description&quot;: &quot;Schedule a new service appointment. <br>                         Use ONLY when user explicitly wants to create something new.&quot;,<br>    }<br>]</pre><p>Misclassification dropped immediately. Not because the model got smarter, but because we stopped asking it vague questions and started giving it a precise decision to make.</p><h3>Failure is the default, not the exception</h3><p>In traditional software, a failure means something went wrong. In an AI system, failure is the baseline you’re designing away from.</p><p>The agent picks the wrong tool. It extracts a parameter from the wrong part of the conversation. It resolves “Alex” to the wrong person because there are two engineers with that name. These aren’t edge cases. They’re Tuesday.</p><p>So you build defensively not just validation on the way out, but constraint checks before the user ever sees a confirmation:</p><pre><br>pre_checks = [<br>    {<br>        &quot;name&quot;: &quot;date_not_past&quot;,<br>        &quot;checker&quot;: &quot;_precheck_date_not_past&quot;,<br>        &quot;severity&quot;: &quot;block&quot;,   # Hard stop — don&#39;t even show the preview<br>    },<br>    {<br>        &quot;name&quot;: &quot;schedule_conflict&quot;,<br>        &quot;checker&quot;: &quot;_precheck_schedule_conflicts&quot;,<br>        &quot;severity&quot;: &quot;warn&quot;,    # Show warning but let user proceed<br>        &quot;fallback&quot;: &quot;_suggest_available_windows&quot;,<br>    },<br>]</pre><p>The severity distinction mattered more than I expected. Some failures should stop the action entirely you cannot schedule something in the past. Others are warnings the user should see, but shouldn&#39;t be blocked by. Conflating them means either blocking things that should proceed or silently allowing things that shouldn&#39;t.</p><p>Ironically, the more capable the model, the more guardrails you end up adding. Capability without constraint is just a more convincing way to fail.</p><h3>Latency and cost will humble you</h3><p>In a demo, a four-second response feels like magic. In a system where that response triggers two tool calls and a summary generation step, you’ve just added ten seconds to something that needs to feel instant.</p><p>Cost compounds the same way. A multi-step reasoning chain that hits the model three times per request looks fine in a notebook and alarming in a spreadsheet after a week of real usage.</p><p>The optimizations that actually moved the needle weren’t clever they were structural. Cache the decisions that don’t change:</p><pre><br># Table identification cache — avoid re-asking the model <br># which database tables to query for structurally similar requests<br>def _get_cached_tables(self, query: str) -&gt; list[str] | None:<br>    key = self._normalize_query_for_cache(query)  # strips UUIDs, names, numbers<br>    entry = self._cache.get(key)<br>    if entry and (time.time() - entry[&quot;timestamp&quot;]) &lt; 3600:  # 1hr TTL<br>        return entry[&quot;tables&quot;]<br>    return None</pre><p>And push deterministic computation out of the model entirely. Any query involving totals, counts, or aggregates doesn’t need a language model it needs Sum(). The model is for language. The database is for math.</p><h3>The hardest part is the one you can’t automate</h3><p>Here’s what I didn’t expect: the bottleneck was never the model. It was clarity.</p><p>Vague task definition produces vague agent behavior, and no amount of prompt engineering fixes an underspecified problem. The agent reflects whatever thinking you brought to it. Sharp inputs, sharp outputs. Fuzzy inputs, confidently wrong outputs.</p><p>This is what connects back to everything I wrote about whiteboarding before touching a keyboard. The same instinct that made us erase the diagram and start over, surfacing assumptions, defining failure cases, and agreeing on what “done” looks like before writing a line, that instinct doesn’t become less important when you introduce a model. It becomes more important because the model will proceed confidently through your ambiguity, and you won’t know it went wrong until something downstream breaks.</p><p>AI amplifies whatever clarity you bring to it. It doesn’t supply its own.</p><h3>The shift that actually matters</h3><p>The most useful reframe was this: stop asking <em>“how do I get the model to answer correctly”</em> and start asking <em>“how do I design a system where the model can’t easily fail.”</em></p><p>That means smaller, more specific tasks. Explicit interfaces between steps. Reduced ambiguity at every input boundary. Visibility into what the model decided and why. It means treating the model like a powerful but literal collaborator, one that will do exactly what you describe, which means your description needs to be exact.</p><p>It’s the same lesson, again, from a different angle. Think before you build. Whether your pair is a person or a model, that part doesn’t change.</p><p>Building AI agents is genuinely interesting work, not because it’s easy, but because it forces precision about things software usually lets you leave vague. The prompt is the smallest part of the job. The architecture around it is where the craft lives.</p><p>If you’re moving from experimenting with models to shipping real systems, expect things to break in ways that don’t produce error messages. Learn to read silent failures. That’s not a flaw in the process. That’s what the process actually is.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42fe49b5a945" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/from-prompt-to-production-what-nobody-tells-you-about-building-real-ai-agents-42fe49b5a945">From Prompt to Production: What Nobody Tells You About Building Real AI Agents</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[We Spent 40 Minutes Staring at a Whiteboard. We Wrote Zero Lines of Code.]]></title>
            <link>https://medium.com/@shivangraikar/we-spent-40-minutes-staring-at-a-whiteboard-we-wrote-zero-lines-of-code-6ed76b204fa1?source=rss-83c09c8adc1b------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ed76b204fa1</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Shivang Raikar]]></dc:creator>
            <pubDate>Thu, 09 Apr 2026 22:45:33 GMT</pubDate>
            <atom:updated>2026-04-09T22:45:33.101Z</atom:updated>
            <content:encoded><![CDATA[<h3>We Spent 40 Minutes Staring at a Whiteboard. We Wrote Zero Lines of Code. It Was the Best Work We Did All Week.</h3><p>At a five-person startup, nobody handed me a playbook.</p><p>No architecture review board. No internal wiki with the “right” pattern. No senior team dedicated to the exact problem we were solving. Just us, a problem, and the uncomfortable silence before someone draws the first box on a whiteboard.</p><p>That silence taught me more about engineering than any framework ever did.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IRDMEQyacRd_9uPT" /></figure><h3>The day I stopped thinking pair programming was about speed</h3><p>I used to think pairing meant getting twice the code written in half the time. Watch someone work for a week at a startup, and that idea collapses quickly.</p><p>We’ll sit together for half an hour, sometimes longer and not write a single line. One of us will sketch a data flow. The other will say, <em>“wait, what happens when this fails at 3am?”</em> The sketch gets erased. We start again.</p><p>It looks inefficient from the outside. Inside it, you’re watching someone else’s mental model form in real time and it changes yours. You start noticing why they pause before naming a function, why they’re already worried about edge cases before the first function exists. That’s not typing speed. That’s judgment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pty8WwLbw_vquJqq" /></figure><h3>The whiteboard is where the real decisions happen</h3><p>There’s a specific kind of meeting we have that starts with: <em>“let’s just store it in the database.”</em></p><p>Twenty minutes later we’re deep in questions that have nothing to do with a database how does this behave under load? What does version two look like? If this assumption turns out to be wrong, how badly does it hurt us?</p><p>By the time we sit down to write code, the hard part is already done. The code is almost an afterthought a translation of decisions we already made standing up, marker in hand, debating in front of a half-erased diagram.</p><p>This is the part no CS course covers. Writing the code is the easy part, especially with a coding agent subscription nowadays. Figuring out <em>what</em> to write and being willing to throw that away and start over is where the work actually lives.</p><h3>When messy collaboration filters better than any code review</h3><p>From the outside, watching four engineers debate one problem looks wasteful. Why not just pick an approach and ship it?</p><p>Here’s what’s actually happening: bad ideas are dying in a whiteboard discussion instead of in a production incident. Assumptions are being surfaced by someone who asks a question you wouldn’t have thought to ask alone. The design that emerges from that friction is structurally different and not just better looking, but built around concerns that only came up because two people were thinking out loud at the same time.</p><p>I’ve started thinking of those sessions the way I think about tests: they look like overhead until you see what they prevent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Vbg3DohD0kEp_PcU" /></figure><h3>You can’t hide behind your ticket at a five-person company</h3><p>In a larger environment, it’s easy to be heads-down on your slice. Ship the function, close the PR, move on.</p><p>That mindset doesn’t survive a small team. When there are five of you, there’s no one else to decide whether the system makes sense. You’re responsible for the code, yes and also for whether it was the right code to write, how it breaks, and whether it scales past the next three months. You can’t hand that off to a platform team.</p><p><strong>NOTE:</strong> That same habit, it turns out, transfers directly to working with AI coding agents. A well-reasoned problem, thought through, assumptions surfaced, produces a sharp prompt, fewer wasted tokens, and a working prototype on the first attempt instead of the fifth. Think before you build. Whether your pair is a person or a model, that part doesn’t change.</p><p>That accountability felt uncomfortable at first. Now it’s the thing I’d miss most if I left.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ed76b204fa1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>