<?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 Vishnu Teja Kugarthi on Medium]]></title>
        <description><![CDATA[Stories by Vishnu Teja Kugarthi on Medium]]></description>
        <link>https://medium.com/@vishnutejaap?source=rss-a6461505d1c1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*oZgewvf-mHDfyin_</url>
            <title>Stories by Vishnu Teja Kugarthi on Medium</title>
            <link>https://medium.com/@vishnutejaap?source=rss-a6461505d1c1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 20:35:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vishnutejaap/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[WebMCP: Letting AI Agents Actually Use the Web]]></title>
            <link>https://medium.com/@vishnutejaap/webmcp-letting-ai-agents-actually-use-the-web-70f1f97e3540?source=rss-a6461505d1c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/70f1f97e3540</guid>
            <category><![CDATA[agents]]></category>
            <category><![CDATA[mcps]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[model-context-protocol]]></category>
            <category><![CDATA[web-mcp]]></category>
            <dc:creator><![CDATA[Vishnu Teja Kugarthi]]></dc:creator>
            <pubDate>Mon, 31 Aug 2026 17:59:51 GMT</pubDate>
            <atom:updated>2026-09-03T08:09:15.160Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DkFs8NojPfy1Yjmd3s0wwg.png" /><figcaption>WebMCP</figcaption></figure><p>If you’ve spent any time building with AI agents, you’ve hit the same wall over and over: agents are great at <em>reasoning</em>, but clumsy at <em>acting</em> on the live web. Today, an agent that wants to book a flight, update a CRM record, or check a dashboard has exactly two bad options — scrape the DOM and hope the layout doesn’t change, or wait for someone to hand-build a bespoke API integration. Neither scales. That’s the gap WebMCP is starting to close.</p><h4>The problem: agents and websites don’t speak the same language</h4><p>The Model Context Protocol (MCP) solved a real problem for backend tools — it gave AI models a standard way to discover and call functions exposed by a server. But most of what people actually do all day happens in a browser tab, not behind an API. Your bank, your project tracker, your favorite SaaS dashboard — these are websites first, APIs second (if at all).</p><p>So when an agent needs to interact with one of these sites, it’s stuck doing what’s essentially browser automation cosplay: taking screenshots, guessing at CSS selectors, clicking buttons that might have moved. It’s slow, brittle, and it breaks the moment a designer ships a redesign.</p><h4>The idea: let the website describe itself</h4><p>WebMCP flips the model. Instead of an agent reverse-engineering a page from the outside, the <em>website itself</em> exposes a set of structured, callable tools directly in the browser — the same way an MCP server exposes tools to a model, but scoped to that page’s actual capabilities.</p><p>Concretely, a page can register something like “search_products”, “add_to_cart”, or “get_account_balance” as a first-class, typed tool, along with a description of what it does and what arguments it expects. An agent visiting the page doesn’t need to guess the DOM structure — it just asks: “what tools do you offer?” and gets back a clean, structured answer.</p><p>This is a small shift with big implications. It moves the burden of “how do I let an agent use my site” from the agent builder to the site owner — who already knows exactly what their app can do.</p><p>To make this concrete, I built a small proof of concept: <a href="https://github.com/VishnuKugarthi/Job_Os_WebMCP">Agentic Job Application OS</a>, an AI career-agent workspace for the WebMCP Challenge. On mount, the app registers about ten tools on document.modelContext — searchJobs, scoreJobMatch, tailorResume, applyToTopMatch, submitApplication, and so on — each one calling the <em>exact same functions the UI itself uses</em>. An agent working through the site (via ChatGPT&#39;s in-app browser, or Chrome with WebMCP enabled) isn&#39;t scraping the job board&#39;s DOM or guessing at button positions; it&#39;s calling searchJobs({query: &quot;frontend&quot;}) and getting structured results back, the same way it would call any other MCP tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VB2CNvqcXPseSb148P75EA.jpeg" /><figcaption>WebMCP tools exposed on client side</figcaption></figure><h4>Why this matters more than it sounds like</h4><p>It’s reliable in a way scraping never will be. A tool interface doesn’t break when someone changes a button’s color or moves a form field. The contract is explicit, not inferred.</p><p>It’s incremental. A site doesn’t need to rebuild its whole product as an API. Developers can expose just a handful of key actions — the ones that actually matter for agent workflows — and leave the rest of the UI untouched. In the job-application project, that’s a dozen well-scoped tools sitting on top of an otherwise ordinary Next.js app — no external API, no backend rewrite.</p><p>It keeps humans and agents on the same page, literally. Because the tools live inside the existing web app rather than a separate backend service, the same session, auth, and state that a human user has already established can be reused by the agent acting on their behalf. In the demo app, tool calls mutate the same <a href="https://github.com/pmndrs/zustand">zustand</a> store the UI reads from, so when the agent finds a match and prepares an application, the Applications page updates live — no polling, no separate “agent view” out of sync with what the human sees.</p><p>It makes human-in-the-loop a code-level guarantee, not a UI suggestion. This is the part I think matters most for anything agents can act on: in the job-application app, approveApplication and rejectApplication are wired only to button clicks — they are never registered as WebMCP tools at all. There is no tool call, no prompt, no clever phrasing that lets an agent approve its own application; submitApplication structurally checks status === &#39;approved&#39; in the store logic and returns NOT_APPROVED otherwise. The agent can draft a resume, find the best match, and stage everything — but a human has to click &quot;approve&quot; before anything ships. That boundary lives in code, not in an instruction the agent could ignore.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aBFTpgH38CFUITbzKi8AvQ.jpeg" /><figcaption>The human reviewed the agent-filled application</figcaption></figure><p>It’s a natural extension of MCP, not a competing standard. If MCP taught the ecosystem how models talk to servers, WebMCP is teaching it how models talk to the pages people already use every day.</p><h4>Where this goes next</h4><p>The honest state of things: WebMCP is early. Standardization, browser support, and security models (you really don’t want every tab silently exposing a “transfer_funds” tool to any agent that asks) are all still being worked out. But the direction is compelling — a web where “agent-usable” isn’t a bolt-on integration but a property a site can declare the same way it declares its title or its favicon.</p><p>If that happens, the payoff isn’t just faster automation. It’s an entire ecosystem of software that agents can navigate as fluently as humans do — without either side having to fake it.</p><p>If you want to see the pattern end-to-end — tool registration, live state updates, and the approval gate all in one small codebase — the <a href="https://github.com/VishnuKugarthi/Job_Os_WebMCP">Agentic Job Application OS repo</a> is a good place to poke around. It’s intentionally scoped down (mocked job data, no real submissions, no external LLM calls) so the WebMCP integration itself is easy to find and read.</p><p>I’m currently exploring AI projects and open to freelance gigs and collaborations. Feel free to connect on LinkedIn!</p><p><a href="https://www.linkedin.com/in/vishnu-teja-kugarthi/">Let’s connect on LinkedIn!</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=70f1f97e3540" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My app got 50 downloads]]></title>
            <link>https://medium.com/@vishnutejaap/my-app-got-50-downloads-9080a6a0dade?source=rss-a6461505d1c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/9080a6a0dade</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[mobile-apps]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Vishnu Teja Kugarthi]]></dc:creator>
            <pubDate>Thu, 14 May 2026 17:33:25 GMT</pubDate>
            <atom:updated>2026-05-14T17:39:53.327Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*446BWjCNbbFSXU9IOgJMzw.png" /><figcaption>Spend Tracker</figcaption></figure><p>In January 2026, I finally decided to tackle a long-standing goal on my learning backlog: building a mobile app. As a web developer, the mobile ecosystem felt a bit daunting, and I wasn’t interested in learning everything from scratch.</p><p>To bridge the gap, I decided to let <strong>AI do the heavy lifting.</strong> Since day one, every single line of code has been written by AI, leveraging tools like <strong>Google </strong>Antigravity and <strong>VS Code</strong>’s built-in LLM capabilities. I used <strong>Expo</strong> to handle the app bundling, which made the entire transition incredibly seamless. By the end of February, I reached a modest but exciting milestone: 50 downloads on the Play Store.</p><h3>What is Spend Tracker?</h3><p>For those who aren’t familiar, <strong>Spend Tracker</strong> is a streamlined mobile app designed for tracking debit transactions and managing personal finances.</p><p>This month, I’ve introduced several new features to help users take better control of their money:</p><ul><li><strong>Budget Alerts:</strong> Get notified before you overspend.</li><li><strong>Excel Exports:</strong> Download your transaction history directly to a spreadsheet.</li><li><strong>Spending Trends:</strong> Visualize your habits with data-driven insights.</li><li><strong>Granular Tracking:</strong> Monitor your spending on a daily, weekly, and monthly basis.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wUzl0gsFnff_W30jpnf69w.png" /><figcaption>Spend Tracker</figcaption></figure><h3>Get Started</h3><p>If you’re curious about the journey, check out my <a href="https://medium.com/@vishnutejaap/spend-tracker-how-i-built-my-first-mobile-app-using-google-antigravity-faf1abe8f0c9">earlier blog post</a> where I discuss the initial version and the development process.</p><p><strong>Ready to track your spends?</strong> Download Spend Tracker for Android <a href="https://play.google.com/store/apps/details?id=com.vishnutejaap.spendtracker&amp;pcampaignid=web_share">here: Spend Tracker on Google Play</a></p><p><strong>Install it and leave a review on the Play Store…!!!</strong></p><p>I’m currently exploring AI projects and open to freelance gigs and collaborations. Feel free to connect!</p><p><a href="https://www.linkedin.com/in/vishnu-teja-kugarthi/">Let’s connect on LinkedIn!</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9080a6a0dade" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Spend Tracker: How I Built My First Mobile App Using Google Antigravity]]></title>
            <link>https://medium.com/@vishnutejaap/spend-tracker-how-i-built-my-first-mobile-app-using-google-antigravity-faf1abe8f0c9?source=rss-a6461505d1c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/faf1abe8f0c9</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[spending]]></category>
            <category><![CDATA[no-code]]></category>
            <category><![CDATA[google-antigravity]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[Vishnu Teja Kugarthi]]></dc:creator>
            <pubDate>Sat, 17 Jan 2026 17:31:30 GMT</pubDate>
            <atom:updated>2026-01-17T17:31:30.190Z</atom:updated>
            <content:encoded><![CDATA[<p>I always wanted to release an app to the Play Store, but I never felt I had enough time or the technical expertise to navigate the entire process. That changed when I discovered <strong>Google Antigravity</strong>. I decided to take the leap and build an entire app from scratch using AI-powered tools.</p><h3>The Tech Stack</h3><p>Code Editor: Google Antigravity<br>UI framework: React Native<br>AI Models: Gemini &amp; Claude<br>Build Framework: Expo<br>Platform: Google Play Store</p><h3>What is Google Antigravity?</h3><p>In simple terms, Antigravity is an AI-powered code editor (similar to Visual Studio Code) that helps you build applications by generating and refining code for you. By leveraging LLMs like Gemini and Claude, it assists in everything from logic implementation to debugging, making the development process incredibly easy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XTLrUCOkwmanimigrZGeZQ.png" /></figure><h3>What is Spend Tracker?</h3><p><strong>Spend Tracker</strong> is a mobile application designed to simplify how you monitor your finances. It provides a clean, straightforward interface to view your expenses on a <strong>daily, weekly, and monthly</strong> basis.</p><p>The goal was to create something that provides immediate value without unnecessary complexity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*7J8y83URbSl7InO0qYQqQA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*4HHnOax9GWFd5JOMrhxD7g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*PjtzFvB92cmgEpTgrvjrig.png" /><figcaption>Spend Tracker images</figcaption></figure><h3>How It Works?</h3><p>Once installed, Spend Tracker uses SMS permission to automatically detect and extract expense details from your transaction alerts. This removes the hassle of manual entry, ensuring your expense log is always up to date.</p><h4>Your Privacy Matters</h4><p>Privacy is a top priority. Spend Tracker:</p><ul><li>Requires no login or signup.</li><li>Stores all data locally on your device.</li><li>Never uploads your data to external servers or shares it with third parties.</li></ul><h3>Install the app</h3><p>You can install Spend Tracker on the Google Play Store here:<br><a href="https://play.google.com/store/apps/details?id=com.vishnutejaap.spendtracker"><strong>Install Spend Tracker</strong></a><strong> — </strong><a href="https://play.google.com/store/apps/details?id=com.vishnutejaap.spendtracker">https://play.google.com/store/apps/details?id=com.vishnutejaap.spendtracker</a></p><p>Feel free to check it out and let me know your thoughts!</p><p>I’m currently exploring AI projects and open to freelance gigs and collaborations. Feel free to connect!</p><p><a href="https://www.linkedin.com/in/vishnu-teja-kugarthi/">Let’s connect on LinkedIn!</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=faf1abe8f0c9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Multi-AI Agent Customer Support System with LangChain]]></title>
            <link>https://medium.com/@vishnutejaap/building-a-multi-ai-agent-customer-support-system-with-langchain-16e1051a6321?source=rss-a6461505d1c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/16e1051a6321</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[multi-agent-systems]]></category>
            <category><![CDATA[agents]]></category>
            <category><![CDATA[gemini]]></category>
            <category><![CDATA[langchain]]></category>
            <dc:creator><![CDATA[Vishnu Teja Kugarthi]]></dc:creator>
            <pubDate>Sun, 27 Jul 2025 17:56:07 GMT</pubDate>
            <atom:updated>2025-07-27T18:29:54.175Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Problem: Overcoming Support System Bottlenecks</strong></h3><p>Traditional customer support often falters with generic chatbots and siloed departments, leading to customer frustration. Single, monolithic AI struggles with diverse query types, resulting in inefficient resolutions and poor handoffs. The challenge is creating a support system that’s both intelligent and specialized, knowing precisely when to engage the right expert — human or AI.</p><h3><strong>Solution: Empowering Support with Multi-AI Agents</strong></h3><p>Our project introduces a robust multi-AI agent system built with LangChain and Google’s Gemini. This intelligent backend triages incoming queries, instantly answers FAQs, routes complex issues to specialized technical or billing AI agents, and gracefully escalates unresolved cases to human support with a ticket. This collaborative approach ensures efficient, accurate, and enhanced customer experiences by directing each query to the most capable “team member.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t32sc-ObWSR0LGat7GUB2A.jpeg" /><figcaption>Multi-Agent Customer Support Chat Bot</figcaption></figure><h4>Flow of the Multi-Agent Customer Support System</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*brJhQR42ynxXJjxQQXKgEQ.jpeg" /><figcaption>Application flow</figcaption></figure><p>Here’s the flow described in a list of points:</p><ol><li><strong>User Initiates Interaction:</strong> A user sends a query to the system.</li><li><strong>Chat Bot Receives Query:</strong> The initial “Chat Bot” component receives the user’s message.</li><li><strong>Query Sent to Triage Agent:</strong> The Chat Bot passes the user’s query to the “Triage Agent” for initial processing.</li><li><strong>Triage Agent’s Decision Process:</strong> The Triage Agent evaluates the query and decides on the next step:<br>- <strong>Direct Answer (FAQ):</strong> If the query can be answered by the “FAQ tool” (e.g., a common question), the Triage Agent provides the answer back to the Chat Bot, which then sends it to the user.<br>- <strong>Routing to Specialist:</strong> If the query is not a simple FAQ, the Triage Agent routes it to a specialized agent:<br> a. To the “Tech Agent” for technical issues.<br> b. To the “Billing Agent” for billing-related inquiries.</li><li><strong>Specialized Agent Processing: </strong>The “Tech Agent” or “Billing Agent” receives the routed query and attempts to resolve it using their specific knowledge and tools.</li><li><strong>Escalation to Human (if needed): </strong>If the “Tech Agent” or “Billing Agent” cannot resolve the issue, they trigger an “Escalate to Human with a Ticket” process. This involves:<br>- Prompting the user for an email address (if not already provided).<br>- Generating a unique ticket ID.<br>- Notifying the user that a human agent will contact them shortly, including the ticket ID and email confirmation.</li><li><strong>Response to User:</strong> The final resolution (FAQ answer, specialist agent’s solution, or human escalation confirmation) is sent back through the Chat Bot to the user.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hEQgq8_ZBLtupe5gFS62Nw.jpeg" /><figcaption>Chat Bot</figcaption></figure><h4>1. Core Routing (Triage Agent)</h4><p>Triage agent system prompt:</p><pre>&quot;&quot;&quot;You are a customer support triage agent. Your primary goal is to help customers by routing them to the right team or providing FAQ answers.<br><br>STRICT ROUTING RULES:<br><br>1. TECHNICAL ISSUES (Route to TECH) - If query contains ANY of these indicators:<br>   - Internet/network/wifi/connection problems or issues<br>   - App or website issues<br>   - Login/access problems<br>   - Error messages<br>   - System performance<br>   - Device problems<br>   - Software/hardware concerns<br>   - Loading/speed issues<br>   YOU MUST respond with EXACTLY: &quot;ROUTE_TECH: [brief description]&quot;<br><br>2. BILLING ISSUES (Route to BILLING) - If query contains ANY of these:<br>   - Customer IDs (e.g., &quot;customer_101&quot;, &quot;customer 102&quot;)<br>   - Words like: balance, payment, bill, charge, plan, account<br>   - Financial symbols ($)<br>   YOU MUST respond with EXACTLY: &quot;ROUTE_BILLING: [brief description]&quot;<br><br>3. FAQ (Use get_faq_answer tool) - ONLY if:<br>   - Query is about general policies/information<br>   - NO technical issues mentioned<br>   - NO billing/account issues<br>   - NO customer IDs<br>   <br>CRITICAL RULES:<br>- For ANY internet/connection/network issue → ALWAYS reply &quot;ROUTE_TECH: [exact issue from user]&quot;<br>- For ANY technical problem → MUST use ROUTE_TECH format<br>- NEVER use FAQ tool for technical or billing issues<br>- When in doubt → Route to TECH<br>- Keep descriptions brief and use user&#39;s own words&quot;&quot;&quot;</pre><p>This prompt is highly effective because it provides the AI with <strong>explicit routing rules and negative constraints</strong>, ensuring precise and consistent decision-making for query classification. By clearly defining criteria for technical, billing, and FAQ queries, it minimizes ambiguity and streamlines the initial handling of customer interactions.</p><h4>2. Knowledge-Base Tools</h4><p>We register pure Python functions as LangChain tools:</p><pre>@tool<br>def get_faq_answer(query: str) -&gt; str:<br>    &quot;&quot;&quot;<br>    Looks up an answer to a common customer question in the FAQ knowledge base.<br>    Use this for general inquiries like &#39;What are your hours?&#39; or &#39;How do I reset my password?&#39;.<br>    &quot;&quot;&quot;<br>    query_words = set(query.lower().split())<br><br>    # First try exact phrase matching<br>    for faq_q, faq_a in FAQ_KB.items():<br>        if faq_q.lower() in query.lower():<br>            return faq_a<br><br>    # Then try keyword matching<br>    best_match = None<br>    max_word_match = 0<br><br>    for faq_q, faq_a in FAQ_KB.items():<br>        faq_words = set(faq_q.lower().split())<br>        matching_words = query_words.intersection(faq_words)<br><br>        # Check if this is a better match than what we&#39;ve seen<br>        if len(matching_words) &gt; max_word_match:<br>            max_word_match = len(matching_words)<br>            best_match = faq_a<br><br>        # If we match most of the words in either the query or the FAQ question<br>        if len(matching_words) &gt;= min(len(query_words), len(faq_words)) * 0.7:<br>            return faq_a<br><br>    # If we found a decent partial match, use it<br>    if best_match and max_word_match &gt;= 2:<br>        return best_match<br><br>    return &quot;I could not find an answer to your question in the FAQ. Please try rephrasing or ask for human assistance.&quot;</pre><p>Similar decorators wrap <strong>get_tech_solution</strong> and <strong>get_billing_info.</strong></p><h4>3. Escalation &amp; Email</h4><p>When the AI can’t resolve an issue, we generate a ticket ID and send an email:</p><pre>@langchain_tool(args_schema=EscalateToHumanArgs)<br>def escalate_to_human_tool(summary: str, user_email: Optional[str] = None) -&gt; str:<br>    &quot;&quot;&quot;<br>    Escalates the current customer issue to a human support agent.<br>    Provide a summary of the issue and any relevant customer contact information like email.<br>    &quot;&quot;&quot;<br>    return _raw_escalate_to_human_logic(summary, user_email)</pre><p>This decorated function internally calls the core escalation logic, _raw_escalate_to_human_logic, which handles the actual email sending and ticket generation.</p><pre># backend/.env<br>SMTP_SERVER=smtp.gmail.com<br>SMTP_PORT=587<br>SMTP_USERNAME=you@example.com # your email Ex: gmail.com<br>SMTP_PASSWORD=securepassword # create App Password from your google account<br>SMTP_FROM_EMAIL=you@example.com # your email Ex: gmail.com</pre><p>SMTP environment variables are responsible for sending confirmation email to the user with the Ticket ID.</p><p>The internal <strong>send_email</strong> function reads those .env vars via os.getenv, starts TLS, logs in, and dispatches the message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6tbzQdMQnb0fgVS11YrSPw.jpeg" /><figcaption>human support escalation</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xuHSQPnPaA5TekDumJFV8g.jpeg" /><figcaption>email received by user</figcaption></figure><h4>4. Project Flow &amp; Takeaways</h4><ol><li><strong>Frontend</strong>: Single-page chat using Tailwind + fetch to /chat.</li><li><strong>FastAPI</strong>: Orchestrates triage → appropriate tool/agent → response.</li><li><strong>Agents</strong>: Keep each concern tiny and testable.</li><li><strong>JSON KBs</strong>: Non-devs can update FAQs, tech tips, billing records.</li><li><strong>Email Escalation</strong>: Simple env-driven SMTP send for real support tickets.</li></ol><p>Explore the full <a href="https://github.com/VishnuKugarthi/customer_support_ai_agent">repo</a> for details, swap in your favorite LLM, or extend with new agents!</p><p>I’m currently exploring AI projects and open to freelance gigs and collaborations. Feel free to connect!</p><p><a href="https://www.linkedin.com/in/vishnu-teja-kugarthi/">Let’s connect on LinkedIn!</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16e1051a6321" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MCP: Building a Context-Aware Chatbot with Tool Integration]]></title>
            <link>https://medium.com/@vishnutejaap/mcp-building-a-context-aware-chatbot-with-tool-integration-5c47c03188fc?source=rss-a6461505d1c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c47c03188fc</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[model-context-protocol]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[chatbot-development]]></category>
            <category><![CDATA[rags]]></category>
            <dc:creator><![CDATA[Vishnu Teja Kugarthi]]></dc:creator>
            <pubDate>Fri, 11 Jul 2025 19:03:35 GMT</pubDate>
            <atom:updated>2025-07-11T19:26:50.641Z</atom:updated>
            <content:encoded><![CDATA[<p>As a developer passionate about practical AI applications, I’ve recently completed a project that I believe beautifully encapsulates the power of <strong>Model Context Protocol (MCP)</strong> and its real-world implications. This isn’t just a theoretical exercise; it’s a <strong>fully runnable application</strong> designed to demonstrate how Large Language Models (LLMs) can be intelligently augmented with external tools to create truly context-aware and functional systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*k9s4znl6h_HhmDc7JDeoCg.png" /></figure><h4>The Challenge: Bridging LLMs with Real-World Data</h4><p>While LLMs are incredibly powerful, their knowledge is typically confined to their training data. For a chatbot to be genuinely useful in a business context, it needs to:</p><ol><li><strong>Access dynamic, up-to-date information:</strong> Think product catalogs, external APIs, or internal company documents.</li><li><strong>Perform specific actions:</strong> Beyond just generating text, it should be able to “look up” or “fetch” data.</li><li><strong>Maintain conversational context:</strong> Remember previous turns to provide coherent responses.</li></ol><p>My project tackles these challenges head-on by implementing a robust MCP framework.</p><h4>Understanding the Model Context Protocol (MCP) 🧠</h4><p>The <strong>Model Context Protocol (MCP)</strong> is a design pattern that enables Large Language Models to interact dynamically with external tools and data sources. Instead of the LLM being a standalone brain, MCP turns it into an intelligent <em>orchestrator</em>.</p><p>In my application, MCP manifests as a sophisticated dialogue between the user, the LLM, and various specialized tools:</p><ol><li><strong>LLM as the Director:</strong> The Google Gemini LLM receives the user’s query and the entire conversation history. Crucially, it’s also provided with a <strong>manifest of available tools</strong> — their names, descriptions, and the parameters they accept.</li><li><strong>Intelligent Tool Selection:</strong> Based on the user’s intent, the LLM decides if a tool is needed. If so, it doesn’t just respond with text; it generates a structured <strong>“tool call”</strong> (e.g., “call get_answers_from_pdf with query return policy&quot;).</li><li><strong>Execution &amp; Feedback Loop:</strong> My Flask backend intercepts this tool call, executes the corresponding Python function, and then feeds the tool’s result <em>back</em> to the LLM. This “feedback loop” is the core of MCP — the LLM now has the real-world data it needs to formulate an accurate, context-aware response.</li></ol><p>This dynamic interaction allows the chatbot to go beyond its initial training data, acting as a true intelligent agent capable of reasoning and action.</p><h4>The Tools and Resources Powering the App 🛠️</h4><p>To achieve this context-aware functionality, the application integrates several distinct tools and resources:</p><p><strong>Custom-Built Tools (Implemented in Python):</strong></p><ol><li><strong>get_product_details(product_id):</strong></li></ol><ul><li><strong>Purpose:</strong> Retrieves specific information (name, price, description) for products from a local product catalog.</li><li><strong>Resource:</strong> product_catalog.json file (loaded into memory).</li></ul><p>2. <strong>get_jsonplaceholder_posts(limit):</strong></p><ul><li><strong>Purpose:</strong> Fetches a specified number of recent posts or articles.</li><li><strong>Resource:</strong> External JSONPlaceholder API (https://jsonplaceholder.typicode.com).</li></ul><p>3. <strong>get_answers_from_pdf(query):</strong></p><ul><li><strong>Purpose:</strong> Searches a company’s FAQ document to find answers to user questions (e.g., about shipping, returns, warranty).</li><li><strong>Resource:</strong> faq.pdf file (text extracted and parsed into a dictionary at startup).</li></ul><h4>Core Technologies &amp; Libraries:</h4><ul><li><strong>HTML/JavaScript:</strong> The frontend for the interactive chat interface.</li><li><strong>Python (Flask):</strong> The backend web framework for handling requests, managing conversation flow, and orchestrating tool calls.</li><li><strong>Google Gemini API:</strong> The Large Language Model providing the core conversational intelligence and tool-calling capabilities.</li></ul><h3>Diving Deeper: The Engineering Behind the Intelligence 💡</h3><p>The backend, built with <strong>Python (Flask)</strong>, is designed for clarity and extensibility.</p><h4><strong>Two-Stage LLM Interaction:</strong></h4><ol><li>The user’s query, conversation history, and <strong>declarations of all available tools</strong> are sent to the Gemini LLM.</li><li>The LLM responds, either with a direct text answer or a structured <strong>functionCall</strong> (e.g., {&#39;name&#39;: &#39;get_answers_from_pdf&#39;, &#39;args&#39;: {&#39;query&#39;: &#39;return policy&#39;}}).</li><li>If a functionCall is received, the Flask backend executes the corresponding Python function (e.g., get_answers_from_pdf).</li><li>The <strong>output from the tool</strong> is then sent <em>back</em> to the LLM in a subsequent call, allowing the LLM to synthesize a natural language response grounded in the retrieved data. This closed-loop feedback is central to MCP.</li></ol><h4><strong>Robust PDF Content Parsing (A Significant Challenge Solved!):</strong></h4><p>Extracting structured information from PDFs can be notoriously difficult due to inconsistent formatting and PyPDF2&#39;s raw text output. I tackled this by implementing a highly robust parsing strategy:</p><ul><li><strong>Initial Extraction:</strong> PyPDF2 extracts raw text from faq.pdf (opened in binary mode rb).</li><li><strong>Aggressive Normalization:</strong> All extracted text undergoes a thorough whitespace normalization (re.sub(r&#39;\s+&#39;, &#39; &#39;, text)) to create a consistent string, making it resilient to varied line breaks and spacing.</li><li><strong>Iterative Sectioning:</strong> Instead of a single complex regex, I developed a method to Identify all major section headings (like “Shipping Information:”, “Return Policy:”) using a simple, flexible regex. Programmatically slice the RAW_PDF_TEXT_CONTENT between these identified headings, ensuring that each heading is correctly associated with its entire content block.</li></ul><p>This approach guarantees that even with subtle PDF rendering quirks, the FAQ_DATA dictionary is accurately populated, allowing the get_answers_from_pdf tool to retrieve precise answers.</p><h4>Experience It Yourself! Clone and Run the Project 🚀</h4><p>I’ve made this project fully accessible on GitHub so you can explore the code and see the MCP in action.</p><ol><li><strong>Clone the repository:</strong></li></ol><pre>git clone https://github.com/VishnuKugarthi/mcp_project_tools_integration<br>cd mcp_project_tools_integration</pre><p><strong>2. Navigate to the </strong><strong>backend directory:</strong></p><pre>cd backend</pre><p><strong>3. Set up a Python virtual environment (recommended):</strong></p><pre>python -m venv venv <br># On Windows: .\venv\Scripts\activate <br># On macOS/Linux: source venv/bin/activate</pre><p><strong>4. Install dependencies:</strong></p><pre>pip install -r requirements.txt</pre><p><strong>5. Create a </strong><strong>.env file:</strong> In the backend directory, create a file named .env and add your Google Gemini API key:</p><pre>GEMINI_API_KEY=&quot;YOUR_GEMINI_API_KEY_HERE&quot;</pre><p><strong>6. Ensure </strong><strong>files/product_catalog.json and </strong><strong>files/faq.pdf exist:</strong> These are included in the repo.</p><p><strong>7. Run the Flask backend:</strong></p><pre>python app.py</pre><ul><li><em>Check your terminal! You should see backend app </em>Running on <a href="http://127.0.0.1:5000/">http://127.0.0.1:5000</a></li></ul><p><strong>8. Open the frontend:</strong> In your web browser, open frontend/index.html. You should see the chat UI as shown below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5mPYlJd9xietmgVENCc9LQ.png" /></figure><p><strong>Try these queries in the chat UI:</strong></p><ul><li>“What is P101?” (Product Catalog Tool)</li><li>“Can you get me some recent articles?” (JSONPlaceholder API Tool)</li><li>“What is your return policy?” (PDF FAQ Tool)</li><li>“How do I track my delivery?” (PDF FAQ Tool)</li><li>“What payment methods do you accept?” (PDF FAQ Tool)</li><li>“Tell me about product P103.” (Product Catalog Tool)</li></ul><h4>This project is a tangible demonstration of :</h4><ul><li><strong>Advanced AI/ML Application Development:</strong> Building intelligent systems that go beyond basic API calls.</li><li><strong>Model Context Protocol (MCP) Implementation:</strong> Designing and integrating tools for dynamic LLM interaction.</li><li><strong>Backend Development (Python/Flask):</strong> API design, routing, request handling, and environment management.</li><li><strong>API Integration:</strong> Seamlessly connecting with external services (Gemini API, JSONPlaceholder).</li><li><strong>Data Processing &amp; Retrieval (RAG principles):</strong> Extracting and structuring information from unstructured documents (PDFs) for retrieval.</li><li><strong>Robust Error Handling:</strong> Implementing try-except blocks for resilient applications.</li><li><strong>Problem Solving:</strong> Tackling complex challenges like PDF text parsing with robust regex and logic.</li><li><strong>Clean Code &amp; Maintainability:</strong> Writing well-structured, commented, and easily understandable code.</li></ul><p>I’m currently exploring AI projects and open to freelance gigs and collaborations. Feel free to connect!</p><p><a href="https://www.linkedin.com/in/vishnu-teja-kugarthi/">Let’s connect on LinkedIn!</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c47c03188fc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Personal Assistant with Local LLMs and RAG on My MacBook Air]]></title>
            <link>https://medium.com/@vishnutejaap/building-a-personal-assistant-with-local-llms-and-rag-on-my-macbook-air-04603ec0954e?source=rss-a6461505d1c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/04603ec0954e</guid>
            <category><![CDATA[assistant]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[ollama]]></category>
            <category><![CDATA[macbook]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Vishnu Teja Kugarthi]]></dc:creator>
            <pubDate>Sat, 05 Jul 2025 11:39:52 GMT</pubDate>
            <atom:updated>2025-07-05T12:00:11.355Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DTCsnnYsvmoWQ_EZYyYPtQ.png" /><figcaption>personal assistant running on my local</figcaption></figure><p>In the world of Large Language Models (LLMs), it often feels like you need a supercomputer or a massive cloud budget to do anything meaningful. But what if I told you that you could build a powerful, domain-specific AI assistant, running entirely on your personal laptop—even one with “just” 8GB of RAM, like my MacBook Air M2?</p><p>That’s exactly what I set out to do, and I’m excited to share how I built <strong>Vishnu’s Personal Assistant</strong>, a RAG-powered chatbot that answers questions about my resume, skills, and projects, all running locally.</p><h3>Why Go Local?</h3><p>While cloud-based LLMs like ChatGPT are incredible, developing locally offers some compelling advantages:</p><ol><li><strong>Privacy &amp; Security:</strong> Your data never leaves your machine. Perfect for sensitive information like a resume.</li><li><strong>Cost-Effectiveness:</strong> No cloud API bills or GPU instance charges. Once the models are downloaded, it’s free to run.</li><li><strong>Offline Accessibility:</strong> Work from anywhere, even without an internet connection.</li><li><strong>Control &amp; Customization:</strong> Full control over the model, its behavior, and its integration into your applications.</li><li><strong>Leveraging Apple Silicon:</strong> Modern Macs with M-series chips (M1, M2, M3) boast powerful Neural Engines and unified memory architecture, making them surprisingly capable for on-device AI inference.</li></ol><p>But how do you make an LLM smart about <em>your</em> specific data, like a resume, without sending it to the cloud or fine-tuning a massive model? The answer lies in <strong>Retrieval-Augmented Generation (RAG).</strong></p><h3>The Magic of RAG: Making LLMs Fact-Checked</h3><p>Foundational LLMs are vast knowledge bases, but they can “hallucinate” or lack specific, up-to-date information. RAG solves this by giving the LLM a factual safety net.</p><p><strong>Here’s the core idea:</strong> Instead of asking the LLM to answer from its general training data, we provide it with relevant, external information (in my case, my resume). The LLM then uses <em>only</em> this provided “context” to formulate its answer. This grounds the LLM’s responses in truth and drastically reduces made-up answers.</p><p>For my personal assistant, this means:</p><ul><li><strong>No more hallucinations:</strong> The assistant won’t invent jobs or skills I don’t have.</li><li><strong>Hyper-relevance:</strong> Every answer is directly pulled from or inferred from my resume content.</li></ul><h3>The Tech Stack: Building Blocks for Your Local AI</h3><p>To bring Vishnu’s Personal Assistant to life, I relied on a powerful yet accessible set of tools:</p><ul><li><strong>Ollama:</strong> The unsung hero for local LLM inference. Ollama makes it incredibly easy to download, run, and manage large language models directly on your machine, with fantastic optimization for Apple Silicon.</li><li><strong>LangChain:</strong> This is my “orchestration layer.” LangChain provides the tools to chain together complex LLM applications, from loading documents and splitting them, to creating embeddings, managing vector stores, and integrating with the LLM itself. It significantly simplifies the RAG pipeline.</li><li><strong>Streamlit:</strong> My choice for the user interface. Streamlit allows you to build beautiful, interactive web applications purely in Python, with minimal effort. It’s perfect for quickly creating shareable demos.</li><li><strong>ChromaDB:</strong> A lightweight, in-memory vector database that integrates seamlessly with LangChain. It stores the numerical representations (embeddings) of my resume chunks, allowing for fast similarity searches.</li></ul><h4>Choosing the Right Models for 8GB RAM:</h4><p>This was the trickiest part! With only 8GB of unified memory on my M2 MacBook Air, model selection was critical. I opted for highly efficient, quantized models:</p><ul><li><strong>LLM (for answers):</strong> For the core LLM (generating answers), I chose <strong>llama3.2:3b</strong>. This decision came after evaluating several efficient models, including <strong>gemma2:2b</strong>, balancing capability with the performance needs of my 8GB MacBook Air. These smaller, quantized models are key to smooth local operation.</li><li><strong>Embedding Model (for understanding):</strong> <strong>nomic-embed-text</strong> This model is specifically designed for creating accurate text embeddings efficiently, and its small footprint makes it ideal for local use.</li></ul><h3>How Vishnu’s Personal Assistant Works Under the Hood</h3><p>Let’s break down the RAG magic behind the chatbot:</p><ol><li><strong>Resume Loading:</strong> The application starts by loading my my_resume.txt file.</li><li><strong>Text Chunking:</strong> The resume is then split into smaller, manageable chunks (e.g., 500 characters each). This is crucial because LLMs have a limited “context window” — the amount of text they can process at once.</li><li><strong>Embedding:</strong> Each text chunk is converted into a numerical vector (an “embedding”) using the nomic-embed-text model. These embeddings capture the semantic meaning of the text.</li><li><strong>Vector Store:</strong> These embeddings are stored in a local ChromaDB vector database, ready for quick lookups.</li><li><strong>Question Asked:</strong> When you type a question, the app takes your query, converts it into an embedding, and then searches the ChromaDB for the most similar (relevant) resume chunks.</li><li><strong>Contextualized Generation:</strong> The retrieved chunks are then passed along with your original question to the llama3.2:3b LLM. A specially crafted prompt instructs the LLM to use <em>only</em> this provided context to generate an answer. If the information isn&#39;t in the context, it&#39;s told to politely state so, preventing hallucinations.</li><li><strong>Chat History:</strong> Streamlit’s st.session_state seamlessly manages the ongoing conversation, providing a natural chat experience.</li></ol><h3>Code</h3><pre>import streamlit as st<br>from langchain_community.document_loaders import TextLoader<br>from langchain.text_splitter import RecursiveCharacterTextSplitter<br>from langchain_ollama import OllamaEmbeddings<br>from langchain_community.vectorstores import Chroma<br>from langchain_ollama import OllamaLLM<br>from langchain.chains import RetrievalQA<br>from langchain.prompts import PromptTemplate<br><br># --- Configuration ---<br># IMPORTANT: Ensure &#39;my_resume.txt&#39; exists in the same directory as this app.py file<br># and contains the plain text content of your resume.<br>DOCUMENT_PATH = &quot;my_resume.txt&quot;<br><br># Model for answering questions (LLM for generation)<br>LLM_MODEL = &quot;llama3.2:3b&quot; <br><br># Dedicated model for generating embeddings (MUST support embeddings)<br># nomic-embed-text is highly recommended for this purpose and is very efficient.<br>EMBEDDING_MODEL = &quot;nomic-embed-text&quot;<br><br># --- Streamlit UI Setup ---<br>st.set_page_config(page_title=&quot;Vishnu&#39;s Personal Assistant - LLM Demo&quot;,<br>                   page_icon=&quot;:robot_face:&quot;,<br>                   layout=&quot;centered&quot;,<br>                   initial_sidebar_state=&quot;collapsed&quot;)<br><br>st.title(&quot;Hi, I&#39;m Vishnu&#39;s Personal Assistant 🤖&quot;)<br>st.subheader(&quot;Powered by Local LLMs via Ollama&quot;)<br>st.write(&quot;Ask me anything about Vishnu&#39;s **work experience, skills, or projects**.&quot;)<br>st.write(f&quot;Powered by **{LLM_MODEL}** (for answers) and **{EMBEDDING_MODEL}** (for understanding)&quot;)<br>st.markdown(&quot;---&quot;)<br><br># Display document content in an expander for transparency<br>try:<br>    with open(DOCUMENT_PATH, &#39;r&#39;) as f:<br>        st.expander(&quot;View Loaded Resume Content&quot;).code(f.read())<br>except FileNotFoundError:<br>    st.error(f&quot;Error: &#39;{DOCUMENT_PATH}&#39; not found. Please create this file in the same directory as app.py and add Vishnu&#39;s resume text.&quot;)<br>    st.stop()<br><br>st.markdown(&quot;---&quot;)<br><br># --- RAG Pipeline Setup (runs once when app starts) ---<br>@st.cache_resource<br>def setup_rag_pipeline():<br>    &quot;&quot;&quot;<br>    Sets up the RAG pipeline components: document loading, splitting,<br>    embedding, vector store creation, and LLM initialization.<br>    This function is cached to run only once to optimize performance.<br>    &quot;&quot;&quot;<br>    with st.spinner(f&quot;Setting up LLM ({LLM_MODEL}) and RAG pipeline with Embeddings ({EMBEDDING_MODEL})...&quot;):<br>        # 1. Load document from the specified path<br>        loader = TextLoader(DOCUMENT_PATH)<br>        documents = loader.load()<br><br>        # 2. Split documents into smaller, manageable chunks<br>        # Increased chunk_size slightly for more context, adjusted overlap accordingly<br>        text_splitter = RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=50)<br>        texts = text_splitter.split_documents(documents)<br><br>        # 3. Create embeddings for the text chunks using the DEDICATED Embedding model<br>        embeddings = OllamaEmbeddings(model=EMBEDDING_MODEL)<br><br>        # 4. Create a vector store (ChromaDB) from the chunks and their embeddings<br>        vectorstore = Chroma.from_documents(texts, embeddings)<br><br>        # 5. Create a retriever to fetch relevant documents from the vector store<br>        retriever = vectorstore.as_retriever(search_kwargs={&quot;k&quot;: 3}) # Retrieve top 3 relevant chunks<br><br>        # 6. Initialize the Large Language Model (LLM) for text generation<br>        llm = OllamaLLM(model=LLM_MODEL)<br><br>        # 7. Create a custom prompt template for the RAG chain<br>        # This guides the LLM to answer based *only* on the provided context.<br>        template = &quot;&quot;&quot;You are Vishnu&#39;s personal assistant. Use the following context to answer questions about Vishnu.<br>        If you don&#39;t know the answer based on the provided context, politely state that the information is not available in the resume.<br>        Do not make up answers.<br><br>        Context: {context}<br><br>        Question: {question}<br>        Answer:&quot;&quot;&quot;<br>        QA_CHAIN_PROMPT = PromptTemplate.from_template(template)<br><br>        # 8. Create RetrievalQA chain with the custom prompt<br>        qa_chain = RetrievalQA.from_chain_type(<br>            llm=llm,<br>            chain_type=&quot;stuff&quot;,<br>            retriever=retriever,<br>            return_source_documents=False, # Set to True if you want to see which chunks were used<br>            chain_type_kwargs={&quot;prompt&quot;: QA_CHAIN_PROMPT}<br>        )<br>        st.success(&quot;RAG pipeline setup complete! Ready to chat.&quot;)<br>        return qa_chain<br><br># Setup the RAG pipeline when the app starts or is rerun<br>qa_chain = setup_rag_pipeline()<br><br># --- Chat History Management ---<br># Initialize chat history in Streamlit&#39;s session state<br>if &quot;messages&quot; not in st.session_state:<br>    st.session_state.messages = []<br>    # Add an initial greeting from the assistant<br>    st.session_state.messages.append({&quot;role&quot;: &quot;assistant&quot;, &quot;content&quot;: &quot;Hello! I&#39;m Vishnu&#39;s personal assistant. How can I help you today?&quot;})<br><br># Display chat messages from history on app rerun<br>for message in st.session_state.messages:<br>    with st.chat_message(message[&quot;role&quot;]):<br>        st.markdown(message[&quot;content&quot;])<br><br># --- User Input and Response Generation ---<br># Accept user input<br># Added a more inviting placeholder<br>if prompt := st.chat_input(&quot;Ask me about Vishnu&#39;s experience, skills, or projects...&quot;, key=&quot;chat_input&quot;):<br>    # Add user message to chat history<br>    st.session_state.messages.append({&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: prompt})<br>    # Display user message in chat message container<br>    with st.chat_message(&quot;user&quot;):<br>        st.markdown(prompt)<br><br>    # Get assistant response<br>    with st.chat_message(&quot;assistant&quot;):<br>        with st.spinner(&quot;Thinking...&quot;):<br>            try:<br>                # Invoke the QA chain with the user&#39;s query<br>                response = qa_chain.invoke({&quot;query&quot;: prompt})<br>                assistant_response = response[&quot;result&quot;]<br>                st.markdown(assistant_response)<br>            except Exception as e:<br>                # Improved error message for the user<br>                assistant_response = (<br>                    f&quot;Oops! An error occurred: `{e}`. &quot;<br>                    &quot;This might be due to Ollama not running, or the models &quot;<br>                    f&quot;(&#39;{LLM_MODEL}&#39; and &#39;{EMBEDDING_MODEL}&#39;) not being pulled correctly. &quot;<br>                    &quot;Please check your terminal for more details and ensure Ollama is active.&quot;<br>                )<br>                st.error(assistant_response)<br>                st.warning(&quot;If the model is not responding, try restarting Ollama or your Streamlit app.&quot;)<br><br>    # Add assistant response to chat history<br>    st.session_state.messages.append({&quot;role&quot;: &quot;assistant&quot;, &quot;content&quot;: assistant_response})<br><br>st.markdown(&quot;---&quot;)<br>st.caption(&quot;This demo showcases local LLM inference and RAG on Apple Silicon. [Learn more about Vishnu](https://vitk.in/).&quot;)</pre><h3>See It in Action!</h3><p>No need to take my word for it. Here’s a quick demo video of Vishnu’s Personal Assistant in action:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FrwBPVJY9MT8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DrwBPVJY9MT8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FrwBPVJY9MT8%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/201834eb9c3ef0ee7f56825d79c056fb/href">https://medium.com/media/201834eb9c3ef0ee7f56825d79c056fb/href</a></iframe><h3>Building Your Own</h3><p>Want to set up your own personal assistant? It’s straightforward!</p><p><strong>Prerequisites:</strong></p><ul><li>Python 3.9+</li><li>Ollama installed and running locally (<a href="https://ollama.com/">Download Ollama</a>)</li></ul><p><strong>Quick Setup Steps:</strong></p><ol><li><strong>Clone the repository:</strong> Find the full code on my <a href="https://github.com/VishnuKugarthi/My_Personal_Chatbot">GitHub</a>.</li><li><strong>Create Virtual Environment (Recommended):</strong> Create a dedicated environment for your project to manage dependencies cleanly.<br>python3 -m venv .venv Then activate it with source .venv/bin/activate.</li><li><strong>Install Python dependencies:</strong> pip install -r requirements.txt</li><li><strong>Prepare your resume:</strong> Create a my_resume.txt file in the project directory with your plain text resume.</li><li><strong>Pull the models:</strong> ollama pull llama3.2:3b and ollama pull nomic-embed-text</li><li><strong>Run the app:</strong> streamlit run app.py</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*Nr7xOYFNUy9OdLSykngkAA.jpeg" /><figcaption>personal assistant</figcaption></figure><p>You’ll find all the detailed instructions and troubleshooting tips in the project’s README.md on my <a href="https://github.com/VishnuKugarthi/My_Personal_Chatbot">GitHub repository.</a></p><h3>Challenges</h3><p>The main challenge was optimizing for 8GB of RAM. This guided my model choices towards smaller, highly quantized versions like llama3.2:3b and nomic-embed-text. While a larger context window (like Gemma 3&#39;s 128K) is tempting, the KV cache memory cost often outweighs the benefits on constrained hardware.</p><h3>Conclusion</h3><p>Building this personal AI assistant has been an incredibly rewarding journey, demonstrating that powerful LLM applications are within reach for individual developers, even on standard laptops. It’s a testament to the rapid advancements in open-source AI and tools like Ollama, LangChain, and Streamlit.</p><p>I’m currently exploring AI projects and open to freelance gigs and collaborations. Feel free to connect!</p><p><a href="https://www.linkedin.com/in/vishnu-teja-kugarthi/">Let’s connect on LinkedIn!</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=04603ec0954e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Code Translator]]></title>
            <link>https://medium.com/@vishnutejaap/ai-code-translator-4aa21a3a8e50?source=rss-a6461505d1c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/4aa21a3a8e50</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[code-translator]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[learning]]></category>
            <dc:creator><![CDATA[Vishnu Teja Kugarthi]]></dc:creator>
            <pubDate>Sat, 21 Jun 2025 20:26:42 GMT</pubDate>
            <atom:updated>2025-07-05T12:13:20.787Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2-BBAYR7Nq5uWI8ip9P6GA.png" /></figure><p>Hey everyone! 👋 <br>So, I’ve been diving headfirst into the world of AI, and let me tell you, it’s been a wild ride! One of my latest projects? Building a code translator using Groq’s awesome AI models.</p><p><strong>Imagine this: </strong>you’ve got some old-school Dojo code lying around, gathering dust. Maybe it’s from a project you haven’t touched in ages, or perhaps you’re just curious about how it would look in modern React. That’s where my little AI buddy comes in!</p><h4><strong>Tools &amp; Technologies Used</strong></h4><p>1. <strong>VS Code: </strong>A versatile and widely-used code editor for writing and managing the project.<br>2. <strong>Python: </strong>Used to write the code for interacting with the Groq API and processing the code transformation.<br>3. <strong>Llama AI Model (Large Language Model): </strong>Powers the code conversion process, translating code from one JavaScript library/framework (e.g., Dojo) to another (e.g., React).</p><h4>How Does It Work?</h4><p>Basically, I whipped up a Python script that uses Groq’s powerful Llama3–8b-8192 model. I feed it your old code (in this case, Dojo) and tell it to transform it into shiny new React code. Think of it as a multilingual translator for your JavaScript!</p><p>Here’s a sneak peek at the core of my translator:</p><pre>import groq<br>import os<br>from dotenv import load_dotenv<br><br>load_dotenv()<br><br># use your own key below <br>GROQ_API_KEY = os.getenv(&quot;LLAMA_API_KEY&quot;)<br>if not GROQ_API_KEY:<br>    raise ValueError(&quot;Groq API Key is missing. Please set GROQ_API_KEY in .env file.&quot;)<br><br>client = groq.Client(api_key=GROQ_API_KEY)<br><br>def transform_js_code(old_code, source_lib, target_lib):<br>    prompt = f&quot;Convert the following {source_lib} code to {target_lib}:\n\n{old_code}\n\nTransformed {target_lib} code:&quot;<br>    response = client.chat.completions.create(<br>        model=&quot;Llama3–8b-8192&quot;,<br>        messages=[<br>            {&quot;role&quot;: &quot;system&quot;, &quot;content&quot;: &quot;You are an expert JavaScript code converter. You can convert code from one library to another. Be precise and clear. For example, convert Dojo code to React. another example, convert React code to Angular.&quot;},<br>            {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: prompt}<br>        ]<br>    )<br>    return response.choices[0].message.content<br><br>def read_js_from_file(file_path):<br>    with open(file_path, &quot;r&quot;, encoding=&quot;utf-8&quot;) as file:<br>        return file.read()<br><br>file_path = &quot;dojo-example.html&quot;<br>old_js_code = read_js_from_file(file_path)<br>transformed_code = transform_js_code(old_js_code, &quot;dojo&quot;, &quot;React&quot;)<br><br>print(transformed_code)</pre><h4>Let’s break it down:</h4><ul><li><strong>import groq, os, dotenv</strong>: libraries for API access, environment handling, and secure key loading.</li><li><strong>load_dotenv():</strong> loads the API key from a .env file.</li><li><strong>groq.Client(…):</strong> initializes the Groq client.</li><li><strong>transform_js_code(…):</strong> prompts the AI to convert JavaScript code.</li><li><strong>client.chat.completions.create:</strong> sends the prompt to Groq’s LLM and fetches a response.</li></ul><h4>The Magic Unfolds!</h4><p>I took a simple Dojo snippet (a color picker, in our example) and let the AI do its thing. And boom! It spat out clean, functional React code:</p><p><strong>Dojo code/Source code:</strong></p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>    &lt;title&gt;Dojo Example&lt;/title&gt;<br>    &lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/dojo/1.10.4/dojo/dojo.js&quot;&gt;&lt;/script&gt;<br>    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://ajax.googleapis.com/ajax/libs/dojo/1.10.4/dijit/themes/claro/claro.css&quot;&gt;<br>    &lt;style&gt;<br>        body {<br>            font-family: Arial, sans-serif;<br>        }<br>    &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body class=&quot;claro&quot;&gt;<br>    &lt;h2&gt;Select a Color&lt;/h2&gt;<br>    &lt;div id=&quot;colorPicker&quot;&gt;&lt;/div&gt;<br>    &lt;script&gt;<br>        require([&quot;dijit/form/ComboBox&quot;, &quot;dojo/store/Memory&quot;, &quot;dojo/domReady!&quot;], function (ComboBox, Memory) {<br>            var colorStore = new Memory({<br>                data: [<br>                    { name: &quot;Red&quot;, id: &quot;red&quot; },<br>                    { name: &quot;Blue&quot;, id: &quot;blue&quot; },<br>                    { name: &quot;Green&quot;, id: &quot;green&quot; }<br>                ]<br>            });<br>            var colorPicker = new ComboBox({<br>                store: colorStore,<br>                searchAttr: &quot;name&quot;<br>            }, &quot;colorPicker&quot;);<br>            colorPicker.startup();<br>        });<br>    &lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p><strong>React code/Target code:</strong></p><pre>import React, { useState, useEffect } from &#39;react&#39;;<br>import ReactDOM from &#39;react-dom&#39;;<br><br>function App() {<br>  const [selectedColor, setSelectedColor] = useState(&#39;&#39;);<br><br>  useEffect(() =&gt; {<br>    const colorOptions = [<br>      { value: &#39;red&#39;, label: &#39;Red&#39; },<br>      { value: &#39;blue&#39;, label: &#39;Blue&#39; },<br>      { value: &#39;green&#39;, label: &#39;Green&#39; },<br>    ];<br><br>    const colorPicker = document.getElementById(&#39;colorPicker&#39;);<br><br>    ReactDOM.render(<br>      &lt;select id=&quot;colorPicker&quot; value={selectedColor} onChange={(event) =&gt; setSelectedColor(event.target.value)}&gt;<br>        {colorOptions.map((option) =&gt; (<br>          &lt;option key={option.value} value={option.value}&gt;<br>            {option.label}<br>          &lt;/option&gt;<br>        ))}<br>      &lt;/select&gt;,<br>      colorPicker<br>    );<br>  }, [selectedColor]); // Added selectedColor to dependency array for re-render on change<br><br>  return (<br>    &lt;div&gt;<br>      &lt;h2&gt;Select a Color&lt;/h2&gt;<br>      &lt;div id=&quot;colorPicker&quot;&gt;&lt;/div&gt;<br>      &lt;p&gt;Selected Color: {selectedColor}&lt;/p&gt;<br>    &lt;/div&gt;<br>  );<br>}<br><br>ReactDOM.render(&lt;App /&gt;, document.getElementById(&#39;root&#39;));</pre><h4><strong>Why Did I Do This?</strong></h4><p>Well, for starters, it’s super fun! But more importantly, it’s a great way to explore AI’s potential in code transformation. Imagine how this could streamline legacy code migrations or help developers learn new frameworks faster.</p><h4>My Takeaways:</h4><ul><li>AI is surprisingly good at understanding and translating code.</li><li>Groq’s models are seriously fast and efficient.</li><li>Building projects like this is an amazing way to learn and experiment with AI.</li><li>Proper prompt engineering is key to getting the desired output from the model.</li><li>Understanding the nuances of both source and target code is crucial for accurate translation.</li></ul><p>This project is just the beginning of my AI adventures. I’m excited to see where this journey takes me!</p><p>Stay tuned for more AI experiments and coding shenanigans!</p><p>I’m currently exploring AI projects and open to freelance gigs and collaborations. Feel free to connect!</p><p><a href="https://www.linkedin.com/in/vishnu-teja-kugarthi/">Let’s connect on LinkedIn!</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4aa21a3a8e50" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>