Vector Database
A vector database stores and indexes high-dimensional vector embeddings, enabling efficient similarity searches for AI and machine learning applications.
Vector databases are designed to store and query vector embeddings, which are numerical representations of data generated by machine learning models. These embeddings capture semantic meaning, allowing for similarity searches. Unlike traditional databases that focus on exact matches, vector databases excel at finding items that are similar based on their vector representations. This makes them ideal for applications like image and text search, recommendation systems, and anomaly detection. They use specialized indexing techniques, such as approximate nearest neighbor (ANN) algorithms, to speed up similarity searches in high-dimensional spaces.
Vector databases are crucial for modern AI applications. They provide the infrastructure needed to efficiently manage and query the vast amounts of data generated by machine learning models. By enabling fast similarity searches, they facilitate tasks such as finding similar documents, recommending products, and identifying patterns in complex datasets. The ability to perform these operations quickly and accurately is essential for the success of many AI-driven applications.
graph LR
Center["Vector Database"]:::main
Pre_linear_algebra["linear-algebra"]:::pre --> Center
click Pre_linear_algebra "/terms/linear-algebra"
Pre_embeddings["embeddings"]:::pre --> Center
click Pre_embeddings "/terms/embeddings"
Pre_machine_learning["machine-learning"]:::pre --> Center
click Pre_machine_learning "/terms/machine-learning"
Rel_nosql["nosql"]:::related -.-> Center
click Rel_nosql "/terms/nosql"
Rel_prompt_engineering["prompt-engineering"]:::related -.-> Center
click Rel_prompt_engineering "/terms/prompt-engineering"
Rel_semantic_search["semantic-search"]:::related -.-> Center
click Rel_semantic_search "/terms/semantic-search"
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧒 Explain Like I'm 5
📍 A [database](/en/terms/database) that finds information based on how 'similar' it is to your request, allowing AI to have a long-term memory.
🤓 Expert Deep Dive
## Why RAG Needs a Vector DB
Retrieval-Augmented Generation (RAG) is the gold standard for reducing AI hallucinations. Instead of relying on a model's static, outdated training data, we store our company's private documents in a vector database. When a user asks a question, we retrieve the top 3-5 most relevant text chunks (nearest neighbors) and pass them to the LLM. The LLM then answers the question using only those chunks as evidence. This turns the AI into a librarian who looks up facts rather than a storyteller who makes them up.