Artificial Intelligence · Retrieval & Search
Vector Embeddings Explained
How meaning becomes geometry.
1 min readPublished Updated
- embeddings
- vectors
An embedding maps text, images, or other data to a fixed-length vector where distance encodes similarity.
python
def cosine_similarity(a, b):
import numpy as np
return np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b))Embeddings are the foundation of semantic search, recommendation, and retrieval-augmented generation.
Try it#
Drag the sliders to change the angle between two vectors, then pick a word to see its nearest neighbours in a toy embedding space.
Vector similarity