# Day 10 - Feb 2 2026

Build a system that fixes LLM hallucinations by grounding answers in retrieved data.

### 1. The Problem: Hallucination

LLMs are like confident improvisers. If you ask them about a private document (e.g., "What is my salary?"), they will either guess or say "I don't know."

* Why? Their training data has a cutoff date and does not include your private files.

### 2. The Solution: RAG (Retrieval Augmented Generation)

RAG is essentially an "Open Book Exam" for AI. Instead of asking the AI to memorize facts, we give it the textbook (Context) right before asking the question.

### 3. The Architecture (The 3 Steps)

1. Retrieval (Vector Search): The user asks a question. We convert it to a vector and find the most similar chunk in our ChromaDB.
2. Augmentation (Prompt Engineering): We construct a "Mega Prompt" that looks like this:

> "Context: \[Insert Retrieved Data Here]. Question: \[User Question]."

3. Generation (LLM): The model answers the question using the context we provided, drastically reducing errors.

### Status:

* [x] Connected Vector DB to LLM.
* [x] Implemented Context Injection.
* [x] Verified "Grounded" Response (The AI used my data).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://shankar-lab.gitbook.io/mylearning/15-days-genai-learning-challenge/day-10-feb-2-2026.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
