Glossary/Retrieval & Search

What is Vector Database?

A data store optimized for saving embedding vectors and finding the nearest neighbors of a query vector quickly, at scale.

Semantic search requires answering "which of these million vectors are closest to this one?" fast. Vector databases index embeddings with structures (like HNSW graphs) that make approximate nearest-neighbor search efficient, and pair each vector with metadata for filtering.

Vector storage can live in a dedicated database or as an extension of a general-purpose one. The extension approach — such as pgvector for PostgreSQL — keeps vectors, documents, permissions, and full-text indexes in one system with one consistency model, which simplifies hybrid search and access control considerably.

In BeforeQuery

How BeforeQuery uses this

BeforeQuery stores vectors in PostgreSQL with the pgvector extension, alongside the documents, chunks, full-text indexes, and permission data they belong to. One store means hybrid retrieval, visibility rules, and source-group filters happen in a single query path.

From definition to deployment

Connect a knowledge source and see cited AI answers on your own content in minutes — free, no credit card required.

Get Started Free