Why the naive chatbot lies

Before we build the RAG pipeline, let us see exactly why we need one. A plain LLM has no access to your website, your docs, or anything written after its training cutoff. Ask it a specific question about a niche site and it will confidently make something up.

examples/naive.py
python
# The naive approach: just ask the LLM
prompt = "What is the refund policy on example-store.com?"

async for chunk in llm_provider.generate_stream(prompt, temperature=0.3):
    print(chunk, end="")

# The answer will be fluent, confident, and quite possibly wrong.
# The model has no idea what example-store.com actually says.

This is the failure mode RAG exists to solve. Without grounding, the model draws on training data and plausible guesses. Neither is a source of truth.

Flashcards: Flashcards

Loading practice…

Fine-tuning changes behavior and style. It is a poor fit for fact retrieval. Your content changes, and retraining every time is slow and expensive. RAG keeps facts in a searchable index you can update instantly. Fine-tuning and RAG solve different problems, and RAG is almost always the right starting point for grounded answers.

Quiz: Quiz

Loading practice…

Checkpoint: Ingestion and grounding checkpoint

Loading practice…