<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sanyam Kansal</title>
    <description>The latest articles on DEV Community by Sanyam Kansal (@sanyamkansal).</description>
    <link>https://dev.to/sanyamkansal</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4079243%2Fe51ee1db-c3a7-440f-bef4-5b75cb61366d.png</url>
      <title>DEV Community: Sanyam Kansal</title>
      <link>https://dev.to/sanyamkansal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sanyamkansal"/>
    <language>en</language>
    <item>
      <title>AI-RAG-Bot — chat with your documents. 100% local, 100% private, $0 to run</title>
      <dc:creator>Sanyam Kansal</dc:creator>
      <pubDate>Sun, 18 Oct 2026 19:09:30 +0000</pubDate>
      <link>https://dev.to/sanyamkansal/ai-rag-bot-chat-with-your-documents-100-local-100-private-0-to-run-3d90</link>
      <guid>https://dev.to/sanyamkansal/ai-rag-bot-chat-with-your-documents-100-local-100-private-0-to-run-3d90</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week2-2026-10-12"&gt;Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/sanyamkansal/AI-RAG-Bot" rel="noopener noreferrer"&gt;AI-RAG-Bot&lt;/a&gt; is a local "chat with your documents" assistant: drop files into a folder, ask questions in your terminal, and get answers grounded strictly in those files. It reads &lt;code&gt;.txt&lt;/code&gt;, &lt;code&gt;.pdf&lt;/code&gt;, and images — and for scanned PDFs and photos of documents, it runs OCR (Tesseract + OpenCV), so even a photographed receipt becomes searchable knowledge.&lt;/p&gt;

&lt;p&gt;Who would pay for this? Anyone who handles documents they're not allowed to paste into a cloud chatbot:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A freelancer whose client contracts are under NDA&lt;/li&gt;
&lt;li&gt;An accountant handling clients' tax documents&lt;/li&gt;
&lt;li&gt;A law student working through case files&lt;/li&gt;
&lt;li&gt;A small clinic with scanned intake forms&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For all of them, the "easy" option today — pasting a client PDF into a hosted AI service — means shipping sensitive data to a third-party server. AI-RAG-Bot's entire value proposition is that &lt;strong&gt;nothing ever leaves the laptop&lt;/strong&gt;: embeddings live in a local ChromaDB, the model runs through Ollama, and the only network call is the initial model download.&lt;/p&gt;

