<?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: Atharv Patwardhan</title>
    <description>The latest articles on DEV Community by Atharv Patwardhan (@atharvpatwardhan).</description>
    <link>https://dev.to/atharvpatwardhan</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1254560%2F0a12a7f1-3e45-4ace-92ba-6a02970a35f6.png</url>
      <title>DEV Community: Atharv Patwardhan</title>
      <link>https://dev.to/atharvpatwardhan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/atharvpatwardhan"/>
    <language>en</language>
    <item>
      <title>How I made my own chatbot using RAG</title>
      <dc:creator>Atharv Patwardhan</dc:creator>
      <pubDate>Mon, 22 Jul 2024 21:29:30 +0000</pubDate>
      <link>https://dev.to/atharvpatwardhan/how-i-made-my-own-chatbot-using-rag-3jhf</link>
      <guid>https://dev.to/atharvpatwardhan/how-i-made-my-own-chatbot-using-rag-3jhf</guid>
      <description>&lt;p&gt;In this post, I'm going to talk about how I made my own chatbot for my personal web portfolio &lt;a href="https://atharvpatwardhan.vercel.app/" rel="noopener noreferrer"&gt;here.&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;When I first stumbled across the concept of RAG, I wondered how this is any different than just training ChatGPT to give answers based on data given in the prompt.&lt;/p&gt;

&lt;p&gt;Here's why RAG is important:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;More developer control:&lt;/strong&gt; RAG gives the developer more control over information sources and how it is presented to the user. They can restrict sensitive information and also provide the latest information to users.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost Effective:&lt;/strong&gt; RAG is much cheaper than training a model to operate in a domain-specific area.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use-case specific:&lt;/strong&gt; RAG provides output based on only the context provided to it. This enables developers to create tailor-made models to only respond to domain-specific questions and not give vague responses outside the model's area of expertise.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now let's get to the fun part - actually making a chatbot!&lt;/p&gt;

&lt;p&gt;I started out by creating the context for my chatbot. I asked chatGPT to write a 1000-word text to train a RAG model based on my resume.&lt;/p&gt;

&lt;p&gt;Once, I had the context, I used the chatOpenAI API from the langchain/openai library to define my model. I decided to go with the gpt-3.5-model.&lt;/p&gt;

&lt;p&gt;I created a prompt asking the LLM to answer questions as if it were an AI version of me, using the data given in the context. I played around with the temperature and prompt for a bit until I finally got satisfactory results.&lt;/p&gt;

&lt;p&gt;This was a fun project that taught me about RAG architectures and gave me hands-on exposure to the langchain library too.&lt;/p&gt;

&lt;p&gt;Make sure to check out my website and try the chatbot for yourself &lt;a href="https://atharvpatwardhan.vercel.app" rel="noopener noreferrer"&gt;here!&lt;/a&gt;&lt;/p&gt;

</description>
      <category>rag</category>
      <category>machinelearning</category>
      <category>langchain</category>
      <category>vercel</category>
    </item>
  </channel>
</rss>
