<?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: Gokul Kannan</title>
    <description>The latest articles on DEV Community by Gokul Kannan (@gokul_kannan_1011).</description>
    <link>https://dev.to/gokul_kannan_1011</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%2F3904495%2F19204239-5958-4316-9813-7e25e813c347.png</url>
      <title>DEV Community: Gokul Kannan</title>
      <link>https://dev.to/gokul_kannan_1011</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gokul_kannan_1011"/>
    <language>en</language>
    <item>
      <title>AWS - EC2</title>
      <dc:creator>Gokul Kannan</dc:creator>
      <pubDate>Sun, 05 Jul 2026 08:12:35 +0000</pubDate>
      <link>https://dev.to/gokul_kannan_1011/aws-ec2-41dg</link>
      <guid>https://dev.to/gokul_kannan_1011/aws-ec2-41dg</guid>
      <description>&lt;p&gt;Assume we have multiple applications and we need to deploy those in a server so that those applications can be accessed by people from anywhere through internet. Now lets deploy all those in a single server. By doing this, we make all those applications to share all the resources among them.&lt;br&gt;
The resources here means the RAM, storage and the underlying Operating System. &lt;/p&gt;

&lt;p&gt;Although there are drawbacks like there is no isolation for the applications, still all the applications can run individually by using the shared resources. Now, lets say there is a lot of requests coming into one of the application and it starts using most of the shared resources. So, if one of the application takes lot of the resources for its process then that impacts the performance of all the other applications.&lt;/p&gt;

&lt;p&gt;This is a major drawback in deploying all the applications into a single server. So what are the other options to overcome this problem. Lets have individual servers for each applications, so there won't be any such shared usage. This would definitely solve our problem but at what cost? The procurement of physical servers and maintenance costs would be very high making this option as not a viable one. &lt;/p&gt;

&lt;p&gt;To resolve this issue, there came the concept of Virtual Machines (VMs).&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Virtual Machine?
&lt;/h2&gt;

&lt;p&gt;In a Virtual Machine, each application runs on its own operating system while sharing a single physical machine (Bare Metal Machine). Here this machine would be segregated as separate virtual (imaginary) machines with its own OS. And the underlying RAM in that physical machine would be split among these virtual machines.&lt;br&gt;
Now these different OS will be called as Image. It means the item that is used to run the OS or known as the .iso file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fogmyo4qqi5ltknzgtbj3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fogmyo4qqi5ltknzgtbj3.png" alt=" " width="606" height="262"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fszk3cxg9mnp7se72fnei.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fszk3cxg9mnp7se72fnei.png" alt=" " width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Benefits of Virtual Machines&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multiple operating systems can run on a single physical machine..&lt;/li&gt;
&lt;li&gt;Better isolation between applications.&lt;/li&gt;
&lt;li&gt;Lower hardware and maintenance cost&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  EC2
&lt;/h2&gt;

&lt;p&gt;In AWS, one of the service is there to create these VMs and use it for various purposes like static website hosting, deploying applications, running DB servers or for a batch processing. This service is called as EC2 (Elastic Compute Cloud). Similarly all other cloud providers have this service like in Azure VM, Digital Ocean-Droplets. Even though the terminologies differs, the underlying concept remains the same.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why EC2?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Complete Control :&lt;/strong&gt; You can install any software, operating system (Linux, Windows, macOS), or application stack you need.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Elasticity :&lt;/strong&gt; Based on your usage, it can scale automatically to handle peak traffic and shrink them when demand drops, avoiding wasted resources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Customizations :&lt;/strong&gt; Based on your requirement you can customize the VM instance which would be a best fit for your workload.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pricing Model
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;On-Demand:&lt;/strong&gt; When you just need it for a short period, you can opt for this model. If there is any use case like for testing, where you need it for a limited time, then you can use this model.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reserved Instances:&lt;/strong&gt; When you need a VM for many years, then you can opt for this and you would receive significant discounts (up to 72%) compared to On-Demand pricing in exchange. Good option for production use cases.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Spot Instances:&lt;/strong&gt; Here you can take advantage of unused AWS compute capacity at great discounts (up to 90%). (for Video Rendering AI model training). AWS can take it down at anytime with prior notification.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Savings Plan :&lt;/strong&gt; This is like a mutual agreement where I am going to use the AWS services, so you can ask for concession to get an EC2 instance. This is more flexible than reserved instance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Categories of EC2
&lt;/h2&gt;

