All terms

Vector Database

A database optimized for storing embedding vectors and retrieving nearest neighbors by similarity at scale.

Databases2 min read

Definition

A vector database stores high-dimensional embedding vectors and supports fast approximate nearest neighbor (ANN) search. Instead of matching exact keywords, it finds items whose vectors are closest to a query vector.

Popular options include Pinecone, Weaviate, Qdrant, Milvus, and PostgreSQL with the pgvector extension.

In simple terms

Imagine a librarian that understands ideas instead of only book titles. You describe what you need; they walk to the shelf where conceptually similar books live — even if none share your exact words. A vector database is that librarian at software scale.

Where you see it

  • ChatGPT retrieval plugins query vector stores of company docs.
  • E-commerce sites find visually or semantically similar products.
  • Code assistants index repositories for relevant snippets.
  • Research labs store Somali document embeddings for multilingual search.

How it works

  1. 1.Ingest and embed

    Documents are chunked, embedded, and inserted with metadata (source, title, timestamps).

  2. 2.Index vectors

    ANN indexes (HNSW, IVF, etc.) organize vectors for sub-linear search time.

  3. 3.Query by vector

    The user's question is embedded; the database returns top-k nearest vectors.

  4. 4.Filter and rank

    Metadata filters (language, date, access level) narrow results before returning chunks to an LLM.

At a glance

Why it matters

  • LLMs alone cannot search your private or fresh data efficiently — vector DBs make grounded answers possible.
  • They are the storage layer behind modern semantic search and RAG architectures.

Often confused

  • Vector databases replace traditional SQL databases.

    They complement relational DBs — often used together for metadata + vector search.

  • Exact keyword search is obsolete.

    Hybrid search (keywords + vectors) often outperforms either approach alone.