<?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: Mohsin Arif</title>
    <description>The latest articles on DEV Community by Mohsin Arif (@mhsnarf).</description>
    <link>https://dev.to/mhsnarf</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%2F4147862%2Ffb045096-cde1-493d-a2de-3a9f59c9a4ab.jpg</url>
      <title>DEV Community: Mohsin Arif</title>
      <link>https://dev.to/mhsnarf</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mhsnarf"/>
    <language>en</language>
    <item>
      <title>How to Stop Your AI Chatbot From Making Things Up (RAG, Explained Simply)</title>
      <dc:creator>Mohsin Arif</dc:creator>
      <pubDate>Mon, 28 Sep 2026 18:48:07 +0000</pubDate>
      <link>https://dev.to/mhsnarf/how-to-stop-your-ai-chatbot-from-making-things-up-rag-explained-simply-51lk</link>
      <guid>https://dev.to/mhsnarf/how-to-stop-your-ai-chatbot-from-making-things-up-rag-explained-simply-51lk</guid>
      <description>&lt;p&gt;Ask an ordinary chatbot about your business and it will answer with complete confidence, even when it is completely wrong. It will invent a return policy, quote a price you never set, or promise a&lt;br&gt;
  feature that does not exist. In AI this is called &lt;strong&gt;hallucination&lt;/strong&gt;, and for a business it is not a quirk, it is a liability.&lt;/p&gt;

&lt;p&gt;The good news is that it is fixable, and the fix is well understood. The technique is &lt;strong&gt;RAG&lt;/strong&gt;, and once you grasp how it works, you will never again trust an ungrounded chatbot with your customers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why chatbots make things up&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A model like GPT or Claude was trained on a vast slice of the internet up to a fixed cutoff date. When you ask it something, it generates the most &lt;em&gt;plausible-sounding&lt;/em&gt; continuation from that training,&lt;br&gt;
  one token at a time. It has never seen your product catalog, your refund policy, or last week's price change, so when it lacks the fact, it does not stop, it fills the gap, fluently.&lt;/p&gt;

&lt;p&gt;That fluency is precisely what makes a wrong answer dangerous: &lt;strong&gt;it looks right.&lt;/strong&gt; A confident, well-written, entirely fabricated answer is more damaging than an obvious error, because no one thinks to&lt;br&gt;
  check it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What RAG actually means
&lt;/h2&gt;

&lt;p&gt;RAG stands for &lt;strong&gt;Retrieval-Augmented Generation&lt;/strong&gt;. Beneath the term is a straightforward principle: &lt;strong&gt;before the model answers, it looks the facts up in your own content.&lt;/strong&gt; Rather than leaning on&lt;br&gt;
  training memory, it retrieves the specific passage that answers the question and composes its reply from that source.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;It is the difference between answering from memory and taking an open-book exam with your handbook on the desk.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  How it works, step by step
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Your data.&lt;/strong&gt; Your docs, FAQs, policies, and product information, your single source of truth.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Chunk and embed.&lt;/strong&gt; That content is split into small passages and converted into &lt;code&gt;vectors&lt;/code&gt; (numeric fingerprints of meaning), stored in a vector database.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retrieve.&lt;/strong&gt; When a customer asks a question, the system pulls the handful of passages that most closely match it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Answer from context.&lt;/strong&gt; The model receives those passages under a strict instruction: &lt;em&gt;answer only from this.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cite the source.&lt;/strong&gt; A sound build shows where the answer came from, making it verifiable rather than a black box.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Why this matters for your business
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Trust:&lt;/strong&gt; answers are drawn from your real information, so customers get correct ones.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Honesty:&lt;/strong&gt; built well, it says &lt;em&gt;"I don't know"&lt;/em&gt; or hands off to a human instead of inventing a response.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Freshness:&lt;/strong&gt; update a document and the bot's knowledge updates with it, no retraining required.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Proof:&lt;/strong&gt; citations let anyone verify an answer in seconds.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;An answer you cannot trust is worse than no answer at all.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Where teams get RAG wrong
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Bad chunking:&lt;/strong&gt; passages too large or too small, so retrieval surfaces the wrong context.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No citations:&lt;/strong&gt; no way to tell whether an answer was grounded or guessed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No fallback:&lt;/strong&gt; the bot should escalate when it is unsure, not bluff its way through.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ignoring cost:&lt;/strong&gt; every call carries a token cost, so error handling and sensible limits matter from day one.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The bottom line
&lt;/h2&gt;

&lt;p&gt;A chatbot is only as trustworthy as the data it stands on. RAG is how you ensure it stands on &lt;em&gt;yours&lt;/em&gt;. If your bot is confidently wrong, that is not a model problem, it is a grounding problem, and&lt;br&gt;
  grounding problems are eminently solvable.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I build custom RAG chatbots and voice agents that answer strictly from your own data, with sources. If your bot is confidently wrong, I can help. See &lt;a href="https://www.mhxmllc.com/custom-rag-chatbot-developer/" rel="noopener noreferrer"&gt;Custom RAG Chatbot &lt;br&gt;
  Developer&lt;/a&gt; or email me at &lt;a href="mailto:mohsinarif@mhxmllc.com"&gt;mohsinarif@mhxmllc.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published on &lt;a href="https://www.mhxmllc.com/blog/stop-ai-chatbot-hallucinating/" rel="noopener noreferrer"&gt;mhxmllc.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>chatgpt</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
