Vector Databases

Similarity search over embeddings

Definition

A vector database stores embeddings – numeric vectors that capture the meaning of text or images – and quickly finds the vectors most similar to a query.

What for?

It enables semantic search: results are found by meaning rather than exact words. It is the basis of many RAG systems.

Technical architecture

flowchart LR
  T[Text, images] --> E[Embedding model]
  E --> V[Vectors + metadata]
  V --> IDX[(ANN index e.g. HNSW)]
  Q[Query] --> QE[Query embedding] --> IDX
  IDX -->|cosine similarity, filters| R[Top-k results]

Core components

Embeddings
Vectors produced by an embedding model from content.
Similarity measure
E.g. cosine similarity or dot product between vectors.
ANN index
Approximate nearest neighbour search, e.g. with HNSW, for fast queries.
Metadata filters
Narrow results, e.g. by tenant, language or date.

Practical examples

  • pgvector adds vector columns and similarity search to PostgreSQL.
  • A product search finds “laptop bag” for the query “notebook sleeve”.

Enterprise use cases

  • RAG knowledge bases
  • Semantic product search
  • Recommendations and duplicate detection

Quiz

1. What does a vector database mainly store?

2. What does ANN stand for?

3. Which measure is often used for similarity?

Related news

Pinecone Introduces Open Source Vector Search Extension for PostgreSQL

Source excerptPinecone has announced pg_pinecone, an open source PostgreSQL extension that adds vector search to existing pgvector columns without requiring a Pinecone account. Its native engine uses an IVF index with RaBitQ quantization and applies filters during search rather than after candidate retrieval, addressing a limitation of pgvector's HNSW approach for selective queries. By Renato Losio

Presentation: Finetuning Your Embedding Model for Better Search: Learning from Agentic Search at Dell

Source excerptRachel Shalom explains how Dell solved enterprise RAG retrieval failures on internal terminology by fine-tuning open-source embedding models. She discusses data prep with hard negatives, distributed InfoNCE loss training on H100 GPUs, automated hyperparameter tuning, and production evaluation using LLM-as-a-judge. By Rachel Shalom

Data + AI Anywhere: AlloyDB Omni integration with local models

Source excerptOpen models like Gemma 4 from Google DeepMind are a great option to keep your data local. But how can a local AI model integrate with on-premises data? AlloyDB Omni, Google’s 100% PostgreSQL-compatible database that runs anywhere, now integrates with locally hosted large language models (LLMs). With AlloyDB Omni, you can build agentic experiences on your own infrastructure and on your own terms. Whether it’s in the cloud, in your datacenter, or even on your laptop, you can have data plus AI anywhere. Built-in AI for your local environment AlloyDB Omni is a downloadable, run-anywhere edition of AlloyDB that easily deploys to your own infrastructure, including on-premises. AlloyDB Omni packs powerful, built-in AI, including the same ScaNN indexing technology powering Google Search. When you pair AlloyDB Omni with a model, you can store vector embeddings at scale; search them semantically; and even query the database using natural language. You can use virtually any model you like, whether that’s a frontier Cloud-hosted model like Gemini or a local model. And with locally hosted models you maintain complete control over your data environment. Connecting to Gemma 4, Qwen3.8, and other…