Skip to content

Rag Fundamentals

PART 15 — RAG Fundamentals

LLMs are frozen in time. They don't know your private company data.

  • Retrieval-Augmented Generation (RAG): Searching for relevant documents and pasting them into the LLM's prompt before asking the question.

Architecture:

[ Data Ingestion Pipeline ]
Documents
 ↓
Chunking (Split into paragraphs)
 ↓
Embedding Model
 ↓
Vector Database (Stores vectors + original text)

[ Query Pipeline ]
User Query ("What is our refund policy?")
 ↓
Embedding Model
 ↓
Vector Search (Find nearest chunks in DB)
 ↓
Relevant Chunks ("Refunds are allowed within 30 days...")
 ↓
Prompt Construction ("Context: [Chunks]. Answer user query.")
 ↓
LLM
 ↓
Answer

Why does an HLD engineer care?

RAG is the standard architecture for enterprise AI. You must design ingestion pipelines (batch jobs, streaming), manage chunking strategies, choose embedding models, and architect the retrieval latency to ensure the LLM responds accurately.