<?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 Binay Kumar Ray on Medium]]></title>
        <description><![CDATA[Stories by Binay Kumar Ray on Medium]]></description>
        <link>https://medium.com/@binayr?source=rss-def7bf9f30e6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*jVivoJDkExDiWYcICUkUow@2x.jpeg</url>
            <title>Stories by Binay Kumar Ray on Medium</title>
            <link>https://medium.com/@binayr?source=rss-def7bf9f30e6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 13:34:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@binayr/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[The Order That Nobody Noticed]]></title>
            <link>https://medium.com/@binayr/the-order-that-nobody-noticed-9a4c2e9a6a2f?source=rss-def7bf9f30e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a4c2e9a6a2f</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[murder-mystery]]></category>
            <category><![CDATA[triage]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <dc:creator><![CDATA[Binay Kumar Ray]]></dc:creator>
            <pubDate>Fri, 21 Aug 2026 04:19:42 GMT</pubDate>
            <atom:updated>2026-08-21T04:19:42.585Z</atom:updated>
            <content:encoded><![CDATA[<p>Solving the Murder Mystery before they find the dead</p><p>Every logistics platform has a version of this story. An order comes in. It sails through multiple agentic stages in the workflow. Somewhere along the way a process restarts, a checkpoint vanishes, a retry quietly gives up and the order just… stops. No alarm. No error on anyone’s dashboard that screams loudly enough. It sits there, frozen mid-journey, while the container it represents keeps moving through the real world.</p><p>Days later, someone asks: <em>“Hey, what happened to booking 271905296? Why is it stuck?”</em></p><p>And then I end up spending an afternoon spelunking through status fields, audit trails, and event logs, reconstructing what went wrong, usually discovering the order fell into a gap between three different recovery mechanisms, each of which was watching a slightly different door while the order slipped out a fourth.</p><p>I got tired of that afternoon. So I automated the it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4xVRiIvmU7o-2DmSrBpbVg.png" /></figure><h3>The old way</h3><p>Think about how we debug. Get the error, check the last recognisable file path, then go to the code block, debug line by line to identify the issue. Now this is automated, you are probably sending the error log to claude and asking it to debug for you. It’s faster but still you have to do it for every error one by one. and for some unfixable issue you retrigger certain process manually.</p><h3>The new way</h3><p>Now imagine this, You are asleep something goes wrong with few orders. usually there will be escalation in the morning. but what if even before the escalation The system automatically detects the problem, does the troubleshooting, identifies the rrot cause and unblocks the error. and for some reason if it can not you get a details email with root cause and steps to fix it. Won’t that be great? You have the answer before they can ask questions 😉</p><h3>The insight: debugging is a repeatable craft</h3><p>Here’s the thing we noticed after triaging a couple of these incidents back-to-back: we were following the <em>same script</em> every time.</p><p>Look at the order’s current status. Check when it was last touched, if it started a stage and nothing has moved since, it’s dead, not slow. Read the audit trail for the last thing that actually happened. Cross-check the message inbox, because an order can look “in progress” on one side while the other side silently gave up hours ago. Then, and only then, form a theory and fix it.</p><p>That script never lived in anyone’s head alone. I wrote it down as a runbook after two real production incidents. And once a debugging process is written down step by step, with the exact questions to ask and the exact evidence to trust, a curious thought appears:</p><p><em>Why is a human still running this script?</em></p><h3>Meet the Triage Agent</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*2ptiub6CURZNO3JAiI33eQ.png" /></figure><p>The Triage Agent is an AI agent that does what our best debugging session did automatically, around the clock.</p><p>A lightweight monitor keeps watch over the order pipeline. If any order stops making progress for longer than a configurable window (two hours, by default), the agent wakes up and investigates that specific order: pulls its history, reads the evidence, distinguishes “genuinely stuck” from “legitimately waiting,” and forms a diagnosis with a confidence score exactly the way a human investigator would, because it was trained on exactly how our human investigators worked.</p><p>Then comes the part we’re most deliberate about: <strong>fixing things.</strong></p><h3>How an investigation actually unfolds</h3><p>So what does the agent <em>do</em> when it wakes up? Think of it as a detective with database access and a very disciplined method.</p><p><strong>First, the vital signs.</strong> Every order in our system carries a medical chart of sorts: its current stage, and a timestamp for every step it has ever entered or completed. The agent’s first query pulls that chart. One comparison does a surprising amount of work: <em>when did the current stage start, and when was the order last touched?</em> A healthy order, even a slow one , keeps leaving fingerprints as it works; the “last touched” time keeps ticking forward. If the stage started at 07:37:14 and the last touch is <em>also</em> 07:37:14, down to the microsecond, the conclusion is unavoidable: whatever was working on this order died mid-task and never came back. Dead, not slow. That one distinction prevents the agent from “fixing” orders that are merely having a long day.</p><p><strong>Second, the security footage.</strong> Every order also keeps an append-only diary. An audit trail of everything that ever happened to it, written by the system itself. The agent reads it newest-first. This is usually where the story is: the last entry might be an unhandled exception with the exact error text, or a record showing the order was deliberately parked waiting for a planning window and then went silent. Certain error signatures are old acquaintances, the agent has our past incident write-ups baked in, so it recognizes, say, the tell-tale fingerprint of a lost checkpoint the way a veteran engineer recognizes a bug they’ve fixed before.</p><p><strong>Third, the mailroom.</strong> Orders enter our system as messages, and every message has its own processing record with its own lifecycle. This is the sneaky one: an order can look “in progress” on the order side while its message record quietly gave up hours earlier and was marked with a terminal status that nothing will ever look at again. Checking both sides is how the agent catches failures that are invisible from either side alone. If needed, it digs further container data, vendor tenders, amendment history but only where the evidence points.</p><p><strong>Then, the diagnosis.</strong> With the vital signs, the diary, and the mailroom record in hand, the agent writes down what it believes happened and how confident it is citing the actual timestamps and events, never a hunch.</p><p>Phew 😮‍💨, It’s like solving a murder mystery before anyone could notice the dead.</p><p><strong>Finally, the fix by the book.</strong> Here’s the part that keeps this safe: the agent doesn’t improvise repairs. Our system already has retry machinery that knows how to pick up orders in certain recognizable states. So the agent’s repair moves all amount to the same idea: <em>put the order into exactly the state the existing machinery already treats as “please retry me,” and let that machinery do its job.</em> For a dead-mid-stage order, that means two careful writes in the right order, mark the order as failed-at-this-stage (the shape the retry logic recognizes), then reset its message record so the pipeline picks it up again. Do those in the wrong order and the retry gets silently discarded. A lesson we learned the hard way as humans, which is precisely why it’s encoded in the agent’s rules rather than left to its judgment. A few minutes later, the agent’s evidence of success is the same one a human would use: the order’s “last touched” time is moving again.</p><h3>Trust, but with guardrails</h3><p>Handing an AI the keys to a production database is how horror stories start. So we didn’t.</p><p>The agent can <em>look at</em> anything, but it can only <em>touch</em> the system through a small set of pre-approved repair moves. The same recoveries a human operator would have made, riding the retry machinery the system already has. It never invents a new way to fix something. It gets a strict budget of attempts per order, so it can’t thrash. Orders waiting on a human decision, or already deep in financial territory, are off-limits entirely. And it ships in “diagnose-only” mode by default: it tells you what it <em>would</em> do, and earns the right to act by being right in shadow mode first.</p><p>Every single thing it does every look, every fix, every conclusion is written into the order’s own audit trail and a permanent run history. If you ever wonder what the agent did and why, the answer is one query away.</p><h3>Knowing when to raise its hand</h3><p>Some orders really are beyond automatic repair. A code bug, a broken integration, something no sanctioned fix can reach.</p><p>When the agent concludes an order needs a human or when it has tried its allowed repairs and the order is still stuck it sends one clear email to the maintainer: what it observed, what it believes went wrong, what it already tried, and the exact steps a human should take next. One email per stuck order per day, not a flood. The agent’s job isn’t to replace the humans; it’s to make sure the humans only see the problems that genuinely deserve them with the investigation already done.</p><p>As a result, I see many orders getting processed automatically. Even after that I receive an email when the agent has identified real code bug, the root cause and steps how to fix that in code. isn’t that something.</p><h3>What I learned building it</h3><p>Three lessons stand out.</p><p><strong>Write your runbooks like you’re teaching someone.</strong> Our triage runbook became the agent’s brain almost verbatim. The discipline of writing “here’s how you tell stuck from slow” precisely enough for a junior engineer turned out to be precisely enough for an AI.</p><p>I know what you thinking. “<em>I don’t really debug like we used to do before. Claude does it for me.</em>”, even better once you debug an issue, ask claude to create that runbook for you and then ask claude to use the run book to create the agent.</p><p><strong>Policies belong in code, not in prompts.</strong> The agent’s judgment decides <em>what’s wrong</em>; plain old code decides <em>when to escalate</em>, <em>how many retries are allowed</em>, and <em>who gets emailed</em>. An AI that forgets to send the alert is useless; code never forgets.</p><p><strong>The safety net shouldn’t hang from the thing it’s catching.</strong> The agent lives entirely outside the order-processing pipeline. If the pipeline crashes, loses state, or misbehaves in a brand-new way, the doctor doesn’t catch the patient’s disease it just gets a new case to solve.</p><h3>The quiet payoff</h3><p>The best outcome of this project isn’t dramatic. It’s the absence of drama.</p><p>An order gets stuck at 2 a.m. By 4 a.m. it has been investigated, diagnosed, and nudged back onto its path or a maintainer wakes up to one well-written email instead of a mystery. Nobody spends an afternoon spelunking. Nobody asks “whatever happened to that booking?” because the answer is already in the log, signed by an agent that never sleeps.</p><p>The containers keep moving. And so do we.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a4c2e9a6a2f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Three Languages of Agentic AI Value]]></title>
            <link>https://medium.com/@binayr/the-three-languages-of-agentic-ai-value-9dd52a35c5fa?source=rss-def7bf9f30e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/9dd52a35c5fa</guid>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[kpi]]></category>
            <dc:creator><![CDATA[Binay Kumar Ray]]></dc:creator>
            <pubDate>Tue, 16 Jun 2026 17:01:51 GMT</pubDate>
            <atom:updated>2026-06-16T17:17:22.899Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Most agentic AI projects are failing. Not because the technology doesn’t work but because no one agreed on what “working” means.</em></p><p>Gartner recently dropped a number that should make every AI team uncomfortable: <strong>over 40% of agentic AI projects will be cancelled by the end of 2027</strong>. The culprits cited are familiar escalating costs, unclear business value, inadequate risk controls. But the deeper diagnosis is simpler and more uncomfortable than any of those: organisations are building agentic systems that impress engineers, confuse product owners, and mystify leadership. Everyone is speaking a different language, measuring different things, and calling it success.</p><p>This is the value gap. And it is quietly sabotaging deployments everywhere.</p><p>The fix isn’t better models, more compute, or shinier demos. It is a shared vocabulary, a way to translate what an agent <em>does</em> into something that every stakeholder, from the developer writing the tool calls to the CFO reviewing the quarter, can understand and act on.</p><p>That vocabulary is what I call <strong>OOM</strong>. More about it in a minute..</p><h3>Why the Current Moment Is Both Exciting and Dangerous</h3><p>The numbers are genuinely staggering. The global agentic AI market sits at around $4–5 billion in 2025 and is on a trajectory toward $103 billion by the early 2030s. Enterprise software vendors Microsoft, IBM, Google, Salesforce have all moved from experimentation to deep embedding of agents into their core products. The shift from “AI hype” to “operational agentic AI” is real.</p><p>And yet: 88% of AI pilots never make it to production. Around 42% of companies scrapped most of their AI initiatives in 2025 alone up sharply from 17% the year before. The average organisation abandons nearly half its proofs of concept before they reach users.</p><p>What separates the projects that survive from the ones that get cancelled in the next planning cycle? The survivors connect every layer of the stack technical, product, and business with a coherent measurement story. The failures don’t.</p><p>Traditional metrics, as one market analyst put it bluntly, were “designed for a completely different kind of system.” Accuracy, latency, uptime these tell you the agent is running. They do not tell you whether it is <em>working</em>. The measurement gap is the problem, and OOM is the map out of it.</p><h3>The Three Levels of OOM</h3><p>Think of OOM as three concentric circles of accountability. Each layer speaks to a different audience, answers a different question, and operates on a different timescale. The mistake most teams make is trying to satisfy all three audiences with one layer’s language usually the innermost technical one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*mQewwIypGTTS67FUjmoQ4w.png" /></figure><h3>Level 1 — Output: For You (Developers and Engineers)</h3><p><strong>The question at this level:</strong> <em>Is the agent doing what I built it to do?</em></p><p>Output is the layer developers own. It is what the agent produces at the task level: a completed workflow, a resolved ticket, a generated draft, a database query, a tool call chain. Output metrics are granular, operational, and fast reviewed daily or per-deployment.</p><p>This is where most teams currently live. And it is necessary. But it is also where teams get trapped, because maximising output metrics does not automatically create value. An agent can achieve a 90% task completion rate on the wrong tasks and deliver nothing meaningful to the business.</p><p><strong>Useful output-level signals:</strong></p><ul><li><strong>Task completion rate</strong>: the percentage of assigned tasks the agent finishes autonomously, without human escalation. This is the baseline health indicator for any agentic system.</li><li><strong>Escalation rate: </strong>how often the agent hands off to a human. High rates signal confidence or capability gaps. For well-scoped workflows like standard contract review, you should be targeting under 5%.</li><li><strong>Tool call efficiency: </strong>are the right tools being selected in the right sequence? Inefficient reasoning paths drive up cost and latency without improving results.</li><li><strong>Hallucination or error rate: </strong>how often does the agent produce a plausibly wrong result? This matters especially in high-stakes domains where near-right is indistinguishable from wrong until it causes damage.</li><li><strong>Latency per task: </strong>not just average latency, but latency variance. Unpredictable agents are harder to trust than consistently slow ones.</li><li><strong>Context window utilisation: </strong>a subtle but important efficiency signal for long-running or multi-step agents.</li></ul><p><strong>Evaluating at the Output level</strong></p><p>Evaluation here is about <em>correctness. D</em>oes the agent do the right thing, reliably, across a representative range of inputs? This is where most teams have the clearest frameworks, and also where the most common mistakes happen.</p><p>The most effective approach is building a <em>golden dataset</em>: a curated set of real-world tasks with known correct outputs, drawn from actual production use cases rather than synthetic examples. Run the agent against this dataset on every significant change prompt updates, model upgrades, tool additions. If your golden dataset doesn’t degrade gracefully as the system changes, you don’t have signal, you have noise.</p><p>Useful evaluation techniques at this level include trajectory evaluation (did the agent take a reasonable path to reach its answer, not just the right answer?), tool selection audits (was the right tool called in the right order?), and failure mode classification (when the agent fails, does it fail loudly and escalate, or fail silently and continue?). Silent failures are the most dangerous output-level defect in agentic systems. They are invisible until the damage reaches a human reviewer or a downstream system.</p><p>One underused technique: <strong>adversarial replay</strong>. Take the inputs that caused human escalations last week and run them through the current agent version. If the escalation rate on that slice isn’t falling over time, your refinement loop isn’t working.</p><p><strong>The developer’s trap to avoid:</strong> celebrating output metrics in isolation. A 95% task completion rate is impressive engineering. It is not business value until someone maps it upward.</p><h3>Level 2 — Outcome: For Product Owners and Teams</h3><p><strong>The question at this level:</strong> <em>Is this agent making the product and the people using it, measurably better?</em></p><p>Outcome is the layer product owners own. It sits one level above individual task performance and asks about the effect on users, workflows, and processes over time. Outcomes are reviewed weekly or monthly, and they answer the question that technical metrics cannot: did this actually help?</p><p>This is the most underdeveloped layer in most agentic deployments. Developers are focused on outputs; leadership is focused on P&amp;L. The product layer, which should bridge both, is often left measuring proxy signals that don’t hold up under scrutiny.</p><p><strong>Useful outcome-level signals:</strong></p><ul><li><strong>Time-to-value per workflow</strong>: How long does it now take to complete a process that the agent is involved in, compared to the baseline? If an agent is handling invoice exception processing at 80% autonomous completion and each human-handled exception cost $9, you can start building a real outcome picture.</li><li><strong>User adoption and return rates</strong> : Are the people the agent is supposed to serve actually using it repeatedly? An average one-month retention rate of 39% is the industry baseline; anything materially below that suggests the agent isn’t creating genuine value for users.</li><li><strong>Reduction in human escalation over time</strong> : Not just current escalation rate, but the trend. As the agent learns or is refined, does it escalate less? Stagnant or worsening escalation over time is a product failure, even if technical metrics are stable.</li><li><strong>Process cycle time reduction:</strong> The real-world clock time for a given workflow, from trigger to resolution. A 20–30% reduction in cycle time within the first two quarters is a reasonable target for well-scoped operational deployments.</li><li><strong>Error correction cost</strong>: What does it cost the team when the agent gets it wrong? This is distinct from error rate. A 2% error rate in a low-stakes workflow costs almost nothing to correct; the same rate in a financial reconciliation workflow could cost orders of magnitude more.</li><li><strong>Feature stickiness: A</strong>re users returning to the agent for the same tasks, or only for novelty? Stickiness reveals whether the agent is solving a real recurring problem.</li></ul><p><strong>Evaluating at the Outcome level</strong></p><p>Outcome evaluation is harder than output evaluation because it requires comparing the world with the agent against the world without it and that counterfactual is rarely clean. The right approach is to define the baseline <em>before</em> deployment, not after.</p><p>Before going live, document the current state: average cycle time for the workflow, human effort per task, error rate in the existing process, and user satisfaction with the status quo. These become your control group. Without them, you are measuring change without a reference point, which makes it easy to claim success and impossible to prove it.</p><p>At this level, evaluation should focus on <em>trend</em>, not snapshot. A single week’s retention number tells you almost nothing. A retention curve over the first three months tells you whether the agent is building genuine habits or riding novelty. A cycle-time graph over two quarters tells you whether refinements are compounding. Outcome evaluation is longitudinal by nature.</p><p>Practically: run a monthly review that pulls three things side by side . The output metrics from Level 1, the outcome signals for the same period, and a qualitative digest of what human reviewers are escalating and why. The qualitative layer is easy to skip and often the most diagnostic. Patterns in escalation reasons reveal product-level gaps that no quantitative signal surfaces on its own.</p><p>One technique worth building explicitly: <strong>User shadowing sessions</strong>. Periodically observe real users interacting with the agent not through dashboards, but live. What they struggle with, where they lose trust, and what they work around tells you more about outcome quality than any metric you can instrument.</p><p><strong>The product owner’s trap to avoid:</strong> Measuring adoption without measuring quality of adoption. High usage numbers on an agent that isn’t actually completing tasks well is a vanity metric in disguise.</p><h3>Level 3 — Metric: For Leadership and Executives</h3><p><strong>The question at this level:</strong> <em>Is this investment moving the numbers that matter to the business?</em></p><p>Metric is the layer that leadership owns. It operates at the level of the organisation revenue, cost, risk, competitive position. It is reviewed quarterly and annually, and it is the language that earns or loses budget authority.</p><p>Most agentic AI teams are disconnected from this layer. They cannot explain, in the language of a P&amp;L, what their agent contributes. This disconnect is fatal when budget cycles come around and it is the primary reason projects get cancelled even when they are technically successful.</p><p><strong>Useful metric-level signals:</strong></p><ul><li><strong>Total cost of AI ownership trajectory: </strong>The full program cost tracked against value delivered. Healthy programs show improving unit economics over time: cost per task should decrease as the agent is refined and scaled.</li><li><strong>ROI (honest version): </strong>The formula is straightforward: ROI % = (Total Savings - Total Cost) / Total Cost × 100. The inputs require discipline: you must count infrastructure, engineering time, evaluation overhead, and the cost of errors, not just the compute bill.</li><li><strong>Revenue influence: </strong>For customer-facing agents, how much revenue flows through agent-assisted or agent-completed interactions? For internal agents, how much additional revenue capacity has been unlocked by freeing human time?</li><li><strong>Risk exposure change: </strong>Particularly for compliance-sensitive domains. What is the agent’s audit footprint? Are governance and compliance exceptions trending down?</li><li><strong>Competitive differentiation velocity: </strong>How quickly is the organisation identifying, scoping, and deploying new agentic use cases? This is a strategic health indicator, not an operational one. Organisations that can move faster than their peers build durable advantages.</li><li><strong>Employee capacity unlocked: </strong>Not headcount reduction (which tends to generate resistance and distrust), but the measurable shift in what human teams spend their time on. If agents handle the routine, do humans demonstrably spend more time on high-judgment work? This is harder to measure but important for sustainable deployment.</li></ul><p><strong>The leadership trap to avoid:</strong> Judging agentic AI against narrow cost-savings metrics inherited from traditional automation. Agents that improve accuracy, reduce risk, and compress decision cycles create value that a simple cost-per-task calculation will systematically undercount.</p><h3>How to Drive Value: The Practical Path</h3><p>Understanding OOM is the frame. Actually driving value through it requires a few disciplines that most teams skip.</p><h3>Start with a narrow, measurable job</h3><p>Agents that are scoped to a specific, well-defined task with a clear before-and-after baseline are the ones that survive budget reviews. “Resolve tier-1 support tickets autonomously” is a job. “Help the support team” is not. Define the job before you write the first prompt. Attach that job to a concrete outcome from Level 2. Then identify which Level 3 metric it moves.</p><p>This sequence job → outcome → metric is the OOM chain applied in reverse as a planning tool. If you cannot draw the chain before you build, you will not be able to justify the build after you ship.</p><p><em>You need to understand the Metric depends on the Outcome, which depends on the Output. But the values is created by keeping balance between these and deriving the numbers.</em></p><h3>Instrument from day one, not after the fact</h3><p>One of the most common failure patterns in agentic deployments is instrumentation as an afterthought. Teams build the agent, ship it, and then try to reverse-engineer what it is doing. By then, the data needed to establish baselines is gone.</p><p>Build with observability from the start: action-level logging, human intervention capture, cost-per-task tracking. Establish a review cadence — daily for operational output metrics, weekly for outcome trends, monthly for business impact assessment.</p><h3>Separate pilot performance from program performance</h3><p>Pilots are designed to succeed. They get the best use cases, the most engineering attention, and the most forgiving conditions. The failure mode is treating a successful pilot as proof that the program works at scale. It isn’t.</p><p>The real test is whether the agent’s unit economics improve as it scales whether the cost per task falls, the escalation rate improves, and the business metric it is intended to move actually moves. Track the program, not just the pilot.</p><h3>Create a shared scorecard across all three OOM levels</h3><p>The most valuable thing a team can do is build a single document updated regularly that shows all three OOM levels side by side for each deployed agent. Developers see their output metrics. Product owners see the outcome trends. Leadership sees the business metrics. Everyone can see the chain connecting them.</p><p>This sounds obvious. Almost no one does it. The result is that each stakeholder group operates on different assumptions about whether the agent is working until a budget review forces the question, and no one has a coherent answer.</p><h3>Treat evaluation as a product, not a task</h3><p>Evaluation is often treated as a one-time quality gate before deployment. For agentic systems, it needs to be continuous and systematic. Replay historical workflows against the agent regularly. Run adversarial test cases. Monitor for drift in reasoning quality as underlying models update. Integrate feedback from human reviewers into refinement cycles.</p><p>Organisations that win with agentic AI are moving from Stage 1 (utilisation tracking “is the agent running?”) to Stage 2 (outcome measurement “is it working?”) to Stage 3 (strategic impact attribution “is it moving our business?”). Most organisations are stuck at Stage 1. The measurement ladder is the value ladder.</p><h3>The Honest Summary</h3><p>Agentic AI is failing because teams are building systems they cannot explain, measuring things that don’t connect to value, and presenting results in a language that only half their stakeholders understand.</p><p>OOM is not a silver bullet. It is a discipline: a commitment to connecting every technical decision to a product outcome, and every product outcome to a business metric. It requires alignment between developers, product owners, and leadership that most organisations have not yet established.</p><p>The organisations that will lead in agentic AI over the next three years are not necessarily the ones with the best models or the largest infrastructure budgets. They are the ones who can answer three questions clearly:</p><ul><li><strong>What did the agent produce?</strong> (Output)</li><li><strong>What changed in the product because of it?</strong> (Outcome)</li><li><strong>What moved in the business as a result?</strong> (Metric)</li></ul><p>If you can answer all three and connect them coherently you have something most of the industry does not: a reason to keep going.</p><p><strong>References:</strong></p><ul><li><a href="https://www.gartner.com/en/newsroom/press-releases/2025-06-25-gartner-predicts-over-40-percent-of-agentic-ai-projects-will-be-canceled-by-end-of-2027">https://www.gartner.com/en/newsroom/press-releases/2025-06-25-gartner-predicts-over-40-percent-of-agentic-ai-projects-will-be-canceled-by-end-of-2027</a></li><li><a href="https://cmr.berkeley.edu/2025/08/adoption-of-ai-and-agentic-systems-value-challenges-and-pathways/">https://cmr.berkeley.edu/2025/08/adoption-of-ai-and-agentic-systems-value-challenges-and-pathways/</a></li><li><a href="https://www.landbase.com/blog/agentic-ai-statistics">https://www.landbase.com/blog/agentic-ai-statistics</a></li><li><a href="https://futurumgroup.com/insights/was-2025-really-the-year-of-agentic-ai-or-just-more-agentic-hype/">https://futurumgroup.com/insights/was-2025-really-the-year-of-agentic-ai-or-just-more-agentic-hype/</a></li><li><a href="https://www.marketsandmarkets.com/Market-Reports/agentic-ai-market-208190735.html">https://www.marketsandmarkets.com/Market-Reports/agentic-ai-market-208190735.html</a></li><li><a href="https://beam.ai/agentic-insights/why-42-percent-of-ai-projects-show-zero-roi-and-how-to-be-in-the-58-percent">https://beam.ai/agentic-insights/why-42-percent-of-ai-projects-show-zero-roi-and-how-to-be-in-the-58-percent</a></li><li><a href="https://www.rtinsights.com/why-agentic-ai-projects-are-getting-canceled-and-how-you-can-save-yours/">https://www.rtinsights.com/why-agentic-ai-projects-are-getting-canceled-and-how-you-can-save-yours/</a></li><li><a href="https://beinsure.com/ai-projects-deliver-roi/">https://beinsure.com/ai-projects-deliver-roi/</a></li><li><a href="https://www.informationweek.com/machine-learning-ai/agentic-ai-has-a-value-gap-and-the-old-roi-models-won-t-close-it">https://www.informationweek.com/machine-learning-ai/agentic-ai-has-a-value-gap-and-the-old-roi-models-won-t-close-it</a></li><li><a href="https://trullion.com/blog/why-over-40-of-agentic-ai-projects-will-fail/">https://trullion.com/blog/why-over-40-of-agentic-ai-projects-will-fail/</a></li><li><a href="https://www.captechconsulting.com/articles/why-so-many-ai-initiatives-are-failing-to-deliver-roi">https://www.captechconsulting.com/articles/why-so-many-ai-initiatives-are-failing-to-deliver-roi</a></li><li><a href="https://cloud.google.com/transform/the-kpis-that-actually-matter-for-production-ai-agents">https://cloud.google.com/transform/the-kpis-that-actually-matter-for-production-ai-agents</a></li><li><a href="https://cloud.google.com/transform/gen-ai-kpis-measuring-ai-success-deep-dive">https://cloud.google.com/transform/gen-ai-kpis-measuring-ai-success-deep-dive</a></li><li><a href="https://cloud.google.com/transform/roi-of-ai-how-agents-help-business">https://cloud.google.com/transform/roi-of-ai-how-agents-help-business</a></li><li><a href="https://www.moxo.com/blog/agentic-ai-kpis">https://www.moxo.com/blog/agentic-ai-kpis</a></li><li><a href="https://oteemo.com/blog/kpis-measuring-agentic-ai/">https://oteemo.com/blog/kpis-measuring-agentic-ai/</a></li><li><a href="https://www.pendo.io/essential-kpis-measuring-ai-agent-performance/">https://www.pendo.io/essential-kpis-measuring-ai-agent-performance/</a></li><li><a href="https://www.auxiliobits.com/blog/evaluating-agentic-ai-in-the-enterprise-metrics-kpis-and-benchmarks/">https://www.auxiliobits.com/blog/evaluating-agentic-ai-in-the-enterprise-metrics-kpis-and-benchmarks/</a></li><li><a href="https://www.getmonetizely.com/articles/how-to-effectively-measure-agentic-ai-performance-essential-kpis-and-success-metrics">https://www.getmonetizely.com/articles/how-to-effectively-measure-agentic-ai-performance-essential-kpis-and-success-metrics</a></li><li><a href="https://digitate.com/wp-content/uploads/2025/12/Agentic-AI-and-the-Future-of-Enterprise-IT-Report-1.pdf">https://digitate.com/wp-content/uploads/2025/12/Agentic-AI-and-the-Future-of-Enterprise-IT-Report-1.pdf</a></li></ul><p></p><p></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9dd52a35c5fa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Went From Burning $50 in a Day to Building 3 Microservices for $17 with Claude Code]]></title>
            <link>https://medium.com/@binayr/how-i-went-from-burning-50-in-a-day-to-building-3-microservices-for-17-with-claude-code-98a9b55364fe?source=rss-def7bf9f30e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/98a9b55364fe</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[knowledge-graph]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <dc:creator><![CDATA[Binay Kumar Ray]]></dc:creator>
            <pubDate>Tue, 14 Apr 2026 06:44:54 GMT</pubDate>
            <atom:updated>2026-04-14T10:17:36.953Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A practical guide to dramatically reducing token usage without sacrificing output quality</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qy86UnLsntsu0Ru4iu-DVQ.png" /></figure><h4><strong>Day 1: The $50 Wall</strong></h4><p>April 1st, 2026. My Claude Code limit was reset with a $50 monthly credit — what I thought was a comfortable buffer for a month of serious work.</p><p>By end of <strong>day</strong>, it was gone.</p><p>What did I build? One Java microservice. I fed Claude a complex Excel file, a Word document with user stories, and a database schema. Claude understood it, planned it, and started building. It was genuinely impressive. But before I could fix the small issues that came up during development, I had run out of tokens entirely and had to switch to Cursor to finish the job.</p><p><strong>One service. One day. $50.</strong></p><p>I was excited about Claude Code’s potential, but clearly something had to change about how I was using it.</p><h4><strong>The Root Problem: Claude Reads Everything, Every Time</strong></h4><p>The core issue with AI coding agents and Claude Code is no exception is that they tend to re-read your entire codebase on every task. Every context switch, every follow-up question, every small fix: the model loads everything it might possibly need, burning tokens before it even begins responding.</p><p>When you’re working on something large and interconnected like a data engineering platform with multiple services, complex business logic spread across Excel sheets, dozens of email threads as requirements, and database schemas the token cost of just <em>*loading context*</em> becomes enormous.</p><p>I needed a smarter approach. Not just to save money, but to actually get better results.</p><h4><strong>Fast Forward: 3 Services, 7 BRDs, $17</strong></h4><p>A weeks later, I came back with a topped-up balance and a completely different strategy. The result: <strong>3 full microservices</strong> (each with DDL, database integration, and unit tests) and <strong>7 curated Business Requirement Documents</strong>, all for $17.</p><p>Here’s exactly what changed — and the architecture that made it possible:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IzAjxccp5odqaJLZPSEwjw.png" /></figure><h4><strong>The Strategy: Graph + Knowledge + Skills</strong></h4><p><strong>1. Map Your Codebase with `code-review-graph`</strong></p><p>The first thing I did was set up <a href="https://github.com/tirth8205/code-review-graph"><strong>code-review-graph</strong></a><strong> </strong>by Tirth Patel.</p><p>The tool builds a persistent structural map of your codebase using Tree-sitter, parsing it into a graph of functions, classes, imports, and their relationships. Instead of Claude reading every file to understand your project, it queries this graph to find only the files that actually matter for a given task.</p><p>The numbers are striking. Across benchmarks on real open-source repositories:</p><p>- <strong>8.2x average token reduction </strong>on code reviews</p><p>- Up to <strong>49x fewer tokens</strong> on large monorepos (a Next.js monorepo went from 27,700+ files being considered to roughly 15)</p><p>- <strong>100% recall</strong> on blast-radius analysis. It never misses an actually impacted file</p><p>Setup is straightforward:</p><pre>pip install code-review-graph<br>code-review-graph install # auto-detects Claude Code, Cursor, Windsurf, etc.<br>code-review-graph build # parse your codebase</pre><p>Once installed, it hooks into Claude Code via MCP. Every time Claude needs to understand what a change affects, it queries the graph instead of scanning everything. For a 500-file project, the initial build takes about 10 seconds; subsequent incremental updates run in under 2 seconds.</p><p>This alone was transformative for my workflow. Before, Claude would load a sprawling service just to fix a single method. After, it fetched only the blast radius of the changed function, the callers, dependents, and related tests and nothing else.</p><p>Additional Feature: Execute “code-review-graph visualize” to visualize the graph relation of the project in an interactive D3.js graph.</p><p>Explore more commands <a href="https://github.com/tirth8205/code-review-graph?tab=readme-ov-file#usage">here</a></p><p><strong>2. Build a Knowledge Base, Not Just Files</strong></p><p>This was the shift I hadn’t appreciated before. On day 1, I had thrown raw files at Claude: a complex Excel, a doc, a schema. That works once, but it doesn’t scale. Every new conversation, every new task, Claude had to re-digest everything from scratch.</p><p>This time around, I pre-processed my inputs into structured knowledge. I had:</p><p>- 20 Excel sheets of business logic and mapping tables</p><p>- 4 Word documents of user stories and requirements</p><p>- 20+ email threads containing clarifications and edge cases</p><p>Instead of feeding these raw, I first asked Claude to read and synthesize them into structured documentation — summaries, data dictionaries, field mapping tables, a single source of truth about each domain. This documentation became my knowledge base, living in my repository.</p><p>The effect was immediate. Once that knowledge base existed, I could reference it with a sentence instead of re-uploading 20 files. Claude could say “based on the accounts reconciliation knowledge base” and actually mean it, because the context was precise and compact.</p><p>You might wonder why build knowledge base if I already have a graph. Basically The graph represents the code base and relations but these knowledge base represents business logics, exceptions, edge cases etc.</p><p><strong>3. Turn Winning Prompts into Skills</strong></p><p>After the first successful BRD generation, I noticed I was going to repeat the same complex prompt pattern multiple times. So I turned it into a Claude Code skill.</p><p>A skill is essentially a reusable prompt template — a structured instruction file that tells Claude how to approach a specific type of task. For my case, it was: “given this knowledge base documentation, produce a structured BRD containing inputs, outputs, formulas, edge cases, unit tests, acceptance criteria, definitions of done, DDL etc.”</p><p>The skill meant I didn’t have to re-explain the full structure every time. I just invoked it with a reference to the relevant domain knowledge, and Claude produced consistently structured output every time, for every service.</p><p>The BRDs Claude produced included:</p><ul><li>Input/output field definitions with types and constraints</li><li>Business formulas and calculation logic</li><li>Edge cases and error handling scenarios</li><li>Unit test specifications with expected inputs/outputs</li><li>Acceptance criteria tied to the original requirements</li><li>Definitions of done at both feature and service level</li><li>DDL files for the service’s data model</li><li>Database Entity/ Repository Mappings.</li><li>Service and Controller logic</li></ul><p>Before this workflow, generating something like this would have required multiple long back-and-forth sessions and a lot of repeated context. With the skill and knowledge base in place, it was a single invocation.</p><h4><strong>The Full Stack That Made This Work</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7Af3vRFFe3NkXYzGKDEN4g.png" /></figure><p>Each layer reduces the tokens needed at the next step. The knowledge base means Claude doesn’t re-read raw files. The graph means Claude doesn’t re-scan code. The skills mean Claude doesn’t re-derive task structure. By the time Claude is actually generating output, it’s working with exactly the context it needs, nothing more.</p><h3><strong>Other Tools Worth Knowing</strong></h3><h4><strong>Graphify — [</strong><a href="https://graphify.net/"><strong>graphify.net</strong></a><strong>]</strong></h4><p>Graphify is another codebase visualization tool aimed at giving AI assistants a clearer map of your code structure. I tried it but didn’t get the results I was hoping for the integration with my workflow wasn’t as smooth and the token savings weren’t as measurable. That said, the concept is sound and it may work better for different project types or setups. Worth experimenting with if `code-review-graph` doesn’t fit your stack.</p><h4><strong>Caveman — [</strong><a href="https://github.com/JuliusBrussee/caveman/blob/main/README.md"><strong>github.com/JuliusBrussee/caveman</strong></a><strong>]</strong></h4><p>Caveman takes a completely different angle on the token problem. Rather than reducing what Claude <strong><em>reads</em></strong>, it reduces what Claude <strong><em>writes, </em></strong>by making Claude respond in a stripped-down, filler-free style. No pleasantries, no hedging, no “I’d be happy to help you with that.” Just the answer.</p><p>The benchmarks show an average 65% reduction in output tokens, with peaks above 80% on explanation-heavy tasks. A March 2026 paper cited in the repo found that brief constrained responses could actually <strong><em>improve</em></strong> accuracy by 26 percentage points on some benchmarks.</p><p>I haven’t tried it yet in my own workflow, but the idea is compelling especially for long debugging sessions where Claude tends to narrate everything at length. If your token usage is heavily weighted toward output (which it often is during iterative code review), Caveman could be a meaningful complement to the input-side optimizations above.</p><h4><strong>Key Takeaways</strong></h4><p><strong>Invest in context, not just prompts.</strong> <br>The raw time spent building a knowledge base and setting up the code graph paid for itself within a session. Every subsequent task became faster and cheaper.</p><p><strong>Reuse structure aggressively.</strong> <br>If you’re doing a class of work more than twice, make it a skill. The upfront cost is a few minutes; the payoff is consistent quality and dramatically fewer tokens across every future invocation.</p><p><strong>Graph-based context &gt;&gt; file-based context.</strong> <br>Feeding Claude a structural map of your codebase and letting it query what it needs is fundamentally more efficient than hoping your file selection is correct. Tools like `code-review-graph` make this the default behavior.</p><p><strong>Output tokens matter too.</strong> <br>If you’re in a tight budget, consider whether you actually need verbose explanations or just the code. Caveman-style compression is an option worth exploring.</p><p>The $50 in a day wasn’t a Claude problem. It was a workflow problem. With the right architecture around it, Claude Code can do an extraordinary amount of work at surprisingly low cost — but it requires you to treat context as a first-class engineering concern, not an afterthought.</p><p><em>All tools mentioned: <br>- </em><a href="https://github.com/tirth8205/code-review-graph"><em>code-review-graph</em></a><em> <br>- </em><a href="https://graphify.net/"><em>Graphify</em></a><em> <br>- </em><a href="https://github.com/JuliusBrussee/caveman"><em>Caveman</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=98a9b55364fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Cost of Precision: Finding Balance in AI Retrieval]]></title>
            <link>https://medium.com/@binayr/the-cost-of-precision-finding-balance-in-ai-retrieval-a68af62d1988?source=rss-def7bf9f30e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/a68af62d1988</guid>
            <category><![CDATA[agentic-rag]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[chatbots]]></category>
            <dc:creator><![CDATA[Binay Kumar Ray]]></dc:creator>
            <pubDate>Sat, 06 Sep 2025 12:09:57 GMT</pubDate>
            <atom:updated>2025-09-06T12:12:17.370Z</atom:updated>
            <content:encoded><![CDATA[<p>Jevons Paradox suggests that “when a resource becomes more efficient to use, overall consumption of that resource often increases instead of decreasing”. It’s counterintuitive — and we recently ran into this exact scenario in our LLM-powered RAG (Retrieval-Augmented Generation) system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qJ-K7VxxgasEwzWoeHbzVQ.png" /></figure><h3>The Setup: Our RAG Workflow</h3><p>Our system is designed to ensure <strong>high-quality, contextually relevant answers</strong> by layering multiple AI components. One such component is our Corrective RAG, which retrieves and evaluates the answer for relevancy. More on that explained below :</p><ol><li><strong>RAG Search</strong></li></ol><p>Queries are vectorized and matched against Qdrant.</p><ul><li>Each search round retrieves up to <strong>18 candidate documents (vector points)</strong> for consideration.</li></ul><p><strong>2. Document Grader</strong></p><ul><li>Each candidate document is semantically graded against the query.</li><li>Only documents above with relevance are allowed to pass.</li><li>This ensures users don’t see loosely relevant or noisy content.</li></ul><p><strong>3. Hashtag-Based Retry</strong></p><ul><li>If no document passes grading, the system doesn’t give up.</li><li>Instead, it <strong>generates query hashtags</strong> (semantic keywords or variations) and re-triggers the RAG search with those tags.</li><li>Each retry attempts to retrieve and grade another batch of 18 documents.</li><li>This loop continues until a relevant match is found or limits are reached.</li></ul><p>On paper, this architecture balances <strong>accuracy and robustness</strong>, ensuring the user gets the best possible document match.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*BW7wwGy02WfaSMvs5EARcQ.png" /></figure><h3>The Change: Stronger Grading</h3><p>Unfortunately the previous system was doing only semantic grading and many irrelevant documents passed the grading process, which reduce the overall accuracy of the system.</p><p>On <strong>August 22</strong>, we upgraded the <strong>grading mechanism</strong> to be more discerning. The new grader was much better at identifying the subject of discussion and aspect of query for grading, thus identify irrelevant documents and discarding them.</p><p>This meant:</p><ul><li>The system allowed only <em>highly relevant</em> documents to pass.</li><li>The quality of answers improved noticeably.</li></ul><p>So far, so good.</p><h3>The Unintended Consequence</h3><p>But then Jevons Paradox kicked in.</p><p>Because the grader was stricter:</p><ul><li>Fewer documents passed in the first cycle and in many cases all documents were rejected in grading.</li><li>More queries fell into the <strong>retry loop</strong>.</li><li>Each retry triggered a new set of 18 documents to grade.</li><li>If still no match, the process repeated again and again.</li></ul><p>In effect, the stricter grader caused <strong>many more cycles of hashtag generation and grading</strong>. What was intended to reduce noise ended up multiplying the total workload.</p><h3>The Impact on Cost</h3><ul><li>Average queries now required <strong>multiple passes instead of one</strong>.</li><li>Each pass graded 18 documents, so the total graded documents per query increased.</li><li>The LLM calls for grading scaled up sharply.</li></ul><p>The bottom line: <strong>our daily LLM cost jumped 3.5x</strong> — without any increase in user traffic.</p><h3>The Fix: Containing the Loop</h3><p>Initially we set to only single retry to contain the loop but even then in case of faliue it will be atleast 36 document search.</p><p>Finally on <strong>September 1</strong>, we made a decisive change:</p><ul><li>We <strong>disabled repeated hashtag-driven retries</strong> after the first failed cycle.</li><li>The system still benefits from the improved grading but no longer spirals into endless retries.</li></ul><p>The result:</p><ul><li>LLM costs returned to baseline.</li><li>Answer quality remained high enough for most use cases.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7hnDoaFZ5SbPl9AMhax2ag.png" /></figure><h3>Lessons Learned</h3><p>This experience is a real-world reminder of Jevons Paradox in AI:</p><ul><li><strong>Efficiency ≠ Lower Cost</strong><br> Improvements in quality can drive up resource usage — and costs — when the system compensates by “trying harder.”</li><li><strong>Measure Tradeoffs Continuously</strong><br> It’s not enough to measure accuracy or user satisfaction alone. You must also track <strong>system cost per query</strong> to find the sweet spot.</li><li><strong>Design for Balance</strong><br> Strict grading improves precision, but without guardrails, it can trigger runaway retries. Systems need <strong>circuit breakers</strong> to balance quality, latency, and cost.</li></ul><h3>Takeaway</h3><p>In LLM-powered systems, “better” answers often come with hidden costs. The real challenge isn’t just building smarter pipelines — it’s <strong>finding the equilibrium between accuracy, efficiency, and cost-effectiveness.</strong></p><p>Our journey shows that even small architectural tweaks can tip the balance. By continuously measuring ROI and being ready to adapt, we’re learning how to manage this paradox — turning insights into sustainable outcomes.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a68af62d1988" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How GenAI Turned My Two-Year PDF Project into a Five-Minute Task]]></title>
            <link>https://medium.com/@binayr/how-genai-turned-my-two-year-pdf-project-into-a-five-minute-task-461359fbdf36?source=rss-def7bf9f30e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/461359fbdf36</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[gen-ai-revolution]]></category>
            <category><![CDATA[futuristic]]></category>
            <category><![CDATA[cost-savings]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Binay Kumar Ray]]></dc:creator>
            <pubDate>Tue, 18 Jun 2024 05:22:30 GMT</pubDate>
            <atom:updated>2024-06-18T05:22:30.970Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nJnFzW7GTGV3U_WRVfnRTw.jpeg" /></figure><p>Generative AI is causing quite a stir across various fields — creatives, communications, software engineering, you name it. Every tech giant — OpenAI, Google, Amazon, Facebook, Microsoft — is racing to develop the most advanced Large Language Model (LLM) and outdo the competition. The possibilities with these AI tools are endless and available right at our fingertips.</p><p>The real magic happens with prompt engineering, which lets us tap into the true potential of these AI marvels. Imagine having an assistant that not only understands your needs but can also perform complex tasks with a simple command. From generating creative content to automating tedious data processing tasks, GenAI can handle it all. It’s like having a superpower that makes your computer an even smarter companion.</p><p>Let me share my journey. A few years ago, I developed a sophisticated screening system that handled a variety of PDFs. It processed them, classified each document correctly, extracted text using OCR technology, identified key entities, formatted the information into JSON, and sent it back to the UI. Phew! Quite the marathon, right? This event-driven system was stitched together with Kafka, used PyTorch for image classification, OpenCV for document processing, Google OCR for text extraction, and TensorFlow for entity recognition. It was cutting-edge, fast, and adaptable, saving months of screening effort and converting it into minutes. The system significantly reduced costs and time for the company.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/1*2fN4vfdRzbpocQpR4UC9gA.png" /></figure><p>But little did I know that within a year, OpenAI would revolutionize AI and render most of these complex systems obsolete. The new architecture is remarkably simple and accurate, thanks to GenAI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*yu9WA1fBVqluh5jw84gebQ.png" /></figure><p>Yesterday, I was experimenting with ChatGPT, specifically GPT-4. With its powerful capabilities, I uploaded documents and processed them effortlessly. I just had to frame the right prompt to extract the data and format it into JSON. In just 5–10 lines of code, I got the exact response I needed, which was then sent back to the UI. This prototype can easily be packaged, deployed, and scaled according to our needs.</p><p>Here’s a glimpse of what I did:</p><pre>import openai<br>openai.api_key = &#39;your-api-key&#39;<br>document = open(&#39;your-document.pdf&#39;, &#39;rb&#39;)<br><br>prompt = &quot;&quot;&quot;<br>Extract the blood report values and format them in JSON with keys as test names and values as <br>{test name: {&#39;value&#39;: value, &#39;unit&#39;: unit, &#39;ideal&#39;: ideal range}}<br>&quot;&quot;&quot;<br><br>response = openai.Completion.create(<br> engine=&quot;gpt-4&quot;,<br> prompt=prompt,<br> files=[document],<br> max_tokens=1000<br>)<br>print(response.choices[0].text)</pre><p>The above code snippet shows how you can leverage GenAI to simplify a complex task. It’s almost magical how what once took years to perfect can now be achieved in minutes. GenAI isn’t just a tool; it’s a game-changer, bringing efficiency and simplicity to tasks that once seemed monumental.</p><p>In summary, Generative AI has transformed the way we approach problem-solving in tech. By harnessing the power of prompt engineering, we can unlock incredible capabilities, making our workflows more efficient and our systems smarter. Whether you’re dealing with complex data processing or creative tasks, GenAI is here to turn your ambitious projects into effortless endeavors. So, why not dive into the world of Generative AI and see how it can revolutionize your work too?</p><p><strong>Pros and Cons of the suggested system</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ozZTlLFRAvDrRgOE1b6tSQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=461359fbdf36" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering RAG: Kickstart Your AI Journey with LLM and RAG]]></title>
            <link>https://medium.com/@binayr/mastering-rag-kickstart-your-journey-with-llm-and-rag-ab68b76a76f3?source=rss-def7bf9f30e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab68b76a76f3</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[genai]]></category>
            <dc:creator><![CDATA[Binay Kumar Ray]]></dc:creator>
            <pubDate>Fri, 31 May 2024 08:31:09 GMT</pubDate>
            <atom:updated>2024-05-31T08:31:24.277Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zwxIYtbOdUUdl6eAxNLbGg.png" /></figure><p>In this blog, you’ll learn about Large Language Models (LLMs), Retrieval-Augmented Generation (RAG), and how to set up a basic RAG system on your own. We’ll use Facebook’s LLaMA for a smaller setup and explore how OpenAI and Azure can provide even more refined results.</p><h3>What is LLM?</h3><p>A Large Language Model (LLM) is an advanced AI system trained on vast amounts of text data to understand, generate, and manipulate human language. These models use deep learning techniques to perform various tasks, such as text generation, translation, summarization, and question answering.</p><p>- OpenAI’s ChatGPT: Known for its conversational abilities and versatility, ChatGPT generates coherent and contextually relevant responses, making it ideal for chatbots and content creation.</p><p>- Facebook’s LLaMA: Focused on efficiency and adaptability, LLaMA aims to deliver high performance with lower computational requirements, making powerful language models more accessible.</p><p>- Azure OpenAI: Combines OpenAI’s models with Microsoft’s Azure cloud services, offering enhanced scalability, security, and enterprise support. This integration helps businesses deploy and manage LLMs within a robust cloud infrastructure.</p><p>Each platform has different strengths, tailored to specific applications and user needs.</p><h3>What is RAG?</h3><p>Retrieval-Augmented Generation (RAG) is an AI technique that enhances text generation by first retrieving relevant information from a large dataset and then using this information to generate a response. This process ensures that the generated content is accurate and contextually relevant.</p><p>Example:</p><p>If you ask an AI about the history of the internet, a traditional model might give a general answer based on its training data. A RAG model, however, first searches a large database for relevant information and then uses this specific data to craft a detailed response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*mECn-r8aMuIoV69oU4x3fA.png" /></figure><h3>Setting Up LLM</h3><p>You can use either a local or a remote LLM. Remote options include OpenAI, Azure OpenAI (suitable for organizations wanting to keep data within their infrastructure), Claude, and Gemini.</p><p>Local Setup with Docker:</p><p>1. Run the Docker Container:</p><pre>docker run -d -v $(PWD)/data:/root/.ollama -p 11434:11434 --name ollama ollama/ollama</pre><p>2. Access the Container:</p><pre>docker exec -it ollama bash</pre><p>3. Run LLaMA3 Model:</p><pre>ollama run llama3</pre><p>This command will download and start the LLaMA3 model. Once running, you can interact with it via the command line or an API. This uses <a href="https://github.com/ollama/ollama"><strong>Ollama</strong></a><strong> </strong>to run the model locally, please refer the link attached and choose the one suitable to your usecase.</p><h3>Setting Up RAG</h3><p><strong>Option 1: </strong>Local LLaMA with Docker</p><p>Dependencies:</p><pre>huggingface-hub<br>sentence-transformers<br>langchain==0.0.352<br>chromadb==0.3.29<br>tiktoken<br>unstructured</pre><p>Code:</p><pre>import os<br>from langchain_community.llms import Ollama<br>from langchain.document_loaders import RecursiveUrlLoader<br>from langchain.embeddings import HuggingFaceEmbeddings<br>from langchain.text_splitter import RecursiveCharacterTextSplitter<br>from langchain.vectorstores import Chroma<br>from langchain.chains import ConversationalRetrievalChain<br><br># Initialize the index if required<br>def init_index():<br>    if not os.getenv(&#39;INIT_INDEX&#39;, &#39;false&#39;).lower() == &#39;true&#39;:<br>        return<br>    documents = RecursiveUrlLoader(<br>        TARGET_URL,<br>        max_depth=4,<br>        prevent_outside=True,<br>        use_async=True,<br>        timeout=600<br>    ).load()<br>    text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)<br>    documents = text_splitter.split_documents(documents)<br>    embeddings = HuggingFaceEmbeddings(model_name=&quot;all-MiniLM-L6-v2&quot;)<br>    vectordb = Chroma.from_documents(<br>        documents=documents,<br>        embedding=embeddings,<br>        persist_directory=&quot;./data/chromadb&quot;<br>    )<br>    vectordb.persist()<br><br># Initialize the conversation<br>def init_conversation():<br>    embeddings = HuggingFaceEmbeddings(model_name=&quot;all-MiniLM-L6-v2&quot;)<br>    vectordb = Chroma(persist_directory=&quot;./data/chromadb&quot;, embedding_function=embeddings)<br>    llm = Ollama(<br>        model=&quot;llama3&quot;,<br>        base_url=&quot;http://localhost:11434&quot;,<br>        verbose=True,<br>    )<br>    global conversation<br>    conversation = ConversationalRetrievalChain.from_llm(<br>        llm,<br>        retriever=vectordb.as_retriever(),<br>        return_source_documents=True,<br>        verbose=True,<br>    )<br><br># Chat function<br>def chat(question):<br>    response = conversation({&quot;question&quot;: question, &quot;chat_history&quot;: []})<br>    return response[&#39;answer&#39;]<br>init_index()<br>init_conversation()<br>print(chat(&quot;What is Task Decomposition?&quot;))</pre><p><strong>Option 2:</strong> Using OpenAI</p><p>Dependencies:</p><pre>langchain<br>langchain_community<br>langchain_chroma<br>langchain_core<br>langchain_openai<br>langchain_text_splitters<br>langchainhub</pre><p>Code:</p><pre>import bs4<br>import bs4<br><br>from langchain import hub<br>from langchain_chroma import Chroma<br>from langchain_community.document_loaders import WebBaseLoader<br>from langchain_core.output_parsers import StrOutputParser<br>from langchain_text_splitters import RecursiveCharacterTextSplitter<br><br># Load, chunk, and index the content<br>loader = WebBaseLoader(<br>    web_paths=(&quot;https://lilianweng.github.io/posts/2023-06-23-agent/&quot;,),<br>    bs_kwargs=dict(<br>        parse_only=bs4.SoupStrainer(<br>            class_=(&quot;post-content&quot;, &quot;post-title&quot;, &quot;post-header&quot;)<br>        )<br>    ),<br>)<br><br>docs = loader.load()<br>text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)<br>splits = text_splitter.split_documents(docs)<br><br># Use one of the two embedding based on your import selection<br>embeddings = OpenAIEmbeddings()<br>embeddings=HuggingFaceEmbeddings(model_name=&#39;sentence-transformers/all-MiniLM-L6-v2&#39;)<br><br>vectorstore = Chroma.from_documents(documents=splits, embedding=embeddings)<br><br># Retrieve and generate<br>retriever = vectorstore.as_retriever()<br>prompt = hub.pull(&quot;rlm/rag-prompt&quot;)<br>llm = OpenAI()<br><br>def format_docs(docs):<br>    return &quot;\n\n&quot;.join(doc.page_content for doc in docs)<br><br>rag_chain = (<br>    {&quot;context&quot;: retriever | format_docs, &quot;question&quot;: RunnablePassthrough()}<br>    | prompt<br>    | llm<br>    | StrOutputParser()<br>)<br><br>print(rag_chain.invoke(&quot;What is Task Decomposition?&quot;))</pre><p>Please give it a try and let me know how it works out.</p><p><strong>References</strong></p><ul><li><a href="https://medium.com/rahasak/build-rag-application-using-a-llm-running-on-local-computer-with-ollama-and-langchain-e6513853fda0">build-rag-application-using-a-llm-running-on-local-computer-with-ollama-and-langchain</a></li><li><a href="https://python.langchain.com/v0.2/docs/tutorials/rag/#:~:text=A%20typical%20RAG%20application%20has,passes%20that%20to%20the%20model.">langchain ragBuild a Retrieval Augmented Generation (RAG) App</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab68b76a76f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Containerize Your Curiosity: Docker Decoded for Beginners]]></title>
            <link>https://medium.com/@binayr/containerize-your-curiosity-docker-decoded-for-beginners-d2709cd5b48f?source=rss-def7bf9f30e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2709cd5b48f</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <category><![CDATA[containerization]]></category>
            <category><![CDATA[docker-image]]></category>
            <dc:creator><![CDATA[Binay Kumar Ray]]></dc:creator>
            <pubDate>Tue, 14 May 2024 17:56:40 GMT</pubDate>
            <atom:updated>2024-05-14T18:02:45.666Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z5phP2MeBOeKUwj2CCibKw.png" /></figure><p>Are you curious about Docker but not sure where to start? Dive into the world of containerization with this beginner-friendly guide! We’ll demystify Docker and walk you through the process of creating your first container, step by step.</p><h3><strong>What is Docker?</strong></h3><p>Docker is a powerful tool that allows you to package and run applications in lightweight containers. These containers contain everything your application needs to run, making it easy to deploy applications consistently across different environments.</p><h3>Getting Started</h3><p><strong>1. Installation:</strong></p><p>First things first, you’ll need to install Docker on your machine. Docker provides straightforward installation instructions for various operating systems on their website. Once installed, you can verify the installation by running `docker — version` in your terminal or command prompt.</p><p><strong>2. Understanding Docker Keywords:</strong></p><p>Before we dive into creating containers, let’s understand some key Docker keywords:</p><p>- <strong>FROM</strong>: Specifies the base image to use for your container. This is where your container starts.<br> <br>- <strong>RUN</strong>: Executes commands during the build process to set up your environment and install dependencies.<br> <br>- <strong>CMD</strong>: Sets the default command to run when the container starts. This can be overridden at runtime.<br> <br>- <strong>ENTRYPOINT</strong>: Specifies the command to run when the container starts. Unlike CMD, values passed to ENTRYPOINT cannot be overridden.</p><p><strong>3. Building Your First Docker Image:</strong></p><p>Let’s create a simple “Hello, World!” application using Docker:</p><p>1. <strong>Create a Directory</strong>: Start by creating a directory for your project and navigate into it.</p><p>2. <strong>Create a Dockerfile</strong>: Inside the project directory, create a file named `Dockerfile` and open it in a text editor.</p><p>3. <strong>Write the Dockerfile</strong>: In the Dockerfile, define the steps to build your image. Here’s a basic example:</p><pre># Use an existing Docker image as a base<br>FROM alpine<br> <br># Set the default command to print &quot;Hello, World!&quot;<br>CMD [&quot;echo&quot;, &quot;Hello, World!&quot;]</pre><p>4. <strong>Build the Docker Image</strong>: In your terminal or command prompt, navigate to the project directory and run the following command to build your Docker image:</p><pre>docker build -t my-image .</pre><p><strong>5. Running Your Docker Container:</strong></p><p>Now that you have built your Docker image, it’s time to run a container based on that image:</p><pre>docker run my-image</pre><h3>Understanding Differences: RUN vs CMD vs ENTRYPOINT</h3><p>- <strong>RUN</strong>: Executes commands during the build process to set up your environment and install dependencies. These commands are run once during the build process.<br> <br>- <strong>CMD</strong>: Sets the default command to run when the container starts. This command can be overridden when running the container.<br> <br>- <strong>ENTRYPOINT</strong>: Specifies the command to run when the container starts. Values passed to ENTRYPOINT cannot be overridden and are appended to any arguments specified when running the container.</p><h3>Conclusion:</h3><p>Congratulations! You’ve created and run your first Docker container. While this guide covers the basics, there’s still much more to explore. With Docker, you have the power to containerize your applications and deploy them with ease. If you liked this post please add a comment. If you want more in-depth walkthrough let me know for another post. Happy containerizing! 🐳✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2709cd5b48f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unveiling the Intricacies of Python Tuples and Dictionaries]]></title>
            <link>https://medium.com/@binayr/unveiling-the-intricacies-of-python-tuples-and-dictionaries-6f7b9579387d?source=rss-def7bf9f30e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f7b9579387d</guid>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[python-dictionaries]]></category>
            <category><![CDATA[python-list]]></category>
            <category><![CDATA[python-tuple]]></category>
            <category><![CDATA[python-memory-management]]></category>
            <dc:creator><![CDATA[Binay Kumar Ray]]></dc:creator>
            <pubDate>Wed, 17 Apr 2024 10:04:30 GMT</pubDate>
            <atom:updated>2024-04-17T10:04:30.546Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*clDXIsB1Wx3-NR-L-AcfUg.png" /></figure><h3>A Deep Dive into Memory Allocation</h3><p>Greetings, Python enthusiasts! Today, we embark on an enlightening journey through the inner workings of Python’s tuples and dictionaries. Join me as we delve deep into the fascinating realms of memory allocation within these indispensable data structures, with a special focus on the dynamic and versatile Python dictionaries.</p><h3>Navigating Tuples: A Prelude to Discovery</h3><p>Let’s commence our exploration with Python’s immutable tuples — a steadfast foundation in the programmer’s arsenal. Picture an empty tuple, its memory awaiting the arrival of data. As we venture forth, the enigma of memory allocation begins to unravel.</p><h4>The Symphony of Tuple Construction</h4><p>With each addition, Python’s compiler orchestrates a symphony of memory allocation. Opposite to Lists, tuples are inherently immutable. That means you can not add/update/remove element from tuple. Therefore when a tuple is created it is created with readonly mode which takes less space than list. on top of that when you create a tuple with some elements in it, it only assigns memory to the elements added as tuples can not be modified.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/310/1*4URFPgnBP1xbyNykmyx9Qg.png" /></figure><p>Every data point in a tuple is just a location which can not be modified. Take for example the above tuple, the 3rd index on the tuple points to an empty list []. you can not replace this list from this tuple, however you can add/remove items in the list, thus making the tuple immutable but list mutable. Comment down on what you think of the memory allocation in tuple when you add elements to the list.</p><h4>The Intricate Dance of Python Dictionaries</h4><p>Now, let us pivot to the dynamic and versatile realm of Python dictionaries — a domain where keys and values intertwine in a captivating dance of association. Initialized with precision, Python meticulously allocates memory for each key-value pair, laying the groundwork for efficient and lightning-fast data retrieval.</p><h4>Mapping Memory in Python’s Dictionaries</h4><p>With the addition of our inaugural key-value pair, Python allocates a dedicated block of memory. As our dictionary expands, each new mapping is met with a harmonious allocation of memory, ensuring optimal storage and swift access to our data. As dictionary is built of the base of hashmaps the memory allocation is also done based on the reruired memories of the hashmap itself.</p><h4>Dynamic Growth and Efficient Mapping</h4><p>What sets dictionaries apart is their dynamic nature — Python seamlessly adjusts its memory allocation to accommodate new entries. Whether we add one key-value pair or a hundred, Python’s memory management ensures efficient mapping and retrieval, even as our dictionary evolves. Thus making the insert/retrieval of elements of dictionary to the complexity of O(1)</p><h4>Visual Insights: A Map to Understanding</h4><p>Accompanying our exploration is an annotated image, vividly illustrating the allocated blocks of memory. These visual cues offer a clear window into Python’s intricate memory allocation process within dictionaries, guiding us on our quest for deeper knowledge.</p><h3>Unveiling the Tapestry of Python’s Memory Magic</h3><p>In conclusion, our expedition through Python tuples and dictionaries reveals a tapestry of orchestrated memory management — a symphony of allocation and expansion. From the anticipatory patterns of tuple allocation to the associative dance of dictionaries, Python’s memory allocation unveils a captivating tapestry of efficiency and foresight.</p><h4>Join the Exploration: Share Your Insights</h4><p>Join me in this immersive journey into the heart of intricacies of Python’s internal working! Comment down your thoughts, insights and knowledge to help me come up with more such blogs.</p><p>#PythonTuples #DictionaryMagic #PythonProgramming #DataStructures #MemoryAllocation #TechExploration</p><p>Let’s unravel the secrets together and delve into the intricate world of Python’s memory management, where tuples and dictionaries take center stage. 🌟✨</p><p>Scan below QR code to connect with me on Topmate..</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*mL13fsnr4YBIwIkPaMQvXw.png" /><figcaption><a href="https://topmate.io/binay">https://topmate.io/binay</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f7b9579387d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Intricacies of Python Lists: A Dive into Memory Allocation]]></title>
            <link>https://medium.com/@binayr/the-intricacies-of-python-lists-a-dive-into-memory-allocation-c50c3277d1ab?source=rss-def7bf9f30e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/c50c3277d1ab</guid>
            <category><![CDATA[codinginsights]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[python-list]]></category>
            <category><![CDATA[memory-allocation]]></category>
            <category><![CDATA[techexploration]]></category>
            <dc:creator><![CDATA[Binay Kumar Ray]]></dc:creator>
            <pubDate>Tue, 09 Apr 2024 19:00:36 GMT</pubDate>
            <atom:updated>2024-04-09T19:00:36.956Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IKJL_BCuro-nHxcAaoEIKg.png" /></figure><p>Welcome, curious minds, to the enigmatic world of Python lists. Today, we embark on a journey to uncover the hidden mechanisms that dictate how Python manages memory when it encounters the versatile list data structure.</p><h4>The Blank Canvas of a List</h4><p>Let us begin our exploration with an empty slate — a list initialized to a modest size of 56. As we take our first steps into the realm of lists, the mysteries of memory allocation slowly reveal themselves.</p><h4>The Append Operation: A Prelude to Memory Magic</h4><p>With each append() operation, Python&#39;s compiler performs a delicate dance of memory allocation. Astonishingly, upon adding the first element, not just one, but 4 vacant blocks are bestowed upon our list. This initial allocation swells the size to 88 (56 + 4 blocks * 8).</p><h4>Unraveling the Patterns of Allocation</h4><p>The intrigue deepens as subsequent appends follow a pattern. Until the fourth append, the size remains unchanged, with Python reserving space for anticipated growth.</p><p>However, a subtle shift occurs with the fifth append. An additional 4 blocks are introduced, yet this time, the value finds its home in the 5th index while the next 3 slots remain vacant.</p><h4>The Enigma of Progressive Allocation</h4><p>As our list blossoms with elements, Python’s compiler reveals its idiosyncrasies. The 9th append introduces 8 empty blocks, mysteriously filling only the 8th slot.</p><h4>A Journey Through Append Iterations</h4><p>With each iteration, a fascinating saga unfolds. On the 17th append, 9 empty blocks emerge, housing the value in the 17th slot. This pattern of progressive allocation weaves a captivating narrative of Python’s list management.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*9eZYgM7rN4IibbqB5_aYXA.jpeg" /></figure><h4>Revelations and Visual Insights</h4><p>In the annotated image accompanying this exploration, the groups of allocated blocks are highlighted in luminous yellow. This visual cue offers a window into the orchestrated dance of memory allocation within a Python list.</p><h4>Closing Thoughts</h4><p>In conclusion, our journey into Python lists has unveiled a nuanced world of memory management. This observation, a mere glimpse into the intricate workings of Python, invites further exploration.</p><p>Should you seek deeper insights or wish to share your own revelations, the door to discussion is wide open. The world of Python lists awaits your exploration.</p><h4>Coming Up Next</h4><p>Our expedition into the depths of Python’s data structures continues. Up next on our itinerary: a rendezvous with the intriguing realms of Dictionaries and tuples. More details on List operations.</p><p><em>Note: Image generated with AI, diagrams drawn with draw.io</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c50c3277d1ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[REST API in English]]></title>
            <link>https://medium.com/@binayr/rest-api-in-english-a4bc2c0c8af8?source=rss-def7bf9f30e6------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4bc2c0c8af8</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[web-applications]]></category>
            <category><![CDATA[json]]></category>
            <category><![CDATA[protocall]]></category>
            <dc:creator><![CDATA[Binay Kumar Ray]]></dc:creator>
            <pubDate>Mon, 13 Jul 2020 08:08:48 GMT</pubDate>
            <atom:updated>2020-07-13T08:08:48.997Z</atom:updated>
            <content:encoded><![CDATA[<p>REST Stands for <strong>RE</strong>presentational <strong>S</strong>tate <strong>T</strong>ransfer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*fpexkbEqeJSDGs2DmjmNHg.jpeg" /></figure><p><strong>RE</strong>presentational → How it looks or represented<br><strong>S</strong>tate → Intended Action associated with it<br><strong>T</strong>ransfer → Communication<br>Too complicated? Ok let’s scale down..</p><p>Even I am explaining this to non programmers as well as programmers It is pretty obvious that we are talking about web applications and how they communicate to make our life easier. I am assuming You have no knowledge of technology at all apart from how to open an website in browser, logging into it and the waste your time.</p><p>Suppose there are 2 guys(Jon and Brad) discussing about weather in a bar in English. Now enters and pretty attractive lady (Sally) but she doesn’t speak or understand English at all but she knows Spanish. Now you know men right! They will do all things possible to make an interesting conversation happen with Sally. So they invite another person Jason (who speaks English and Spanish both). Now 4 of them have a pretty nice evening together and understand each other.</p><p>Think of 2 applications. Facebook and Gmail and assume they can communicate with each other. Enters Sally (Instagram), she can not communicate with Facebook because they don’t understand the request and response of each other. If you don’t know what request and response is try to think, when someone talks to you they are sending a request. You absorb the content of their speech (process data from the incoming request) and then say something back (send a response). For them to communicate they must talk in the same language or there need to be another way to convert different language into a common one.</p><p>Enters JSON. In Technology JSON is a way to store data in key value pair. Like {“name”: “Sally”, “message”: “Hello World”}. For facebook to understand this they need to have a mechanism in place to extract data out of it and also facebook need to send data in the same format so Sally(Instagrams) knows how to extract data out of it. Now all of the applications are in sync. They can talk to each other via JSON pretty quickly and easily.</p><p>Now this is the representational part of it. Now let’s do the Action..<br>In Technology There is something called <strong>CRUD</strong> (stands for <strong>C</strong>reate <strong>R</strong>etrieve <strong>U</strong>pdate <strong>D</strong>elete). Basically all web based actions can be summed up to these 4 actions. and have 4 different methods associated with these 4 actions. <br>Create → POST<br>Retrieve → GET<br>Update → PUT<br>Delete → DELETE</p><p>This means when you send a POST request it creates a new data. GET fetches the data from server. PUT Updates the existing data and DELETE deletes the existing data. When we send a request we an actually categorize the request to these 4 before sending the request.</p><p>Too complex? Imagine Jon told sally “My name is Jonathan”. Sally registers that in her mind for the first time(POST happened) and say’s “Nice to Meet you Jonathan.”. Jon heard that (GET happend) and said “You can call me Jon”. Sally registered that as well and started to adress him as Jon (PUT happened). After sometime Sally went home and completely forgot about Jon. DELETE happened :D</p><p>So what we got from all of above? 2 entities need to communicate via a common language. Based on the intention the the data from the common language is extracted and processed. We put both of these together and boom REST API is build. Ofcourse there is <strong>T </strong>stands for Transfer. means the communication happening between these people with some specific rules in place to understand each other properly.</p><p>Now I am gonna go completely technical to put together all these together.</p><p>REST API is a way to communicate between different web applications developed in different languages, different UI’s, Devices etc in a clean and efficient way. facebook in php, Instgram in Python/Django but still you can post a photo on instagram link you facebook and the same photo gets posted on your facebook because the data(Image) is exposed to facebook via JSON with the required actions. This has become the web standard now. This is how web applications communicate with each other. This is how you can open instagram from your mobile app and also from the browser of your laptop. The possibilities are countless.</p><p>I hope this blog will be useful to you and you learnt something new. Share any thoughts or feedbacks or scenarios you have so that I can also learn something new from you too. Have an awesome day :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4bc2c0c8af8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>