&lt;p&gt;You can configure the machine based on amount of CPU and RAM you needed.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Based on RAM - Eg: t3.micro, t3.small&lt;/li&gt;
&lt;li&gt;CPU based - Eg : c6i.large&lt;/li&gt;
&lt;li&gt;Memory Optimized - Eg: r6i.large&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now you got your EC2, which is a bare metal machine with RAM, CPU. But how do you consume this. So, here we need AMI.&lt;/p&gt;

&lt;p&gt;AMI - Amazon Machine Image - Image means OS&lt;/p&gt;

&lt;p&gt;We need an OS for our Virtual Machine. EC2 supports two different sets of OS.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Public AMI - Ubuntu, windows, mac, linuxmint, Amazon OS.&lt;/li&gt;
&lt;li&gt;Private AMI - May be an organization would have a proprietary OS. Even this is supported by AWS. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Accessing EC2 in AWS
&lt;/h2&gt;

&lt;p&gt;You can access the EC2 through your console and launch it using the "Launch Instance" option.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe809jjvquk6zi43qgk8d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe809jjvquk6zi43qgk8d.png" alt=" " width="800" height="497"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When you set up an EC2 instance, you have to configure different things as followed:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Name and Tags:&lt;/strong&gt; The Name and tags are just to identify the VM based on its purpose and this tags would be helpful in managing many resources under your AWS account. Its just a key-value pair along with a resource type which is based on the purpose &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F19yrx4zq5ufrsrsrjuvf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F19yrx4zq5ufrsrsrjuvf.png" alt="Name and Tags for EC2" width="800" height="202"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Amazon Machine Image (AMI):&lt;/strong&gt; This is like a template that contains the operating system, initial software, and root configurations needed to launch the server.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvx7r25w06xiykoqzyp3e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fvx7r25w06xiykoqzyp3e.png" alt="AMI" width="800" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Instance Types:&lt;/strong&gt; The specific hardware configuration (CPU, RAM, storage, networking capacity).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fauum6cpypebd02e0n7rl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fauum6cpypebd02e0n7rl.png" alt="Instance Types" width="798" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Pairs:&lt;/strong&gt; Secure cryptographic credentials used to securely log into your Linux or macOS instances (typically using SSH). Here AWS generates a public key and a private key. The private key is given to you as a .pem file once this key pair is generated and while launching the server(VM), the public key gets stored over there by AWS. Only with that private key, you would be able to communicate with the server through SSH. &lt;/p&gt;

&lt;p&gt;You can imagine the public key is the lock for your house and the private key is the key for that lock. &lt;br&gt;
Now only with that key you can open your lock. This way we are making sure only with the valid key, you would be able to enter your house(VM). This way of secure connection is possible using the openssh tool. &lt;br&gt;
When we have this tool in your machine and another server(machine), you can create this key pairs and put the public key into that server's allowed list or authorized keys and now you can connect to that server using its IP and this private key.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fipvzq5s1nh3nr35al0dt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fipvzq5s1nh3nr35al0dt.png" alt="Key Pairs" width="717" height="691"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz0j04wgs32d9mwl06n9i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz0j04wgs32d9mwl06n9i.png" alt="Key Pairs Creation" width="648" height="322"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Security Groups:&lt;/strong&gt; A virtual firewall that controls what inbound and outbound network traffic is permitted to and from your instance. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnkyl4uczcltfhjn5xuks.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnkyl4uczcltfhjn5xuks.png" alt="Security Groups" width="799" height="463"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  VPC
&lt;/h2&gt;

