惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

MyScale Blog
MyScale Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
人人都是产品经理
人人都是产品经理
V
Visual Studio Blog
博客园 - 叶小钗
A
About on SuperTechFans
Last Week in AI
Last Week in AI
量子位
博客园 - 三生石上(FineUI控件)
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
MongoDB | Blog
MongoDB | Blog
T
The Blog of Author Tim Ferriss
Vercel News
Vercel News
博客园 - 司徒正美
博客园 - Franky
博客园 - 【当耐特】
月光博客
月光博客
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
S
SegmentFault 最新的问题
大猫的无限游戏
大猫的无限游戏
博客园 - 聂微东
J
Java Code Geeks

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Introduction to RAG
Ramya Peruma · 2026-04-28 · via DEV Community

Ramya Perumal

RAG is Retrieval-Augmented Generation.

What is a Model?
A model is nothing but an equation.
Example:
y=mx+c
During training, values of x and y will be provided. The model has to find the appropriate values of m and c and try to make a line that best fits the graph. The values of m and c may vary depending on the use case.

What is a Parameter?
A parameter is nothing but a variable that is learned during training.
In the above equation:
m is a parameter
c is a parameter

If the number of parameters is more, the model can learn more complex patterns.

What is Temperature
Temperature controls the model's creativity. It usually ranges from 0 to 1.
Lower temperature gives more factual answers.
Higher temperature gives more imaginative answers.

Temperature is passed along with the prompt input.
Usually, it is kept around 0.5 for balanced output.

SLM
SLM stands for Small Language Model.
It usually has fewer billion parameters and is trained for a particular domain or specific tasks.
Training cost can still be high, similar to LLMs, depending on the use case.
Example: smallest ai - provides voice-based smaller AI models.

LLM
LLM stands for Large Language Model.
It usually has billions of parameters and contains knowledge from many domains. It is called a generalized model.
Example: gpt-oss-120b.

How LLM Works
The primary functionality of an LLM is to predict the next word correctly.
It generates text by predicting one word after another based on previous words.
Sometimes LLMs generate incorrect information confidently. This is called hallucination.
Example:
If the model knows about cats and dogs but has limited knowledge about lions, it may generate irrelevant or incorrect content.
Hallucination can be reduced by writing proper prompts and providing correct context.

What is RAG?
RAG stands for Retrieval-Augmented Generation.

It is a method used to provide private or external knowledge such as:
Company policies
HR policy documents
Internal business documents

This information is given to the LLM so it can generate human-readable answers based on that content.

Where is Private Data Stored?
Private data is usually stored in a database called a Vector Database.

How Documents are Stored
Documents are split into smaller parts called chunks.
These chunks are converted into numerical vectors and stored in the vector database.

To search relevant chunks quickly, algorithms like:

ANN (Approximate Nearest Neighbors)
KNN (K-Nearest Neighbors)
are commonly used.