Vector database

Also called vector store, vector db, vector index

A database built to store embeddings and quickly find the ones most similar to a query.

A vector database stores embeddings, the numerical representations of text, images or other data, alongside the original content and metadata. Its main job is nearest-neighbour search: given a query vector, return the stored vectors closest to it, fast, even when there are millions of them.

Vector databases are the usual storage layer in RAG systems and semantic search. When a user asks a question, the question is embedded, the database returns the most similar document chunks, and those chunks go into the model's prompt. Metadata filters, such as date, department or document type, narrow the results.

There are dedicated vector databases and also vector features added to general databases such as PostgreSQL, Elasticsearch and many cloud data stores. For small collections, a few thousand chunks, a simple in-memory index or a vector extension on an existing database is often enough. Dedicated systems earn their place at large scale or when search speed is critical.

Example

A legal team stores 40,000 contract clauses as embeddings with metadata for client and year. A lawyer asks for "limitation of liability clauses that exclude data breaches" from 2024 onward, and the database returns the 20 closest clauses in under a second.

Common mistake

Adding a vector database before you need one. Many projects start with a dedicated service, extra cost and new infrastructure for a few hundred documents that would fit in a long prompt or a simple file-based index. Start simple and move to a database when scale or speed demands it.

Find a prompt for the task in front of you.

96 prompts in 8 categories. Copy one, fill in the blanks, paste it into any model.

Browse prompts

Promptlexity is a free library of 96 AI prompts and 8 downloadable AI skills across 8 categories, plus a glossary of 64 AI and prompting terms. Each prompt shows the exact text to paste, the variables to fill in, an example of what comes back, and why it works. Each glossary term has a plain-English definition, an example and a common mistake. 6 step-by-step guides cover the basics. No signup, works with ChatGPT, Claude, Gemini and other models.

Press Esc to close