&lt;p&gt;For any services that you are running in AWS, there is one default item called as VPC gets created. It means &lt;strong&gt;Virtual Private Cloud&lt;/strong&gt;. You can imagine/consider this VPC like a room and lets say now you are bringing an EC2(Computer) machine into this. And this room is having an Internet connection. Now you have to pay the rent for both the room and the EC2 machine. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw9k59327t9bktzbop5w5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw9k59327t9bktzbop5w5.png" alt="VPC explanation" width="565" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you have selected all the configurations, you can launch your instance. You can click on that "Connect" and using the SSH client, follow those commands to connect to you server. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzbryad0h36v5td122auw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzbryad0h36v5td122auw.png" alt="EC2" width="799" height="335"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Faxsql9ty41xr2vugbqnf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Faxsql9ty41xr2vugbqnf.png" alt="EC2" width="800" height="302"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once you connected, you can try running a webserver and host a simple application and try accessing through your browser.&lt;/p&gt;

&lt;p&gt;If its an ubuntu server, try running the following command before installing anything like web servers or any other packages.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"sudo apt update"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can try installing a web server like nginx. To install run the below command :&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo apt install nginx&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Start the Web Server :&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo systemctl start nginx&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You'll see something like :&lt;br&gt;
 "Active: active (running)"&lt;/p&gt;

&lt;p&gt;Now you should be able to see the nginx webserver's default page in browser when you try to hit the public IP of your EC2 instance, which you could get it from the AWS console. Here in browser you are trying to access the server using http. &lt;br&gt;
So, if you are not able to see the nginx webserver's default page, it means that http port is not enabled in your security group rules. You can enable it by getting into your security group and click on "Edit inbound Rules". And add the rule for HTTP. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsj1vfksyx97f1eb10qjd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsj1vfksyx97f1eb10qjd.png" alt="Security Group" width="800" height="285"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9y014fy4t4t16yolbnfl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9y014fy4t4t16yolbnfl.png" alt="Add Rule" width="799" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now if you access the EC2's public IP through browser, it connects to this port 80 configured in the security group and shows the default nginx server's web page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F60rlbfnn87j2cnqfxcml.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F60rlbfnn87j2cnqfxcml.png" alt="Nginx Web Server" width="800" height="298"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also, create a simple application and make it listen to  any port (Eg: port 8000) and we can make this nginx server as a reverse proxy so that when the browser sends a request to Nginx on port 80, it forwards the request internally to the port 8000 where your application is running and it loads application's page in the browser. &lt;/p&gt;

&lt;p&gt;We have seen how to create a AWS EC2 and tried running a webserver on it. Now you must have a clear foundational understanding of how to create EC2, connecting to it through SSH and running a webserver on it.&lt;/p&gt;

&lt;p&gt;One additional info- once you have created a new AWS account, you can see list of activities to do and on completing each, you could earn additional AWS credits. Here you can start with "Launching an instance using EC2".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg8ok43ouynwe6240dtez.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fg8ok43ouynwe6240dtez.png" alt="Activities to earn AWS credits" width="628" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj5swnvmrzafokwogmle3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fj5swnvmrzafokwogmle3.png" alt="Completion of one Activity" width="800" height="472"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>ec2</category>
      <category>virtualmachine</category>
    </item>
    <item>
      <title>Vector Databases in RAG - Day 2</title>
      <dc:creator>Gokul Kannan</dc:creator>
      <pubDate>Sun, 03 May 2026 10:43:27 +0000</pubDate>
      <link>https://dev.to/gokul_kannan_1011/vector-databases-in-rag-day-2-18m4</link>
      <guid>https://dev.to/gokul_kannan_1011/vector-databases-in-rag-day-2-18m4</guid>
      <description>&lt;p&gt;In Day-1, we understood about the overview of a RAG system and what are its components and how it helps the LLM to generate more accurate and contextual responses. Now, lets see about the storage of the data using Vector Databases.&lt;/p&gt;

&lt;h2&gt;
  
  
  Vector Database
&lt;/h2&gt;

&lt;p&gt;Lets assume that we have a PDF with us and this would be considered as our private data. Now I want my LLM to have the context about this PDF, So that I could ask any query related to that PDF and get the response. &lt;/p&gt;

&lt;p&gt;Now, we need to store this PDF data in a format with which the LLM could fetch the data and give us a relevant responses.&lt;br&gt;
Here in this case, Vector Database helps us to store the PDF data in a Numerical format which can be used by the LLM to fetch the relevant data.&lt;/p&gt;

&lt;p&gt;A vector database stores data in the form of vectors (arrays of numbers).&lt;/p&gt;

