🧭 Vector Databases and Embeddings: The Infrastructure Behind RAG
Interactive 3D embedding space where plotting a query vector among document embeddings shows nearest-neighbour search retrieving the closest points and feeding them into a simulated RAG pipeline.
A 3D embedding space where document chunks cluster by topic; plotting a query vector among them and running nearest-neighbour search shows exactly how a vector database retrieves context for a RAG pipeline.
🔬 What It Demonstrates
Semantically similar text lands near each other in embedding space. A vector database ranks every stored embedding against the query using a similarity metric and returns the top-K closest matches, which are then stuffed into the LLM's context window.
🎮 How to Use
Pick a query topic and drift it toward a neighbouring one, choose cosine or Euclidean similarity, and adjust top-K and embedding spread. Press "Run retrieval" to watch the nearest documents stream up into the simulated LLM context.
💡 Did You Know?
At billion-vector scale, exact nearest-neighbour search is too slow — production vector databases use approximate methods like HNSW graphs or IVF indexes to trade a sliver of accuracy for millisecond-scale lookups.
Interactive 3D embedding space where querying a nearest-neighbour index shows how vector databases retrieve context chunks that power retrieval-augmented generation.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install