<?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 Kundan Singh on Medium]]></title>
        <description><![CDATA[Stories by Kundan Singh on Medium]]></description>
        <link>https://medium.com/@kundansinghsorout?source=rss-c988f0478dee------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*TP5oMK_ks2Ux_06kmdBr9w.png</url>
            <title>Stories by Kundan Singh on Medium</title>
            <link>https://medium.com/@kundansinghsorout?source=rss-c988f0478dee------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 13:05:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kundansinghsorout/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 I Stopped AI “Context Pollution” and Drastically Reduced Token Usage]]></title>
            <link>https://medium.com/@kundansinghsorout/how-i-stopped-ai-context-pollution-and-drastically-reduced-token-usage-bdf61594d278?source=rss-c988f0478dee------2</link>
            <guid isPermaLink="false">https://medium.com/p/bdf61594d278</guid>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <dc:creator><![CDATA[Kundan Singh]]></dc:creator>
            <pubDate>Mon, 10 Aug 2026 09:02:51 GMT</pubDate>
            <atom:updated>2026-08-10T09:02:51.452Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a91KQ2WOClf6wzhL40sFyw.png" /></figure><p>If you’ve spent any time building projects with AI coding assistants, you know the honeymoon phase. For the first twenty prompts, the AI is a genius. It writes flawless code, understands your architecture, and moves at lightning speed.</p><p>But by prompt fifty, something breaks.</p><p>The AI starts forgetting your original instructions. It hallucinates variables that don’t exist. And worst of all, because AI billing is based on “tokens” (the amount of text the AI has to read and generate), your costs skyrocket. Why? Because every time you ask a new question, the AI has to re-read the <em>entire</em> history of your conversation. This is called <strong>context pollution</strong>.</p><p>I realized that treating my AI assistant like a single, monolithic employee was the problem. Here is how I solved it by building a <strong>Manager-Worker Architecture</strong> using Git Worktrees — a method that keeps code quality perfectly intact while slashing token usage.</p><h3>The Core Idea: Divide and Conquer</h3><p>In a real software company, the Lead Architect doesn’t type out every line of CSS. They plan the system, define the tasks, and hand them off to developers.</p><p>I decided to treat my AI the exact same way. Instead of using one massive AI chat for my entire project, I split the AI into two roles:</p><ol><li><strong>The Master (The Planner):</strong> Uses a high-tier, heavy-reasoning model. Its only job is to analyze the project, figure out what needs to be built next, and write a detailed instruction manual for that specific task.</li><li><strong>The Worker (The Executor):</strong> Uses a faster, cheaper, mid-tier model. Its only job is to take the Master’s instructions, write the code, and pass the tests.</li></ol><h3>The Secret Weapon: Git Worktrees</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sCUKDsqMxd86bCp8vrbMSw.png" /></figure><p>To keep the Worker AI completely focused, I use a feature called <strong>Git Worktrees</strong>.</p><p>If you aren’t a hardcore developer, think of a Worktree as a temporary, parallel dimension of your project folder. Instead of the Worker AI messing around in your main project folder (which might break things or confuse the Master AI), a Worktree creates an isolated folder for just that one specific task.</p><p>Because it’s a separate folder, I can even spin up the user interface for the Worktree on a different network port (like localhost:8502) to visually check the changes, while my main stable project keeps running perfectly on localhost:8501.</p><h3>The Step-by-Step Workflow</h3><p>Here is how the loop actually works in practice:</p><h3>1. The Master Plans</h3><p>I open my main session and tell the Master AI what feature I want. The Master does the deep thinking. It doesn’t write the code; instead, it creates a new Worktree (a separate branch and folder) and drops a simple task_spec.md file inside it. This file explains exactly what needs to be done.</p><h3>2. The Worker Executes</h3><p>I open a fresh, brand-new AI session inside the Worktree folder using the cheaper Worker model. Because it’s a new session, its “memory” is totally empty. It only reads the task_spec.md and the few files it needs to edit. No bloated history. No context pollution. It just writes the code.</p><h3>3. The Quality Gate (Automated Tests)</h3><p>Here is the most important part to save tokens: <strong>The Master AI never reviews the Worker’s code.</strong> Having a high-tier AI read hundreds of lines of code to check for errors is a massive waste of tokens.</p><p>Instead, the Worker is required to run automated test cases. If the tests fail, the Worker reads the error log, fixes its own code, and tries again. Once the tests show a “green” passing status, the code is definitively good to go.</p><h3>4. The Handoff</h3><p>Once the tests pass, the Worker automatically pushes the code and creates a Pull Request. I merge it.</p><p>I then go back to the Master session and simply say: <em>“Task completed.”</em></p><p>The Master pulls the latest updates. It doesn’t read the massive code diff. It just sees the “success” status, updates its internal checklist, and begins planning the next feature.</p><h3>Why This is a Game Changer</h3><ul><li><strong>Incredible Token Efficiency:</strong> The expensive Master model only reads high-level summaries. The cheaper Worker model only reads the specific files for its current task. You never pay to have an AI read a 100-message deep conversation.</li><li><strong>No Hallucinations:</strong> Because the Worker starts with a fresh brain for every single task, it never gets confused by code you deleted three days ago.</li><li><strong>High Quality:</strong> By forcing the Worker to pass automated tests rather than relying on an AI to “eyeball” the code for correctness, the main branch stays incredibly stable.</li></ul><p>By shifting from a single “chat” to a highly structured Manager-Worker pipeline, you stop fighting the AI’s memory limits. You spend fewer tokens, encounter fewer bugs, and ship features faster.</p><h3>Over to You!</h3><p>Have you tried splitting your AI coding tasks between different models, or are you still relying on a single, massive chat session? I’d love to hear how you are managing your workflows. Drop a comment below and let me know which of these strategies you are going to try first — or share your own tricks for beating AI memory limits!</p><p>If you found this breakdown helpful and want to see more practical guides on optimizing your daily workflows, <strong>hit that follow button</strong>. Let’s figure out the future of building software together! Ans let’s discuss if you have any issue to implement or anything interesting to brainstorm with me.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bdf61594d278" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I Built a Job-Search Copilot That Refuses to Lie]]></title>
            <link>https://medium.com/@kundansinghsorout/i-built-a-job-search-copilot-that-refuses-to-lie-c3c8d2c9a3e4?source=rss-c988f0478dee------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3c8d2c9a3e4</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[job-search]]></category>
            <category><![CDATA[ai-job-automation]]></category>
            <dc:creator><![CDATA[Kundan Singh]]></dc:creator>
            <pubDate>Wed, 22 Jul 2026 19:33:25 GMT</pubDate>
            <atom:updated>2026-07-22T19:33:25.713Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Deterministic where possible, agentic where necessary — engineering an honest job-apply pipeline that runs entirely on your laptop.</em></p><h3>The problem, with numbers</h3><p>A serious job application takes about 30 minutes. Read the job description properly. Figure out which parts of your experience actually matter for this role. Rework your resume so those parts lead. Export a clean PDF. Fill the form. Answer the screener questions.</p><p>Now multiply that by the volume a real job search demands, and every candidate lands on one of two bad strategies: spend three hours a day on five applications, or blast one generic resume at everything and hope. The first burns you out. The second buries you — recruiters open a posting to find 500 near-identical resumes, and the genuinely qualified people are indistinguishable from the noise.</p><p>Both sides of the hiring table lose. I was living the candidate side of it, so I built the tool I wished existed.</p><h3>What it does</h3><p>One pipeline, seven stages, end to end:</p><p>Find → Score → Tailor → Render → Apply → Track → Prep</p><ul><li>Find: aggregates postings from 10+ job boards and company ATS pages into one workspace.</li><li>Score: a two-stage match — a fast composite score over every job, then a deeper rubric pass on the ones worth it — so you spend attention where it counts.</li><li>Tailor: rewrites your resume <em>for that job</em> (more on the rules below, because this is where every tool like this goes wrong).</li><li>Render: produces an exactly-two-page, ATS-parseable PDF. Not “about two pages” — the renderer loops until it is exactly two.</li><li>Apply: submits through one of three automation tiers, with hard guardrails.</li><li>Track: reads your Gmail (read-only) and classifies recruiter replies — every application moves across a kanban on its own as rejections, assessments, and interview invites arrive.</li><li>Prep: generates likely interview questions from the job description, keeps a STAR story bank, and builds a company research brief.</li></ul><p>So far it has aggregated 2,000+ jobs, submitted and tracked 230+ real applications, and survived 100-job overnight runs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sj20HCIeOZHbCqPL8IkNxw.png" /></figure><h3>The part I refused to compromise: it cannot lie</h3><p>Every resume-tailoring tool faces the same temptation: the language model “improves” your resume by quietly inventing things. A skill you don’t have. A metric you never measured. An inflated title. It usually works on the ATS — and then detonates in the interview.</p><p>So the core rule of this system is enforced by code, not by prompt:</p><p>Every claim in the master resume carries a confidence tag — core, working, familiar, or do_not_claim. The tailoring step can select, reorder, and rephrase — but a verifier checks every line of the output against those tagged claims. A line that can&#39;t be traced back to something real is rejected before it ever reaches a PDF.</p><p>And when an application form asks something the system doesn’t know — current CTC, notice period, visa status, “do you have a relative at this company?” — it does not guess. It pauses, asks <em>me</em>, saves my answer to a Q&amp;A memory, and never asks the same question twice. There is no code path where the system fabricates a fact about a human being.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JzY0VsnBcm-sqkGoSESC5w.png" /></figure><p>This isn’t ethics as decoration. A fabricated resume gets you interviews you’ll fail. The system’s actual job is to present the real you clearly enough to be seen — not to invent a better you.</p><h3>One job, one application</h3><p>Here’s a real row from my database. The same data analyst posting arrived from three boards as:</p><ul><li>MH, IN</li><li>Pune, Maharashtra, India</li><li>Pune Division, Maharashtra, India</li></ul><p>Same job, three location spellings, three “different” postings — and a naive tool would apply to all three. The same recruiter sees your resume three times. That’s how you get flagged as spam.</p><p>Deduplication here runs three passes: apply-URL match, then an exact hash over normalized company + title + location, then a fuzzy title match within the same normalized company and location. When I measured it against live data, 51 cross-board pairs shared a company and title. Fourteen were the same posting in different spellings — those collapse into one. Thirty-seven were genuinely different postings (the same title hired in Pune <em>and</em> Bengaluru) — those stay separate. A state-only location is deliberately never merged into a city-level one, because “Maharashtra” could be any city in Maharashtra, and a wrong merge silently deletes a job you wanted.</p><p>Then the interesting part: when one job exists on several boards, <em>which channel do you apply through?</em> The system prefers the company’s own ATS over the native board, and the native board over one-click mass-apply channels. The reasoning is entirely about interview odds: a company’s own ATS is what the hiring team actually screens from, while the one-click pile is the largest and least-read stack in recruiting. One application, through the door a human actually opens.</p><h3>Deterministic where possible, agentic where necessary</h3><p>“AI agent” is the hammer of the moment, so let me be precise about where this system does <em>not</em> use one.</p><p>Tier 1 — direct ATS form-fill. Greenhouse and Lever have stable, predictable forms. A deterministic script fills them. It’s fast, testable against recorded HTML fixtures in CI, and it fails loudly when a selector drifts.</p><p>Tier 2 — major job boards. These run through <em>your own logged-in browser session</em>, at human pace, under hard caps. Still deterministic: each board has a dedicated applier that knows its exact flow, including the ugly parts — one board reveals screener questions through a chatbot one message at a time; another hides its apply dialog inside shadow DOM where naive DOM queries return nothing.</p><p>Tier 3 — everything else. Company career portals (Workday, Keka, SuccessFactors, and a thousand custom ones) can’t have a dedicated script each. This is the <em>only</em> place an adaptive agent runs: a browser extension autofills what it can, and an agent loop handles what’s left — bounded to a fixed number of steps, restricted to a closed list of actions, and forbidden by hard rules from ever touching CAPTCHAs, passwords, or diversity questions, no matter what the model decides.</p><p>And here’s the design goal that I think matters most: the agent’s target usage is zero. Every agent run writes a full trace — every observation, every decision, every screenshot. When a portal shows up repeatedly, I read the trace, encode that flow as a deterministic fast path with a regression fixture, and that portal never needs the agent again. The agent isn’t the product. It’s the scout that makes the deterministic system grow.</p><p>Why so stubborn about this? Because agents are slower, costlier, and less predictable than code — and when thirty lines of selector logic plus a fixture test can replace an agent, they should. The inverse design — agents everywhere — demos beautifully and degrades in production.</p><h3>Guardrails are the product</h3><p>Every apply attempt passes through, in order: a kill switch, configurable activity hours (applications go out when a human would plausibly send them), a per-board daily cap, and a minimum tailored-match score below which the system refuses to apply at all.</p><p>On top of that, three red lines that no setting can disable: CAPTCHAs are never solved automatically — they pause for a human. Diversity and EEO self-identification questions are never auto-answered. And every attempt leaves a full audit trail — what was clicked, what was answered, what the outcome was.</p><p>The result is a system that is <em>structurally incapable</em> of spray-and-pray. Fewer, better applications isn’t the marketing line; it’s what the guardrails enforce.</p><h3>Local-first, by design</h3><p>The whole stack runs on a laptop with Docker Compose. The LLM can be fully local — a 4-billion-parameter model via Ollama tailors a resume in about 90 seconds, at zero API cost. Gmail access is read-only, used solely to classify recruiter replies. Nothing about your job search — not your resume, not your salary answers, not your rejection emails — leaves your machine.</p><p>That started as a privacy stance. It turned out to also be the property that engineering teams and compliance-minded companies ask about first.</p><h3>What broke at 100 jobs a night</h3><p>The honest section. Automation against the live web is mostly failure engineering, and three failures taught me more than everything that worked.</p><p>The 74-tab night. During the first overnight stress run, the browser wedged with 74 open tabs and 255 registered targets. Root cause: a cleanup path that silently swallowed tab-close failures — each leaked tab was invisible until the pile-up froze everything, and 11 innocent jobs recorded failures that had nothing to do with those jobs. The fix was boring and absolute: force-close through the browser’s debug protocol, and never swallow a cleanup failure silently. Peak tab count the next night: three.</p><p>The redesign that broke everything. One morning, a major board’s frontend rewrite removed the role attributes my selectors anchored on — every selector matched zero elements, and every posting suddenly read as “external application” (a wrong answer, delivered confidently). The dialog also turned out to live inside shadow DOM, where standard DOM queries return empty and only framework-level locators can reach. Two fixes: anchor on aria-labels (the only handle stable across both designs), and — more important — make the system report <em>“unknown state, selectors may have drifted”</em> instead of asserting a wrong verdict. Confident wrongness is the most expensive failure mode automation has.</p><p>The stranded rows. Answering a screener question flipped the application’s status to “in progress” <em>before</em> re-running the apply. When a resume attempt died mid-flight — browser hiccup, timing, anything — the row was stranded in a state no screen listed and no process would ever revisit. Three applications sat invisible for days before I found them. The fix inverted the order: validate everything <em>before</em> changing state, run the slow work in the background, and park any failure in a visible, retryable state. The lesson generalizes: in workflow systems, the <em>order</em> of state changes is where the bugs live.</p><h3>And then it flies itself</h3><p>The newest layer: save a search as a batch — titles, cities, boards, salary floor — and the system re-runs it on a timer, tailors everything it finds, and applies. One batch active at a time. A new cycle starts only when nothing is left mid-application. Every guardrail above still runs on every single job, because autopilot deliberately reuses the exact same pipeline a manual click uses — it decides <em>when</em>, never <em>how</em>. Scheduling a pipeline is a feature; reimplementing one is a future bug.</p><p><em>[Screenshot: the autopilot page with a batch waiting on the queue]</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mLdlf3PdXIpAzGXVVUgvEA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lp6SVf8Fb6jqCob5rhYbJQ.png" /></figure><h3>What happens next — and where you come in</h3><p>The system works end to end today: it found jobs this morning, tailored honestly, applied within its caps, and filed recruiter replies while I wrote this article.</p><p>The open question is what it becomes. I’m weighing open-core against a closed beta, and the strongest argument for opening it is purely technical: board integrations rot — selectors drift weekly as sites redesign — and a community keeps ten boards alive in a way no individual can. The argument for a closed beta is focus: a smaller group, faster iteration, tighter feedback.</p><p>If you have a strong take, I want to hear it. If you want early access, the waitlist is linked below. If you want to contribute — especially if you know a job board or ATS I haven’t covered — my DMs are open.</p><p>And if you work at a hiring platform, a staffing firm, or an HR-tech company, and any of this overlaps with problems on your roadmap — I’m easy to find.</p><p><em>Waitlist link : </em><a href="https://forms.gle/QWgijo8VvEBNjqJh9">https://forms.gle/QWgijo8VvEBNjqJh9</a></p><p><em>LinkedIn : </em><a href="https://www.linkedin.com/in/kundan-singh-sorout/">https://www.linkedin.com/in/kundan-singh-sorout/</a></p><p><em>Demo video :</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FHs9sAIysHq4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DHs9sAIysHq4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FHs9sAIysHq4%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c390122b63d44433caa8387ca61c7683/href">https://medium.com/media/c390122b63d44433caa8387ca61c7683/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3c8d2c9a3e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running Local LLMs on a 6GB GPU Laptop — What Actually Works in 2026 (And What Doesn’t)]]></title>
            <link>https://medium.com/@kundansinghsorout/running-local-llms-on-a-6gb-gpu-laptop-what-actually-works-in-2026-and-what-doesnt-487fda2a604e?source=rss-c988f0478dee------2</link>
            <guid isPermaLink="false">https://medium.com/p/487fda2a604e</guid>
            <category><![CDATA[quantization]]></category>
            <category><![CDATA[qwen-35]]></category>
            <category><![CDATA[local-llm]]></category>
            <category><![CDATA[ollama]]></category>
            <dc:creator><![CDATA[Kundan Singh]]></dc:creator>
            <pubDate>Thu, 02 Apr 2026 12:54:31 GMT</pubDate>
            <atom:updated>2026-04-02T12:54:31.038Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MiOCrWJfF0dHhk0A5fSJRw.png" /></figure><p>I’ve been running local LLMs on my RTX 3060 6GB laptop for a while now. And let me be honest — nobody talks about what it’s actually like to work with 6GB VRAM. Everyone writes guides assuming you have 12GB, 16GB, or worse, a $4,000 workstation.</p><p>So I’m writing this for people like me. People who are serious about local AI but working with real-world constraints — budget laptops, 6GB GPUs, and no patience for guides that don’t actually work on their hardware.</p><p>I also recently came across something interesting — <strong><em>Sipeed </em></strong>released a tool called <a href="https://llmdev.guide/">llmdev.guide</a> that benchmarks hardware by tokens/sec, price, and power consumption across different LLMs. It’s a solid reference. But it still doesn’t tell you the real tricks you need to survive on 6GB VRAM. That’s what this post is about.</p><h3>Why I Started Running LLMs Locally</h3><p>Honestly? Privacy was the first reason. I’m building a DRL-based stock trading system with 1400+ stocks. My data — my signals, my portfolio positions, my backtesting logs — I didn’t want any of it going to OpenAI servers. Not because I’m paranoid. Just because it’s mine.</p><p>The second reason was cost. API tokens add up fast when you’re running hundreds of test queries during model development. Running locally? Zero per query.</p><p>The third reason was offline access. I travel. I work from places where the internet is unreliable. A local model doesn’t care about your WiFi.</p><h3>The 6GB VRAM Wall Is Real</h3><p>Let me be real with you. Most 7B models in full precision (FP16) need around 14GB of VRAM. That’s more than double what I have. So no — you can’t just “download and run” anything you want.</p><p>Here’s what actually happens when you don’t know what you’re doing:</p><p>✖️ Model loads for 2 minutes then crashes with CUDA out of memory<br>✖️ You reduce batch size to 1 and it still crashes<br>✖️ You Google for an hour and find guides that assume 12GB+</p><p>I went through all of this. So let me save you the time.</p><h3>My Setup — What I Actually Use</h3><p>Hardware: RTX 3060 6GB (laptop), 16GB RAM, Windows 11<br>Tool of choice: Ollama</p><p>Let me talk about Ollama for a second because this changed everything for me.</p><p>I’ve tried LM Studio, text-generation-webui, llama.cpp directly — all of them. But I keep coming back to Ollama. Why? Because it’s dead simple. One command to pull a model, one command to run it. That’s it.</p><pre>ollama pull qwen3.5:4b<br>ollama run qwen3.5:4b</pre><p>Done. You’re talking to a local model. No YAML config files. No broken Python dependencies. No 45-minute setup guides.</p><p>But the real reason I love Ollama for 6GB hardware specifically is this — it handles the quantization and layer loading intelligently. When you pull a model, you can specify Q4_K_M versions that are optimized for low VRAM. And if needed, Ollama automatically offloads some layers to CPU — which means you can still run models that technically exceed your VRAM, just slower.</p><p>For larger models where I need to push the limits — like running a 13B or even a 34B model in a pinch — Ollama handles the split loading between GPU and RAM without me having to manually figure out layer counts. It just works.</p><h3>Models That Actually Work on 6GB</h3><p>This is the list I’ve personally tested and confirmed works on RTX 3060 6GB:</p><p>✅ Qwen3.5 4B Q4_K_M — My current daily driver. Absolutely punches above its weight for a 4B model. Handles reasoning, code, and long instructions like a champ. Barely touches 3.5GB VRAM. This is the one I recommend to everyone on 6GB first.<br>✅ Qwen3.5 9B Q4_K_M — When I need more depth — complex multi-step reasoning, longer context, or more nuanced responses. Fits in ~6GB with some headroom. Noticeably better than 4B on hard tasks without a big speed penalty.<br>✅ Qwen2.5 7B Q4_K_M — The older generation but still solid for code generation. If you can’t get Qwen3.5 for some reason, this is a reliable fallback. Fits comfortably in 6GB.<br>✅ Gemma 2 2B — When I need something ultra-fast and the GPU is already doing other things. Tiny, responsive, good enough for quick lookups.<br>✅ LLaVA 7B Q4 — For vision + language tasks like analyzing charts for my trading system.</p><p>Older models I used before (still work, but Qwen3.5 is better now):<br>→ Mistral 7B Q4_K_M — Was my go-to for months. Still runs fine on 6GB. Replaced by Qwen3.5 9B for most tasks.<br>→ Phi-3 Mini (3.8B) — Good for quick queries. Now outclassed by Qwen3.5 4B at the same size range.<br>❌ Llama 3.1 8B FP16 — Crashes. Every time.<br>❌ Mixtral 8x7B — Beautiful model. 26GB+ VRAM. Not happening on 6GB.<br>❌ Any 13B+ model in FP16 — Forget it.</p><h3>Techniques That Actually Help</h3><p>These are the real techniques I use daily — not theory, not YouTube tutorials, actual things that keep my setup running.</p><ol><li>Always use Q4_K_M quantization</li></ol><p>Q4_K_M is the sweet spot. It reduces model size by ~60–70% vs FP16 with minimal quality loss. For Qwen3.5 9B, you go from ~18GB in FP16 → ~6GB with Q4_K_M. That’s the difference between “impossible” and “runs perfectly” on 6GB.</p><p>In Ollama, just do:</p><pre>ollama pull qwen3.5:4b-q4_K_M</pre><p>2. Keep your context window short</p><p>This is the one thing most people get wrong. The longer your context window, the more GPU memory the model eats — not just for the model weights, but for the KV cache too. For quick queries and code help, I keep context at 2048. For longer document tasks, I push to 4096 max.</p><p>3. Close everything else before running</p><p>Browsers with many tabs, VS Code with extensions, Chrome — all of these take VRAM even when you’re not actively using them. I have a habit of closing everything before loading a model. Frees up 0.5–1GB which makes a real difference at 6GB.</p><p>4. Use Ollama’s — gpu-layers flag for fine control</p><p>If a model is too big for full GPU loading, you can tell Ollama exactly how many layers to keep on GPU and let the rest run on CPU. Slower, but it works:</p><pre>ollama run mistral - gpu-layers 20</pre><p>I use this when I want to test a larger model without fully committing to it.</p><h3>The Money vs Performance Reality</h3><p>I came across the llmdev.guide benchmark recently (published by Sipeed), and one thing struck me immediately — a $260 Intel Arc B580 12GB GPU delivers roughly the same tokens per second as a $4,000+ NVIDIA DGX Spark or Apple Mac Studio M3 for Qwen 3.5 9B.</p><p>That tells you everything you need to know. More money doesn’t automatically mean better inference performance for local LLMs. What matters is:</p><p>→ VRAM capacity (can you load the model at all?)<br>→ Memory bandwidth (how fast data moves to/from the GPU)<br>→ The right quantization for your use case</p><p>My RTX 3060 6GB has lower bandwidth than a 3090, yes. But with the right model and quantization, I still get 25–40 tokens/sec on Qwen3.5 4B Q4_K_M, and around 15–22 tokens/sec on Qwen3.5 9B Q4_K_M. That’s fast enough for real work.</p><h3>What I Wish I Knew Before Starting</h3><p>A few honest lessons from months of doing this:</p><p>VRAM is king, not the number of CUDA cores. I wasted weeks trying to optimize things that didn’t matter, when the real answer was always quantization.</p><p>Smaller models are not worse models. Qwen3.5 4B at Q4_K_M handles 80% of my daily tasks faster and better than a poorly quantized 13B model struggling in CPU-offload mode. Don’t let the parameter count fool you.</p><p>Don’t buy hardware just for LLMs — yet. If your current laptop runs Q4 models at acceptable speeds, hold that money. The GPU market is moving fast. What’s worth buying in 6 months will look very different.</p><p>Ollama is not just a beginner tool. I’ve seen people say “graduate” from Ollama to llama.cpp. I disagree. Ollama’s simplicity is a feature, not a limitation. I use it for everything, from quick tests to my actual production local inference setup.</p><h3>Final Thoughts</h3><p>6GB VRAM is not a dead end. It’s a constraint that teaches you to be smart about what you run and how you run it.</p><p>I’ve built RAG pipelines, stock market data analysis tools, and a full DRL trading system — all with a local model running on this laptop. It works. Not because I have great hardware, but because I learned what actually matters.</p><p>If you’re sitting on a mid-range GPU right now wondering if local AI is even possible for you — it is. You just need the right model, the right quantization, and Ollama to make it dead simple.</p><p>What model are you currently running locally? Or are you still on cloud inference? Drop it in the comments 👇</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=487fda2a604e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Just Dropped TurboQuant — And It Changes Everything for Local LLM Inference]]></title>
            <link>https://medium.com/@kundansinghsorout/google-just-dropped-turboquant-and-it-changes-everything-for-local-llm-inference-d6e35447ce9b?source=rss-c988f0478dee------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6e35447ce9b</guid>
            <category><![CDATA[polar-quant]]></category>
            <category><![CDATA[llm-quantization]]></category>
            <category><![CDATA[quantization]]></category>
            <category><![CDATA[turbo-quant]]></category>
            <dc:creator><![CDATA[Kundan Singh]]></dc:creator>
            <pubDate>Thu, 26 Mar 2026 14:18:33 GMT</pubDate>
            <atom:updated>2026-03-26T14:18:33.274Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Turbo Quant to reduce Long Context Window." src="https://cdn-images-1.medium.com/max/1024/1*0EABd3v6-7F0OZp1TBssew.png" /></figure><p>I’ve been building a DRL-based stock trading system for a while now. 1400+ stocks. Custom multi-factor environment. DQN models — the whole thing.</p><p>One thing kept bothering me while running this setup locally. My RTX 3060 has 6GB VRAM as because I can’t send my codebase to any server. Every time I tried to push the context window longer — to feed more stock data, more indicator history, more news text into the model — the KV cache would eat up the remaining VRAM and inference would stall. Then I either drop the context or offload to CPU and kill the speed completely.</p><p>I’ve been sitting with this problem for months. No clean solution.</p><p>Then two days ago Google Research dropped TurboQuant. I read through the paper and the GitHub implementation the same evening. And honestly — this is the most excited I’ve been about a research paper in a long time. Not because it’s hyped. Because it directly solves my exact problem.</p><h3>So what is TurboQuant?</h3><p>It’s a compression algorithm for the KV cache of LLMs. Accepted at ICLR 2026. Research by Google, in collaboration with KAIST and NYU.</p><p>Quick background — the KV cache is the memory that stores all previous tokens your model has seen during a conversation or inference run. It grows with context length. At 100k tokens, the KV cache can actually be bigger than the model weights themselves. That’s the core bottleneck for anyone running local inference with limited VRAM.</p><p>TurboQuant compresses that cache down to 3 bits. With zero accuracy loss. No fine-tuning. No calibration data needed. No per-model setup.</p><p>I’ll be honest — that claim sounds too good. But the benchmarks back it up. More on that below.</p><h3>How it actually works</h3><p>Two stages. Both do a specific job.</p><ol><li><strong><em>PolarQuant : </em></strong>Normal quantizers store vectors in Cartesian coordinates (X, Y, Z). The problem is the data boundaries keep changing so you always need an expensive normalization step. PolarQuant converts the same data into polar coordinates instead. Think of it like switching from “Go 3 blocks East, 4 blocks North” to “Go 5 blocks at a 37-degree angle”. Same info, less overhead.<br>The key insight: angular distributions of high-dimensional vectors are <br>highly concentrated and predictable. So the boundaries are already known. No normalization needed. PolarQuant takes pairs of coordinates, converts them recursively into polar form, and ends up with a single radius + a set of compact angles. Far fewer bits.</li><li><strong><em>QJL — Quantized Johnson-Lindenstrauss :</em></strong> Here’s the problem PolarQuant alone can’t fix: MSE-based quantizers introduce a bias in inner product calculations. And in transformer attention, everything runs on inner products (query × key dot products). If that’s biased, attention scores are wrong.<br>QJL takes the tiny residual error left after Stage 1 and applies the Johnson-Lindenstrauss Transform to it. JL is a maths theorem that lets you project high-dimensional data to much lower dimensions while preserving distances. Then QJL reduces each resulting number to just 1 sign bit: +1 or -1. That’s it. 1 bit per value.</li></ol><p>The crazy part is — that 1 bit completely cancels the bias that Stage 1 introduced. Zero memory overhead. Near-Shannon-optimal compression. And the attention scores come out clean.</p><h3>The benchmark numbers</h3><p>Google tested TurboQuant on Llama-3.1–8B-Instruct, Ministral-7B, Gemma, and Mistral. Benchmarks: LongBench and ZeroSCROLLS. Both standard long-context evaluation suites.</p><p>Here’s what they got:</p><p>✅ KV cache: 6x smaller. FP16 → 3 bits<br>✅ Attention speed on H100: up to 8x faster in 4-bit mode vs 32-bit baseline<br>✅ Accuracy loss: zero. Literally zero across all benchmarks<br>✅ Needle-in-a-Haystack: 100% recall maintained at 3.5 bits up to 104k tokens<br>✅ Fine-tuning: not required<br>✅ Calibration data: not required<br>✅ Vector search (GloVe d=200): beats Product Quantization and RabbitQ in recall with zero training time</p><p>That last one is interesting. KIVI and RabbitQ are the current best-in-class KV compression methods in the field. TurboQuant beats both.</p><p>And the really crazy part — none of the 8x speed improvement requires any special hardware ops. The algorithm uses basic matrix operations and sign bits. No exotic Tensor Core intrinsics. Which means it works on consumer GPUs too. Not just H100s.</p><h3>What this means for me on RTX 3060 6GB</h3><p>Right now with a 7B model at 4-bit weights I can barely push 4k–6k tokens before the KV cache starts competing with the model weights for VRAM. Beyond that I’m either truncating context or watching inference grind to 2–3 tokens/sec on CPU offload.</p><p>Once TurboQuant lands in llama.cpp or vLLM (which is a matter of months, not years), here’s what changes for me:</p><p>✅ Context window goes from ~4k to ~20–24k on the same 6GB. Same model. Same quality. That means I can feed way more stock data, news context, and indicator history into a single inference call without hitting the VRAM wall.</p><p>✅ Might be able to run a 13B model at shorter context instead of a 7B at longer context. The KV cache is no longer the bottleneck deciding which model I can run.</p><p>✅ Local vector search gets faster. I use nearest-neighbour lookups for market regime detection and stock similarity scoring. TurboQuant’s zero-training-required vector quantization means I can store more embeddings in GPU memory and query them faster — no upfront PQ training, no codebooks to manage.</p><p>✅ It’s pure PyTorch. No special hardware requirements. My 3060 handles basic matrix ops and sign bits just fine. The community implementation is already live: <a href="https://github.com/tonbistudio/turboquant-pytorch">https://github.com/tonbistudio/turboquant-pytorch</a></p><h3>Where things stand right now</h3><p>TurboQuant is not yet integrated into llama.cpp or vLLM as of today. It’s at the research-to-production boundary.</p><p>But:</p><p>The community PyTorch implementation is already working. The algorithm needs only standard matrix ops. The paper is at ICLR 2026 which means visibility is high. NVIDIA DGX forum and llama.cpp issue tracker already have people discussing TurboQuant KV backend support.</p><p>What to watch for:</p><p>→ llama.cpp issue tracker for a — kv-cache-quant turboquant flag<br>→ vLLM PR discussions on KV quantization backends<br>→ Ollama adding TurboQuant as a compression mode<br>→ The turboquant-pytorch repo adding CUDA kernel support</p><p>I’m planning to start experimenting with the PyTorch repo on my DRL setup this weekend. The code is clean enough to get started in one sitting.</p><p>Google Research blog: <a href="https://research.google/blog/turboquant-redefining-ai-efficiency-with-extreme-compression/">https://research.google/blog/turboquant-redefining-ai-efficiency-with-extreme-compression/</a></p><p>PyTorch implementation: <a href="https://github.com/tonbistudio/turboquant-pytorch">https://github.com/tonbistudio/turboquant-pytorch</a></p><p>Are you running local LLMs on a consumer GPU and hitting the same VRAM wall? Would be curious what context lengths you’re working with and which models you’re using. Drop it in the comments 👇</p><p>#GoogleResearch #TurboQuant #LocalLLM #KVCache #Quantization #PyTorch #MachineLearning #RTX3060 #LLM #ICLR2026 #DeepLearning #AlgoTrading</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6e35447ce9b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Finally Stopped Worrying About What My AI Agent Was Sending Outside My Machine]]></title>
            <link>https://medium.com/@kundansinghsorout/how-i-finally-stopped-worrying-about-what-my-ai-agent-was-sending-outside-my-machine-1a92d0ce4017?source=rss-c988f0478dee------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a92d0ce4017</guid>
            <category><![CDATA[openclaw]]></category>
            <category><![CDATA[nemotron]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[nemoclaw]]></category>
            <category><![CDATA[nemotron-cascade-2]]></category>
            <dc:creator><![CDATA[Kundan Singh]]></dc:creator>
            <pubDate>Sat, 21 Mar 2026 10:35:41 GMT</pubDate>
            <atom:updated>2026-03-21T10:35:41.513Z</atom:updated>
            <content:encoded><![CDATA[<p>A practical deep-dive into running NemoClaw locally with OpenClaw for a personal stock analysis project — and why it changed how I think about AI agent security</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g8tRGkc8ylMEC46A5qq3gg.png" /></figure><h3>The Problem That Annoyed Me for Weeks</h3><p>I’ve been building a Deep Reinforcement Learning based stock trading system as a personal project for quite some time now. 1400+ stocks, custom multi-factor environment, DQN models — the whole thing.</p><p>A few weeks back I decided to take it one step further. Instead of running manual queries on my backtesting results, I wanted to hook up an AI agent that could do it for me. Natural language → analysis → answer. Something where I could just ask “which stocks gave the best reward in the last 50 episodes?” and get a proper answer without writing code every time.</p><p>I set up OpenClaw, connected it to my local files, gave it access to my stock data pipeline.</p><p>It worked. Impressively well, actually.</p><p>But then I started thinking — this agent has access to my entire dataset folder. My local portfolio files. My backtesting logs. And nothing is stopping it from making an external API call and sending all of that somewhere. OpenClaw by default is very permissive. There are no guardrails on what the agent can access or where it can send data.</p><p>That thought sat in my head for a while. Then I came across NVIDIA’s NemoClaw announcement at GTC 2026.</p><h3>What is NemoClaw, Actually?</h3><p>Before I get into what I did with it, let me clear something up because I’ve seen a lot of people confused about this.</p><p>NemoClaw is NOT a new AI agent. It’s not a new LLM. It’s not a replacement for OpenClaw.</p><p>NemoClaw is an open-source security and privacy reference stack that sits on top of OpenClaw. Jensen Huang announced it at NVIDIA GTC 2026 and put it really simply —</p><blockquote>“Agentic systems in the corporate network can have access to sensitive information. They can execute code and communicate externally. You could access employee information, access supply chain, access finance information, and send it out. Obviously, this can’t possibly be allowed.”</blockquote><p>The same problem exists for personal setups too. My stock data, my portfolio positions, my entire dataset — I didn’t want any of it casually routed to some external API without my knowledge.</p><p>NemoClaw is NVIDIA’s answer to this problem. And the best part — it installs in literally one command.</p><h3>The Architecture: What’s Actually Inside NemoClaw</h3><p>Let me break down what NemoClaw actually consists of, because this is the part most articles skip over.</p><h4>1. OpenShell — The Sandbox Runtime</h4><p>This is the core of everything. OpenShell creates a kernel-level isolated container around your OpenClaw agent. We’re not talking about a basic Docker container here. The isolation works at multiple levels — Filesystem (prevents reads/writes outside allowed paths), Network (blocks unauthorized outbound connections), Process (blocks privilege escalation and dangerous syscalls), and Inference (reroutes model API calls to controlled backends).</p><p>The filesystem policy is strict by default. The agent can only write to /sandbox and /tmp. Everything else is read-only. If the agent tries to touch something outside those paths — blocked. If it tries to connect to a host that isn’t on the approved list — blocked, and it shows up in the terminal for me to approve or deny.</p><p>The sandbox uses Landlock, seccomp, and network namespace isolation under the hood. These are kernel-level mechanisms, not application-level checks that can be bypassed.</p><h4>2. Privacy Router — The Underrated Part</h4><p>This is the component most people are sleeping on.</p><p>Not every query your agent makes carries the same risk. When my agent is asking about general patterns in stock price movements — that’s low sensitivity. When it’s accessing my actual backtesting results with specific position data — that’s different.</p><p>NemoClaw’s privacy router classifies queries automatically based on data sensitivity and routes them accordingly:</p><p>High-sensitivity queries → routed to local Nemotron models, data never leaves your machine. Low-sensitivity queries → can route to cloud models for speed and quality.</p><p>The routing logic is configurable. You can define your own sensitivity rules — by file type, by content pattern, by data source. The router then acts as middleware between the agent and the inference backend, making routing decisions automatically without the agent needing to “know” about it.</p><p>This single feature reduced my cloud inference cost during testing because a large chunk of queries didn’t need cloud at all.</p><h4>3. Nemotron 3 Super 120B — The Default Model</h4><p>NemoClaw routes cloud inference through Nemotron 3 Super 120B by default. This model is interesting from a technical standpoint — 120B total parameters but only 12B active during inference, hybrid architecture combining Mamba-2 layers for long sequences + MoE feedforward layers + standard attention, 1 million token context window, and trained at NVFP4 precision.</p><p>The Mamba-2 layers handle long sequences with linear-time complexity instead of quadratic attention cost. This actually matters when you’re working with long backtesting logs or multi-step reasoning tasks — the model doesn’t slow down the way a pure attention model does.</p><p>For local inference, I used Ollama to pull the model and route NemoClaw to it instead of the cloud endpoint. More on that below.</p><h3>Installing It — Simpler Than Expected</h3><p>The install is a single curl command:</p><pre>curl -fsSL https://nvidia.com/nemoclaw.sh | bash</pre><p>This installs Node.js if needed, sets up base directories, and launches an onboarding wizard. Then you run:</p><pre>nemoclaw onboard</pre><p>Behind the scenes, nemoclaw onboard does quite a bit of work. It resolves the required blueprint, verifies the digest, plans the necessary system resources, creates the Docker sandbox and applies policies, and then OpenClaw is injected and runs inside the isolated sandbox.</p><p>The “blueprint” concept is something I found genuinely well thought out. It’s a declarative, versioned, digest-verified configuration file that defines exactly what the sandbox looks like, what policies apply, and how inference is configured. Every time I run onboard, I get the exact same reproducible environment. No “why is the agent behaving differently today” situation.</p><p>Once it’s done, managing the sandbox is straightforward:</p><pre>nemoclaw my-assistant connect<br>nemoclaw my-assistant status<br>nemoclaw my-assistant logs - follow</pre><h3>My Personal Setup: DRL Stock Project + NemoClaw</h3><p>Here’s what I actually used it for.</p><p>My setup has around 1400+ stock datasets sitting in local folders. I run DQN model training sessions, generate backtesting results, and save reward logs per episode. Earlier, I was querying all of this manually in Jupyter. I wanted an agent that could do this for me.</p><p>The problem with raw OpenClaw: The agent could read all of this. Fine. But it could also technically make network calls during its reasoning steps. And since I’m sometimes using cloud-hosted models for inference, there was a real possibility of my raw stock data going out as part of a prompt context. I had no visibility into that.</p><p>What I set up with NemoClaw: I created a policy that allows the agent filesystem access only to my designated project folder. Anything outside this — blocked. The agent cannot touch my other personal files, cannot touch my portfolio data sitting in a different folder, cannot connect to random endpoints.</p><p>For inference, I routed sensitive queries to my local RTX GPU running Nemotron Cascade 2 via Ollama:</p><pre>ollama pull nemotron-cascade-2</pre><p>Then I configured the inference route in NemoClaw to point to localhost:11434 instead of the cloud. For general stock analysis questions that don’t touch raw data — I let it hit the cloud endpoint for better reasoning quality.</p><p>What the agent does now: I can ask it things like — “Which stocks in my DQN training run from last week gave average episode reward above 0.8?”, “Compare the reward curves from my last 3 training sessions”, “Which features had the most variance in my dataset preprocessing run?”</p><p>It reads from the allowed folder, runs the analysis, gives me the answer. No data leaves in an uncontrolled way. I can see exactly what network calls were made through the OpenShell logs.</p><h3>What I Learned (The Honest Part)</h3><p>Privacy routing logic needs tuning. The default sensitivity classification works well for obvious cases, but for domain-specific data like mine — stock tickers, custom feature names, DQN reward logs — I had to define custom patterns. It took some iteration to get the routing right.</p><p>Local Nemotron Cascade 2 inference on consumer GPU is actually quite decent. Being a 30B MoE model with only 3B active parameters at inference time, it doesn’t hammer my RTX the way a dense model would. Response times are reasonable even for medium-length context queries. The MoE architecture is genuinely the right call for local use. For short queries it’s fine. For long context analysis I switched to cloud routing for those.</p><p>The sandbox filesystem policy is strict by design — which is correct. I initially got frustrated because the agent couldn’t read a file I forgot to add to the allowed list. But that’s exactly how it should work. The default-deny approach is the right one.</p><p>OpenShell’s unknown host surfacing is actually useful. When the agent tried to reach a host that wasn’t on my approved list, it didn’t silently fail — it surfaced it in the terminal and asked me to approve or deny. That visibility is something I genuinely didn’t expect to value until I saw it working.</p><h3>Performance on My Setup</h3><p>Running on my RTX GPU, 32GB RAM:</p><p>Query response time (cloud inference): 2–3 seconds average</p><p>Query response time (local Nemotron Cascade 2 via Ollama): 8–15 seconds depending on context length</p><p>Sandbox creation on first onboard: ~3 minutes</p><p>Vector similarity operations within the agent: under 100ms</p><p>For a personal practice setup, the local inference speed is acceptable. For anything time-sensitive I’ll use cloud routing.</p><h3>Why This Matters Beyond Enterprise</h3><p>Everyone talks about NemoClaw as an enterprise solution. Healthcare, finance, legal — big sectors with compliance budgets. I get it. But honestly? The same architecture that protects hospital patient data can protect your personal trading logic.</p><p>Think about it — if you’re building algo trading bots, your strategy logic is your IP. Your backtested signals, your tuned DRL models — that’s real value you don’t want leaking to some third-party API. NemoClaw gives you the same enterprise-grade isolation but you control the perimeter.</p><p>Also — the multi-agent memory system is genuinely underrated for individual use. I run multiple experiment iterations on my DRL model. Having an agent that actually remembers what worked in session 3 vs session 7 without me manually logging everything? That’s a productivity gain that’s hard to quantify until you experience it.</p><h3>Try It Yourself</h3><p>If you want to experiment with NemoClaw yourself, here’s the quick path I took:</p><ol><li>Go to NVIDIA’s NeMo framework page and read the NemoClaw docs first. Don’t skip this — the policy schema is not something you want to guess.</li></ol><p>2. Install OpenShell locally (Linux preferred). The sandbox setup on Windows WSL2 works but had some quirks for me.</p><p>3. Pull Nemotron Cascade 2 via Ollama:</p><pre>ollama pull nemotron-cascade-2</pre><p>4. Start with a simple policy — allow only 2–3 tools at first. Then slowly expand. Don’t try to define everything on day one.</p><p>5. Test the unknown-host surfacing by intentionally having the agent try to reach something not on your allowed list. See how it handles it. That one interaction will tell you a lot about how the system thinks.</p><p>The official docs are at build.nvidia.com and the NeMo GitHub repo has working examples. Don’t rely on the marketing page — go straight to the code.</p><h3>Final Thoughts</h3><p>NemoClaw is not a hype release. It’s a quiet but significant shift in how NVIDIA is thinking about AI agents — not just what they can do, but what they’re allowed to do.</p><p>The Guardrails + OpenShell + NeMo Agent combination is genuinely novel. You’re not just running an agent — you’re running a governed agent. That’s the difference between a smart assistant and a trustworthy one.</p><p>For my personal DRL stock project — running locally on my RTX GPU — this setup has become genuinely useful. Not perfect. Still learning where the edges are. But that’s kind of the point. You’re supposed to learn the edges.</p><p>If you’re building something with local LLMs and care about your data not leaving your machine — NemoClaw is worth your time to explore. Seriously.</p><p>Are you already running any kind of sandboxed agent setup locally? Or still on pure cloud inference? Would love to know how others are approaching this — drop it in the comments.</p><blockquote><em>Tags: #NVIDIA, #NemoClaw, #OpenClaw , #AI Agents, #Local LLM, #Deep Reinforcement Learning, #Data Privacy, #Nemotron, #Machine Learning, #Python</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a92d0ce4017" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building RAGNITE: How I Created an Enterprise-Grade Agentic AI Platform in Two Weekends]]></title>
            <link>https://medium.com/@kundansinghsorout/building-ragnite-how-i-created-an-enterprise-grade-agentic-ai-platform-in-two-weekends-40aa7ff691e9?source=rss-c988f0478dee------2</link>
            <guid isPermaLink="false">https://medium.com/p/40aa7ff691e9</guid>
            <dc:creator><![CDATA[Kundan Singh]]></dc:creator>
            <pubDate>Fri, 17 Oct 2025 19:28:26 GMT</pubDate>
            <atom:updated>2025-10-17T19:28:26.429Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A technical deep-dive into architecting a production-ready multi-agent system with advanced RAG, vector databases, and intelligent conversation management</em></p><h3>The Challenge That Started It All</h3><p>Last month, my friend threw down an interesting gauntlet: “Can you build something that’s actually production-ready? Something a real company would deploy? And can you do it in a week?”</p><p>As someone who’s spent years working with traditional chatbots and rule-based systems, I knew the bar was high. Modern enterprises don’t just want another Q&amp;A bot — they need intelligent systems that can understand context, work with their data, and actually solve business problems.</p><p>So I cleared my calendar for two weekends and dove deep. What emerged was RAGNITE — a multi-agent AI platform that I honestly believe could be deployed in any enterprise tomorrow.</p><h3>Why Traditional Chatbots Fall Short</h3><p>Before jumping into the technical implementation, let me explain why I took such a different approach.</p><p>Most business chatbots follow a simple pattern: user asks question → LLM generates response → done. But real business scenarios are messy:</p><ul><li>HR wants to create employee profiles, not just answer policy questions</li><li>Executives need data visualizations, not just text summaries</li><li>Users have follow-up questions that build on previous context</li><li>Different roles need different data access levels</li></ul><p>Traditional systems break down because they treat each interaction as isolated. Real conversations are contextual, multi-step, and often require multiple tools working together.</p><h3>The Architecture Decision: Going Agenticp</h3><p>I decided on a multi-agent architecture where specialized agents handle different aspects of the conversation. Here’s the core design:</p><pre>class AgenticSystem:<br>    def __init__(self):<br>        self.rag_agent = SmartRAGDatabaseAgent()<br>        self.general_agent = GeneralConversationAgent()<br>        self.memory_manager = ConversationMemoryManager()<br>        self.tool_orchestrator = ToolOrchestrator()</pre><p>Each agent has a specific responsibility, but they can collaborate through the tool orchestrator. Think of it like a well-organized development team — everyone has their expertise, but they work together on complex problems.</p><h3>Deep Dive: The Smart RAG Implementation</h3><p>The most challenging part was building a RAG system that could intelligently work with database schemas. Most RAG implementations just dump everything into the context window, but that’s inefficient and error-prone.</p><h3>Challenge 1: Schema Complexity</h3><p>Modern databases aren’t simple. My test database has 8 interconnected tables:</p><ul><li>employees (12 records)</li><li>departments (7 records)</li><li>products (12 records)</li><li>customers (8 records)</li><li>orders (50 records)</li><li>order_items (200+ records)</li><li>sales (100 records)</li><li>suppliers (5 records)</li></ul><p>If I fed all this schema information to the LLM every time, I’d hit token limits and get confused responses.</p><h3>Solution: Embedding-Based Table Selection</h3><p>Instead, I created a two-tier RAG system:</p><p><strong>Tier 1: Table Information Files</strong><br> Each table gets its own documentation file with just the essentials:</p><pre># employees_table.txt<br>## Table: employees<br>### Columns<br>- id (INTEGER PRIMARY KEY): Unique employee identifier<br>- name (TEXT NOT NULL): Full employee name  <br>- department_id (INTEGER): Foreign key to departments.id<br>- salary (REAL): Annual salary in USD<br>- hire_date (DATE): Employment start date<br>...</pre><p><strong>Tier 2: Join Information Files</strong><br> Relationships between tables are documented separately:</p><pre># employees__departments.txt<br>## Join Relationship  <br>**employees.department_id = departments.id**<br>## Common Patterns<br>SELECT e.name, d.name as department <br>FROM employees e <br>JOIN departments d ON e.department_id = d.id<br>...</pre><h3>The Magic: Vector Similarity Search</h3><p>Here’s where it gets interesting. When a user asks a question, the system:</p><ol><li>Converts the query to embeddings using Qwen3-embeddings-0.6b</li><li>Searches the vector database (ChromaDB) using cosine similarity</li><li>Returns only the top 3 most relevant tables</li><li>Fetches corresponding join information for those tables</li></ol><pre>def get_relevant_tables(self, user_query: str, top_k: int = 3):<br>    results = self.table_collection.query(<br>        query_texts=[user_query],<br>        n_results=top_k<br>    )<br>    <br>    relevant_tables = []<br>    for i in range(len(results[&#39;ids&#39;][0])):<br>        relevant_tables.append({<br>            &quot;table_name&quot;: results[&#39;metadatas&#39;][0][i][&#39;table_name&#39;],<br>            &quot;content&quot;: results[&#39;documents&#39;][0][i],<br>            &quot;similarity&quot;: 1 - results[&#39;distances&#39;][0][i]<br>        })<br>    <br>    return relevant_tables</pre><p>This approach reduced context size by 70% while improving query accuracy significantly.</p><h3>Memory Management: The Conversation State Challenge</h3><p>One thing I learned early: users don’t think in isolated queries. They build on previous conversations. A typical flow looks like:</p><ol><li>“Show me all employees”</li><li>“What’s the average salary?”</li><li>“Create a chart of salaries by department”</li><li>“Which department has the highest variance?”</li></ol><p>Each follow-up question assumes context from previous responses. Traditional systems fail here because they don’t maintain state.</p><h3>My Solution: Intelligent Session Memory</h3><p>I built a memory system that caches query results with rich metadata:</p><pre>def store_memory_data(self, data, description, query=&quot;&quot;, tables_used=None):<br>    memory_key = f&quot;query_{len(st.session_state.smart_agent_memory)}&quot;<br>    <br>    stored_data = {<br>        &quot;data&quot;: data,<br>        &quot;description&quot;: description,<br>        &quot;query&quot;: query,<br>        &quot;tables_used&quot;: tables_used or [],<br>        &quot;timestamp&quot;: pd.Timestamp.now().isoformat(),<br>        &quot;record_count&quot;: len(data) if isinstance(data, list) else 1,<br>        &quot;is_valid&quot;: data is not None<br>    }<br>    <br>    st.session_state.smart_agent_memory[memory_key] = stored_data</pre><p>When a user asks a follow-up question, the system checks if it can use cached data instead of re-querying the database. This makes conversations feel natural and responsive.</p><h3>Tool Registration: Single LLM Call Architecture</h3><p>Instead of multiple back-and-forth calls, I implemented a tool registration system where the LLM can plan and execute multiple actions in sequence:</p><pre>system_prompt = &quot;&quot;&quot;<br>AVAILABLE TOOLS:<br>1. execute_sql_query(query: str) - Execute SQL SELECT queries safely<br>2. generate_python_analysis(code: str) - Execute Python for analysis<br>3. create_visualization(chart_type: str, data_columns: list) - Create charts<br>4. get_memory_data() - Retrieve cached data from previous queries<br><br>Respond with JSON containing your planned actions:<br>{<br>    &quot;reasoning&quot;: &quot;Your thought process&quot;,<br>    &quot;actions&quot;: [<br>        {<br>            &quot;tool&quot;: &quot;execute_sql_query&quot;,<br>            &quot;parameters&quot;: {&quot;query&quot;: &quot;SELECT ...&quot;},<br>            &quot;purpose&quot;: &quot;Get employee data&quot;<br>        },<br>        {<br>            &quot;tool&quot;: &quot;create_visualization&quot;, <br>            &quot;parameters&quot;: {&quot;chart_type&quot;: &quot;bar&quot;, &quot;data_columns&quot;: [&quot;department&quot;, &quot;avg_salary&quot;]},<br>            &quot;purpose&quot;: &quot;Visualize salary by department&quot;<br>        }<br>    ],<br>    &quot;response&quot;: &quot;Natural language response to user&quot;<br>}<br>&quot;&quot;&quot;</pre><p>This lets the LLM plan complex workflows and execute them efficiently.</p><h3>The Database Layer: More Than Just SQL</h3><p>I spent considerable time designing a realistic database schema that reflects real business relationships:</p><ul><li>Employees belong to departments</li><li>Products come from suppliers</li><li>Customers place orders containing multiple items</li><li>Sales are tracked with commissions and regions</li></ul><p>But the real challenge was making the system generate correct SQL. LLMs are notorious for hallucinating table names and relationships.</p><h3>Solution: Fallback Query Generation</h3><pre>def execute_sql_query(self, query: str):<br>    success, results, message = self.db_connection.execute_safe_query(query)<br>    <br>    # If complex query fails, try simplified version<br>    if not success and &quot;no such column&quot; in message.lower():<br>        if &quot;departments&quot; in query.lower() and &quot;d.name&quot; in query:<br>            fallback_query = &quot;SELECT department, AVG(salary) as avg_salary FROM employees GROUP BY department&quot;<br>            success, results, message = self.db_connection.execute_safe_query(fallback_query)<br>            <br>    return success, results, message</pre><p>This graceful degradation ensures users get answers even when the initial SQL generation isn’t perfect.</p><h3>Visualization: From Data to Insights</h3><p>One feature I’m particularly proud of is the intelligent visualization engine. When users ask for charts, the system:</p><ol><li>Analyzes the data types in memory</li><li>Maps user-requested columns to actual data columns</li><li>Selects appropriate chart types</li><li>Handles data aggregation automatically</li></ol><pre>def create_visualization(self, chart_type, data_columns, title):<br>    df = pd.DataFrame(memory_data)<br>    <br>    # Intelligent column mapping<br>    column_mapping = {}<br>    for expected_col in data_columns:<br>        if expected_col == &#39;department&#39; and &#39;department&#39; in df.columns:<br>            column_mapping[expected_col] = &#39;department&#39;<br>        elif expected_col == &#39;avg_salary&#39; and &#39;salary&#39; in df.columns:<br>            column_mapping[expected_col] = &#39;salary&#39;<br>    <br>    # Auto-aggregate if needed<br>    if df[x_col].dtype == &#39;object&#39; and len(df) &gt; 20:<br>        grouped_df = df.groupby(x_col)[y_col].mean().reset_index()<br>        fig = px.bar(grouped_df, x=x_col, y=y_col, title=title)<br>    <br>    return fig</pre><h3>Security and Enterprise Readiness</h3><p>From day one, I designed this with enterprise deployment in mind:</p><p><strong>Data Security:</strong></p><ul><li>All processing happens on-premise</li><li>No data leaves the company’s infrastructure</li><li>SQL injection prevention through parameterized queries</li><li>Role-based access control ready for integration</li></ul><p><strong>Scalability:</strong></p><ul><li>Containerized architecture (Docker-ready)</li><li>Stateless agents for horizontal scaling</li><li>Vector database can handle millions of documents</li><li>Memory management prevents resource leaks</li></ul><p><strong>Auditability:</strong></p><ul><li>All queries logged with timestamps</li><li>User actions tracked for compliance</li><li>Conversation history maintained</li><li>Data lineage for every insight generated</li></ul><h3>The Technical Stack Deep Dive</h3><p><strong>Core LLM:</strong> Currently using Qwen3–4B (limited by my laptop’s GPU), but the architecture supports any Ollama-compatible model. In production, you’d probably want Qwen3–14B or 32B for better reasoning.</p><p><strong>Embeddings:</strong> Qwen3-embeddings-0.6b for English, but I’ve tested with EmbeddingGemma-300m for multilingual support.</p><p><strong>Vector Database:</strong> ChromaDB with persistent storage. The cosine similarity search typically returns results in &lt;50ms.</p><p><strong>Web Framework:</strong> Streamlit for rapid prototyping, but the backend is API-ready for integration with any frontend.</p><p><strong>Database:</strong> SQLite for development, but the connection layer abstracts this — works with PostgreSQL, MySQL, SQL Server out of the box.</p><h3>Real-World Use Cases I’ve Tested</h3><p><strong>HR Scenario:</strong><br> “Create a new employee profile for Sarah Chen in the Marketing department with a salary of $72,000, starting next Monday.”</p><p>The system generates the INSERT statement, validates the department exists, and confirms the action.</p><p><strong>Executive Dashboard:</strong><br> “Show me Q3 sales performance by region and predict Q4 trends based on historical data.”</p><p>It queries sales data, generates Python analysis for forecasting, and creates interactive visualizations.</p><p><strong>Manager Self-Service:</strong><br> “What’s our team’s average tenure and how does it compare to company averages?”</p><p>Combines employee data with calculated fields and provides contextual analysis.</p><p>Below are few screenshots of a conversations:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DR4Aob6AG_LkeWgiPWTwKA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EVfeT8dV17ivqE1gSxAR7w.png" /></figure><h3>What I Learned (The Hard Way)</h3><p><strong>Memory Management is Critical:</strong> Users expect conversations to flow naturally. Implementing robust session management took longer than I expected but was absolutely worth it.</p><p><strong>LLMs Hallucinate Schema:</strong> No matter how good your prompt engineering, LLMs will sometimes generate invalid SQL. Fallback strategies are essential.</p><p><strong>Context Window Management:</strong> Even with smart RAG, you can hit token limits. Building a tiered information architecture was crucial.</p><p><strong>Visualization is Hard:</strong> Users ask for “charts” but actually want insights. The visualization engine needed to be intelligent about data aggregation and chart selection.</p><h3>Performance Benchmarks</h3><p>Running on my development machine (16GB RAM, GTX 1660):</p><ul><li>Query response time: 2–4 seconds average</li><li>Vector similarity search: &lt;100ms</li><li>Complex SQL generation: 1–2 seconds</li><li>Visualization creation: 500ms-1s</li><li>Memory-based follow-ups: &lt;1 second</li></ul><p>In production with proper hardware, these numbers would be significantly better.</p><h3>Future Roadmap</h3><p><strong>Authentication Integration:</strong> Microsoft Teams/Azure AD integration is next on my list. The role-based access control framework is already there.</p><p><strong>Advanced Analytics:</strong> I want to add time series forecasting, anomaly detection, and statistical testing capabilities.</p><p><strong>Document RAG:</strong> Currently works with structured data, but the vector database can easily handle unstructured documents — manuals, policies, contracts.</p><p><strong>Multi-Modal Support:</strong> Adding support for charts, PDFs, and image analysis would make this even more powerful.</p><p><strong>API-First Design:</strong> Building REST APIs so other applications can leverage the intelligence layer.</p><h3>Why This Matters for the Industry</h3><p>We’re at an inflection point in enterprise AI. Companies are moving beyond simple chatbots to systems that can actually perform work. The agentic approach — where AI systems can plan, execute, and adapt — is going to be crucial for the next wave of business applications.</p><p>What excites me most about RAGNITE is that it proves you can build production-grade agentic systems without massive resources. The key is thoughtful architecture, not just throwing compute at the problem.</p><h3>Try It Yourself</h3><p>The entire project is open source on GitHub. You can have it running locally in about 10 minutes:</p><ol><li>Clone the repository <a href="https://github.com/kundan121/agentic-ai">https://github.com/kundan121/agentic-ai</a></li><li>Install Ollama and pull Qwen3–4B</li><li>Run pip install -r requirements.txt</li><li>Execute streamlit run main_advanced.py</li></ol><p>I’m actively maintaining and enhancing it, so star the repo if you find it useful. Always happy to discuss technical details or potential collaborations.</p><p>The future of enterprise AI is agentic, contextual, and conversational. RAGNITE is my contribution to that future — built in two weekends, but architected for the next decade of business intelligence.</p><p><em>What do you think about the agentic approach to enterprise AI? Have you experimented with multi-agent systems in your work? I’d love to hear about your experiences in the comments.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40aa7ff691e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>