&lt;p&gt;A vector database is a specialized database designed to store and search vector embeddings (numerical representations of data). Unlike traditional RDBMS systems that use exact matching (like SQL queries), vector databases are optimized for similarity search. Examples include ChromaDB, Pinecone, FAISS, and Qdrant.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;Text =&amp;gt; converted into numbers using embeddings&lt;br&gt;
Image =&amp;gt; converted into numbers&lt;br&gt;
Audio =&amp;gt; converted into numbers&lt;/p&gt;

&lt;p&gt;These numbers capture meaning, not just raw data.&lt;/p&gt;

&lt;h2&gt;
  
  
  What does mean by Numerical Format?
&lt;/h2&gt;

&lt;p&gt;It means the any kind of Data (Text, Image or Audio) is converted into a numerical format using any kind of encoding algorithms and gets saved into DB.&lt;/p&gt;

&lt;p&gt;Here, first we would break down the PDF data as chunks of data where each chunk would have n number of characters. Then each chunks would be converted into a vector points with n-number of dimensions. To have clear understanding, Lets see the below example :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Today is Wednesday&lt;/li&gt;
&lt;li&gt;Tomorrow is Thursday&lt;/li&gt;
&lt;li&gt;I am travelling today&lt;/li&gt;
&lt;li&gt;Wednesday is a nice series&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now I need this data to be converted into some sort of numerical format - as vectors. Here lets consider a simple One Hot Encoding.&lt;/p&gt;

&lt;p&gt;First lets just find all the unique words and list it down as an array.&lt;/p&gt;

&lt;p&gt;[Today, is, Wednesday, Tomorrow, Thursday, I, am, Travelling, a, nice, series]&lt;/p&gt;

&lt;p&gt;Now lets assign the values 1 and 0 for each words in the same array format. We would give 1 if it occurs in the sentence, if not 0.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;1 1 1 0 0 0 0 0 0 0 0 &lt;/li&gt;
&lt;li&gt;0 1 0 1 1 0 0 0 0 0 0&lt;/li&gt;
&lt;li&gt;1 0 0 0 0 1 1 1 0 0 0&lt;/li&gt;
&lt;li&gt;0 1 1 0 0 0 0 0 1 1 1&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As you can see, now we have converted each sentence into a numerical format. This is a very basic encoding algorithm which can be used for a meaningful conversion.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do we do this conversion?
&lt;/h2&gt;

&lt;p&gt;Now we understood that why we need to convert the data in a numerical format and we would use different kinds of encoding algorithms to do that conversion.&lt;/p&gt;

&lt;p&gt;So, how do we convert our data into a format which can be stored in a vector database? The answer is Embedding Models.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is this Embedding Model?
&lt;/h2&gt;

&lt;p&gt;Embedding Model helps us to convert our data into vectors which can then be stored into a vector DB.&lt;/p&gt;

&lt;p&gt;There are different sets of embedding models available. One such model is nomic-embed which has a 768 Dimensions, it means each chunk of data is represented as a vector of 768 Dimensions.&lt;/p&gt;

&lt;p&gt;Data &lt;br&gt;
↓&lt;br&gt;
[nomic-embed -Embedding Model]&lt;br&gt;
↓&lt;br&gt;
768D[] vectors &lt;br&gt;
↓&lt;br&gt;
VectorDB&lt;/p&gt;

&lt;h2&gt;
  
  
  Why do we need to save as Numerical Format?
&lt;/h2&gt;

&lt;p&gt;We may have a question that why can't we just store the same text data into the DB and do a normal text search. In this case, what happens is, we would be able to save those as isolated words and we can't really extract the context or semantic meaning out of this.&lt;/p&gt;

&lt;p&gt;Vector DB helps us to find a similar meaning data by doing a Similarity or Semantic Search. &lt;/p&gt;

&lt;p&gt;Now lets understand the whole flow where this Vector DB gets used:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Your data (PDF, docs, DB) → converted into embeddings&lt;/li&gt;
&lt;li&gt;Stored in a vector DB&lt;/li&gt;
&lt;li&gt;When user asks a question → it is also converted into a vector&lt;/li&gt;
&lt;li&gt;Vector DB finds similar content&lt;/li&gt;
&lt;li&gt;That content is sent to the LLM for answer generation&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Lets understand with an example.&lt;/p&gt;

