<?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 Bhavik Jikadara on Medium]]></title>
        <description><![CDATA[Stories by Bhavik Jikadara on Medium]]></description>
        <link>https://medium.com/@bhavikjikadara?source=rss-9e9f86f6aafd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*KOkGqw0Ftj7Oj6dPMjxTcw.jpeg</url>
            <title>Stories by Bhavik Jikadara on Medium</title>
            <link>https://medium.com/@bhavikjikadara?source=rss-9e9f86f6aafd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 01:23:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bhavikjikadara/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[How to Create a Virtual Environment in Python]]></title>
            <link>https://bhavikjikadara.medium.com/how-to-create-a-virtual-environment-in-python-4e076a8e7e50?source=rss-9e9f86f6aafd------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e076a8e7e50</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[virtual-environment]]></category>
            <category><![CDATA[tips]]></category>
            <category><![CDATA[python-virtualenv]]></category>
            <dc:creator><![CDATA[Bhavik Jikadara]]></dc:creator>
            <pubDate>Tue, 03 Nov 2026 08:49:55 GMT</pubDate>
            <atom:updated>2026-11-03T08:49:55.935Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nto2oRLVR1EahmOQ5X6B-g.png" /><figcaption><a href="https://chatgpt.com/s/m_6ae99fb2c08c81918f537bae65aa5f8a">Image Source</a></figcaption></figure><p><em>A practical, step-by-step guide for Windows, macOS, and Linux</em></p><p>A few years ago I installed a newer version of a library for one project and, without noticing, broke another project that had been running fine for months. Nothing was wrong with the code. The two projects simply needed different versions of the same package, and I had only one place to install it.</p><p>That mess is exactly what a <strong>virtual environment</strong> prevents. If you write Python regularly, this is one habit worth building on day one.</p><p>In this guide you will learn what a virtual environment is, how to create and use one on any operating system, and how to fix the errors beginners usually hit.</p><h3>What is a virtual environment?</h3><p>A virtual environment is an isolated folder that contains its own Python interpreter and its own set of installed packages. When it is active, pip install puts packages inside that folder instead of your system-wide Python.</p><p>Think of it like giving each project its own toolbox. Project A can use Django 4, Project B can use Django 5, and neither one knows the other exists.</p><h3>Why you should use one</h3><ul><li><strong>No version conflicts.</strong> Each project keeps the exact versions it needs.</li><li><strong>A clean system Python.</strong> You avoid cluttering (or accidentally breaking) the Python your operating system may depend on.</li><li><strong>Reproducibility.</strong> You can list your dependencies and rebuild the same setup on another machine or on a server.</li><li><strong>No admin rights needed.</strong> Installing into a project folder does not require elevated permissions.</li></ul><h3>Prerequisites</h3><p>You only need Python 3.3 or newer. The venv module ships with it. Check your version first:</p><pre>python --version</pre><p>On macOS and Linux you may need to use python3 instead:</p><pre>python3 --version</pre><h3>Step 1: Create a project folder</h3><pre>mkdir my_project<br>cd my_project</pre><p>Keeping the environment inside (or right next to) the project makes it easy to find later.</p><h3>Step 2: Create the virtual environment</h3><p>Run this inside your project folder:</p><p><strong>Windows</strong></p><pre>python -m venv venv</pre><p><strong>macOS / Linux</strong></p><pre>python3 -m venv venv</pre><p>Let’s break that command down:</p><ul><li>python -m venv runs Python&#39;s built-in venv module.</li><li>The last venv is simply the <strong>name of the folder</strong> that will be created. You can call it anything. Many people use venv, .venv, or env.</li></ul><p>After it finishes, you will see a new folder. Inside, there is a copy of the Python interpreter, a pip installation, and a place where packages will live (Lib/site-packages on Windows, lib/pythonX.Y/site-packages on macOS and Linux).</p><h3>Step 3: Activate the environment</h3><p>Creating the environment is not enough. You have to <strong>activate</strong> it so your terminal uses it.</p><p><strong>Windows (Command Prompt)</strong></p><pre>venv\Scripts\activate</pre><p><strong>Windows (PowerShell)</strong></p><pre>venv\Scripts\Activate.ps1</pre><p><strong>macOS / Linux</strong></p><pre>source venv/bin/activate</pre><p>When activation works, your terminal prompt gets the environment name in front of it:</p><pre>(venv) C:\Users\you\my_project&gt;</pre><p>That (venv) prefix is your signal that you are working inside the isolated environment.</p><h3>Quick check</h3><p>Confirm which Python and pip you are using:</p><pre># Windows<br>where python</pre><pre># macOS / Linux<br>which python</pre><p>The path should point inside your venv folder. If it points to a system location, the environment is not active.</p><h3>Step 4: Install packages</h3><p>With the environment active, install packages the normal way:</p><pre>pip install requests</pre><p>Check what is installed:</p><pre>pip list</pre><p>You will see only a handful of packages, because this environment is fresh and separate from everything else on your machine.</p><h3>Step 5: Save your dependencies</h3><p>To share your project or recreate it later, save the package list into a file:</p><pre>pip freeze &gt; requirements.txt</pre><p>Anyone (including future you) can then rebuild the same environment:</p><pre>python -m venv venv<br># activate it, then:<br>pip install -r requirements.txt</pre><p>This is the step that turns “it works on my machine” into “it works on every machine.”</p><h3>Step 6: Deactivate when you are done</h3><p>To leave the environment and return to your normal shell:</p><pre>deactivate</pre><p>The (venv) prefix disappears. Your environment and its packages are untouched and ready for next time.</p><h3>Deleting a virtual environment</h3><p>A virtual environment is just a folder, so removing it is simple. Deactivate first, then delete the folder.</p><pre># macOS / Linux<br>rm -rf venv</pre><pre># Windows (Command Prompt)<br>rmdir /s /q venv</pre><p>Because you have a requirements.txt, you can always rebuild it.</p><h3>Common problems and fixes</h3><h3>1. PowerShell says “running scripts is disabled on this system”</h3><p>This is the most common Windows issue. PowerShell blocks activation scripts by default. Allow scripts for your current user:</p><pre>Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser</pre><p>Then try activating again. Alternatively, use Command Prompt, which does not have this restriction.</p><h3>2. “No module named venv” or “ensurepip is not available” on Ubuntu/Debian</h3><p>Some Linux distributions package venv separately. Install it:</p><pre>sudo apt install python3-venv</pre><h3>3. python is not recognized</h3><p>Python may not be on your PATH. On Windows, try the launcher:</p><pre>py -m venv venv</pre><p>You can also reinstall Python and tick <strong>“Add Python to PATH”</strong> during setup.</p><h3>4. Packages install globally even though I created an environment</h3><p>You most likely forgot to activate it. Look for the (venv) prefix in your prompt. A safe habit is to call pip through Python so you always use the right one:</p><pre>python -m pip install requests</pre><h3>5. I moved or renamed my project folder and the environment broke</h3><p>Virtual environments store absolute paths internally, so they do not survive being moved. Delete the folder and recreate it from requirements.txt.</p><h3>Using a specific Python version</h3><p>If you have several Python versions installed, pick one explicitly when creating the environment.</p><p><strong>Windows</strong></p><pre>py -3.11 -m venv venv</pre><p><strong>macOS / Linux</strong></p><pre>python3.11 -m venv venv</pre><p>The environment will use whichever interpreter you called, which is handy when a project requires an older or newer version.</p><h3>venv vs. virtualenv: what is the difference?</h3><p>You will also hear about a tool called <strong>virtualenv</strong>. It came first, and venv was later added to the standard library, based on the same idea.</p><p>venv virtualenv Comes with Python Yes No, install with pip install virtualenv Setup needed None One install Speed Good Often faster at creating environments Extra features Basics More options, supports older Python versions</p><p>For most people, venv is enough. If you want to try virtualenv:</p><pre>pip install virtualenv<br>virtualenv venv</pre><p>Activation and everything else work the same way.</p><h3>Good habits to build</h3><ul><li><strong>One environment per project.</strong> Never share one between unrelated projects.</li><li><strong>Add the environment folder to </strong><strong>.gitignore.</strong> Do not commit it. Commit requirements.txt instead.</li></ul><pre>venv/ .venv/</pre><ul><li><strong>Keep </strong><strong>requirements.txt up to date.</strong> Re-run pip freeze &gt; requirements.txt after installing something new.</li><li><strong>Name it consistently.</strong> Using .venv or venv everywhere means editors like VS Code and PyCharm detect it automatically.</li><li><strong>Upgrade pip inside the environment</strong> now and then:</li></ul><pre>python -m pip install --upgrade pip</pre><h3>Final thoughts</h3><p>Virtual environments take about thirty seconds to set up, and they save hours of debugging later. Once you make “create the environment first” the first step of every new project, dependency headaches mostly disappear.</p><p>If this guide helped you, share it with someone just starting out in Python. And if you ran into an error that is not covered here, drop it in the comments. I would like to hear about it.</p><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e076a8e7e50" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Build a Full-Stack App with an AI Coding Agent (2026 Guide)]]></title>
            <link>https://bhavikjikadara.medium.com/how-to-build-a-full-stack-app-with-an-ai-coding-agent-2026-guide-0057d46eb632?source=rss-9e9f86f6aafd------2</link>
            <guid isPermaLink="false">https://medium.com/p/0057d46eb632</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai-pair-programming-guide]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[full-stack-app-with-ai]]></category>
            <category><![CDATA[ai-coding-agent-tutorial]]></category>
            <dc:creator><![CDATA[Bhavik Jikadara]]></dc:creator>
            <pubDate>Sun, 23 Aug 2026 16:41:18 GMT</pubDate>
            <atom:updated>2026-08-23T16:41:18.520Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UBzJgizjrp7c5mqJRHTKNg.png" /><figcaption>Image generated by <a href="https://chatgpt.com/s/m_6a8b1f0f4f0c8191a6680ce7d4150eb2">ChatGPT</a></figcaption></figure><p>Learn how to build a full-stack web app using an AI coding agent. A simple, step-by-step guide for beginners — no heavy jargon, just real steps.</p><p>If you’ve ever wanted to build your own app but felt stuck before you even started, you’re not alone. Setting up a backend, connecting a database, writing an API, building a frontend — it’s a lot. It used to take days just to get the boring setup done, before you even wrote the “real” part of your app.</p><p>Things are different now. AI coding agents — tools like Claude Code, Cursor, and <a href="https://github.com/features/copilot"><strong>GitHub Copilot</strong></a> — can now write code, run commands, fix errors, and even test your app for you. You still lead the project. But you’re no longer doing every single step alone.</p><p>In this guide, I’ll walk you through exactly how to build a full-stack app with an AI coding agent, from a blank idea to something live on the internet. No confusing terms, no assuming you already know everything. Just the real steps, explained simply.</p><h3>What Is an AI Coding Agent, Really?</h3><p>Let’s clear this up first, since a lot of blogs skip it.</p><p>A normal AI code tool (like basic autocomplete) just guesses your next line of code. You still do all the thinking, typing, and fixing.</p><p>An <strong>AI coding agent</strong> is different. You give it a task in plain English — like “add a login page” — and it can:</p><ul><li>Look through your whole project, not just one file</li><li>Plan out the steps needed to finish the task</li><li>Actually write the code across multiple files</li><li>Run your app or tests to check if it works</li><li>Notice when something’s broken and try to fix it</li></ul><p>Basically, it acts less like a tool and more like a helpful junior developer sitting next to you. You’re still the one making decisions. It’s just doing a lot of the typing and grunt work.</p><h3>Why This Matters for Beginners and Pros Alike</h3><p>You don’t need to be an expert coder to build something real anymore. But you do still need to know what you <em>want</em> — the agent can’t read your mind.</p><p>Here’s the honest truth: AI agents are great at writing code fast, but they’re not great at guessing what you actually meant if your instructions are vague. The people who get the best results are the ones who plan a little before typing anything into the chat box.</p><p>That’s exactly what we’ll do next.</p><h3>Step 1: Get Clear on What You’re Building</h3><p>Before opening any tool, grab a notebook or a blank doc and answer these:</p><ul><li><strong>What does the app actually do?</strong> (One sentence. Example: “A to-do list app where people can add tasks and mark them done.”)</li><li><strong>Who is it for?</strong> (Just you? Your team? The public?)</li><li><strong>What are the 3–5 must-have features?</strong> Not 20. Just the core ones.</li><li><strong>Do you need user accounts / login?</strong></li><li><strong>Do you already have a tech stack preference?</strong> If not, that’s fine — a common, beginner-friendly combo is:</li><li>Frontend: <a href="https://nextjs.org/"><strong>Next.js</strong></a><strong> + </strong><a href="https://react.dev/"><strong>React</strong></a></li><li>Backend: <a href="https://fastapi.tiangolo.com/"><strong>FastAPI </strong></a><strong>(Python)</strong> or <a href="https://nodejs.org/en"><strong>Node.js</strong></a><strong>/</strong><a href="https://expressjs.com/"><strong>Express</strong></a></li><li>Database: <a href="https://www.postgresql.org/"><strong>PostgreSQL</strong></a></li></ul><p>Write all of this down in a short paragraph. This becomes your “brief” — the first thing you’ll hand to your AI agent.</p><p><strong>Why this step matters:</strong> if you skip it and just say “build me an app,” the AI will guess a lot of things for you, and you’ll spend more time fixing wrong guesses than you would have spent just writing five sentences up front.</p><h3>Step 2: Ask the Agent to Plan Before It Codes</h3><p>This step trips up a lot of beginners. They open the AI tool and immediately say “build the whole app now.”</p><p>Don’t do that.</p><p>Instead, paste your brief and ask something like:</p><blockquote><em>“Based on this brief, propose a project folder structure, a database schema, and a list of API endpoints. Don’t write code yet — just the plan.”</em></blockquote><p>Read through what it gives you. You don’t need to understand every technical detail, but check the basics:</p><ul><li>Does the plan match what you actually asked for?</li><li>Are the main features covered?</li><li>Is anything missing?</li></ul><p>If something looks off, just say so in plain words: “This is missing a way for users to reset their password” or “This database table looks too complicated, can you simplify it?”</p><p>This back-and-forth is where the real quality comes from. Skipping it is the #1 reason people end up with messy AI-built apps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tAkxnhN661pZVZKANJDrrg.png" /><figcaption>Image generated by <a href="https://chatgpt.com/s/m_6a8b204ea6c481919457e961447ca513">ChatGPT</a></figcaption></figure><h3>Step 3: Set Up the Project (Let the Agent Do the Boring Part)</h3><p>Once the plan looks good, it’s time to build the skeleton of the project. Ask the agent to:</p><ul><li>Create the folder structure it proposed</li><li>Set up the backend framework (routes, models, config files)</li><li>Set up the frontend framework with basic pages</li><li>Add a .env file for settings like database passwords</li><li>Write a short README explaining how to run the project</li></ul><p>This part is genuinely boring to do by hand, and it’s exactly what AI agents are great at. Let it handle this so you can save your energy for the parts that actually need your judgment.</p><h3>Step 4: Build the Backend, One Piece at a Time</h3><p>Here’s a mistake beginners make: asking for the <em>entire</em> backend in one message. Don’t. It’s much easier to review small pieces than one giant wall of code.</p><p>Instead, go feature by feature. For example:</p><ol><li>“Add an endpoint to create a new task.”</li><li>Look at the code it wrote. Does it check for missing data? Does it handle errors?</li><li>Ask it to write a quick test for that one endpoint.</li><li>Run the test. If it passes, move to the next feature.</li></ol><p>This loop — <strong>ask, check, test, repeat</strong> — keeps you in control the whole time. It also means if something breaks later, you know roughly where the problem is, instead of digging through 500 lines you never actually read.</p><h3>Step 5: Build the Frontend the Same Way</h3><p>Now connect the parts people will actually see and use.</p><p>Describe pages in terms of what a <em>person</em> should experience, not code terms. For example, instead of saying “build a React component with useState,” say:</p><blockquote><em>“Build a page where I can see my list of tasks, click a checkbox to mark one done, and see a small message pop up confirming it.”</em></blockquote><p>Let the agent figure out the technical “how.” Your job is describing the “what” clearly. Once it builds the page, actually click around it. Does it feel right? Is anything confusing? Say so, in plain words — the agent can usually adjust the layout, spacing, or wording quickly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3onY_gGrgTSM0ZXmmP36vw.png" /><figcaption>Image generated by <a href="https://chatgpt.com/s/m_6a8b20b2d3a481918c4584ae874b56b8">ChatGPT</a></figcaption></figure><h3>Step 6: When Something Breaks (Because It Will)</h3><p>This is normal. Don’t panic, and don’t just say “it’s broken, fix it.” Give the agent something to work with:</p><ul><li>Copy the exact error message and paste it in</li><li>Say what you were doing right before it broke</li><li>Ask it to explain <em>why</em> it happened, not just patch it</li></ul><p>That last part matters more than people realize. If you only ask for a fix, you’ll keep hitting the same kind of bug later. If you ask <em>why</em>, you start learning your own app better — which helps a lot once the project grows.</p><p>This is also a good time to ask for basic safety checks: making sure user input is validated, passwords aren’t stored in plain text, and there’s some kind of rate limiting on your API so it can’t be spammed.</p><h3>Step 7: Put It Online</h3><p>An app sitting on your laptop doesn’t help anyone. Ask the agent to help you:</p><ul><li>Run a production build to catch errors before going live</li><li>Set up environment variables properly for the live version</li><li>Pick a hosting option (<a href="https://vercel.com/">Vercel</a> and <a href="https://railway.com/">Railway</a> are simple and beginner-friendly; a VPS with Nginx works if you want more control)</li><li>Write a short checklist to test after every deploy (does the login work? does the main page load? are there console errors?)</li></ul><p>A tip that saves a lot of headaches: deploy early, even when the app is half-finished. It’s much easier to catch a small problem on day 3 than a big tangled one on day 30.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6nGelWKU9YmqPfRNHdeSWg.png" /></figure><h3>A Few Honest Tips From Doing This a Lot</h3><ul><li><strong>Small requests beat big ones.</strong> “Add a delete button to this task card” works better than “finish the whole app.”</li><li><strong>Read the code, even a little.</strong> You don’t need to understand every line, but skim it like you’d skim an email from a coworker — enough to catch anything odd.</li><li><strong>Keep your brief updated.</strong> As the app grows, update your original notes so the agent (and you) don’t lose track of what the app is supposed to do.</li><li><strong>Test often, not at the end.</strong> Waiting until the whole app is “done” to test it means way more bugs stacked on top of each other.</li><li><strong>Let it handle the boring stuff.</strong> Boilerplate, repeated CRUD code, basic tests — hand these off. Spend your own time on the parts that need real judgment: what the app should do, how it should feel, and whether it’s actually solving the problem you set out to solve.</li></ul><h3>Final Thoughts</h3><p>Building a full-stack app with an AI coding agent isn’t about sitting back and watching code appear. It’s more like directing a very fast, very capable assistant who still needs clear instructions and a second pair of eyes. Plan a little before you type. Work in small pieces. Test as you go. Do that, and you can go from a blank page to a working, live app far faster than doing it all by hand — without losing control over what you’re actually building.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QBjYRuwmAWzfrMdaJKDJKw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0057d46eb632" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Build RAG at Scale: Why Enterprise AI Needs a Platform Mindset]]></title>
            <link>https://bhavikjikadara.medium.com/how-to-build-rag-at-scale-why-enterprise-ai-needs-a-platform-mindset-0aa49f75f7ba?source=rss-9e9f86f6aafd------2</link>
            <guid isPermaLink="false">https://medium.com/p/0aa49f75f7ba</guid>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[enterprise-ai]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[product-management]]></category>
            <dc:creator><![CDATA[Bhavik Jikadara]]></dc:creator>
            <pubDate>Fri, 02 Jan 2026 06:34:22 GMT</pubDate>
            <atom:updated>2026-01-02T06:36:10.616Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*bBx1jyjPhtNnOZmr-_IlSg.png" /></figure><h4>Moving retrieval-augmented generation from impressive demos to reliable, business-ready systems</h4><p>Retrieval-augmented generation (RAG) has become one of the most talked-about ideas in enterprise AI. On paper, it feels like the missing link: combine the reasoning power of large language models with your organization’s own data, and suddenly AI becomes accurate, contextual, and useful.</p><p>And yet, many companies share the same experience. The demo looks great. The pilot works fine. But once RAG is rolled out to real users, across real teams, with real data, cracks start to show. Answers feel inconsistent. Performance slows down. Trust drops. Costs rise.</p><p>This usually leads to the wrong conclusion: <em>“The model isn’t good enough.”</em><br> In reality, the model is rarely the problem.</p><p>RAG doesn’t fail because of AI limitations. It fails because organizations treat it like an LLM feature instead of a long-term platform capability.</p><h3>RAG at scale is an architecture problem, not a prompt problem</h3><p>Most early RAG systems follow a simple pattern: documents are embedded, stored in a vector database, retrieved based on similarity, and passed to a language model. This approach is fine for experiments, internal tools, or narrow use cases.</p><p>But enterprises don’t operate in neat, static environments.</p><p>Policies change. Documents are revised. Knowledge lives in PDFs, emails, wikis, CRMs, spreadsheets, ticketing systems, and chat tools. Different teams use different terminology for the same concept. Some information is authoritative, some is outdated, and some is simply wrong.</p><p>When this complexity hits a simple RAG pipeline, the system doesn’t break loudly. It breaks subtly. It retrieves “almost right” information and confidently turns it into “definitely wrong” answers.</p><p>At scale, RAG becomes less about generation and more about <strong>how knowledge is collected, organized, retrieved, validated, and governed</strong>.</p><h3>Treating enterprise knowledge as a living system</h3><p>One of the biggest mental shifts required for scalable RAG is recognizing that knowledge behaves very differently from code or structured data.</p><ul><li>Knowledge drifts.</li><li>It forks.</li><li>It contradicts itself.</li></ul><p>A scalable RAG system starts with ingestion, not prompts. Documents need to be cleaned, normalized, and broken into consistent chunks. They need metadata that answers basic questions: Where did this come from? How recent is it? Who owns it? Is it authoritative or informational?</p><p>Without this foundation, retrieval quality collapses over time. The AI isn’t hallucinating because it’s creative; it’s hallucinating because it’s being fed ambiguous or outdated context.</p><p>In many organizations, RAG is the first thing that forces them to confront years of neglected knowledge management. That’s uncomfortable, but it’s also where real value begins.</p><h3>Retrieval is the real engine of RAG</h3><p>It’s tempting to think that once documents are embedded, retrieval is “solved.” In practice, retrieval is where most large-scale RAG systems succeed or fail.</p><p>As datasets grow, pure vector similarity becomes noisy. You get content that is semantically related but contextually wrong. A policy summary from three years ago might rank higher than the current policy simply because it uses more similar language.</p><p>This is why production RAG systems start to look less like simple AI pipelines and more like modern search engines.</p><p>They combine multiple strategies:</p><ul><li>Semantic search for meaning</li><li>Keyword or lexical search for precision</li><li>Metadata filters for authority and freshness</li><li>Caching for frequent questions</li><li>Tiered storage for hot vs long-tail knowledge</li></ul><p>The retrieval layer becomes adaptive. It changes how it searches based on the question, the user’s role, and the sensitivity of the information. This is not an optimization detail; it’s the core of the system.</p><p>At scale, retrieval is no longer a supporting step. It <em>is</em> the product.</p><h3>Grounding and validation are non-negotiable</h3><p>Even with strong retrieval, language models are not naturally obedient. They summarize, infer, and fill gaps whether you want them to or not.</p><p>This is why scalable RAG systems explicitly enforce grounding. Prompts are standardized and version-controlled. Answers are required to cite their sources. In high-risk environments, responses are checked by secondary models or rule-based validators before reaching users.</p><p>Think of this as quality control, not mistrust. Just as financial reports go through audits and reviews, AI-generated answers need guardrails when they influence decisions, customers, or compliance.</p><p>Without validation, retrieval becomes optional context instead of a constraint.</p><h3>Why agentic RAG is the natural next step</h3><p>Once the core layers are stable, organizations often introduce agentic behavior. Instead of retrieving once and answering once, the system can reason in steps.</p><p>An agent might:</p><ul><li>Rewrite a vague user question</li><li>Retrieve additional context when confidence is low</li><li>Cross-check answers against constraints</li><li>Call internal APIs to fill missing data</li><li>Escalate or abstain when uncertainty remains high</li></ul><p>This is where RAG moves from “smart search” to “adaptive system.” But agents don’t fix weak foundations. If retrieval is poor or knowledge is messy, agents simply fail faster and more confidently.</p><p>Agentic RAG works only when built on disciplined ingestion, strong retrieval, and clear grounding rules.</p><h3>Where most enterprises go wrong</h3><p>Across industries — technology, marketing, education, operations — the same failure patterns appear:</p><ul><li>Different teams use different chunking and metadata standards</li><li>Documents are updated but embeddings are not</li><li>Retrieval latency grows unnoticed until users complain</li><li>Costs rise without clear visibility into why</li><li>No one owns RAG as a shared platform</li></ul><p>When failures occur, teams lose trust, and RAG quietly gets sidelined.</p><p>The common thread is governance. RAG isn’t something every team should reinvent. It’s a shared capability that needs ownership, observability, and clear architectural boundaries.</p><h3>From prototype to platform</h3><p>The organizations that succeed with RAG don’t necessarily use better models. They use better systems.</p><p>They treat RAG as infrastructure. They invest in ingestion pipelines, retrieval quality, monitoring, and validation. They accept that knowledge is messy and design for that reality instead of fighting it.</p><p>The result isn’t just better AI answers. It’s faster decision-making, more confident teams, and AI systems that people actually trust.</p><p>RAG at scale is not about clever prompts or shiny demos. It’s about building a durable platform that evolves with your business and your knowledge.</p><p>And that’s what separates experiments from products.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0aa49f75f7ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Complete Guide to Building AI Agents with OpenAI AgentKit]]></title>
            <link>https://bhavikjikadara.medium.com/a-complete-guide-to-building-ai-agents-with-openai-agentkit-7ad1d7ad54ec?source=rss-9e9f86f6aafd------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ad1d7ad54ec</guid>
            <category><![CDATA[ai-autonomous-agents]]></category>
            <category><![CDATA[agent-kit]]></category>
            <category><![CDATA[ai-tools]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Bhavik Jikadara]]></dc:creator>
            <pubDate>Sat, 08 Nov 2025 16:35:02 GMT</pubDate>
            <atom:updated>2025-11-08T16:35:02.690Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T8hAHTb5UD9g2I3PVUTjmw.png" /><figcaption>Building AI Agents with OpenAI AgentKit</figcaption></figure><p><a href="https://openai.com/"><strong>OpenAI</strong></a><strong> </strong>recently launched <a href="https://openai.com/index/introducing-agentkit/"><strong>AgentKit</strong></a>, a comprehensive toolkit designed to help developers and enterprises build, deploy, and optimize AI agents. The platform aims to reduce friction in taking agents from prototype to production by providing integrated building blocks that previously required juggling multiple fragmented tools.</p><p>This announcement marks a significant shift in how we approach AI agent development, making it accessible to both technical and non-technical users while maintaining the power and flexibility that developers need.</p><h3>What is AgentKit?</h3><p><a href="https://openai.com/index/introducing-agentkit/">AgentKit</a> is a complete set of building blocks available in the OpenAI platform designed to help you take agents from prototype to production. Think of it as an all-in-one solution that eliminates the need for complex orchestration, custom connectors, manual evaluation pipelines, and fragmented prompt tuning.</p><h4>Core Components</h4><p><a href="https://openai.com/index/introducing-agentkit/">AgentKit</a> consists of four main capabilities:</p><ul><li><strong>Agent Builder: </strong>A visual, fast way to design the logic and steps of your agents, described as “like Canva for building agents”. It’s built on top of the Responses API that hundreds of thousands of developers already use.</li><li><strong>ChatKit: </strong>An embeddable chat interface that developers can integrate into their own applications, allowing them to bring their own brand and workflows.</li><li><strong>Evals for Agents: </strong>Tools to measure AI agent performance, including step-by-step trace grading, datasets for assessing individual agent components, automated prompt optimization, and the ability to run evaluations on external models.</li><li><strong>Connector Registry: </strong>Secure connections to internal tools and third-party systems through an admin control panel while maintaining security and control.</li></ul><h4>Why AgentKit Matters</h4><p>The AI agent landscape has been fragmented, with developers needing to piece together multiple tools and services. AgentKit addresses this by:</p><ul><li><strong>Reducing Development Time</strong>: An OpenAI engineer demonstrated building an entire AI workflow and two AI agents live onstage in under eight minutes</li><li><strong>Simplifying Deployment</strong>: No need to manage separate hosting, versioning, or orchestration tools</li><li><strong>Enabling Optimization</strong>: Built-in evaluation and prompt optimization tools</li><li><strong>Ensuring Security</strong>: Centralized admin controls for enterprise security requirements</li></ul><h4>Best Practices for AgentKit</h4><p><strong>1. Start with Clear Objectives: </strong>Define what your agent should accomplish before building. Create a list of specific tasks and expected behaviors.</p><p><strong>2. Use Structured Workflows: </strong>Break complex tasks into smaller, manageable steps. This makes debugging easier and improves reliability.</p><p><strong>3. Implement Proper Error Handling: </strong>Always include try-catch blocks and graceful fallbacks for when things go wrong.</p><pre>def safe_agent_call(prompt):<br>    try:<br>        response = client.chat.completions.create(<br>            model=&quot;gpt-4&quot;,<br>            messages=[{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: prompt}],<br>            timeout=30<br>        )<br>        return response.choices[0].message.content<br>    except openai.APIError as e:<br>        return f&quot;API Error: {str(e)}&quot;<br>    except openai.Timeout as e:<br>        return &quot;Request timed out. Please try again.&quot;<br>    except Exception as e:<br>        return f&quot;Unexpected error: {str(e)}&quot;</pre><p><strong>4. Monitor and Optimize: </strong>Use the Evals for Agents feature to continuously measure performance and identify areas for improvement.</p><p><strong>5. Secure Your Agents:</strong></p><ul><li>Never hardcode API keys</li><li>Use environment variables</li><li>Implement rate limiting</li><li>Validate all inputs</li><li>Use the connector registry for secure integrations</li></ul><h3>Getting Started with AgentKit: Python Examples</h3><p>Let’s explore how to build AI agents using <a href="https://openai.com/index/introducing-agentkit/">AgentKit</a> with practical Python examples.</p><p><a href="https://github.com/Bhavik-Jikadara/ai-customer-service-agent">GitHub - Bhavik-Jikadara/ai-customer-service-agent: This production-ready AI system automates customer support with multi-step workflows, tool integration, stateful conversations, and real-time performance monitoring.</a></p><h3>Real-World Use Cases</h3><ul><li><strong>Customer Support Automation: </strong>Build agents that handle common inquiries, route complex issues to humans, and maintain conversation context.</li><li><strong>Content Generation Pipelines:</strong> Create workflows that research, outline, draft, and refine content automatically.</li><li><strong>Data Analysis Assistants: </strong>Develop agents that query databases, analyze results, generate insights, and create visualizations.</li><li><strong>Internal Tool Automation: </strong>Build agents that interact with your internal systems, automate repetitive tasks, and streamline workflows.</li></ul><h3>Conclusion</h3><p>OpenAI’s AgentKit represents a significant leap forward in making AI agent development accessible and practical. By providing an integrated platform with visual builders, evaluation tools, and secure connectors, it removes many of the traditional barriers to agent development.</p><p>Whether you’re building simple chatbots or complex multi-step automation workflows, AgentKit provides the tools you need to go from prototype to production quickly and reliably.</p><p>The Python examples provided in this guide demonstrate the fundamental patterns for building effective agents. Start with simple use cases, iterate based on evaluation results, and gradually increase complexity as you become more comfortable with the platform.</p><h3>Additional Resources</h3><ul><li><strong>OpenAI Documentation</strong>: <a href="https://docs.openai.com/">https://docs.openai.com</a></li><li><strong>AgentKit Platform</strong>: <a href="https://openai.com/agent-platform/">https://openai.com/agent-platform/</a></li><li><strong>OpenAI API Reference</strong>: <a href="https://platform.openai.com/docs/api-reference">https://platform.openai.com/docs/api-reference</a></li></ul><p>Happy building! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ad1d7ad54ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Large Language Models (LLMs) Work]]></title>
            <link>https://medium.com/ai-agent-insider/how-large-language-models-llms-work-50abd479bbf9?source=rss-9e9f86f6aafd------2</link>
            <guid isPermaLink="false">https://medium.com/p/50abd479bbf9</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[naturallanguageprocessing]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Bhavik Jikadara]]></dc:creator>
            <pubDate>Wed, 08 Oct 2025 14:48:41 GMT</pubDate>
            <atom:updated>2025-10-08T14:50:46.630Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9X2IK2EtHefM55Yt0_WT0w.png" /><figcaption>How Large Language Models (LLMs) Work</figcaption></figure><h4>Discover how Large Language Models (LLMs) like GPT, Claude, and Gemini work. Learn their architecture, training process, applications, limitations, and future trends shaping AI.</h4><h3>Introduction to LLMs</h3><h4>Definition and Purpose</h4><p>A <strong>Large Language Model (LLM)</strong> is a type of machine learning model trained on a vast amount of text data to understand and generate human language. These models are designed for <strong>natural language processing (NLP)</strong> tasks, with a core capability in <strong>language generation</strong>. They acquire predictive power regarding the syntax, semantics, and ontologies inherent in human language corpora.</p><p>LLMs are a class of <strong>foundation models</strong> — powerful, general-purpose systems that can be adapted to a wide range of tasks. They serve as the core technology behind AI chatbots like <a href="https://chatgpt.com/"><strong>ChatGPT</strong></a><strong>, </strong><a href="https://gemini.google.com/"><strong>Gemini</strong></a><strong>, and </strong><a href="https://claude.ai/new"><strong>Claude</strong></a>, and can be customized for specific applications through a process called <strong>fine-tuning</strong> or guided via <strong>prompt engineering</strong>.</p><h4>Brief History and Evolution</h4><p>The evolution of LLMs represents a journey of increasing scale and architectural innovation in AI and NLP:</p><p><strong>Early Foundations (1990s-2000s):</strong> Before transformers, language models were based on statistical methods and simpler neural networks. <strong>IBM’s statistical models</strong> and smoothed <strong>n-gram models</strong> laid the groundwork for corpus-based language modeling.</p><p><strong>The Neural Network Shift (2010s):</strong> Following breakthroughs in deep learning, architectures like <strong>Word2Vec</strong> (2013) and <strong>LSTMs</strong> (Long Short-Term Memory) advanced language modeling. In 2016, Google transitioned its translation service to neural machine translation (NMT), replacing older statistical models.<br><strong>The Transformer Revolution (2017): </strong>The landmark paper “<strong>Attention Is All You Need</strong>” introduced the <strong>transformer architecture</strong>, which replaced recurrence with <strong>self-attention</strong>. This allowed for efficient parallelization, longer context handling, and scalable training on unprecedented data volumes.<br><strong>The Era of Modern LLMs (2018-Present):</strong> The transformer architecture enabled a new generation of models. <strong>BERT</strong> (2018) was an influential encoder-only model. <strong>GPT-2</strong> (2019) and <strong>GPT-3</strong> (2020) demonstrated the power of decoder-only models for text generation. The 2022 release of the consumer-facing <a href="https://chatgpt.com/"><strong>ChatGPT</strong></a> brought LLMs to widespread public attention, showcasing their capabilities in conversational AI. Recent advancements include <strong>multimodal models</strong> (LMMs) that process text, images, and audio, and reasoning models like <a href="https://openai.com/o1/"><strong>OpenAI o1</strong></a> and <a href="https://api-docs.deepseek.com/news/news250120"><strong>DeepSeek R1</strong></a> that generate complex chains of thought.</p><h3>How LLMs Work</h3><h4>Overview of the Underlying Architecture</h4><p>Most state-of-the-art LLMs are based on the transformer architecture. This architecture fundamentally changed AI by enabling parallel processing of entire sequences of data, overcoming the limitations of previous sequential models like RNNs and LSTMs. A text-generative transformer’s core operation is next-token prediction: given a sequence of words (a prompt), it predicts the most probable next token (a word or sub-word).</p><p>Every text-generative transformer consists of three key components:</p><ol><li><strong>Embedding Layer:</strong> Converts input text into a numerical format.</li><li><strong>Transformer Blocks:</strong> The core processing units that capture contextual relationships between words. Multiple blocks are stacked sequentially.</li><li><strong>Output Layer:</strong> Transforms the processed information into probabilities for the next token.</li></ol><p>The following table outlines the fundamental components of a transformer model and their functions:</p><p>ComponentPrimary FunctionKey ConceptsEmbedding LayerConverts input tokens into numerical vectors.Tokenization, Token Embeddings, Positional EncodingTransformer BlockProcesses tokens to understand context and relationships.Self-Attention, Multi-Head Attention, Feed-Forward Network (FFN)Output LayerGenerates a probability distribution over the vocabulary to predict the next token.Linear Layer, Softmax, Sampling (Temperature, top-k, top-p)</p><h4>Explanation of the Training Process</h4><p>Training an LLM is a multi-stage process that requires immense computational resources.</p><ol><li><strong>Pre-training:</strong> This is the most computationally intensive and costly phase. The model is trained on a massive, unlabeled text corpus (often hundreds of gigabytes or terabytes) to learn the fundamental patterns of language by performing next-token prediction. Through this self-supervised learning, the model builds a statistical understanding of grammar, facts, and reasoning. The cost of pre-training models like GPT-3 can run into millions of dollars, with newer models like GPT-4 and Gemini Ultra costing over $100 million.</li><li><strong>Fine-tuning:</strong> After pre-training, the base model can be further trained, or fine-tuned, on smaller, specific datasets to excel at particular tasks (e.g., legal document analysis, medical Q&amp;A, or adopting a specific conversational style). A common technique is Instruction Fine-Tuning, where the model is trained on instruction-output pairs to better follow user commands. Another advanced method is Reinforcement Learning from Human Feedback (RLHF), which fine-tunes the model based on human preferences to improve the quality, safety, and alignment of its outputs.</li></ol><h4>The Role of Tokenization</h4><p>Tokenization is the process of breaking down raw text into smaller, manageable units called tokens, which form the model’s vocabulary. Since machine learning models process numbers, not text, tokenization is a crucial first step.</p><ul><li>Why it’s needed: A computer sees text as a long sequence of characters. Tokenization defines what “elements” the model will predict.</li><li>Subword Tokenization: Modern LLMs use a hybrid approach. Instead of using only whole words (which leads to a huge, inflexible vocabulary) or only characters (which makes learning high-level patterns hard), they use subword tokenization. Techniques like Byte-Pair Encoding (BPE) start with a vocabulary of individual characters and iteratively merge the most frequent pairs of existing tokens to create new subwords.</li><li>Example: A word like “jumped” might be a single token, while “jumping” might be split into two tokens: “jump” and “ing”. This balances vocabulary size with the ability to handle rare or unseen words.</li></ul><h4>Understanding Attention Mechanisms</h4><p>The attention mechanism is the core innovation that makes transformers so powerful.</p><ul><li><strong>Purpose</strong>: Attention allows the model to dynamically weigh the importance of different words in a sequence when processing another word. It helps the model capture long-range dependencies and contextual relationships, regardless of the distance between words. For example, when processing the word “it” in a sentence, the attention mechanism helps the model determine whether “it” refers to the “wolf” or the “rabbit”.</li><li><strong>Self-Attention:</strong> In the context of transformers, this is often called self-attention because it operates on all the words in the same input sequence. For each token, self-attention generates three vectors: a Query, a Key, and a Value.</li><li><strong>Query (Q): </strong>The token that is “asking for information.”</li><li><strong>Key (K):</strong> A token that “can answer” the query. The model computes a score based on the similarity between the Query and all Keys.</li><li><strong>Value (V):</strong> The actual information that is retrieved from a token once its Key is deemed relevant.</li><li><strong>Multi-Head Attention:</strong> Transformers use multiple attention “heads” in parallel. Each head can learn to focus on different types of relationships — for example, one head might track grammatical agreement, while another tracks semantic meaning — allowing the model to develop a richer, multi-faceted understanding of the text.</li></ul><h3>Key Concepts and Techniques</h3><h4>Embeddings</h4><p>An embedding is a high-dimensional vector (a list of numbers) that represents a token numerically. These vectors are designed to capture the semantic meaning of words; tokens with similar meanings or usage are placed close together in this vector space. For instance, the embeddings for “king,” “queen,” and “prince” would be geometrically closer to each other than to the embedding for “car.” The model looks up these embeddings from a massive matrix stored in its parameters before processing begins.</p><h4>Pretraining and Fine-Tuning</h4><p>As outlined in the training section, this two-stage process is fundamental to LLM development.</p><ul><li>Pretraining is the foundation-building phase, giving the model a broad, general understanding of language.</li><li>Fine-tuning is the specialization phase, adapting the general model to specific tasks or behaviors, which is far more computationally efficient than training from scratch.</li></ul><h4>Supervised vs. Unsupervised Learning</h4><p>The training of LLMs blends concepts from both supervised and unsupervised learning.</p><ul><li><strong>Unsupervised Learning:</strong> The initial pre-training stage is fundamentally self-supervised. The model learns from vast amounts of unlabeled text by trying to predict the next word or a masked word, without human-provided labels.</li><li><strong>Supervised Learning:</strong> The fine-tuning stage often uses supervised learning. The model is trained on smaller, labeled datasets, where each input (e.g., an instruction) is paired with a desired output (e.g., the correct response).</li></ul><h4>Large-Scale Datasets</h4><p>LLMs are voracious consumers of data. The scale and quality of their training datasets are primary drivers of their capabilities. These datasets are categorized by their use:</p><ul><li><strong>Pre-training Corpora:</strong> Massive collections of text from sources like books, websites, and code repositories. The total data size for modern models can surpass 774.5 TB.</li><li><strong>Instruction Fine-Tuning Datasets:</strong> Curated sets of prompts and ideal responses used to teach the model to follow instructions.</li><li><strong>Preference Datasets:</strong> Used for RLHF, containing human or AI judgments on which of several model outputs is better, helping to align the model with human values.</li></ul><h3>Applications of LLMs</h3><p>LLMs have moved beyond research labs to create impact across numerous domains.</p><h4>NLP Tasks and Real-World Use Cases</h4><ul><li><strong>Translation and Summarization:</strong> Accurately translating languages and condensing long documents into concise summaries.</li><li><strong>Question Answering and Chatbots:</strong> Powering sophisticated conversational agents for customer service, technical support, and personal assistants.</li><li><strong>Content Generation:</strong> Writing articles, marketing copy, poetry, and computer code. For example, a transformer can be prompted with “Data visualization empowers users to…” and generate a coherent continuation.</li><li><strong>Knowledge Retrieval and Automated Reasoning:</strong> Answering complex questions by retrieving information and performing multi-step reasoning, a capability that previously required bespoke systems.</li></ul><h4><strong>Industries Making an Impact</strong></h4><ul><li><strong>Healthcare:</strong> Assisting with medical documentation, literature review, and imaging analysis.</li><li><strong>Finance:</strong> Used for sentiment analysis of market news, generating financial reports, and detecting fraud.</li><li><strong>Customer Service:</strong> Automating and personalizing customer interactions through intelligent chatbots.</li><li><strong>Legal: </strong>Aiding in legal research, contract review, and summarizing case law.</li><li><strong>Creative Arts:</strong> Helping writers, musicians, and artists brainstorm ideas and generate creative content.</li></ul><h3>Challenges and Limitations of LLMs</h3><h4>Ethical Concerns and Biases</h4><p>LLMs can reflect and even amplify biases present in their training data. These biases can manifest as:</p><ul><li><strong>Gender and Racial Bias:</strong> Associating certain professions with a specific gender or attributing negative traits to specific racial groups.</li><li><strong>Cultural and Socioeconomic Bias:</strong> Over-representing Western perspectives or the viewpoints of affluent communities, thereby marginalizing other cultures and solutions to problems like poverty.<br>Mitigation strategies include using more diverse training data, applying fairness-aware algorithms, and conducting frequent audits.</li></ul><h4>Model Interpretability</h4><p>Understanding <em>why</em> an LLM produces a particular output — a field known as mechanistic interpretability — is a major challenge. Researchers seek to reverse-engineer model components to understand how specific behaviors or outputs are produced, which is critical for detecting and mitigating safety concerns before deployment. This field is being rethought with the help of LLMs themselves, which can be used to generate natural language explanations, though this raises new challenges like hallucinated explanations.</p><h4>Computational Costs</h4><p>The financial and environmental cost of training and deploying LLMs is substantial. Training a model like GPT-3 can cost millions of dollars in computing resources alone, while GPT-4’s cost reportedly exceeded $100 million. This creates a high barrier to entry for academic institutions and smaller companies. Deployment also requires significant resources, leading to the rise of pay-per-token cloud services as a more accessible alternative to self-hosting.</p><h4>Handling Ambiguities and Inaccuracies</h4><p>LLMs can sometimes produce hallucinations — factually incorrect or nonsensical text presented with confidence. They can also be sensitive to slight changes in input phrasing and struggle with tasks requiring deep, nuanced reasoning or real-world common sense. Techniques like chain-of-thought prompting (encouraging the model to “think step-by-step”) are being developed to improve reasoning and reduce errors.</p><h3>Future of LLMs</h3><p>The field of LLMs is advancing at a rapid pace, with several key trends shaping its future.</p><h4>Advancements in Architecture and Training</h4><ul><li><strong>Architectural Refinements:</strong> While the core transformer remains, new variations are improving efficiency and performance. Mixture-of-Experts (MoE) models, like DeepSeek-V3, activate only a small subset of their total parameters (e.g., 37B out of 671B) for a given input, making massive models more efficient to run. Grouped-Query Attention (GQA) and Multi-Head Latent Attention (MLA) are also being adopted to reduce memory usage during inference.</li><li><strong>New Architectures: </strong>While transformers dominate, new architectures like Mamba (a state space model) are emerging as potential competitors, offering efficient alternatives for sequence modeling.</li><li><strong>Synthetic Data: </strong>As high-quality natural language data becomes scarce, researchers are exploring using LLMs themselves to generate high-quality synthetic data for training future models.</li></ul><h4>Multimodal Models</h4><p>The integration of LLMs with other data types is a major frontier. Large Multimodal Models (LMMs) can process and generate not just text, but also images, audio, and video, leading to more versatile AI systems that can understand the world in a more holistic way.</p><h4>The Future of Human-AI Interaction</h4><p>LLMs are poised to become more deeply integrated into our daily lives and workflows. They will likely evolve from tools we explicitly query to proactive assistants that can reason, plan, and take actions on our behalf. Ensuring these systems are aligned with human values and goals remains a critical area of research.</p><h3>Conclusion</h3><p><strong>Large Language Models</strong> represent a profound shift in artificial intelligence. Built on the transformer architecture and trained on unprecedented scales of data, they have moved from being niche research projects to general-purpose technologies with wide-ranging applications across society.</p><p>While their capabilities in language generation, summarization, translation, and reasoning are remarkable, they are not without significant challenges. Issues of bias, cost, interpretability, and reliability are active and critical areas of research and development.</p><p>The field continues to evolve rapidly, with advancements in model efficiency, multimodality, and reasoning pushing the boundaries of what is possible. As LLMs become more capable and integrated into our world, a thoughtful approach to their development and deployment — one that balances innovation with ethical considerations — will be essential for harnessing their full potential for the benefit of humanity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50abd479bbf9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ai-agent-insider/how-large-language-models-llms-work-50abd479bbf9">How Large Language Models (LLMs) Work</a> was originally published in <a href="https://medium.com/ai-agent-insider">AI Agent Insider</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GPT-OSS 120B & 20B: Open Source Mixture of Experts Models by OpenAI]]></title>
            <link>https://medium.com/ai-agent-insider/gpt-oss-120b-20b-open-source-mixture-of-experts-models-by-openai-9581d76cf287?source=rss-9e9f86f6aafd------2</link>
            <guid isPermaLink="false">https://medium.com/p/9581d76cf287</guid>
            <category><![CDATA[gpt-oss]]></category>
            <category><![CDATA[openai-open-source-model]]></category>
            <category><![CDATA[transformers]]></category>
            <category><![CDATA[gpt-oss-120b]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Bhavik Jikadara]]></dc:creator>
            <pubDate>Thu, 07 Aug 2025 17:25:44 GMT</pubDate>
            <atom:updated>2025-08-07T17:25:44.989Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*tAvhdwI3oEEPA9vpDwB2ew.jpeg" /><figcaption><a href="https://i.ytimg.com/vi/guHW1Eb3xSs/hq720.jpg?sqp=-oaymwEhCK4FEIIDSFryq4qpAxMIARUAAAAAGAElAADIQj0AgKJD&amp;rs=AOn4CLDhHYBns_hD45ToW4lsUEvmNLTwzA">Image Source</a> — Open Models gpt-oss 120B &amp; 20B</figcaption></figure><h4>Explore the capabilities of OpenAI’s new open-source models — GPT-OSS 120B and 20B. Learn about their architecture, active parameters per token, expert layers, memory requirements, and how they compare to existing LLMs. Perfect for AI researchers, engineers, and open-source enthusiasts.</h4><p>Open-source just got a major upgrade. OpenAI has launched two powerful open-weight models — <strong>gpt-oss-120B</strong> and <strong>gpt-oss-20B</strong> — and they’re here to reshape the landscape of reasoning-focused AI. These aren’t just smaller siblings of GPT-4o — they’re battle-tested, tool-using, high-performing models that anyone can run, fine-tune, and deploy on their own hardware.</p><p>In this post, I’ll break down what makes these models exciting, why they matter, and how you can get started.</p><h3>🧠 Why GPT-OSS Matters</h3><p>Until now, most top-tier models have been tightly gated behind APIs or behind paywalls. GPT-OSS changes that by offering:</p><ul><li>✅ <strong>Apache 2.0 License</strong> — Yes, that means commercial use is allowed.</li><li>✅ <strong>Open Weights + Tokenizer (o200k_harmony)</strong></li><li>✅ <strong>Competitive Reasoning &amp; Tool Use</strong></li><li>✅ <strong>Local Deployability on Consumer Hardware</strong></li></ul><p>This is a huge leap in <strong>democratizing AI access</strong>, especially for researchers, developers in emerging markets, or organizations with strict data control needs.</p><h3>🔍 Two Models, Two Sizes, Many Possibilities</h3><p>These models use <strong>Mixture of Experts (MoE)</strong>, meaning only a subset of the total parameters are active per inference — making them significantly more efficient than dense models of the same size.</p><p>Here’s your table converted into clear and concise bullet points:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*nFxYsfOMvnpmJDuhxuTaYQ.png" /></figure><p>🧪 You could run gpt-oss-20B on a laptop. Think about the possibilities that unlocks.</p><h3>🧰 Real-World Performance — Not Just Benchmarks</h3><p>These aren’t “just another open model.” GPT-OSS models perform impressively across several high-value domains:</p><p>📌 <strong>Coding &amp; Competition Math:</strong> Outperforms Open Ai&#39;s own o3-mini and nearly matches o4-mini.</p><p>📌 <strong>HealthBench:</strong> Performs better than many proprietary models, tackling realistic health queries with nuance.</p><p>📌 <strong>Tool Use &amp; Function Calling:</strong> Excellent support for few-shot and agentic workflows, including web search and Python code execution.</p><p>📊 Here’s a preview of how gpt-oss-120B stacks up:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VOFlda6Or4OEoIr421uh2A.png" /><figcaption>CodeforcesCompetition code</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JajkQx2gBrDYItdc-MjlRQ.png" /><figcaption>Humanity’s Last ExamExpert-level questions across subjects</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UDZi04RQOkceGrBouHAh2A.png" /><figcaption>AIMECompetition math</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4JkG_feeTtxHtzwwloGgyg.png" /><figcaption>GPQA Diamond (tools)PhD-level science questions</figcaption></figure><h3>🔄 Trained Like the Pros</h3><p>These models weren’t rushed out the door. They went through the same rigorous pre-training and post-training processes as proprietary OpenAI models:</p><ul><li><strong>Supervised fine-tuning</strong></li><li><strong>High-compute reinforcement learning</strong></li><li><strong>Deliberate instruction following with CoT reasoning</strong></li></ul><p>You can even toggle between <strong>low, medium, and high reasoning effort</strong>, based on your latency needs — all with a simple system message.</p><h3>🛡️ Built with Safety in Mind</h3><p>Open-weight models bring risks. Open AI knows this — and took it seriously.</p><p>They adversarial fine-tuned the models (like a red team hacker would) and ran them through their <strong>Preparedness Framework</strong>. Even when optimized for misuse, the models didn’t reach dangerous levels. This is a first-of-its-kind safety benchmark for open LLMs.</p><p>Also, a $500,000 Red Teaming Challenge is live to help catch edge-case issues in the wild. 🧪💥</p><h3>🧩 Ecosystem &amp; Deployment Support</h3><p>Ready to try them out? You’re in luck.</p><p>You can run these models on:</p><ul><li>Hugging Face 🤗: <a href="https://huggingface.co/openai/gpt-oss-120b">openai/gpt-oss-120b</a> and <a href="https://huggingface.co/openai/gpt-oss-20b">openai/gpt-oss-20b</a></li><li><a href="https://ollama.com/library/gpt-oss">Ollama</a></li><li><a href="https://docs.vllm.ai/projects/recipes/en/latest/OpenAI/GPT-OSS.html">vLLM</a></li><li><a href="https://lmstudio.ai/models/openai/gpt-oss-20b">LM Studio</a></li></ul><p>Whether you’re using NVIDIA GPUs, AMD chips, or even Cerebras wafers — you’re covered.</p><p>🛠️ And yes, you can fine-tune them too.</p><h3>🎯 Who Should Use GPT-OSS?</h3><p>If you’re a…</p><ul><li>🧑‍💻 <strong>Developer</strong> building on-device AI</li><li>🧠 <strong>Researcher</strong> exploring CoT reasoning</li><li>🏢 <strong>Enterprise</strong> with privacy requirements</li><li>🌍 <strong>Startup in emerging markets</strong> seeking cost-effective models</li></ul><p>…then GPT-OSS is worth your time.</p><h3>🎨 Final Thoughts + What’s Next</h3><p>GPT-OSS shows us what’s possible when <strong>open models meet top-tier engineering</strong>. These aren’t second-class citizens — they’re frontier-grade models running in your own environment.</p><p>This release is a major win for transparency, innovation, and accessibility.</p><p>🔗 <strong>Explore the models on Hugging Face</strong><br> 🔗 <strong>Read the model cards</strong><br> 🔗 <strong>Join the Red Teaming Challenge</strong></p><p>Let’s push the boundaries of what open AI can do — together. 💪</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9581d76cf287" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ai-agent-insider/gpt-oss-120b-20b-open-source-mixture-of-experts-models-by-openai-9581d76cf287">GPT-OSS 120B &amp; 20B: Open Source Mixture of Experts Models by OpenAI</a> was originally published in <a href="https://medium.com/ai-agent-insider">AI Agent Insider</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prune, Don’t Just Re-Rank: The Secret to Cutting Hallucinations in Retrieval-Augmented Generation…]]></title>
            <link>https://bhavikjikadara.medium.com/prune-dont-just-re-rank-the-secret-to-cutting-hallucinations-in-retrieval-augmented-generation-29840f8f725f?source=rss-9e9f86f6aafd------2</link>
            <guid isPermaLink="false">https://medium.com/p/29840f8f725f</guid>
            <category><![CDATA[ai-hallucination]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[content-pruning]]></category>
            <category><![CDATA[naturallanguageprocessing]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Bhavik Jikadara]]></dc:creator>
            <pubDate>Mon, 07 Jul 2025 12:52:15 GMT</pubDate>
            <atom:updated>2025-07-07T12:52:15.846Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GQAli0Ydx1B8ShZzK95jSA.jpeg" /><figcaption>Prune, Don’t Just Re-Rank</figcaption></figure><h3>Prune, Don’t Just Re-Rank: The Secret to Cutting Hallucinations in Retrieval-Augmented Generation (RAG)</h3><h4>How smart context pruning slashes irrelevant data to make AI answers sharper and more reliable</h4><p>Imagine you’re trying to find a needle in a haystack, but instead of just one haystack, you have dozens, and each is full of bits and pieces — some useful, some not. This is exactly the challenge faced by <strong>Retrieval-Augmented Generation (RAG)</strong> systems, which combine <strong>large language models (LLMs)</strong> with external documents to answer questions. But here’s the catch: if the context you feed into the <strong>LLM </strong>is noisy or irrelevant, you get garbage out — hallucinations, inaccuracies, and confusion.</p><p>In this post, I’ll walk you through a clever trick that can drastically reduce hallucinations in <strong>RAG </strong>systems by going beyond traditional re-ranking. It’s called context pruning, and it’s about cutting out the irrelevant parts of your retrieved documents, not just sorting them better.</p><h4>Why Re-Ranking Isn’t Enough</h4><p>In a typical RAG setup, when you ask a question, the system retrieves a bunch of document chunks that might contain the answer. Since you can’t feed the entire knowledge base into the model, you pick the top <em>K</em> chunks based on relevance. To improve quality, a re-ranker then sorts these chunks to keep only the most relevant ones.</p><p>Sounds good, right? But here’s the problem: even within a relevant chunk, not every sentence is useful. Imagine a chunk about a research paper that mentions the training cost of a model but also includes unrelated tables or background info. Feeding the entire chunk means the model gets distracted by irrelevant details, leading to hallucinations.</p><h4>Enter Context Pruning: Snipping Out the Noise</h4><p>Instead of just re-ranking whole chunks, what if you could prune each chunk to keep only the sentences that matter? This is the idea behind a new technique inspired by the paper <em>Provenance Efficient and Robust Context Pruning for Retrieval-Augmented Generation</em>.</p><p>Think of it like editing a long article down to a summary that only includes the parts answering your question. The pruning model looks at each sentence in the chunk, scores its relevance, and discards the rest. But it’s smarter than just checking sentences in isolation — it keeps the local context so the meaning isn’t lost.</p><p>For example, if you ask, “What is the total training cost of the DeepC3 model?” the pruning model will remove unrelated sentences about training mechanisms or tables and keep only the exact sentence mentioning the cost. This reduces the input size drastically — from thousands of tokens to a few hundred — making the LLM’s job easier and more accurate.</p><h4>Real-Life Impact: Less Hallucination, More Precision</h4><p>In practice, this pruning step can cut down the context size by about 80%, while improving answer accuracy. One demo showed how the system initially missed the exact GPU hour count because the relevant chunk was buried among irrelevant details. After pruning, the model found the precise number and gave a correct answer.</p><p>This is a game-changer for anyone building RAG systems. Instead of blindly trusting re-rankers to filter documents, pruning lets you surgically remove noise within each chunk. It’s like having a personal editor who highlights only the juicy bits relevant to your question.</p><p>Here’s a simple example illustrating the difference between re-ranking whole chunks and pruning sentences within chunks in a Retrieval-Augmented Generation (RAG) setup, using Python-like pseudocode:</p><pre># Example user query<br>query = &quot;What is the total training cost of DeepC3 model?&quot;<br><br># Retrieved document chunk (large, noisy)<br>chunk = &quot;&quot;&quot;<br>The DeepC3 model training involved various mechanisms. <br>Total training cost was 5.576 million GPU hours. <br>Here is a table of hyperparameters used in training.<br>Additional unrelated info about model architecture.<br>&quot;&quot;&quot;<br><br># Traditional re-ranking (keeps or discards whole chunks)<br>def rerank(chunks, query):<br>    # Scores relevance of whole chunks to query<br>    return [chunk for chunk in chunks if &quot;training cost&quot; in chunk]<br><br># Pruning sentences inside chunk (keeps only relevant sentences)<br>def prune_chunk(chunk, query):<br>    sentences = chunk.split(&#39;. &#39;)<br>    relevant_sentences = [s for s in sentences if &quot;training cost&quot; in s or &quot;GPU hours&quot; in s]<br>    return &#39;. &#39;.join(relevant_sentences)<br><br># Using re-ranker<br>reranked_chunks = rerank([chunk], query)<br>print(&quot;Re-ranked chunk:&quot;)<br>print(reranked_chunks[0])<br><br># Using pruning<br>pruned_chunk = prune_chunk(chunk, query)<br>print(&quot;\nPruned chunk:&quot;)<br>print(pruned_chunk)</pre><p>Output:</p><pre>Re-ranked chunk:<br>The DeepC3 model training involved various mechanisms. <br>Total training cost was 5.576 million GPU hours. <br>Here is a table of hyperparameters used in training.<br>Additional unrelated info about model architecture.<br><br>Pruned chunk:<br>Total training cost was 5.576 million GPU hours</pre><p>Explanation:</p><ul><li>The re-ranker keeps or discards entire chunks based on relevance but can still pass noisy or irrelevant sentences.</li><li>The pruner goes deeper by filtering out irrelevant sentences inside a chunk, feeding the LLM only the most relevant information, reducing noise and hallucination risk.</li></ul><h4>What About Speed and Licensing?</h4><p>Of course, pruning adds a small extra step, so it might take a couple of seconds longer depending on how much text you process. Also, the current pruning model is not licensed for commercial use, but since the training recipe is public, we can expect open-source versions soon.</p><h4>Conclusion</h4><p>If you’re working with retrieval-augmented generation, don’t just settle for re-ranking. Pruning is the next frontier to reduce hallucinations and improve answer quality by feeding your LLM only the most relevant, distilled information.</p><p>Think of it as upgrading from a messy filing cabinet to a neatly organized, searchable archive where every document is trimmed to perfection. This simple trick can save you time, improve accuracy, and make your AI-powered systems more trustworthy.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29840f8f725f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[‍ Why Developers Are Switching to UV and How to Install It]]></title>
            <link>https://medium.com/ai-agent-insider/why-developers-are-switching-to-uv-and-how-to-install-it-c008a4c3ad73?source=rss-9e9f86f6aafd------2</link>
            <guid isPermaLink="false">https://medium.com/p/c008a4c3ad73</guid>
            <category><![CDATA[uv]]></category>
            <category><![CDATA[package]]></category>
            <category><![CDATA[installation]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[pip]]></category>
            <dc:creator><![CDATA[Bhavik Jikadara]]></dc:creator>
            <pubDate>Tue, 15 Apr 2025 12:41:55 GMT</pubDate>
            <atom:updated>2025-04-15T12:41:55.044Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*Glk115plwSKV__xV9SLeuQ.png" /><figcaption><strong>Why Developers Are Switching to UV and How to Install It</strong></figcaption></figure><h4>A practical overview of UV’s growing popularity, and a step-by-step guide to install it quickly and safely.</h4><p>UV is becoming the go-to tool for Python developers who want faster, modern workflows. This post explores why UV is gaining traction in the dev community and gives you a detailed step-by-step guide to installing it — no matter your OS or toolchain.</p><h3>🚀 Why Are Developers Switching to UV?</h3><p>Here’s the scoop — UV isn’t just another Python tool. It’s a <strong>blazing fast, Rust-powered CLI</strong> that makes Python tooling feel <em>modern</em> again. Think pip, pipx, venv, and even poetry-level workflows — but unified and faster. Here’s why developers are jumping ship to UV:</p><ul><li><strong>Speed</strong>: Thanks to Rust under the hood, UV installs and resolves dependencies faster than pip or Poetry.</li><li><strong>All-in-one</strong>: It combines features of pip, venv, pipx, and virtualenv into a single tool.</li><li><strong>Isolated environments by default</strong>: No more manually setting up venv. UV handles it out of the box.</li><li><strong>Cross-platform support</strong>: macOS, Linux, and Windows-friendly.</li><li><strong>Modern UX</strong>: Cleaner CLI with better defaults and built-in shell autocompletion.</li></ul><p>Whether you’re managing Python projects, testing across environments, or just tired of juggling pip, venv, and other tools, UV simplifies it all.</p><h3>🔧 How to Install UV (Multiple Ways)</h3><p>Let’s get into how you can install UV — based on what’s best for your system or preference.</p><h4>🔹 1. Standalone Installer (Recommended)</h4><p>The fastest way to get started. Just run one of the following:</p><p><strong>Using </strong><strong>curl:</strong></p><pre># macOS/Linux<br>curl -LsSf https://astral.sh/uv/install.sh | sh<br><br># Windows<br>powershell -ExecutionPolicy ByPass -c &quot;irm https://astral.sh/uv/install.ps1 | iex&quot;</pre><p><strong>Using </strong><strong>wget:</strong></p><pre>wget -qO- https://astral.sh/uv/install.sh | sh</pre><p>Install a specific version:</p><pre># macOS/Linux<br>curl -LsSf https://astral.sh/uv/0.6.14/install.sh | sh<br><br># Windows<br>powershell -ExecutionPolicy ByPass -c &quot;irm https://astral.sh/uv/0.6.14/install.ps1 | iex&quot;</pre><h4>🔹 2. PyPI / pipx</h4><p>Install via <a href="https://github.com/pypa/pipx">pipx</a> to keep UV isolated:</p><pre>pipx install uv</pre><p>Or via pip (you might need Rust toolchain if no wheel is available):</p><pre>pip install uv</pre><h4>🔹 3. Cargo (Rust)</h4><p>Ideal if you’re already using Rust:</p><pre>cargo install --git https://github.com/astral-sh/uv uv</pre><h4>🔹 4. Homebrew (macOS/Linux)</h4><pre>brew install uv</pre><h4>🔹 5. WinGet (Windows)</h4><pre>winget install --id=astral-sh.uv -e</pre><h4>🔹 6. Scoop (Windows)</h4><pre>scoop install main/uv</pre><h3>🔁 How to Upgrade UV</h3><p>If installed via the standalone installer:</p><pre>uv self update</pre><p>To avoid shell profile modifications:</p><pre>export INSTALLER_NO_MODIFY_PATH=1</pre><p>If using pip:</p><pre>pip install --upgrade uv</pre><h3>⚙️ Add Shell Autocompletion (Optional but Nice)</h3><p>For Bash</p><pre>echo &#39;eval &quot;$(uv generate-shell-completion bash)&quot;&#39; &gt;&gt; ~/.bashrc</pre><p>Then reload your terminal.</p><h3>🧼 Uninstalling UV</h3><p>Clean up data:</p><pre>uv cache clean<br>rm -r &quot;$(uv python dir)&quot;<br>rm -r &quot;$(uv tool dir)&quot;</pre><p>Remove binaries:</p><pre><br># macOS/Linux<br>rm ~/.local/bin/uv ~/.local/bin/uvx<br><br># Windows<br>rm $HOME\.local\bin\uv.exe<br>rm $HOME\.local\bin\uvx.exe</pre><h3>Conclusion</h3><p>UV is more than a tool — it’s a productivity booster for modern Python development. With one binary and a blazing-fast core, it simplifies your dev setup, saves time, and makes switching projects effortless. If you haven’t tried it yet, now’s the perfect time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c008a4c3ad73" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ai-agent-insider/why-developers-are-switching-to-uv-and-how-to-install-it-c008a4c3ad73">🧑‍💻 Why Developers Are Switching to UV and How to Install It</a> was originally published in <a href="https://medium.com/ai-agent-insider">AI Agent Insider</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RAG vs. Self-RAG vs. Agentic RAG: Which One Is Right for You?]]></title>
            <link>https://medium.com/ai-agent-insider/rag-vs-self-rag-vs-agentic-rag-which-one-is-right-for-you-3d233ef42cac?source=rss-9e9f86f6aafd------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d233ef42cac</guid>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[agentic-rag]]></category>
            <category><![CDATA[pipeline]]></category>
            <dc:creator><![CDATA[Bhavik Jikadara]]></dc:creator>
            <pubDate>Fri, 04 Apr 2025 06:24:54 GMT</pubDate>
            <atom:updated>2025-04-04T06:31:03.772Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CKSli8cldOCi_nxattl8Dg.png" /><figcaption><strong>RAG Pipeline</strong> vs <strong>Self-RAG</strong> vs <strong>Agentic RAG</strong></figcaption></figure><h4>A breakdown of different RAG architectures and how they impact accuracy, efficiency, and adaptability.</h4><p><strong>Retrieval-Augmented Generation (RAG)</strong> is a powerful <strong>AI </strong>technique that improves the accuracy of large language models by giving them access to external knowledge. Instead of relying only on pre-trained data, <strong>RAG </strong>retrieves relevant information from a database or the internet before generating a response. This makes it more reliable, especially for answering complex or up-to-date questions.</p><p>But AI doesn’t stop evolving. The next step is <strong>Self-RAG</strong>, which enhances RAG by allowing the AI to refine its own searches. Instead of just retrieving information once, Self-RAG evaluates whether the retrieved data is useful and adjusts its search strategy if needed. This leads to smarter, more relevant answers.</p><p><strong>Agentic RAG</strong> takes this a step further by adding decision-making capabilities, making the AI more autonomous. It can decide when to search, what sources to trust, and how to respond based on context — almost like an AI assistant with reasoning skills.</p><p>In this blog, we will learn about the differences between <strong>RAG</strong>, <strong>Self-RAG</strong>, and <strong>Agentic RAG</strong>. We’ll explore how each method improves AI’s ability to retrieve and generate accurate information, their impact on efficiency, and which one is best suited for different use cases.</p><h3>RAG Pipeline: The Groundbreaking Beginning</h3><p>Imagine a world where your AI doesn’t just rely on old training data — it actively pulls in fresh, relevant information to generate accurate responses. That’s exactly what the traditional <strong>Retrieval-Augmented Generation (RAG) pipeline</strong> does through a simple yet powerful process:</p><ul><li><strong>Query</strong>: The user’s input starts the process.</li><li><strong>Retrieval</strong>: The system searches a knowledge base for relevant documents.</li><li><strong>Reranking</strong>: The retrieved information is sorted to prioritize the most useful data.</li><li><strong>Generation</strong>: A large language model (LLM) uses this refined data to craft a well-informed response.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*LVvmL0AiweMLWYwnQ5g3fg.png" /><figcaption>RAG Pipeline</figcaption></figure><p>This approach transformed AI by grounding its responses in real-world data, significantly reducing hallucinations and improving accuracy. In fact, many teams have reported up to a <strong>30% increase in answer accuracy</strong> compared to models that rely only on pre-trained knowledge.</p><h3>Self-RAG: Smarter AI with Self-Assessment</h3><p>Self-RAG improves on traditional RAG by adding a crucial step — self-evaluation. Instead of just retrieving information and generating a response, it <strong>checks the quality of the retrieved data</strong> before proceeding. Here’s how it works:</p><ol><li><strong>Retrieval</strong>: Just like in RAG, the system searches for relevant documents.</li><li><strong>Evaluation</strong>: The AI <strong>analyzes the retrieved information</strong> to see if it’s useful and accurate.</li><li><strong>Decision Making</strong>: If the information is good, the AI moves forward with <strong>answer generation</strong>. If not, it <strong>modifies the query</strong> and tries again to get better data.</li><li><strong>Answer Verification</strong>: Before finalizing the response, the AI checks if it <strong>truly answers the question correctly</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rETGUNmSjvKc6O7I6y5VVA.png" /><figcaption>Self-RAG</figcaption></figure><p>This process makes Self-RAG much more <strong>accurate and reliable</strong>, especially for complex topics where precision is critical. In fact, studies show it can <strong>improve answer accuracy by 73%</strong>, making it a game-changer for industries like healthcare, legal research, and finance, where getting the right answer matters most.</p><h3>Agentic RAG: Smarter Decisions, Better Answers</h3><p>Agentic RAG is the most advanced version of the RAG family. It doesn’t just follow steps — it <strong>acts like a smart assistant</strong>, making its own decisions based on the user’s query. Think of it as an AI that knows how to think on its feet.</p><p>Here’s what makes Agentic RAG special:</p><ol><li><strong>Deep Query Understanding</strong>: It starts by truly understanding what the user wants.</li><li><strong>Smart Path Selection</strong>: Based on the query, it decides whether to search the web, use personal data, or go straight to the LLM.</li><li><strong>Multiple Data Sources</strong>: Instead of pulling info from just one place, it fetches high-quality data from <strong>various trusted sources</strong>.</li><li><strong>Refinement Loops</strong>: Like Self-RAG, it checks and improves the data — but it goes further by <strong>rewriting queries in smarter ways</strong> to get even better results.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WSz7nVxzcks9Psk9kqb0Xg.png" /><figcaption>Agentic RAG</figcaption></figure><p>Thanks to these intelligent features, Agentic RAG shows up to <strong>89% better performance</strong> on complex tasks compared to basic RAG. It’s ideal for industries that need high accuracy, quick thinking, and adaptability — like <strong>healthcare, finance, legal tech, and enterprise AI tools</strong>.</p><h3>Why It Matters for Your AI Strategy</h3><p>Choosing the right <strong>RAG architecture</strong> isn’t just a technical choice — it’s a <strong>strategic move</strong> that can dramatically boost your AI’s performance and business outcomes. Here’s how it makes a real difference:</p><ul><li><strong>Enhanced Reliability</strong>: With fewer hallucinations and fact-based responses, your AI becomes more <strong>trustworthy and dependable</strong> — crucial for use cases like legal, healthcare, and enterprise support.</li><li><strong>Superior Accuracy</strong>: Features like query grading, reranking, and iterative refinement help ensure that responses are <strong>not just fast, but correct and relevant</strong>.</li><li><strong>Dynamic Adaptability</strong>: Whether it’s handling customer support, automating reports, or powering an intelligent chatbot, modern RAG systems <strong>adapt on the fly</strong> to different types of queries and evolving data sources.</li><li><strong>Time and Cost Efficiency</strong>: By reducing errors and automating complex decision-making, RAG-based systems <strong>save manual effort</strong>, cut operational costs, and improve turnaround time.</li><li><strong>Scalable Intelligence</strong>: As your data and use cases grow, Self-RAG and Agentic RAG can scale with you, offering <strong>autonomous, context-aware intelligence</strong> that evolves with your business.</li><li><strong>Competitive Advantage</strong>: In fast-moving sectors, even a small boost in AI accuracy and efficiency can give you a <strong>clear edge</strong>, leading to better user experiences, faster insights, and stronger innovation.</li></ul><p>In short, upgrading to advanced RAG frameworks transforms your AI from a helpful tool into a <strong>strategic partner</strong> in growth, innovation, and decision-making.</p><h3><strong>Conclusion</strong></h3><p>The evolution of Retrieval-Augmented Generation (RAG) is more than just a technical progression — it represents a paradigm shift in how AI systems interact with and process information.</p><ol><li><strong>Traditional RAG Pipelines</strong> laid the foundation for factual AI responses, but their linear structure lacked adaptability.</li><li><strong>Self-RAG</strong> introduced decision-making capabilities, enabling query refinement and self-assessment, leading to a <strong>73% improvement</strong> in accuracy.</li><li><strong>Agentic RAG</strong> takes intelligence to the next level, incorporating <strong>dynamic query analysis, multiple retrieval paths, and relevance checks</strong>, delivering an <strong>89% boost</strong> in complex query handling.</li></ol><p>For organizations and AI developers, understanding and implementing the right RAG approach isn’t just about efficiency — it’s a strategic move toward <strong>building AI systems that are more accurate, reliable, and capable of handling diverse, real-world challenges</strong>.</p><p>As AI continues to evolve, <strong>Agentic RAG</strong> sets the stage for the future, where <strong>intelligent orchestration, real-time reasoning, and dynamic knowledge routing</strong> become essential features of next-gen AI solutions. The future of AI isn’t just about retrieving knowledge — it’s about <strong>understanding, adapting, and responding like a true expert.</strong></p><h3><strong>References</strong></h3><p><a href="https://bhavikjikadara.medium.com/exploring-the-different-types-of-rag-in-ai-c118edf6d73c"><strong>[1]</strong></a><strong>. Exploring the Different Types of RAG in AI</strong></p><p><a href="https://medium.com/ai-agent-insider/developing-rag-systems-with-deepseek-r1-ollama-66a520bf0b88"><strong>[2]</strong></a><strong>. Developing RAG Systems with DeepSeek R1 &amp; Ollama</strong></p><p><a href="https://medium.com/ai-agent-insider/building-rag-applications-with-website-content-60ddd3be124d"><strong>[3]</strong></a><strong>. Building RAG Applications with Website Content</strong></p><p><a href="https://bhavikjikadara.medium.com/evaluating-an-rag-pipeline-using-deepeval-749f641b3186"><strong>[4]</strong></a><strong>. Evaluating an RAG Pipeline Using DeepEval</strong></p><p><a href="https://bhavikjikadara.medium.com/advanced-rag-techniques-to-improve-the-performance-of-generative-models-657cc751ac4c"><strong>[5]</strong></a><strong>. Advanced RAG Techniques to improve the Performance of Generative Models</strong></p><p><a href="https://bhavikjikadara.medium.com/llamaindex-chroma-building-a-simple-rag-pipeline-cd67fc184190"><strong>[6]</strong></a><strong>. Llama Index &amp; Chroma: Building a Simple RAG Pipeline</strong></p><p><a href="https://bhavikjikadara.medium.com/building-powerful-rag-applications-with-haystack-2-x-a8c658da9338"><strong>[7]</strong></a><strong>. Building Powerful RAG Applications with Haystack 2.x</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d233ef42cac" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ai-agent-insider/rag-vs-self-rag-vs-agentic-rag-which-one-is-right-for-you-3d233ef42cac">RAG vs. Self-RAG vs. Agentic RAG: Which One Is Right for You?</a> was originally published in <a href="https://medium.com/ai-agent-insider">AI Agent Insider</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Claude-Powered PR Review System with MCP]]></title>
            <link>https://medium.com/ai-agent-insider/build-a-claude-powered-pr-review-system-with-mcp-26c78411e766?source=rss-9e9f86f6aafd------2</link>
            <guid isPermaLink="false">https://medium.com/p/26c78411e766</guid>
            <category><![CDATA[claude]]></category>
            <category><![CDATA[developer-tools]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[model-context-protocol]]></category>
            <dc:creator><![CDATA[Bhavik Jikadara]]></dc:creator>
            <pubDate>Sun, 23 Mar 2025 12:04:42 GMT</pubDate>
            <atom:updated>2025-03-23T12:04:42.909Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FtzQj7qIp1-aSLAsPpCeqA.png" /><figcaption><a href="https://modelcontextprotocol.io/introduction"><strong>What is Model Context Protocol (MCP)?</strong></a></figcaption></figure><h4>Learn how to automate code reviews by connecting Claude to GitHub and Notion using Anthropic’s Model Context Protocol.</h4><p>Code reviews are essential in today’s fast-paced development environments but can be very time-consuming. What if you could use AI to simplify this process? Introducing the <strong>Model Context Protocol (MCP) </strong>— <strong>Anthropic’s </strong>open standard transforming the way AI models interact with external tools.</p><p>In this guide, I will guide you through building a powerful PR review system that connects Claude with GitHub and Notion, creating an automated workflow that transforms your development process.</p><h3>What is Model Context Protocol (MCP)?</h3><p>The <strong>Model Context Protocol</strong> is an open standard developed by Anthropic that serves as a universal connector between AI models and external tools. Initially built to enhance Claude’s capabilities, <a href="https://www.anthropic.com/news/model-context-protocol"><strong>Anthropic open-sourced MCP in early 2024</strong></a> to foster industry-wide adoption.</p><p>MCP follows a client-server architecture where:</p><ul><li><strong>MCP clients</strong> (like Claude Desktop) request information and execute tasks</li><li><strong>MCP servers</strong> provide access to external tools and data sources</li><li><strong>Host applications</strong> facilitate communication between models and tools</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nz8O3hpwBtjf33CmPlXptQ.png" /><figcaption>Source: <a href="https://modelcontextprotocol.io/introduction">Model Context Protocol</a></figcaption></figure><p>The benefits of using MCP include:</p><ul><li><strong>Standardized integration</strong>: A structured approach to connect AI with external tools</li><li><strong>Flexibility</strong>: Easily switch between different AI models and vendors</li><li><strong>Security</strong>: Keep sensitive data within your infrastructure</li><li><strong>Scalability</strong>: Support for various transport protocols including stdio, WebSockets, HTTP SSE, and UNIX sockets</li></ul><h3>The Demo Project: Building a PR Review Server</h3><p>Our demo project automates code analysis using Claude Desktop and documents reviews in Notion. Here’s the pipeline:</p><ol><li>Set up environment and credentials for GitHub and Notion</li><li>Initialize an MCP server for communication with Claude Desktop</li><li>Fetch PR changes and metadata from GitHub</li><li>Analyze code changes using Claude Desktop</li><li>Document the analysis results in Notion</li></ol><p>Let’s break down the implementation step by step.</p><h4>Step 1: Setting Up the Environment</h4><p>First, we’ll install the uv package manager, which offers faster and lighter package management compared to conda:</p><pre># For Mac/Linux<br>curl -LsSf https://astral.sh/uv/install.sh | sh<br><br># For Windows (PowerShell)<br>powershell -ExecutionPolicy ByPass -c &quot;irm https://astral.sh/uv/install.ps1 | iex&quot;</pre><ul><li>Next, create and set up a project directory:</li></ul><pre>uv init pr_reviewer<br>cd pr_reviewer</pre><ul><li>Create and activate a virtual environment:</li></ul><pre># Mac/Linux<br>uv venv<br>source .venv/bin/activate<br><br># Windows<br>.venv\Scripts\activate</pre><ul><li>Install the required dependencies:</li></ul><pre>uv add &quot;mcp[cli]&quot; requests python-dotenv notion-client</pre><h4>Step 2: Set Up Dependencies and Environment Variables</h4><p>Create a requirements.txt file with the following content:</p><pre># Core dependencies for PR Analyzer<br>requests&gt;=2.31.0          # For GitHub API calls<br>python-dotenv&gt;=1.0.0      # For environment variables<br>mcp[cli]&gt;=1.4.0           # For MCP server functionality<br>notion-client&gt;=2.3.0      # For Notion integration</pre><ul><li>Install these dependencies:</li></ul><pre>uv pip install -r requirements.txt</pre><ul><li>Next, set up your environment variables in a .env file:</li></ul><pre>GITHUB_TOKEN=your_github_token<br>NOTION_API_KEY=your_notion_api_key<br>NOTION_PAGE_ID=your_notion_page_id</pre><p>To generate these credentials:</p><ol><li><strong>GitHub Token</strong>: Log in to GitHub → Settings → Developer settings → Personal Access Tokens → Generate New Token (classic) → Enable read:org, read:repo_hook, and repo permissions</li><li><strong>Notion Integration</strong>:</li></ol><ul><li>Login to <a href="https://www.notion.so/my-integrations">Notion’s integration page</a></li><li>Create a new internal integration</li><li>Copy the integration secret (Notion API key)</li><li>Copy the UUID from the integration URL for the Notion Page ID</li></ul><h4>Step 3: GitHub Integration</h4><p>Create a github_integration.py file to handle PR data retrieval:</p><pre>import os<br>import requests<br>import traceback<br>from dotenv import load_dotenv<br><br># Load environment variables<br>load_dotenv()<br>GITHUB_TOKEN = os.getenv(&#39;GITHUB_TOKEN&#39;)<br><br>def fetch_pr_changes(repo_owner: str, repo_name: str, pr_number: int) -&gt; list:<br>    &quot;&quot;&quot;Fetch changes from a GitHub pull request.<br>    <br>    Args:<br>        repo_owner: The owner of the GitHub repository<br>        repo_name: The name of the GitHub repository<br>        pr_number: The number of the pull request to analyze<br>        <br>    Returns:<br>        A list of file changes with detailed information about each change<br>    &quot;&quot;&quot;<br>    print(f&quot; Fetching PR changes for {repo_owner}/{repo_name}#{pr_number}&quot;)<br>    <br>    # Fetch PR details<br>    pr_url = f&quot;https://api.github.com/repos/{repo_owner}/{repo_name}/pulls/{pr_number}&quot;<br>    files_url = f&quot;{pr_url}/files&quot;<br>    headers = {&#39;Authorization&#39;: f&#39;token {GITHUB_TOKEN}&#39;}<br>    <br>    try:<br>        # Get PR metadata<br>        pr_response = requests.get(pr_url, headers=headers)<br>        pr_response.raise_for_status()<br>        pr_data = pr_response.json()<br>        <br>        # Get file changes<br>        files_response = requests.get(files_url, headers=headers)<br>        files_response.raise_for_status()<br>        files_data = files_response.json()<br>        <br>        # Combine PR metadata with file changes<br>        changes = []<br>        for file in files_data:<br>            change = {<br>                &#39;filename&#39;: file[&#39;filename&#39;],<br>                &#39;status&#39;: file[&#39;status&#39;],  # added, modified, removed<br>                &#39;additions&#39;: file[&#39;additions&#39;],<br>                &#39;deletions&#39;: file[&#39;deletions&#39;],<br>                &#39;changes&#39;: file[&#39;changes&#39;],<br>                &#39;patch&#39;: file.get(&#39;patch&#39;, &#39;&#39;),  # The actual diff<br>                &#39;raw_url&#39;: file.get(&#39;raw_url&#39;, &#39;&#39;),<br>                &#39;contents_url&#39;: file.get(&#39;contents_url&#39;, &#39;&#39;)<br>            }<br>            changes.append(change)<br>        <br>        # Add PR metadata<br>        pr_info = {<br>            &#39;title&#39;: pr_data[&#39;title&#39;],<br>            &#39;description&#39;: pr_data[&#39;body&#39;],<br>            &#39;author&#39;: pr_data[&#39;user&#39;][&#39;login&#39;],<br>            &#39;created_at&#39;: pr_data[&#39;created_at&#39;],<br>            &#39;updated_at&#39;: pr_data[&#39;updated_at&#39;],<br>            &#39;state&#39;: pr_data[&#39;state&#39;],<br>            &#39;total_changes&#39;: len(changes),<br>            &#39;changes&#39;: changes<br>        }<br>        <br>        print(f&quot;Successfully fetched {len(changes)} changes&quot;)<br>        return pr_info<br>        <br>    except Exception as e:<br>        print(f&quot;Error fetching PR changes: {str(e)}&quot;)<br>        traceback.print_exc()<br>        return None<br><br># Example usage for debugging<br># pr_data = fetch_pr_changes(&#39;owner&#39;, &#39;repo&#39;, 1)<br># print(pr_data) </pre><p>This module sends authenticated HTTP requests to the GitHub API to retrieve comprehensive information about a pull request, including metadata and file-level changes.</p><h4>Step 4: Implement the MCP Server</h4><p>This MCP server does the heavy lifting by:</p><ol><li><strong>Initializing the environment</strong>: Setting up the MCP server and Notion client</li></ol><p><strong>2. Registering tools</strong>: Two tools are exposed to Claude:</p><ul><li>fetch_pr: Retrieves PR details from GitHub</li><li>create_notion_page: Creates documentation in Notion</li></ul><p><strong>3. Running the server</strong>: Using stdio as the transport protocol for communication</p><p>Now, let’s create the core PR analyzer that will connect Claude Desktop with GitHub and Notion. Create a pr_analyzer.py file:</p><pre>import sys<br>import os<br>import traceback<br>from typing import Any, List, Dict<br>from mcp.server.fastmcp import FastMCP<br>from github_integration import fetch_pr_changes<br>from notion_client import Client<br>from dotenv import load_dotenv<br><br>class PRAnalyzer:<br>    def __init__(self):<br>        # Load environment variables<br>        load_dotenv()<br>        <br>        # Initialize MCP Server<br>        self.mcp = FastMCP(&quot;github_pr_analysis&quot;)<br>        print(&quot;MCP Server initialized&quot;, file=sys.stderr)<br>        <br>        # Initialize Notion client<br>        self._init_notion()<br>        <br>        # Register MCP tools<br>        self._register_tools()<br>    <br>    def _init_notion(self):<br>        &quot;&quot;&quot;Initialize the Notion client with API key and page ID.&quot;&quot;&quot;<br>        try:<br>            self.notion_api_key = os.getenv(&quot;NOTION_API_KEY&quot;)<br>            self.notion_page_id = os.getenv(&quot;NOTION_PAGE_ID&quot;)<br>            <br>            if not self.notion_api_key or not self.notion_page_id:<br>                raise ValueError(&quot;Missing Notion API key or page ID in environment variables&quot;)<br>            <br>            self.notion = Client(auth=self.notion_api_key)<br>            print(f&quot;Notion client initialized successfully&quot;, file=sys.stderr)<br>            print(f&quot;Using Notion page ID: {self.notion_page_id}&quot;, file=sys.stderr)<br>        except Exception as e:<br>            print(f&quot;Error initializing Notion client: {str(e)}&quot;, file=sys.stderr)<br>            traceback.print_exc(file=sys.stderr)<br>            sys.exit(1)<br>    <br>    def _register_tools(self):<br>        &quot;&quot;&quot;Register MCP tools for PR analysis.&quot;&quot;&quot;<br>        @self.mcp.tool()<br>        async def fetch_pr(repo_owner: str, repo_name: str, pr_number: int) -&gt; Dict[str, Any]:<br>            &quot;&quot;&quot;Fetch changes from a GitHub pull request.&quot;&quot;&quot;<br>            print(f&quot;Fetching PR #{pr_number} from {repo_owner}/{repo_name}&quot;, file=sys.stderr)<br>            try:<br>                pr_info = fetch_pr_changes(repo_owner, repo_name, pr_number)<br>                if pr_info is None:<br>                    print(&quot;No changes returned from fetch_pr_changes&quot;, file=sys.stderr)<br>                    return {}<br>                print(f&quot;Successfully fetched PR information&quot;, file=sys.stderr)<br>                return pr_info<br>            except Exception as e:<br>                print(f&quot;Error fetching PR: {str(e)}&quot;, file=sys.stderr)<br>                traceback.print_exc(file=sys.stderr)<br>                return {}<br>        <br>        @self.mcp.tool()<br>        async def create_notion_page(title: str, content: str) -&gt; str:<br>            &quot;&quot;&quot;Create a Notion page with PR analysis.&quot;&quot;&quot;<br>            print(f&quot;Creating Notion page: {title}&quot;, file=sys.stderr)<br>            try:<br>                self.notion.pages.create(<br>                    parent={&quot;type&quot;: &quot;page_id&quot;, &quot;page_id&quot;: self.notion_page_id},<br>                    properties={&quot;title&quot;: {&quot;title&quot;: [{&quot;text&quot;: {&quot;content&quot;: title}}]}},<br>                    children=[{<br>                        &quot;object&quot;: &quot;block&quot;,<br>                        &quot;type&quot;: &quot;paragraph&quot;,<br>                        &quot;paragraph&quot;: {<br>                            &quot;rich_text&quot;: [{<br>                                &quot;type&quot;: &quot;text&quot;,<br>                                &quot;text&quot;: {&quot;content&quot;: content}<br>                            }]<br>                        }<br>                    }]<br>                )<br>                print(f&quot;Notion page &#39;{title}&#39; created successfully!&quot;, file=sys.stderr)<br>                return f&quot;Notion page &#39;{title}&#39; created successfully!&quot;<br>            except Exception as e:<br>                error_msg = f&quot;Error creating Notion page: {str(e)}&quot;<br>                print(error_msg, file=sys.stderr)<br>                traceback.print_exc(file=sys.stderr)<br>                return error_msg<br>    <br>    def run(self):<br>        &quot;&quot;&quot;Start the MCP server.&quot;&quot;&quot;<br>        try:<br>            print(&quot;Running MCP Server for GitHub PR Analysis...&quot;, file=sys.stderr)<br>            self.mcp.run(transport=&quot;stdio&quot;)<br>        except Exception as e:<br>            print(f&quot;Fatal Error in MCP Server: {str(e)}&quot;, file=sys.stderr)<br>            traceback.print_exc(file=sys.stderr)<br>            sys.exit(1)<br><br>if __name__ == &quot;__main__&quot;:<br>    analyzer = PRAnalyzer()<br>    analyzer.run() </pre><h4>Step 5: Running the MCP Server</h4><p>Now that all the pieces are in place, run the server with:</p><pre>python pr_analyzer.py</pre><p>When the server is running, open Claude Desktop. You’ll notice a plug icon (🔌) in the textbox, indicating the presence of an MCP server. A hammer-like icon (🔨) will display all available MCP tools.</p><h4>Using the PR Review System</h4><ol><li>Paste a PR link in Claude Desktop</li><li>Claude will fetch the PR details using your MCP server</li><li>Claude will analyze the code and provide a summary and review</li><li>You can instruct Claude to upload the analysis to Notion</li></ol><p>The completed workflow automates the entire PR review process, from fetching code changes to documenting the analysis in your Notion workspace.</p><h3>Conclusion</h3><p>By leveraging the <strong>Model Context Protocol</strong>, we’ve built a powerful integration that connects Claude’s intelligence with GitHub’s PR data and Notion’s documentation capabilities. This system demonstrates how MCP serves as a universal connector, allowing AI models to seamlessly interact with external tools and services.</p><p>The PR review system we’ve built offers several advantages:</p><ul><li><strong>Time savings</strong>: Automates the initial code review process</li><li><strong>Consistency</strong>: Applies the same analysis patterns across all PRs</li><li><strong>Documentation</strong>: Maintains a searchable history of reviews in Notion</li><li><strong>Scalability</strong>: Can be extended to support additional tools and services</li></ul><p>MCP represents a significant step forward in creating standardized, interoperable AI systems that can be easily integrated into existing workflows and tools. As more organizations adopt this open standard, we’ll likely see an explosion of innovative AI-powered applications across various domains.</p><h3>References</h3><p><a href="https://modelcontextprotocol.io/introduction">Introduction - Model Context Protocol</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26c78411e766" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ai-agent-insider/build-a-claude-powered-pr-review-system-with-mcp-26c78411e766">Build a Claude-Powered PR Review System with MCP</a> was originally published in <a href="https://medium.com/ai-agent-insider">AI Agent Insider</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>