SmartFAQs.ai
Back to Learn
Intermediate

L2 Distance

L2 distance, also known as Euclidean distance, is a metric that calculates the straight-line length between two points in a high-dimensional vector space. In RAG pipelines, it measures the semantic dissimilarity between a query embedding and document embeddings; a lower L2 score indicates higher relevance.

Definition

L2 distance, also known as Euclidean distance, is a metric that calculates the straight-line length between two points in a high-dimensional vector space. In RAG pipelines, it measures the semantic dissimilarity between a query embedding and document embeddings; a lower L2 score indicates higher relevance.

Disambiguation

Geometric straight-line distance, not angular similarity (Cosine) or Manhattan distance (L1).

Visual Metaphor

"A laser pointer measuring the direct 'as-the-crow-flies' distance between two stars in a galaxy."

Key Tools
FaissPineconeChromaDBMilvusNumPyScikit-learn
Related Connections

Conceptual Overview

L2 distance, also known as Euclidean distance, is a metric that calculates the straight-line length between two points in a high-dimensional vector space. In RAG pipelines, it measures the semantic dissimilarity between a query embedding and document embeddings; a lower L2 score indicates higher relevance.

Disambiguation

Geometric straight-line distance, not angular similarity (Cosine) or Manhattan distance (L1).

Visual Analog

A laser pointer measuring the direct 'as-the-crow-flies' distance between two stars in a galaxy.

Related Articles