&lt;p&gt;Imagine a company has:&lt;/p&gt;

&lt;p&gt;1000 PDFs (policies, FAQs, manuals)&lt;br&gt;
They want a chatbot to answer questions based on these documents&lt;/p&gt;

&lt;p&gt;Step 1: Convert documents into vectors&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Each paragraph is converted into numbers (embeddings) using an Embedding Model&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Step 2: Store in Vector Database&lt;/p&gt;

&lt;p&gt;Step 3: User asks a question&lt;/p&gt;

&lt;p&gt;Step 4: Convert question into vector&lt;/p&gt;

&lt;p&gt;Step 5: Similarity Search&lt;/p&gt;

&lt;p&gt;Vector DB compares:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Question vector&lt;/li&gt;
&lt;li&gt;Stored document vectors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It finds the closest match (similar meaning)&lt;/p&gt;

&lt;h2&gt;
  
  
  How does a vector DB finds the similar meaning?
&lt;/h2&gt;

&lt;p&gt;A Vector Database is a type of database designed to store data as numerical vectors (embeddings) and efficiently retrieve similar data by performing similarity searches using metrics like cosine similarity.&lt;/p&gt;

&lt;p&gt;Let’s imagine we reduce everything to 2D (real systems use 100s–1000s of dimensions).&lt;/p&gt;

&lt;p&gt;We take 5 words:&lt;/p&gt;

&lt;p&gt;Cat&lt;br&gt;
Dog&lt;br&gt;
Tiger&lt;br&gt;
Car&lt;br&gt;
Bus&lt;/p&gt;

&lt;p&gt;Now imagine they are plotted like this:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    ↑ Y-axis
    |
    |        Tiger .(0.8, 0.9)
    |
    |   Cat .(0.6, 0.7)
    |   Dog .(0.65, 0.6)
    |
    |
    |
    |                    Car .(0.1, 0.2)
    |                    Bus .(0.15, 0.25)
    |
    +--------------------------------→ X-axis
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Cat, Dog, Tiger are close → similar meaning ()&lt;br&gt;
Car, Bus are close → similar meaning &lt;br&gt;
Animals are far from vehicles → very different&lt;/p&gt;

&lt;p&gt;Step 1: User query&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Let’s say user searches: "Lion"&lt;/li&gt;
&lt;li&gt;We convert "Lion" into a vector: Lion → (0.75, 0.85)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Step 2: Compare with existing points&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now the Vector DB calculates similarity using something like:

&lt;ul&gt;
&lt;li&gt;Cosine similarity - This measures the angle between two vectors, not just distance&lt;/li&gt;
&lt;li&gt;OR Euclidean distance&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Step 3: Find nearest neighbors&lt;/p&gt;

&lt;p&gt;Finally,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Vector DB returns: Tiger, Cat (top matches)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In reality:&lt;/p&gt;

&lt;p&gt;The Embedding models would not have 2D instead it would have 768D, 1536D, etc.&lt;/p&gt;

&lt;p&gt;Uses optimized algorithms like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ANN (Approximate Nearest Neighbor)&lt;/li&gt;
&lt;li&gt;KNN (K Nearest Neighbor)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Is Vector DB mandatory for RAG?
&lt;/h2&gt;

&lt;p&gt;RAG (Retrieval-Augmented Generation) is an approach/architecture. In one of the approach we use the Vector DB to retrieve the relevant Data. &lt;/p&gt;

&lt;p&gt;Here Vector DB used in the retriever layer to perform semantic search.&lt;/p&gt;

&lt;p&gt;Instead of Vector DB, RAG can also use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keyword search (like SQL LIKE)&lt;/li&gt;
&lt;li&gt;APIs or databases&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So to have clear understanding,&lt;/p&gt;

&lt;p&gt;RAG is not just a LLM + Vector DB&lt;br&gt;
Instead,&lt;br&gt;
RAG is LLM + Retrieval (Vector DB is one way to do retrieval)&lt;/p&gt;

