This article demonstrates how to build a mood-based movie recommendation engine using semantic search with voyage-4-nano embeddings and MongoDB Atlas Vector Search. It explores the technical trade-offs between embedding dimensionality, specifically how varying vector sizes impact the discrimination gap and retrieval ranking stability. The author provides practical guidance on balancing storage efficiency and query precision for vector-based search applications.
Key points
Lower embedding dimensions can create a wider discrimination gap between similarity scores due to aggressive compression but may result in less reliable absolute values.
Higher dimensional vectors (e.g., 2048) offer maximum precision for nuanced semantic distinctions but increase storage and latency requirements.
Ranking stability generally remains consistent across different dimensions, making dimension selection a trade-off between storage efficiency and retrieval accuracy.
A 1024-dimensional embedding is suggested as a balanced default for most production search use cases.