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.
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.
Related terms
Embeddings
Numeric vector representations of text in which semantically similar passages end up close together, enabling search by meaning rather than exact words.
Semantic Search
Search that ranks results by meaning similarity between the query and documents, using embeddings, rather than by matching keywords.
Hybrid Search
A retrieval strategy that combines semantic (vector) search with keyword (full-text) search and merges the results, capturing both meaning and exact matches.
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