&lt;p&gt;So, RAG is an approach where an LLM retrieves relevant external data (often using a vector database) and uses it to generate more accurate, context-aware responses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;A Vector Database performs similarity search by representing data (such as text, images, or audio as chunks) as high dimensional vectors. If we consider that as a multi dimensional space, each item is stored as a point in this space. &lt;br&gt;
When a query is given, it is also converted into a vector, and the database uses similarity metrics such as cosine similarity to measure how close the query vector is to other vectors. &lt;br&gt;
Based on this, it retrieves the most relevant results by selecting the vectors that are closest in terms of semantic meaning.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>rag</category>
      <category>beginners</category>
      <category>vectordatabase</category>
    </item>
    <item>
      <title>Hello World of RAG - Day 1</title>
      <dc:creator>Gokul Kannan</dc:creator>
      <pubDate>Sat, 02 May 2026 11:11:22 +0000</pubDate>
      <link>https://dev.to/gokul_kannan_1011/hello-world-of-rag-day-1-15l9</link>
      <guid>https://dev.to/gokul_kannan_1011/hello-world-of-rag-day-1-15l9</guid>
      <description>&lt;p&gt;As a beginner in understanding LLMs, when I heard the term RAG-Retrieval Augmented Generation, I assumed it was a technique used within LLMs. However, from this session, I learned that RAG is all about use of our own custom or private data along with an LLM to generate more relevant responses.&lt;/p&gt;

&lt;p&gt;Before understanding RAG, we need to have clarity on what exactly these LLMs are? &lt;/p&gt;

&lt;h2&gt;
  
  
  What does a Model mean?
&lt;/h2&gt;

&lt;p&gt;A model means an equation. Let's say now we have this equation &lt;br&gt;
y = mx + c &lt;br&gt;
This is a straight line equation.&lt;br&gt;
If the values of x and y are provided, then the system just tweak the values of m and c to come up with best fits. &lt;br&gt;
Here lets say x = 1  &amp;amp; y = 2, now I can have m=1 &amp;amp; c=1 or m=0 &amp;amp; c=2, etc., Here it learns different patterns. This process is called as learning. &lt;/p&gt;

&lt;h2&gt;
  
  
  Parameters and Weights
&lt;/h2&gt;

&lt;p&gt;Similarly in an AI model, the equation would be much more larger with the billions of parameters. The more complex the equation, the more patterns the model can learn and so the relevance and accuracy improves. Based on the Data exposed to train a model , its prediction varies.&lt;br&gt;
This is the reason why bigger models often perform better. That's why AI companies like OpenAI, Gemini and Claude come up with their model containing billions of parameters which helps to learn complex relationships.&lt;/p&gt;

&lt;p&gt;And along with these parameters, we have something called as weights.&lt;br&gt;
For Example : m1x^2 + m2x^3&lt;br&gt;
Here the m1 and m2 are called as weights. These are the things that comes from the data. These are the values learned during the training which act as deciding factors.&lt;br&gt;
For Example : &lt;br&gt;
When a model learns about animals,&lt;br&gt;
"Cat" gets one weight&lt;br&gt;
"Dog" gets another&lt;br&gt;
"Lion" gets another&lt;/p&gt;

&lt;p&gt;Based on the weights, the relevance changes. And using this the model could prioritize the importance of one over the other.&lt;/p&gt;

&lt;h2&gt;
  
  
  What does an LLM do?
&lt;/h2&gt;

&lt;p&gt;Now we understood about the model. So, what does an LLM actually do?&lt;br&gt;
The answer is "It just predict the next word."&lt;/p&gt;

&lt;p&gt;If you ask a question to an AI, it does not understand like how we do. Instead it uses the question or prompt as an input and it predicts the next word and uses the predicted word again as an input to predict the next. This gets repeated until it generates the complete response. And this is the reason, why it always streams the response and does not just give a whole response at once.&lt;/p&gt;

&lt;h2&gt;
  
  
  But how does it predict the next word?
&lt;/h2&gt;

&lt;p&gt;It uses the weights which the pretrained model already has for all data which it had trained on. What if we ask about a word, which the model didn't get trained on? Will it say "I don't know"?&lt;br&gt;
No, it just Hallucinates. &lt;/p&gt;

