LearnViz CompSci
Home / Learn / Databases / Vector Databases

Advanced Topic 51 of 51 Databases

Vector Databases

Stores indexing embeddings for similarity search.

How it works

Vector databases store high-dimensional embedding vectors produced by machine-learning models and find the most similar ones to a query vector using a distance such as cosine similarity, dot product or Euclidean distance. Exact search is too slow at scale, so they use approximate nearest neighbor indexes such as HNSW graphs, IVF with product quantization and locality-sensitive hashing, trading small accuracy loss for large speedups. Metadata filters combine similarity with conditions.

Step-by-step walkthrough

  1. Content is turned into a vector by an embedding model.
  2. Similar meaning gives nearby vectors.
  3. The vectors are stored in an index such as HNSW.
  4. A query vector finds the nearest neighbours.
  5. Search by meaning powers retrieval for AI applications.

Where it is used

Semantic search, recommendation, image and audio similarity, deduplication and retrieval-augmented generation for language models use vector databases such as Pinecone, Milvus, Weaviate and pgvector.

Common pitfall

Results depend on the quality of embeddings and the chosen model, and mixing embeddings from different models is meaningless. Approximate indexes can miss true neighbors, so tune recall and latency. Index memory needs are large, and updates can be costly. Evaluate with real queries and relevance judgments, and consider simple keyword search combined with vectors.

Where it fits in the course

Vector Databases is topic 51 of 51 in Databases, rated Advanced. It follows Time-Series Databases. It is the last topic in this area.

Practice and explore

How to study this topic

  1. Read the explanation above and restate the definition in your own words.
  2. Open the interactive lesson and answer its mini quiz.
  3. Read the common pitfall, then write a short example that avoids it.
  4. Check your understanding in the Databases quiz, and revisit the topic if you miss a question.

Frequently asked questions

What is Vector Databases?
Stores indexing embeddings for similarity search. It belongs to Databases and is an advanced-level topic.
Where do people use Vector Databases?
Semantic search, recommendation, image and audio similarity, deduplication and retrieval-augmented generation for language models use vector databases such as Pinecone, Milvus, Weaviate and pgvector.
What is the most common mistake with Vector Databases?
Results depend on the quality of embeddings and the chosen model, and mixing embeddings from different models is meaningless.
What should I learn before this topic?
Start with Time-Series Databases, the topic just before it in Databases.
How can I practice it?
Answer the mini quiz in the interactive lesson, then take the Databases quiz.
Is Vector Databases hard to learn?
It is an Advanced topic. Expect to read the explanation more than once and to connect it with earlier topics. Working through a small example by hand helps most.
How long does it take to learn Vector Databases?
Most learners can read the explanation and finish the interactive lesson in under an hour. Fluency comes from applying the idea, so plan a few short practice sessions with the quiz.
Which topics are related to Vector Databases?
Time-Series Databases, NewSQL and Distributed SQL, LSM Trees are closely connected. The full list is in the related topics section of this page.
What should I study after Vector Databases?
You have reached the last topic in Databases. Pick another area on the Learn page, or revisit this topic with the quiz.

Related topics