&lt;p&gt;And because there's no per-query API bill, the unit economics work: set it up once for a client and it costs $0/month to run, forever. Try building that margin on top of a closed API.&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/sanyamkansal" rel="noopener noreferrer"&gt;
        sanyamkansal
      &lt;/a&gt; / &lt;a href="https://github.com/sanyamkansal/AI-RAG-Bot" rel="noopener noreferrer"&gt;
        AI-RAG-Bot
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Local RAG system for intelligent document question answering using OCR, vector search, and a local LLM
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;AI RAG Bot&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;AI RAG Bot is a simple, locally-hosted Retrieval-Augmented Generation (RAG) system built with Python. It allows you to query a knowledge base of your own documents, including text files, PDFs, and images (using OCR). The bot processes these documents, creates vector embeddings, stores them in a local ChromaDB instance, and leverages an LLM via Ollama to generate answers grounded in the retrieved document context.&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Key Features&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Multi-format Document Support:&lt;/strong&gt; Process &lt;code&gt;.txt&lt;/code&gt;, &lt;code&gt;.pdf&lt;/code&gt;, &lt;code&gt;.png&lt;/code&gt;, &lt;code&gt;.jpg&lt;/code&gt;, and &lt;code&gt;.jpeg&lt;/code&gt; files.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optical Character Recognition (OCR):&lt;/strong&gt; Extracts text from images and PDFs using Tesseract OCR, PyMuPDF, and OpenCV.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Smart Chunking:&lt;/strong&gt; Cleans and chunks document text to fit context windows efficiently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local Vector Database:&lt;/strong&gt; Uses &lt;code&gt;chromadb&lt;/code&gt; for persistent, local storage of vector embeddings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sentence Embeddings:&lt;/strong&gt; Utilizes the lightweight and fast &lt;code&gt;all-MiniLM-L6-v2&lt;/code&gt; model from &lt;code&gt;sentence-transformers&lt;/code&gt; to generate embeddings.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;State Tracking:&lt;/strong&gt; Keeps track of document modification times and sizes (&lt;code&gt;document_state.json&lt;/code&gt;…&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/sanyamkansal/AI-RAG-Bot" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;Every layer of the stack is open source, and the open pieces are exactly what make the project work:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Local inference:&lt;/strong&gt; &lt;a href="https://ollama.com" rel="noopener noreferrer"&gt;Ollama&lt;/a&gt; serves Google's open-weight &lt;code&gt;gemma3:1b&lt;/code&gt; — the smallest Gemma variant, about 1 GB, so it runs on modest laptops with no GPU. RAG keeps prompts short and grounded in retrieved chunks, which is exactly why a 1B model is enough here: it answers from the provided context and says "information not found" when the answer isn't in the documents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Embeddings:&lt;/strong&gt; &lt;code&gt;all-MiniLM-L6-v2&lt;/code&gt; from sentence-transformers — small, fast, CPU-friendly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vector store:&lt;/strong&gt; ChromaDB in persistent local mode. The entire "database" is a folder on disk.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extraction:&lt;/strong&gt; PyMuPDF for text PDFs; OpenCV + pytesseract (Tesseract OCR) for scans and images.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;State tracking:&lt;/strong&gt; &lt;code&gt;document_state.json&lt;/code&gt; remembers each file's size and modification time, so unchanged documents aren't re-processed on startup.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The pipeline: scan &lt;code&gt;documents/&lt;/code&gt; → extract text (OCR where needed) → clean → chunk (~500 characters) → embed → store. At query time, the question is embedded too, ChromaDB returns the most similar chunks, and &lt;code&gt;gemma3:1b&lt;/code&gt; is prompted to answer &lt;em&gt;only&lt;/em&gt; from those chunks. That "I couldn't find that" behavior matters more than raw cleverness when someone is asking about a contract.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Privacy a closed API structurally can't offer.&lt;/strong&gt; This isn't a policy promise ("we don't train on your data, trust us") — it's architecture. There is no server to send anything to.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost.&lt;/strong&gt; Embeddings and generation run on hardware the user already owns. For the freelancer use case, that's the difference between a tool free to run and one with a monthly bill per seat — the reason this side hustle works at all.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Freedom to swap.&lt;/strong&gt; Want a different model? &lt;code&gt;ollama pull&lt;/code&gt; anything and change one string. Different embedder? One line. No vendor decides what this tool can become.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Offline by default.&lt;/strong&gt; It works on a plane, in a basement archive, anywhere with no internet. Only a local stack can promise that.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Gemma&lt;/strong&gt; — AI-RAG-Bot runs Google's open-weight &lt;code&gt;gemma3:1b&lt;/code&gt; as its generation model, served entirely locally through Ollama. No API key, no cloud calls: the model lives on the user's own machine.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
    </item>
    <item>
      <title>Building Dukaan Sathi: An AI Voice Assistant for India's Kirana Stores</title>
      <dc:creator>Sanyam Kansal</dc:creator>
      <pubDate>Sat, 15 Aug 2026 17:13:55 +0000</pubDate>
      <link>https://dev.to/sanyamkansal/building-dukaan-sathi-an-ai-voice-assistant-for-indias-kirana-stores-47ja</link>
      <guid>https://dev.to/sanyamkansal/building-dukaan-sathi-an-ai-voice-assistant-for-indias-kirana-stores-47ja</guid>
      <description>&lt;p&gt;Over the past 9 days, I took on the &lt;strong&gt;Voice for Bharat Challenge&lt;/strong&gt; to build an AI Voice Agent tailored for India. The result? &lt;strong&gt;Dukaan Sathi&lt;/strong&gt;, a fully functional voice assistant designed specifically for local Kirana store owners (dukaandars).&lt;/p&gt;

&lt;p&gt;Here is the story of how Dukaan Sathi evolved from a simple starter template into a multi-agent powerhouse capable of managing inventory, handling escalations, and speaking in authentic, pure Hindi.&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 The Problem &amp;amp; The Solution
&lt;/h2&gt;

&lt;p&gt;India runs on Kirana stores. Dukaandars are incredibly busy people, often juggling inventory, customer queries, and billing all at once. They don’t have the time to sit at a laptop and type data into complicated software.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why voice?&lt;/strong&gt; Voice is the most natural, frictionless interface. I wanted a Dukaandar to be able to just speak to their phone: &lt;em&gt;"Mere paas kitna chawal bacha hai?"&lt;/em&gt; (How much rice do I have left?) and get an instant, helpful response.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Dukaan Sathi&lt;/strong&gt; is that solution. It is a helpful, polite, and intelligent voice agent that acts as a digital assistant for the store.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Key Features Built Over 9 Days
&lt;/h2&gt;

&lt;p&gt;Dukaan Sathi isn't just a basic chatbot with text-to-speech bolted on. It's a complete, intelligent system. Here are the highlights of what I built:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Authentic Indian Voices:&lt;/strong&gt; Powered by &lt;strong&gt;Murf Falcon&lt;/strong&gt;, Dukaan Sathi uses extremely natural-sounding Indian voices. The main agent uses a polite female voice (Anisha), ensuring a welcoming tone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Strict Native Script Guardrails:&lt;/strong&gt; One of the most important features I enforced was ensuring the LLM &lt;em&gt;always&lt;/em&gt; outputs Hindi in the native Devanagari script (नमस्ते) and &lt;em&gt;never&lt;/em&gt; in Romanized Hinglish (namaste). This ensures the text-to-speech engine pronounces words perfectly without awkward accents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Persistent Memory:&lt;/strong&gt; The agent remembers returning customers! Using SQLite and LiveKit's Job Context, the agent seamlessly pulls up past interactions so it doesn't have to re-ask for your name.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool Use &amp;amp; Analytics:&lt;/strong&gt; The agent can actively fetch stock balances and log call outcomes. I built a real-time &lt;strong&gt;Call Analytics Dashboard&lt;/strong&gt; in Next.js that updates the moment a call ends!&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Human Escalation:&lt;/strong&gt; When a customer gets angry or the agent doesn't know the answer, it triggers a &lt;code&gt;create_escalation&lt;/code&gt; tool that saves a transcript and logs a ticket for the human owner to review.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-Agent Handoffs:&lt;/strong&gt; The crowning achievement! If a user asks for a refund, Dukaan Sathi transfers the call to a dedicated Returns Specialist. The caller actually hears the voice change to a completely new male voice (Samar), and he instantly knows the context of the conversation.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  🧗 The Difficult Parts &amp;amp; Lessons Learned
&lt;/h2&gt;

&lt;p&gt;Pretending everything worked perfectly on the first try wouldn't be helpful! Here are some hurdles I faced and how I solved them:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The Language Barrier (Romanized vs. Devanagari)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;The Problem:&lt;/strong&gt; LLMs naturally default to writing Hindi in the Latin alphabet (Hinglish) because that's how a lot of their training data looks. However, when you feed Romanized Hindi into an Indian Text-to-Speech engine, the pronunciation often breaks down or sounds unnatural.&lt;br&gt;
&lt;strong&gt;The Solution:&lt;/strong&gt; Heavy prompt engineering. I had to explicitly instruct the agent: &lt;em&gt;"Always write every language in its own native script. Hindi -&amp;gt; Devanagari (नमस्ते), never romanized."&lt;/em&gt; This instantly fixed the pronunciation issues.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Build Your Own Voice Agent
&lt;/h2&gt;

&lt;p&gt;Want to build your own version of Dukaan Sathi? It's easier than you think. You need four main components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Speech-to-Text (STT):&lt;/strong&gt; To transcribe the user's voice.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LLM:&lt;/strong&gt; The "brain" (e.g., OpenAI or Gemini).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Text-to-Speech (TTS):&lt;/strong&gt; To generate the agent's voice (Murf Falcon is highly recommended for Indian voices).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real-time Transport:&lt;/strong&gt; LiveKit handles the ultra-low latency WebRTC streaming.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Getting Started
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Clone the Starter:&lt;/strong&gt; Start with a LiveKit + Next.js + Python template.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Environment Variables:&lt;/strong&gt; You'll need API keys for LiveKit, your LLM, and your TTS provider. &lt;strong&gt;Never commit these to GitHub!&lt;/strong&gt; Always store them in a &lt;code&gt;.env.local&lt;/code&gt; (frontend) and &lt;code&gt;.env&lt;/code&gt; (backend) file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Run the Backend (Python):&lt;/strong&gt; Type &lt;code&gt;uv run src/agent.py dev&lt;/code&gt; in your terminal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Run the Frontend (Next.js):&lt;/strong&gt; Type &lt;code&gt;npm run dev&lt;/code&gt; in your terminal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test it:&lt;/strong&gt; Open &lt;code&gt;localhost:3000&lt;/code&gt;, click connect, and start talking! You can write a custom &lt;code&gt;SYSTEM_PROMPT&lt;/code&gt; in &lt;code&gt;agent.py&lt;/code&gt; to give your agent any personality you want.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;This 10-day challenge proved that voice AI is no longer a futuristic concept—it is accessible, buildable, and ready to solve real-world problems in India today. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thanks to LiveKit and Murf AI for providing the incredible tools that made this possible!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Want to see the code behind Dukaan Sathi? Check out the full source code for my 10-day journey on GitHub here: &lt;a href="https://github.com/sanyamkansal/AI-Voice-Agent" rel="noopener noreferrer"&gt;https://github.com/sanyamkansal/AI-Voice-Agent&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>gemini</category>
      <category>buildinpublic</category>
    </item>
  </channel>
</rss>