&lt;p&gt;For example, the model is trained only on:&lt;br&gt;
Cats&lt;br&gt;
Dogs&lt;br&gt;
and if we ask about:&lt;br&gt;
Lions&lt;/p&gt;

&lt;p&gt;The model was never exposed to data related to "Lions".&lt;br&gt;
Instead of saying:&lt;br&gt;
“I don’t know”&lt;br&gt;
the model answers a wrong answer confidently. This is called Hallucination.&lt;/p&gt;

&lt;p&gt;This is why RAG becomes necessary. Here we would give it a context by providing our private data, so that it doesn't hallucinate when we ask anything related to our data, instead it uses this private data and then generate the response rather than just using the pretrained data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Temperature
&lt;/h2&gt;

&lt;p&gt;Temperature controls the creativity of the model.&lt;br&gt;
It usually ranges from 0 to 1:&lt;/p&gt;

&lt;p&gt;Low Temperature (0.1)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;More factual&lt;/li&gt;
&lt;li&gt;More stable&lt;/li&gt;
&lt;li&gt;Less creative&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Medium Temperature (0.5)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Balanced output&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;High Temperature (0.9)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;More creative&lt;/li&gt;
&lt;li&gt;More imaginative&lt;/li&gt;
&lt;li&gt;Higher chance of hallucination
Temperature does not directly control truth.
It controls randomness.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  LLM and SLM
&lt;/h2&gt;

&lt;p&gt;We don't always need a bigger model which knows everything when we actually just need it for our specific use cases. In this situation, we may need a specialized model. Here SLM helps.&lt;/p&gt;

&lt;p&gt;SLM - Smaller Language Model&lt;br&gt;
This helps us with specific use cases. For example: ChatBots, Any Domain-Specific Tasks, Voice Assistants.&lt;br&gt;
These models may have millions of parameters instead of billions.&lt;/p&gt;

&lt;p&gt;It is much more cheaper, smaller than a LLM&lt;/p&gt;

&lt;p&gt;LLM - Large Language Model&lt;br&gt;
It is a Generalized model which has knowledge from different domains. It has billions of parameters. Example : Claude, Gemini and ChatGPT.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why do we need RAG?
&lt;/h2&gt;

&lt;p&gt;All these LLMs have few major limitations like&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Outdated Knowledge- They may not now about recent events. They only know about the data with which it had been trained on.&lt;/li&gt;
&lt;li&gt;Hallucination - Outcome of first limitation is when we ask about something it doesn't know, it hallucinates.&lt;/li&gt;
&lt;li&gt;They doesn't have any knowledge about a private data which they cannot access. Example : Private Business Data, HR Documents, Finance Documents, Project Reports , Project Management Tool Data, etc.,&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is where the RAG comes into picture.&lt;/p&gt;

&lt;h2&gt;
  
  
  RAG - Retrieval Augmented Generation
&lt;/h2&gt;

&lt;p&gt;This is self Explanatory. &lt;/p&gt;

&lt;p&gt;RAG typically involves three main steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Retrieve&lt;/strong&gt; – Relevant data is fetched from external sources like PDFs, databases, internal files, knowledge bases or documents based on the user’s query.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Augment&lt;/strong&gt; – The retrieved data is added to the prompt/context that is sent to the pre-trained LLM.&lt;br&gt;
(Important: we are not modifying or retraining the model itself, just giving it extra context.)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Generate&lt;/strong&gt; – The LLM uses both its pre-trained knowledge and the retrieved context to generate a more accurate and relevant response.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So instead of relying only upon its pretrained data, it just looks up on this retrieved private data and then generates the response. This way, RAG helps the LLM to overcome the above mentioned limitations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where is this private data gets stored?
&lt;/h2&gt;

&lt;p&gt;The Private Data is stored inside a Database known as a Vector Database. This vector database is a concept. &lt;/p&gt;

&lt;p&gt;For example: The private data like AzureDevOps board content, HR  Policy documents, Jira content, Internal Business Docs. &lt;br&gt;
All these are not directly fed to the LLM. Instead, they are converted and stored intelligently.&lt;/p&gt;

