rag_pipeline
// Query → Embed → Retrieve → Augment → Generate — step by step
Step 0 / 7
Ready — click "step" to begin
💬
User Query
"What causes inflation?"
📐
Embedding Model
Query → Vector
[0.23, -0.71, 0.44, …] ×1536
🔍
Vector DB
ANN Search
cosine similarity
SIMILARITY SCORES (top-5)
📝
Prompt Builder
Augmented Prompt
query + context docs
System: Answer based on the provided context only.

Context:
[Federal Reserve 2023]: "Inflation rose due to supply chain disruptions and excess demand…"
[Investopedia]: "Inflation is caused by demand-pull, cost-push, and built-in factors…"

User: What causes inflation?
🧠
LLM
Generate Answer
grounded in context
What is RAG?
Retrieval-Augmented Generation (RAG) grounds LLM responses in external knowledge. Instead of relying solely on training data, RAG retrieves relevant documents at query time and includes them as context. This reduces hallucinations and enables up-to-date answers.
also by echobash