A Large Language Model (LLM) predicts the next token from the available context.
| Component | Contents | How it changes |
|---|---|---|
| Model weights | Numerical parameters learned during training | Training, fine-tuning or loading different weights |
| Call context | Supplied instructions, messages and tool results | The application builds a new request |
| Search index | Representations of external documents | Indexing a new document version |
A chat database is invisible to the model unless the application supplies its contents. A new instruction in a request does not update weights. Inference means applying an already trained model.
Retrieval-Augmented Generation (RAG) supplies retrieved sources to a generator. A chunk is a document passage; its boundaries should preserve conditions and exceptions. An embedding is a numerical vector representing text. Nearby vectors indicate similarity under the chosen model, not verified truth.
| Method | Role | Example |
|---|---|---|
| BM25 (Best Match 25) | Word-based retrieval | Exact part number AB-42 |
| Dense retrieval | Nearby-vector retrieval | “Send a purchase back” → “product returns” |
| Hybrid search | Combines lexical and vector retrieval | A part number and a problem description |
| RRF — Reciprocal Rank Fusion | Combines ranks rather than incomparable scores | A document near the top of both lists gets larger contributions |
| Reranker | Reorders retrieved candidates more closely | Selects 5 passages from 100 |
| HNSW (Hierarchical Navigable Small World) | Accelerates approximate nearest-neighbour retrieval | Trades recall against time and memory |
If chunking removes the exception, even a good generator receives incomplete evidence. If retrieval returns an old policy, inspect its version and index. RAG does not guarantee correctness or require a vector database: retrieval can use other methods. A hallucination is a plausible but false or unsupported claim; today's price without a current source requires verification.