What Is a Vector Database?
A vector database is a data store purpose-built to persist, index, and query high-dimensional vectors (embeddings). While traditional databases search by exact value or range, vector databases search by similarity — finding the vectors that are mathematically closest to a query vector.
This makes them the backbone of semantic search, recommendation systems, and retrieval-augmented generation (RAG) pipelines.
How Vector Databases Work
- Store — each record contains a vector (e.g., 1536 floats for OpenAI
text-embedding-3-small) plus metadata (text, source URL, timestamp) - Index — an ANN index (commonly HNSW) is built over the vectors for fast retrieval
- Query — a query vector is compared against stored vectors using a distance metric (cosine similarity, dot product, or Euclidean distance)
- Return — the top-k nearest vectors and their associated metadata are returned
# Conceptual example
results = vector_db.query(
vector=embed("how do I cancel my subscription?"),
top_k=5,
filter={"category": "billing"}
)
Popular Vector Databases
| Database | Notable Feature |
|---|---|
| Pinecone | Fully managed, serverless |
| Weaviate | Built-in modules, GraphQL API |
| Qdrant | Rust-based, payload filtering |
| Chroma | Lightweight, local-first |
| pgvector | Postgres extension |
| Typesense | Hybrid search built-in |
Vector Database vs Traditional Database
| Feature | Traditional DB | Vector DB |
|---|---|---|
| Query type | Exact / range | Similarity |
| Data type | Structured rows | Float vectors |
| Index type | B-tree, hash | HNSW, IVF |
| Use case | OLTP, reporting | Semantic search, RAG |
Metadata Filtering
Most vector databases support pre-filtering or post-filtering on metadata fields alongside the vector query. This lets you scope similarity search to a subset of documents:
{
"query_vector": [...],
"filter": { "api_key_id": "user_123", "category": "support" },
"top_k": 10
}
KnowledgeSDK and Vector Storage
KnowledgeSDK manages a dedicated vector collection per API key using Typesense, which supports hybrid search out of the box. When you call POST /v1/extract, the extracted content is automatically chunked, embedded, and inserted into your collection. When you call POST /v1/search, KnowledgeSDK runs a combined vector + keyword query against that collection and returns ranked results.
You never have to provision or manage the vector database yourself.
Choosing a Vector Database
Consider these factors:
- Scale — how many vectors will you store? (thousands vs billions)
- Latency — do you need sub-10ms p99?
- Filtering — do queries need metadata predicates?
- Hosting — managed cloud vs self-hosted
- Hybrid search — do you need keyword + vector in one query?
For most RAG applications with under 10M documents, any of the popular options will handle the load comfortably.