



Overview of distance metrics including Euclidean, cosine similarity, dot product, and Manhattan distance, with guidance on when to use each for optimal retrieval performance.
Loading more......
Cosine Similarity:
Euclidean Distance (L2):
Dot Product:
Manhattan Distance (L1):
Cosine Similarity: Default for text/semantic search
Euclidean: When magnitude matters
Dot Product: For speed
Manhattan: Special cases
With Normalized Vectors:
Without Normalization:
Speed (fastest to slowest):
Most Common in Production:
| Database | Cosine | Euclidean | Dot Product | Manhattan |
|---|---|---|---|---|
| Pinecone | ✓ | ✓ | ✓ | - |
| Weaviate | ✓ | ✓ | ✓ | ✓ |
| Qdrant | ✓ | ✓ | ✓ | ✓ |
| Milvus | ✓ | ✓ | ✓ | ✓ |
| pgvector | ✓ | ✓ | ✓ | - |