← AI Knowledge Home
08 · Embeddings, Search & RAG

How AI Finds External Information Before Answering

This module explains how documents can be prepared, searched, retrieved, and added to a model’s context so answers can use relevant external information.

Understand the full path from source documents to retrieved context.

The Big Picture · two information flows converge

Prepare knowledge, then find what matters

KNOWLEDGE PREPARATION

DOCUMENTSSource material
↓
CHUNKINGSplit large content into useful pieces
↓
EMBEDDINGSRepresent chunks as vectors
↓
VECTOR DATABASE / INDEXStore and organize searchable representations

QUERY TIME

USER QUESTIONA request for information
↓
QUERY REPRESENTATIONRepresent the request for search
↓
SEARCHSemantic Search / Vector Search
↓
RETRIEVAL + RERANKINGReturn and order candidate source content
RELEVANT CONTEXT
↓ RAG · add retrieved context to generation
↓ MODEL → GROUNDED ANSWER

Vector databases are one common implementation, not a requirement for every retrieval system.

Knowledge Map

Prepare → Find → Use

C · USE

RAG

Adds retrieved information to model context before generation.

Grounding

Connects an answer to supplied external evidence.

Key Distinctions

Connected concepts, different layers

EmbeddingRepresentation≠Vector DatabaseStorage and indexing system
Semantic SearchSearch by meaning≠Vector SearchOne technical method
Vector SearchSearch method≠RetrievalBroader information-finding process
RetrievalFinds information≠RAGUses it during generation
RAGRuntime context≠Fine-tuningAdditional training
GroundingTies output to evidence≠Guaranteed correctnessStill requires evaluation
One Example

Answering a leave-policy question

KNOWLEDGE BASE

Employee handbook → chunk leave policy → index content

USER REQUEST

“How many annual leave days do employees receive?” → search / retrieval → relevant leave-policy chunk → add to LLM context → answer

The answer can reference the retrieved policy.

Recommended Learning Path

Learn the retrieval system in order

This is a learning path, not a mandatory technical stack.

01Chunking

Divide documents.

02Embeddings

Represent meaning.

03Vector Database

One storage option.

04Search

Semantic and vector search.

05Retrieval

Select useful content.

06Reranking

Improve ordering.

07RAG

Combine retrieval and generation.

08Grounding

Connect answers to evidence.

Remember the pipeline
Retrieval systems prepare and search external knowledge, while RAG supplies the most relevant information to a model before it generates an answer.