knowledgesdk.com/glossary/vector-database
RAG & Retrievalbeginner

Also known as: vector store, embedding store

Vector Database

A specialized database that stores high-dimensional embedding vectors and enables fast similarity search.

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

  1. Store — each record contains a vector (e.g., 1536 floats for OpenAI text-embedding-3-small) plus metadata (text, source URL, timestamp)
  2. Index — an ANN index (commonly HNSW) is built over the vectors for fast retrieval
  3. Query — a query vector is compared against stored vectors using a distance metric (cosine similarity, dot product, or Euclidean distance)
  4. 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.

Related Terms

RAG & Retrievalbeginner
Embedding
A dense numerical vector representation of text, images, or other data that captures semantic meaning in a high-dimensional space.
RAG & Retrievaladvanced
Approximate Nearest Neighbor
A class of algorithms that find vectors approximately closest to a query vector, trading perfect accuracy for massive speed gains.
RAG & Retrievaladvanced
HNSW
Hierarchical Navigable Small World — a graph-based algorithm for fast approximate nearest-neighbor search in high-dimensional vector spaces.
RAG & Retrievalbeginner
Semantic Search
A search approach that finds results based on meaning and intent rather than exact keyword matching.
User-Agent SpoofingWeb Crawling

Try it now

Build with Vector Database using one API.

Extract, index, and search any web content. First 1,000 requests free.

GET API KEY →
← Back to glossary