Vector Databases Explained
Learn what vector databases do, how embeddings power similarity search, and how metadata filters and hybrid retrieval improve RAG.
7 min
Vector databases store embeddings and make similarity search fast. In AI Engineering, they are often used to retrieve relevant context for RAG systems.
Embeddings
An embedding is a numeric representation of text, image, audio, or another input. Items with related meaning tend to sit near each other in vector space.
type EmbeddedChunk = {
id: string;
text: string;
embedding: number[];
metadata: {
source: string;
tenantId: string;
updatedAt: string;
};
};
Similarity Search
When a user asks a question, the system embeds the query and searches for nearby vectors. The result is a ranked candidate list.
Metadata Filters
Metadata filters keep retrieval relevant and safe. Use them for tenant boundaries, permissions, source type, date ranges, product areas, and language.
Hybrid Search
Hybrid search combines semantic vector search with keyword search. This is useful when exact strings matter, such as product SKUs, API names, legal terms, or error codes.
| Search Type | Strength |
|---|---|
| Vector | Meaning and paraphrase |
| Keyword | Exact tokens and identifiers |
| Hybrid | Broader coverage |
Next Step
Take the vector database quiz, then inspect how your source documents should be chunked and filtered.
Practice this topic
Reinforce the concepts from this lesson with a short quiz and explanation review.
AI Engineering Insider Newsletter
Get practical AI engineering insights in your inbox.
Weekly guides, interview prep, prompts, architecture breakdowns, and production lessons for engineers building with AI.