Skip to main content

Terminology

RAG

Retrieval-Augmented Generation. The architecture of fetching relevant documents from an external store at query time and supplying them to a language model as context, so answers are grounded in current or private data instead of the model's training alone.

ANN

Approximate Nearest Neighbour. A class of search algorithms that return vectors close to a query vector without scanning the entire index, trading a little recall for large gains in speed and scale.

HNSW

Hierarchical Navigable Small World. A graph-based ANN index that navigates layered proximity graphs from coarse to fine; the default high-recall, low-latency index in pgvector, Qdrant, Weaviate, and RediSearch.

IVF

Inverted File Index. An ANN method that clusters vectors into lists (cells) and searches only the nprobe lists nearest the query, trading recall for speed; often combined with product quantization as IVF-PQ.

PQ

Product Quantization. A compression technique that splits a vector into sub-vectors and replaces each with a codebook id, shrinking memory and speeding distance computation at some loss of precision.

BM25

Best Matching 25. A probabilistic lexical ranking function scoring documents by weighted term frequency with length normalisation; the standard sparse-retrieval baseline and the lexical half of most hybrid search.

TF-IDF

Term Frequency-Inverse Document Frequency. A classic weighting scheme that scores a term highly when it is frequent in a document but rare across the corpus; the conceptual ancestor of BM25.

RRF

Reciprocal Rank Fusion. A rank-only method for merging multiple result lists by summing 1/(k + rank) per document; used to fuse lexical and vector results without normalising incompatible scores.

MMR

Maximal Marginal Relevance. A re-ranking strategy that selects results balancing relevance to the query against diversity from already-chosen results, reducing near-duplicate passages in the context.

RAGAS

Retrieval-Augmented Generation Assessment. An open-source evaluation framework computing faithfulness, answer relevancy, context precision, and context recall for RAG pipelines, typically via an LLM judge.

LLM

Large Language Model. A transformer-based model trained on large text corpora that generates and reasons over natural language; the generation component of a RAG system.

kNN

k-Nearest Neighbours. The exact version of nearest-neighbour search that compares the query to every vector and returns the k closest; accurate but linear in corpus size, hence approximated by ANN at scale.

TTL

Time To Live. The lifetime after which a cached entry (embedding, retrieval result, or generated answer) is considered stale and re-computed; the primary freshness control for RAG caches.

HyDE

Hypothetical Document Embeddings. A query-expansion method that embeds a model-generated draft answer instead of the raw query, retrieving documents similar to the hypothetical answer.

kV Cache

Key-Value Cache. The transformer's stored attention keys and values for already-processed tokens; prompt/KV caching reuses it across calls that share a prefix to cut latency and cost on repeated grounding context.

OOD

Out Of Distribution. Input that differs markedly from what a model or retriever was tuned on; OOD queries often retrieve poorly and are a common source of RAG failures.

NER

Named Entity Recognition. Extraction of entities (people, organisations, dates, products) from text; used in metadata enrichment and to build the entity graph in GraphRAG.

p95 Latency

95th-Percentile Latency. The response time below which 95% of requests complete; a tail-latency metric more honest than the mean for user-facing RAG, since slow outliers dominate perceived speed.

Recall@k

Recall at k. The fraction of all relevant documents that appear in the top-k retrieved results; the core retrieval-quality metric that upper-bounds answer quality.

MRR

Mean Reciprocal Rank. The average of 1/(rank of the first relevant result) across queries; rewards retrievers that place a relevant document near the top.

nDCG

Normalised Discounted Cumulative Gain. A ranking metric that rewards placing highly relevant results near the top, discounting gains by position and normalising against the ideal ordering.

ETL

Extract, Transform, Load. The pattern behind a RAG ingestion pipeline: extract documents from sources, transform them by cleaning and chunking, and load chunks plus embeddings into the store.

OCR

Optical Character Recognition. Conversion of images or scanned PDFs into machine-readable text; a frequent first step when ingesting non-digital-native documents into a corpus.

PII

Personally Identifiable Information. Data that can identify an individual; RAG corpora must detect, redact, or access-control PII to meet privacy and compliance requirements.

MCP

Model Context Protocol. An open protocol from Anthropic for connecting models to external tools and data sources through a standard interface, increasingly used to expose retrievers and corpora to agents.

CRAG

Corrective RAG. An approach that grades retrieved documents and triggers corrective actions (re-query, web search, or discard) when retrieval quality is judged low, before generating an answer.

Self-RAG

Self-Reflective RAG. A method where the model emits reflection tokens deciding when to retrieve and critiquing whether its output is supported by the retrieved evidence, improving grounding selectively.

SLA

Service Level Agreement. A committed target (for example p95 latency or availability) for a production RAG service; informs index choice, caching, and capacity planning.

VRAM

Video RAM. GPU memory that bounds how large an embedding or re-ranker model, and how big a batch, you can run locally; a practical constraint when self-hosting RAG components.