Guide / Cheat Sheets

RAG & Retrieval

Retrieval-augmented generation, vector search, chunking, reranking.

↓ Download this cheat sheet (.txt)

Chunking

Splitting long documents into smaller passages before embedding and indexing them, since retrieval works on chunk-sized units.

e.g. Splitting a 50-page PDF into 500-token chunks.

Grounding

Anchoring a model's answer in retrieved or provided source material so it is less likely to hallucinate.

e.g. Requiring the model to quote the exact source passage it used.

Reranking

A second, more precise scoring pass over an initial set of retrieved candidates to reorder them by true relevance before they reach the model.

e.g. A cross-encoder reranker re-scores the top 50 vector-search hits.

Retrieval-Augmented Generation (RAG)

Fetching relevant external documents at query time and feeding them into the model's context so it can answer with up-to-date or private information.

e.g. Searching a company wiki before answering an internal question.

Vector Database

A datastore optimized for storing embeddings and running fast nearest-neighbor similarity search at scale.

e.g. Pinecone, Weaviate, and pgvector are all vector databases.

Vector Search

Finding the most relevant documents by comparing embedding similarity rather than exact keyword matches.

e.g. A query about "car trouble" also matches a document about "vehicle breakdown".