{"head":{"title":"What Is a Vector Database? Definition and Uses | OceanLab","description":"A vector database stores embeddings and finds the closest matches to a query fast. When you need one, when Postgres is enough, and common mistakes.","canonical":"https://oceanlab.in/glossary/vector-database"},"crumbs":[{"name":"Home","path":"/"},{"name":"Glossary","path":"/glossary"},{"name":"vector database","path":"/glossary/vector-database"}],"slug":"vector-database","term":"Vector database","aka":["vector store","vector index"],"category":"AI building blocks","short":"A database built to store embeddings and quickly find the ones closest to a query vector.","body":[["A vector database stores ",{"href":"/glossary/embedding","text":"embeddings"}," alongside the original item and its metadata, and builds an index for nearest-neighbour search: given a query vector, return the most similar items fast. Most use approximate search, which trades a little accuracy for a lot of speed."],["It can be a dedicated product or an extension to a database you already run, such as a vector type and index in PostgreSQL. Good systems also filter on metadata, such as customer, language or date, in the same query."]],"why":["It is the retrieval engine behind most ",{"href":"/glossary/rag","text":"RAG"}," and semantic search features. The choice affects cost, latency, how permissions are enforced and how much new infrastructure the team has to run."],"example":["A legal team's search tool keeps contract chunks with their embeddings in PostgreSQL using a vector extension. Each query filters by client and matter first, then ranks by similarity, so lawyers only see documents from matters they work on."],"inBuild":null,"mistakes":[["Adding a new database before checking whether the one you have can do vector search well enough."],["Filtering for permissions after the search, which can leak results or return too few."],["No plan for re-indexing when documents change or the embedding model is replaced."]],"related":[{"href":"/glossary/embedding","label":"Embedding (vector embedding)","detail":"A list of numbers that represents the meaning of a piece of text, an image or other data, so that similar items have similar numbers."},{"href":"/glossary/rag","label":"RAG (retrieval-augmented generation)","detail":"A pattern that finds relevant passages from your own data and gives them to a language model along with the question, so it answers from your content."},{"href":"/glossary/fine-tuning","label":"Fine-tuning","detail":"Training an existing model further on your own examples so it behaves the way you want, such as following a format, tone or task more reliably."},{"href":"/glossary/llm","label":"LLM (large language model)","detail":"An AI model trained on very large amounts of text that predicts the next piece of text, which lets it read, write and reason in language."}],"tools":[{"href":"/tools/embedding-cost-calculator","label":"Embedding cost calculator","detail":"Free tool"},{"href":"/tools/rag-cost-calculator","label":"RAG cost calculator","detail":"Free tool"}],"links":[{"href":"/ai","label":"AI by industry","detail":"AI use cases, costs and risks per industry."},{"href":"/compare/rag-vs-fine-tuning","label":"RAG vs fine-tuning","detail":"Comparison"}],"sources":[],"legal":false,"updatedAt":"2026-10-25"}