&lt;p&gt;How these documents are stored? &lt;br&gt;
Documents are broken into smaller parts called as Chunks.&lt;br&gt;
These chunks are always a&lt;br&gt;
Sentence Groups or Paragraph Chunks and &lt;br&gt;
not individual Words.&lt;br&gt;
This is because meaning comes from the context and not with isolated words. &lt;br&gt;
This contextual chunks helps the RAG to give a more relevant responses.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a Vector?
&lt;/h2&gt;

&lt;p&gt;A vector has Magnitude and Direction.&lt;/p&gt;

&lt;p&gt;Each Chunk is converted into a numerical vector.&lt;br&gt;
Example:&lt;br&gt;
A paragraph about Lion becomes.&lt;br&gt;
P1=[...700 dimensions]&lt;br&gt;
P2=[...700 dimensions]&lt;br&gt;
P3=[...700 dimensions]&lt;br&gt;
Here P1, P2 and P3 are the points in a graph. All these points are defined with a 700 dimensions. &lt;br&gt;
For our understanding, in a 2D graph, we represent a point with x and y value. It means a point P1 can be defined as (x, y). Similarly we can define a point with any number of dimensions.&lt;br&gt;
Now the system measures the distance between the vectors and finds the relevant information.&lt;/p&gt;

&lt;p&gt;It checks which are the points which are closer to P1. It finds P2 and P3 by measuring the distance. &lt;/p&gt;

&lt;p&gt;Example :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Apple&lt;/li&gt;
&lt;li&gt;Orange&lt;/li&gt;
&lt;li&gt;Pear&lt;/li&gt;
&lt;li&gt;Lemon&lt;/li&gt;
&lt;li&gt;Doctor&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here all the fruits related words stay closer and the word Doctor stays farther from these words.&lt;br&gt;
This is how the relevance works.&lt;/p&gt;

&lt;h2&gt;
  
  
  How relevant Chunks are found?
&lt;/h2&gt;

&lt;p&gt;When we say it measures the distance between each vectors, it means it involves different kinds of Algorithms.&lt;br&gt;
Examples :&lt;br&gt;
ANN - Approximate Nearest Neighbors&lt;br&gt;
KNN - K- Nearest Neighbors&lt;br&gt;
These help quickly find the most relevant chunks.&lt;br&gt;
The same idea is used in:&lt;/p&gt;

&lt;p&gt;Spotify, Netflix recommendations&lt;br&gt;
Amazon suggestions&lt;br&gt;
YouTube feed&lt;br&gt;
Social media recommendations &lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;The flow of RAG system is &lt;br&gt;
User asks a Query - Prompt&lt;br&gt;
↓&lt;br&gt;
System retrieves the chunks from this prompt&lt;br&gt;
↓&lt;br&gt;
This retrieved context goes into the LLM&lt;br&gt;
↓&lt;br&gt;
Based on the context, it retrieves all related chunks of data (Stored in a vector DB)&lt;br&gt;
↓&lt;br&gt;
LLM Generates the Answer with the retrieved relevant chunks of data&lt;br&gt;
↓&lt;br&gt;
User Receives a better response with their context.&lt;/p&gt;

&lt;p&gt;LLM- Predicts&lt;br&gt;
Vector DB - Stores your private Data as vectors&lt;br&gt;
RAG provides the context by searching the vector DB for relevant chunks. Send those to LLM.&lt;br&gt;
More contextual responses are generated.&lt;/p&gt;

&lt;p&gt;RAG is a method where an LLM retrieves relevant information (often from pre-indexed data in a vector database) and uses it to generate a more accurate answer.&lt;/p&gt;

&lt;p&gt;One simple analogy to have a clear understanding is:&lt;br&gt;
If you are getting into a project, you may need a Senior person's help to know about a particular application. &lt;br&gt;
So, RAG can be that senior person by below way:&lt;br&gt;
Here the Data means your application's documentations-files, Jira/ADO data. This is a private data.&lt;/p&gt;

&lt;p&gt;LLM &amp;lt;--&amp;gt; YOUR DATA &lt;br&gt;
 |________| &lt;br&gt;
     ↓ (Combining these two)&lt;br&gt;
   RAG (Now this acts as that Senior Person-You can interact with)&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>llm</category>
      <category>ai</category>
      <category>rag</category>
    </item>
  </channel>
</rss>
