Tool

Vector Database

Why You Need a Vector Database

Embedding turns text into vectors, but these vectors need to be stored somewhere to be retrieved.

You can't store vectors in a regular database for semantic search — traditional databases excel at exact matching like id = 123, name = "John", not "find the content most similar in meaning to this passage."

Vector Database is specifically built for this: storing vectors + efficiently retrieving "most similar vectors."


What Is a Vector Database

One-line definition: A Vector Database is a database specifically designed to store high-dimensional vectors and support semantic similarity retrieval.

Analogy:

  • Traditional database is like a dictionary: searching "which page is this word on"
  • Vector Database is like a librarian: asking "which book discusses the meaning closest to this question"

It doesn't care what each number in the vector means, only the distance between vectors. Close distance = semantically similar. Here, Cosine Similarity is used to measure similarity.


How to Do It: When to Use Vector Databases

Scenarios suited for Vector Database:

  • Large knowledge base document collections that can't be fully fed to the model each time
  • Needing semantic search rather than keyword search
  • Providing a stable retrieval layer for RAG systems

When not to use:

  • Very small data volumes (tens of items) — simple storage is sufficient
  • Very simple scenarios needing only keyword matching

Common pitfalls:

  • Having a vector database doesn't mean RAG is done well: effectiveness also depends on splitting, retrieval strategy, and Prompt stitching
  • Can't replace regular databases: many business fields still need structured storage
  • Higher dimensions aren't always better: higher usually means higher storage and compute costs

Remember this: Vector Database is the storage layer for Embedding — making "finding semantically similar content quickly" possible.

Related terms: Embedding · RAG