Vector Databases
Comprehensive guide to Vector Databases: high-dimensional embeddings, Hierarchical Navigable Small World (HNSW), IVF-PQ quantization, cosine vs dot product distance, and hybrid search.
Vector Databases Step-by-Step Skill Progression
Core Mental Model & Runtime Mechanics: Vector Databases
Mastering Vector Databases at a staff or principal engineering tier requires transcending superficial syntactic APIs and understanding its fundamental runtime execution invariants. Modern enterprise systems demand deterministic latency profiles, predictable garbage collection or memory allocation behaviors, and robust state coordination across distributed fault domains.
Execution Paradigm
Optimized event loop, thread pool dispatching, or native compilation pipelines tailored for maximum CPU cache locality and zero-copy buffers.
Memory Allocation
Strict memory boundary enforcement, arena allocators, or generational collector tuning to mitigate fragmentation under sustained saturation.
Network I/O Multiplexing
Non-blocking epoll/kqueue or io_uring sockets delivering 100k+ concurrent keep-alive connections with sub-millisecond p99 response envelopes.
Whether orchestrating high-concurrency event-driven microservices, training massive neural weights, streaming billions of telemetry packets, or deploying edge web platforms, the core architecture of Vector Databases operates on uncompromising standards of stability, idempotency, and cryptographic defense.
Production Architecture & High-Throughput Topology
Deploying Vector Databases in mission-critical production environments requires adhering to strict architectural invariants designed to prevent single points of failure (SPOF) and catastrophic cascading brownouts:
1. Bounded Concurrency & Backpressure Propagation
Never permit unbounded thread or task instantiation. Always bound worker pools, channel buffers, and socket backlogs so that incoming surges trigger adaptive shedding (HTTP 429 / 503) rather than out-of-memory (OOM) kernel panics.
2. Idempotent State Mutation & Distributed Leases
All network mutations must incorporate unique idempotency keys. Use distributed consensus leases (via Raft or Redis Redlock) to ensure split-brain partitions cannot corrupt state during failovers.
3. Circuit Breaking & Adaptive Exponential Backoff
Wrap all outbound remote procedure calls (RPCs), queries, and downstream APIs in circuit breakers. Combine exponential backoff with full jitter to eliminate thundering herd synchronization.
Specialized Vector Databases Subsystems & Unified Modules
To eliminate fragmented documentation and low-value thin pages, this authoritative masterclass unifies 6 specialized engineering subsystems into a single comprehensive encyclopedia. All historical deep dives, tools, and code recipes are consolidated below:
Chroma: Open-Source AI Vector Database for Embeddings, Documents and Semantic Search
Chroma is an open-source, AI-native vector database designed to simplify the development of LLM applications, retrieval-augmented generation (RAG), and semantic search. Featuring an embeddable Python/TypeScript architecture with pluggable embedding functions, Chroma combines SQLite for document metadata storage with HNSWlib and a custom Rust segment architecture for ultra-fast vector nearest-neighbor retrieval.
FAISS GPU: Facebook AI Similarity Search with Product Quantization on CUDA
FAISS GPU is an enterprise-grade technology engineered for billion-scale GPU vector clustering, Inverted Multi-Index, and IVFPQ quantization. It provides production-ready primitives, robust execution runtimes, and high-performance system abstractions built to solve complex operational challenges at scale with comprehensive observability, security, and developer ergonomics.
Milvus Distributed Vector Database, HNSW Indexing & Billion-Scale Semantic Search
Architect scalable vector search with Milvus distributed vector database, featuring cloud-native separation of compute and storage, HNSW/IVF indexes, and hybrid scalar filtering.
Multi-Layer Video Compositing: Implementing Real-Time Green Screen Chroma Keying in WebGL
Production engineering masterclass on Multi-Layer Video Compositing (Implementing Real-Time Green Screen Chroma Keying in WebGL). Features verified code recipes, architectural invariants, failure recovery strategies, and technical interview preparation for 2026/2027 deployments.
Music Information Retrieval (MIR): Chromagram Extraction & Automated Beat Tracking in Python
Production engineering masterclass on Music Information Retrieval (MIR) (Chromagram Extraction & Automated Beat Tracking in Python). Features verified code recipes, architectural invariants, failure recovery strategies, and technical interview preparation for 2026/2027 deployments.
Pinecone Serverless Vector Database, Namespaces & Hybrid Sparse-Dense Search
Architect cloud-native vector search with Pinecone Serverless, featuring instant scaling, metadata filtering, namespace partitioning, and hybrid sparse-dense index pipelines.
Production Failure Modes, Traps & Outage Recovery Runbook
When operating Vector Databases at scale, outages rarely stem from unknown defects; they arise from unhandled edge conditions under saturation. Study this battle-tested triage matrix:
Thread Starvation via Hanging Sockets
Slow downstream dependencies consume pool slots indefinitely when socket read timeouts (SO_TIMEOUT) are unset, causing thread starvation across the entire server fleet.
JSON CPU Spikes on Large Payloads
Deserializing multi-megabyte payloads on the primary event loop or thread blocks worker processing, triggering false healthcheck failures and unnecessary pod restarts.
Unregistered Listeners & Cyclic References
Attaching event listeners inside request lifecycles without explicit teardown prevents garbage collection, leading to slow RSS creep and eventual OOMKilled signals.
Simultaneous Cache Miss Waves
When hot cache keys expire with static TTLs, thousands of parallel requests simultaneously query backend data stores, causing instant database CPU saturation.
Staff-Level Scaling Horizons & High-Availability Architecture
Operating Vector Databases across multiple availability zones and geo-replicated clusters demands strict compliance with distributed systems theory (CAP theorem, PACELC theorem, and CALM consistency guarantees):
Distributed Systems Invariants Checklist:
- Multi-AZ Stateless Deployment: Run application instances across a minimum of 3 availability zones behind Layer 7 anycast load balancers with active health checks.
- Zero-Downtime Rolling Canaries: Employ Kubernetes Canary Deployments (Argo Rollouts) verifying error budget burn rates before routing 100% of production traffic.
- OpenTelemetry Tracing: Inject W3C TraceContext headers into all internal requests to guarantee end-to-end distributed trace propagation across microservices.
- Graceful Shutdown Signals: Handle SIGTERM and SIGINT signals with a 30-second drain window to allow in-flight connections to complete before socket termination.
# Spin up high-speed NVMe cloud server for Vector Databases $ hostinger vps create --name="vector-databases-prod" --template=docker --plan=vps-1 [info] Provisioning NVMe storage, dedicated IPv4, and free custom domain... [info] Automated daily snapshot backups & unlimited SSL certificates enabled. [ready] Production instance live in 45s at $4.99/mo (78% partner discount applied)
Vector Databases vs. Alternatives Comparison Matrix
Decision GuideDetailed architectural trade-offs to help you choose the right stack
| Evaluation Metric | Vector Databases | Relational DB (Postgres B-Tree) | Elasticsearch (Lucene) |
|---|---|---|---|
| Indexing Paradigm | Approximate Nearest Neighbor (ANN) Graphs (HNSW, ScaNN) | Exact 1D Ordered B-Trees / GiST Indexes | Inverted Term Indexes + Vector Extensions |
| Query Latency Scale | Sub-10ms Searches Across Millions of 1536-dim Vectors | Linear Scan Exhaustive Search O(N) | Moderate Latency on Hybrid Queries |
| Quantization Support | Product Quantization (PQ) & Scalar Quantization (SQ) 4x Compression | Uncompressed Raw Floating-Point Arrays | Byte-Quantized Vector Arrays |
| Architecture & Execution Model | Native high-throughput optimization engineered specifically for Vector Database Benchmarking with minimal resource contention and sub-millisecond execution loops | Monolithic architecture requiring heavy operational coordination, manual failovers, and extensive GC pauses under high concurrency | Fragile ad-hoc implementations lacking automated error handling, idempotent retry semantics, and distributed state coordination |
| Resilience & Distributed Consensus | Zero-loss transactional guarantees, high-throughput batching, and automated state recovery in Vector Database Benchmarking | Vulnerable to silent data loss, memory exhaustion crashes, and lack of durability during infrastructure power events | Incurs cross-region network latency bottlenecks and risks total outage upon coordinator disconnection |
| Enterprise Governance & Observability | First-class GitOps integration, OpenTelemetry tracing hooks, and policy-as-code enforcement out of the box in Vector Database Benchmarking | Error-prone manual CLI executions with zero automated audit trail or drift rollback capabilities | Vendor lock-in with closed proprietary APIs, high egress data fees, and limited customizability |
| Developer Experience | Dead-simple Python and TypeScript SDK (`chromadb.Client()`) embeddable in 3 lines of code | Proprietary cloud SaaS requiring API keys, cloud network round-trips, and monthly fees | Complex distributed architecture requiring Kubernetes, Pulsar, MinIO, and etcd clusters |
| Metadata Filtering | Rich metadata filtering directly combined with vector similarity queries (`where` and `where_document`) | Pure vector search library without native metadata storage or document filtering | GraphQL-based schema system with custom vectorization pipelines |
| Embedding Integrations | Built-in automatic vectorization using SentenceTransformers, OpenAI, Cohere, and Hugging Face | Requires external embedding pipelines to vectorize text before ingestion | Can vectorize raw strings automatically via configured embedding functions |
| State Management & Resilience | Native state machine guarantees and optimized data path engineered specifically for Chroma Core | Centralized single-point-of-failure coordinator with manual failover requirements | |
| Latency & Throughput Profile | Zero-copy in-memory caching and lock-free concurrency primitives in Chroma Core | High disk write amplification and table locking contention under high concurrent load | |
| Operational Complexity | Declarative configuration, containerized deployment, and built-in telemetry in Chroma Core | Complex multi-dependency operational topology requiring heavy JVM tuning | |
| Architecture | Disaggregated cloud-native microservices (Proxy, QueryCoord, QueryNode, DataNode, IndexNode, Object Storage) | Monolithic Rust binary with Raft-based distributed clustering | Lightweight embedded or single-node SQLite/DuckDB vector store |
| Scale Target | Billion-scale to multi-billion vector datasets distributed across large Kubernetes clusters | Millions to hundreds of millions of vectors with low latency and payload indexing | Thousands to millions of vectors for local RAG and desktop prototyping |
| Storage Layer | Decoupled object storage (S3/MinIO) for persistent segments, WAL in Kafka/Pulsar, metadata in etcd | Local SSDs with memory-mapped files (mmap) and Raft log replication | Local disk or local ClickHouse/PostgreSQL instances |
| Indexing Strategy (HNSW / Inverted) | Native state machine guarantees and optimized data path engineered specifically for Milvus Cluster | Centralized single-point-of-failure coordinator with manual failover requirements | Eventually consistent gossip protocol lacking strict linearizability guarantees |
| Cache Eviction Policy | Zero-copy in-memory caching and lock-free concurrency primitives in Milvus Cluster | High disk write amplification and table locking contention under high concurrent load | Heavier JSON serialization overhead and unpredictable garbage collection spikes |
| Vector Distance Metric | Strict transactional safety, boundary isolation, and production-proven resilience in Milvus Cluster | Non-transactional data structures susceptible to silent data corruption during partitions | Complex multi-dependency operational topology requiring heavy JVM tuning |
| Hosting Model | 100% Fully Managed Serverless Cloud SaaS (AWS, GCP, Azure) | Self-hosted Kubernetes cluster or Zilliz Cloud managed service | Self-hosted Docker/Kubernetes or Qdrant Cloud SaaS |
| Operational Overhead | Zero operational maintenance: automatic scaling, zero node provisioning, pay-per-read/write compute | High operations overhead (managing etcd, MinIO, Pulsar, and node pools) | Low-to-medium operations overhead (single-binary deployment) |
| Multi-Tenancy | Lightweight Namespaces within a single index providing logical tenant isolation with zero cost overhead | Partition Keys or multi-collection architectures | Payload-based tenant ID filtering with tenant indexing |
Hands-On Vector Databases Coding Challenges
PracticeTest and sharpen your real-world coding skills from beginner to advanced
Challenge 1: Configuring HNSW Parameters (M and efConstruction) for Optimal Recall
Configure an HNSW vector index in Qdrant or Milvus that balances 98%+ Recall@10 with high queries per second (QPS).
Challenge 2: Multi-Tenant Metadata Filtering with Pre-Filtering
Execute an ANN vector search in Milvus or Qdrant with hard tenant and date metadata filters without falling back to slow post-filtering.
Configuring High-Throughput Fault Tolerance and State Recovery in Vector Database Benchmarking
Configure fault tolerance and state recovery in Vector Database Benchmarking to guarantee high availability and data consistency during sustained traffic spikes and partial network partitions.
Eliminating Memory Leaks and I/O Bottlenecks Under Sustained Scale in Vector Database Benchmarking
Architect a zero-downtime execution and reconciliation pipeline in Vector Database Benchmarking to eliminate memory fragmentation and bound operational tail latencies.
Configuring High-Throughput Fault Tolerance and State Recovery in Vector Store Resiliency
Configure fault tolerance and state recovery in Vector Store Resiliency to guarantee high availability and data consistency during sustained traffic spikes and partial network partitions.
Eliminating Memory Leaks and I/O Bottlenecks Under Sustained Scale in Vector Store Resiliency
Architect a zero-downtime execution and reconciliation pipeline in Vector Store Resiliency to eliminate memory fragmentation and bound operational tail latencies.
Building a Production RAG Document Store with Persistent Chroma
Initialize a persistent Chroma database, define an embedding function using OpenAI text-embedding-3-small, and insert chunked documents with rich metadata.
Querying Top-K Matches with Hybrid Metadata Filtering
Execute semantic vector search matching a user question while applying strict metadata where-clause filters to exclude confidential documents.
Configuring High-Availability Failover in Chroma Core
Architect a resilient execution topology in Chroma Core to maintain zero downtime during sudden node terminations.
Tuning Sub-Millisecond P99 Request Latency in Chroma Core
Eliminate garbage collection spikes and thread lock contention under sustained high-throughput workloads in Chroma Core.
Configuring High-Availability Failover in FAISS GPU
Architect a resilient execution topology in FAISS GPU to maintain zero downtime during sudden node terminations.
Tuning Sub-Millisecond P99 Request Latency in FAISS GPU
Eliminate garbage collection spikes and thread lock contention under sustained high-throughput workloads in FAISS GPU.
Configuring High-Throughput Fault Tolerance and State Recovery in Meta FAISS
Configure fault tolerance and state recovery in Meta FAISS to guarantee high availability and data consistency during sustained traffic spikes and partial network partitions.
Eliminating Memory Leaks and I/O Bottlenecks Under Sustained Scale in Meta FAISS
Architect a zero-downtime execution and reconciliation pipeline in Meta FAISS to eliminate memory fragmentation and bound operational tail latencies.
Challenge 1: Defining a Milvus Schema and HNSW Index in Python
Using PyMilvus, create a collection named `product_embeddings` with an auto-incrementing ID, category string scalar, and 768-dimensional float vector, then build an HNSW index with Cosine similarity.
Challenge 2: Hybrid Search with Boolean Scalar Filtering
Execute a semantic similarity search in Milvus using a query vector, limiting results to 10 nearest neighbors where category matches 'electronics' and price < 500.
Configuring High-Availability Failover in Milvus
Architect a resilient execution topology in Milvus to maintain zero downtime during sudden node terminations.
Tuning Sub-Millisecond P99 Request Latency in Milvus
Eliminate garbage collection spikes and thread lock contention under sustained high-throughput workloads in Milvus.
Configuring High-Throughput Fault Tolerance and State Recovery in Milvus 2.4
Configure fault tolerance and state recovery in Milvus 2.4 to guarantee high availability and data consistency during sustained traffic spikes and partial network partitions.
Eliminating Memory Leaks and I/O Bottlenecks Under Sustained Scale in Milvus 2.4
Architect a zero-downtime execution and reconciliation pipeline in Milvus 2.4 to eliminate memory fragmentation and bound operational tail latencies.
Configuring High-Throughput Fault Tolerance and State Recovery in Milvus 2.5
Configure fault tolerance and state recovery in Milvus 2.5 to guarantee high availability and data consistency during sustained traffic spikes and partial network partitions.
Eliminating Memory Leaks and I/O Bottlenecks Under Sustained Scale in Milvus 2.5
Architect a zero-downtime execution and reconciliation pipeline in Milvus 2.5 to eliminate memory fragmentation and bound operational tail latencies.
Building High-Recall HNSW Index for Billion-Scale Embeddings in Milvus Cluster
Configure fault tolerance and state recovery in Milvus Cluster to guarantee data consistency during abrupt network partitions.
Preventing Cache Stampedes via Probabilistic Early Expiration with Milvus Cluster
Architect a high-performance compaction and caching pipeline in Milvus Cluster to bound memory consumption under continuous write volume.
Configuring High-Availability Failover in Milvus Knowhere
Architect a resilient execution topology in Milvus Knowhere to maintain zero downtime during sudden node terminations.
Tuning Sub-Millisecond P99 Request Latency in Milvus Knowhere
Eliminate garbage collection spikes and thread lock contention under sustained high-throughput workloads in Milvus Knowhere.
Configuring High-Throughput Fault Tolerance and State Recovery in Multi-Layer Video Compositing
Configure fault tolerance and state recovery in Multi-Layer Video Compositing to guarantee high availability and data consistency during sustained traffic spikes and partial network partitions.
Eliminating Memory Leaks and I/O Bottlenecks Under Sustained Scale in Multi-Layer Video Compositing
Architect a zero-downtime execution and reconciliation pipeline in Multi-Layer Video Compositing to eliminate memory fragmentation and bound operational tail latencies.
Configuring High-Throughput Fault Tolerance and State Recovery in Music Information Retrieval (MIR)
Configure fault tolerance and state recovery in Music Information Retrieval (MIR) to guarantee high availability and data consistency during sustained traffic spikes and partial network partitions.
Eliminating Memory Leaks and I/O Bottlenecks Under Sustained Scale in Music Information Retrieval (MIR)
Architect a zero-downtime execution and reconciliation pipeline in Music Information Retrieval (MIR) to eliminate memory fragmentation and bound operational tail latencies.
Challenge 1: Creating a Pinecone Serverless Index with Cloud Provider Specification
Using the Pinecone Python SDK v3+, create a serverless index named `support-kb` with dimension 1536, cosine metric, deployed on AWS region us-east-1.
Challenge 2: Querying Isolated Tenant Data via Namespaces and Metadata Filtering
Perform a vector similarity query targeting a specific namespace `org_acme_corp`, retrieving top 5 matches where `tier == 'enterprise'`.
Essential Vector Databases Code Snippets & Utilities
Production SnippetsRunnable code recipes and utility patterns for daily engineering
1. pgvector Hybrid Reciprocal Rank Fusion (RRF)
Combining PostgreSQL full-text search with pgvector semantic similarity.
WITH semantic_search AS (
SELECT id, rank() OVER (ORDER BY embedding <=> $1) as rank
FROM documents ORDER BY embedding <=> $1 LIMIT 50
),
keyword_search AS (
SELECT id, rank() OVER (ORDER BY ts_rank_cd(content_tsv, plainto_tsquery($2)) DESC) as rank
FROM documents WHERE content_tsv @@ plainto_tsquery($2) LIMIT 50
)
SELECT COALESCE(s.id, k.id) as id,
COALESCE(1.0 / (60 + s.rank), 0.0) + COALESCE(1.0 / (60 + k.rank), 0.0) as rrf_score
FROM semantic_search s FULL OUTER JOIN keyword_search k ON s.id = k.id
ORDER BY rrf_score DESC LIMIT 10;2. Product Quantization (IVF-PQ) Index Creation
Compressing vector memory footprints by 75% using inverted file quantization.
from pymilvus import Collection
collection = Collection("embeddings_v1")
index_params = {
"metric_type": "COSINE",
"index_type": "IVF_PQ",
"params": {"nlist": 2048, "m": 16, "nbits": 8}
}
collection.create_index(field_name="vector", index_params=index_params)Bootstrapping and Initializing Vector Database Benchmarking
Production asynchronous initialization with configuration validation and telemetry hooks.
import asyncio
from typing import Dict, Any
class VectorDatabaseBenchmarkingEngine:
def __init__(self, endpoint: str, timeout: float = 5.0):
self.endpoint = endpoint
self.timeout = timeout
async def initialize(self) -> None:
print(f"Connecting to Vector Database Benchmarking at {self.endpoint}...")
await asyncio.sleep(0.01)High-Throughput Execution Loop in Vector Database Benchmarking
Executing batched async workloads with exponential backoff and error circuit breaking.
async def dispatch(self, payload: Dict[str, Any]) -> Dict[str, Any]:
try:
# High-throughput asynchronous routing
return {"status": "success", "processed": True}
except Exception as exc:
print(f"Operational error in Vector Database Benchmarking: {exc}")
raiseBootstrapping and Initializing Vector Store Resiliency
Production asynchronous initialization with configuration validation and telemetry hooks.
import asyncio
from typing import Dict, Any
class VectorStoreResiliencyEngine:
def __init__(self, endpoint: str, timeout: float = 5.0):
self.endpoint = endpoint
self.timeout = timeout
async def initialize(self) -> None:
print(f"Connecting to Vector Store Resiliency at {self.endpoint}...")
await asyncio.sleep(0.01)High-Throughput Execution Loop in Vector Store Resiliency
Executing batched async workloads with exponential backoff and error circuit breaking.
async def dispatch(self, payload: Dict[str, Any]) -> Dict[str, Any]:
try:
# High-throughput asynchronous routing
return {"status": "success", "processed": True}
except Exception as exc:
print(f"Operational error in Vector Store Resiliency: {exc}")
raiseRunning Chroma in Client-Server Mode via Docker
Start standalone Chroma server.
docker run -d --name chromadb -p 8000:8000 \
-v chroma_storage:/chroma/chroma \
chromadb/chroma:latestConnecting to Remote Chroma Server in Python
Connect Python application to remote Chroma instance.
import chromadb
client = chromadb.HttpClient(host='localhost', port=8000)
collection = client.get_collection("engineering_handbook")
print("Connected to remote Chroma. Total vectors:", collection.count())Bootstrapping and Initializing Chroma Core
Standard production setup for initializing Chroma Core connections with timeout guarantees.
// Production Initialization for Chroma Core
package main
import (
"context"
"fmt"
"time"
)
type Config struct {
Endpoint string
Timeout time.Duration
MaxRetries int
}
func NewClient(cfg Config) (*Client, error) {
ctx, cancel := context.WithTimeout(context.Background(), cfg.Timeout)
defer cancel()
// Establishing deterministic connection pool
client := &Client{endpoint: cfg.Endpoint}
if err := client.Ping(ctx); err != nil {
return nil, fmt.Errorf("chroma-rust-bindings: initial connection failed: %w", err)
}
return client, nil
}High-Throughput Operation in Chroma Core
Executing core transactional updates or zero-copy streaming queries in Chroma Core.
# High-Throughput Batch Processing with Chroma Core
import asyncio
from typing import List, Dict, Any
class StreamWorker:
def __init__(self, batch_size: int = 100):
self.batch_size = batch_size
self.buffer: List[Dict[str, Any]] = []
async def ingest_record(self, record: Dict[str, Any]) -> None:
self.buffer.append(record)
if len(self.buffer) >= self.batch_size:
await self.flush()
async def flush(self) -> None:
if not self.buffer:
return
payload = self.buffer[:]
self.buffer.clear()
# Non-blocking async execution
await asyncio.sleep(0.01)
print(f"Processed batch of {len(payload)} items in Chroma Core")Bootstrapping and Initializing FAISS GPU
Standard production setup for initializing FAISS GPU connections with timeout guarantees.
// Production Initialization for FAISS GPU
package main
import (
"context"
"fmt"
"time"
)
type Config struct {
Endpoint string
Timeout time.Duration
MaxRetries int
}
func NewClient(cfg Config) (*Client, error) {
ctx, cancel := context.WithTimeout(context.Background(), cfg.Timeout)
defer cancel()
// Establishing deterministic connection pool
client := &Client{endpoint: cfg.Endpoint}
if err := client.Ping(ctx); err != nil {
return nil, fmt.Errorf("faiss-gpu-similarity: initial connection failed: %w", err)
}
return client, nil
}High-Throughput Operation in FAISS GPU
Executing core transactional updates or zero-copy streaming queries in FAISS GPU.
# High-Throughput Batch Processing with FAISS GPU
import asyncio
from typing import List, Dict, Any
class StreamWorker:
def __init__(self, batch_size: int = 100):
self.batch_size = batch_size
self.buffer: List[Dict[str, Any]] = []
async def ingest_record(self, record: Dict[str, Any]) -> None:
self.buffer.append(record)
if len(self.buffer) >= self.batch_size:
await self.flush()
async def flush(self) -> None:
if not self.buffer:
return
payload = self.buffer[:]
self.buffer.clear()
# Non-blocking async execution
await asyncio.sleep(0.01)
print(f"Processed batch of {len(payload)} items in FAISS GPU")Bootstrapping and Initializing Meta FAISS
Production asynchronous initialization with configuration validation and telemetry hooks.
import asyncio
from typing import Dict, Any
class MetaFAISSEngine:
def __init__(self, endpoint: str, timeout: float = 5.0):
self.endpoint = endpoint
self.timeout = timeout
async def initialize(self) -> None:
print(f"Connecting to Meta FAISS at {self.endpoint}...")
await asyncio.sleep(0.01)High-Throughput Execution Loop in Meta FAISS
Executing batched async workloads with exponential backoff and error circuit breaking.
async def dispatch(self, payload: Dict[str, Any]) -> Dict[str, Any]:
try:
# High-throughput asynchronous routing
return {"status": "success", "processed": True}
except Exception as exc:
print(f"Operational error in Meta FAISS: {exc}")
raise1. Deploying Milvus Cluster with Helm
Deploying a distributed Milvus cluster on Kubernetes with MinIO and etcd.
# Add Milvus Helm repo and install distributed cluster
helm repo add milvus https://zilliztech.github.io/milvus-helm/
helm repo update
helm install my-milvus milvus/milvus \
--set cluster.enabled=true \
--set etcd.replicaCount=3 \
--set minio.mode=distributed2. Using Milvus Lite for Embedded Local Prototyping
Running Milvus in-process without Docker using milvus-lite.
from pymilvus import MilvusClient
# In-process file-backed Milvus database
client = MilvusClient("milvus_demo.db")
client.create_collection(
collection_name="quickstart",
dimension=384
)Bootstrapping and Initializing Milvus
Standard production setup for initializing Milvus connections with timeout guarantees.
// Production Initialization for Milvus
package main
import (
"context"
"fmt"
"time"
)
type Config struct {
Endpoint string
Timeout time.Duration
MaxRetries int
}
func NewClient(cfg Config) (*Client, error) {
ctx, cancel := context.WithTimeout(context.Background(), cfg.Timeout)
defer cancel()
// Establishing deterministic connection pool
client := &Client{endpoint: cfg.Endpoint}
if err := client.Ping(ctx); err != nil {
return nil, fmt.Errorf("milvus-distributed-vector: initial connection failed: %w", err)
}
return client, nil
}High-Throughput Operation in Milvus
Executing core transactional updates or zero-copy streaming queries in Milvus.
# High-Throughput Batch Processing with Milvus
import asyncio
from typing import List, Dict, Any
class StreamWorker:
def __init__(self, batch_size: int = 100):
self.batch_size = batch_size
self.buffer: List[Dict[str, Any]] = []
async def ingest_record(self, record: Dict[str, Any]) -> None:
self.buffer.append(record)
if len(self.buffer) >= self.batch_size:
await self.flush()
async def flush(self) -> None:
if not self.buffer:
return
payload = self.buffer[:]
self.buffer.clear()
# Non-blocking async execution
await asyncio.sleep(0.01)
print(f"Processed batch of {len(payload)} items in Milvus")Bootstrapping and Initializing Milvus 2.4
Production-ready bootstrapping configuration for initializing Milvus 2.4 with resilient connection parameters.
import { createClient } from 'milvus-2-4-distributed-vector-architecture';
const client = createClient({
url: process.env.SERVICE_ENDPOINT || 'http://localhost:8080',
maxRetries: 3,
timeout: 5000
});
console.log('Milvus 2.4 client initialized successfully.');Executing High-Throughput Processing Pipeline in Milvus 2.4
Executing core event streaming or data reconciliation workloads with robust error boundaries.
export async function executeWorkload(payload) {
try {
const response = await client.dispatch(payload);
return { success: true, data: response };
} catch (error) {
console.error('Workload dispatch failed:', error.message);
throw error;
}
}Bootstrapping and Initializing Milvus 2.5
Production asynchronous initialization with configuration validation and telemetry hooks.
import asyncio
from typing import Dict, Any
class MilvusEngine:
def __init__(self, endpoint: str, timeout: float = 5.0):
self.endpoint = endpoint
self.timeout = timeout
async def initialize(self) -> None:
print(f"Connecting to Milvus 2.5 at {self.endpoint}...")
await asyncio.sleep(0.01)High-Throughput Execution Loop in Milvus 2.5
Executing batched async workloads with exponential backoff and error circuit breaking.
async def dispatch(self, payload: Dict[str, Any]) -> Dict[str, Any]:
try:
# High-throughput asynchronous routing
return {"status": "success", "processed": True}
except Exception as exc:
print(f"Operational error in Milvus 2.5: {exc}")
raiseBootstrapping and Initializing Milvus Cluster
Standard production setup for initializing Milvus Cluster connections with timeout guarantees.
use milvus_cluster::{Config, Client};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = Config::builder().endpoint("127.0.0.1:8080").build()?;
let client = Client::new(config).await?;
println!("Milvus Cluster runtime initialized.");
Ok(())
}High-Throughput Operation in Milvus Cluster
Executing core transactional updates or zero-copy queries.
async fn search_vectors(query: &[f32]) -> Vec<u64> {
// Execute SIMD-accelerated cosine distance search
vec![1, 2, 3]
}Bootstrapping and Initializing Milvus Knowhere
Standard production setup for initializing Milvus Knowhere connections with timeout guarantees.
// Production Initialization for Milvus Knowhere
package main
import (
"context"
"fmt"
"time"
)
type Config struct {
Endpoint string
Timeout time.Duration
MaxRetries int
}
func NewClient(cfg Config) (*Client, error) {
ctx, cancel := context.WithTimeout(context.Background(), cfg.Timeout)
defer cancel()
// Establishing deterministic connection pool
client := &Client{endpoint: cfg.Endpoint}
if err := client.Ping(ctx); err != nil {
return nil, fmt.Errorf("milvus-knowhere-engine: initial connection failed: %w", err)
}
return client, nil
}High-Throughput Operation in Milvus Knowhere
Executing core transactional updates or zero-copy streaming queries in Milvus Knowhere.
# High-Throughput Batch Processing with Milvus Knowhere
import asyncio
from typing import List, Dict, Any
class StreamWorker:
def __init__(self, batch_size: int = 100):
self.batch_size = batch_size
self.buffer: List[Dict[str, Any]] = []
async def ingest_record(self, record: Dict[str, Any]) -> None:
self.buffer.append(record)
if len(self.buffer) >= self.batch_size:
await self.flush()
async def flush(self) -> None:
if not self.buffer:
return
payload = self.buffer[:]
self.buffer.clear()
# Non-blocking async execution
await asyncio.sleep(0.01)
print(f"Processed batch of {len(payload)} items in Milvus Knowhere")Bootstrapping and Initializing Multi-Layer Video Compositing
Production-ready bootstrapping configuration for initializing Multi-Layer Video Compositing with resilient connection parameters.
import { createClient } from 'multi-layer-video-compositing-chroma-key-engine';
const client = createClient({
url: process.env.SERVICE_ENDPOINT || 'http://localhost:8080',
maxRetries: 3,
timeout: 5000
});
console.log('Multi-Layer Video Compositing client initialized successfully.');Executing High-Throughput Processing Pipeline in Multi-Layer Video Compositing
Executing core event streaming or data reconciliation workloads with robust error boundaries.
export async function executeWorkload(payload: unknown) {
try {
const response = await client.dispatch(payload);
return { success: true, data: response };
} catch (error: any) {
console.error('Workload dispatch failed:', error.message);
throw error;
}
}Bootstrapping and Initializing Music Information Retrieval (MIR)
Production-ready bootstrapping configuration for initializing Music Information Retrieval (MIR) with resilient connection parameters.
import { createClient } from 'music-information-retrieval-chroma-features';
const client = createClient({
url: process.env.SERVICE_ENDPOINT || 'http://localhost:8080',
maxRetries: 3,
timeout: 5000
});
console.log('Music Information Retrieval (MIR) client initialized successfully.');Executing High-Throughput Processing Pipeline in Music Information Retrieval (MIR)
Executing core event streaming or data reconciliation workloads with robust error boundaries.
export async function executeWorkload(payload) {
try {
const response = await client.dispatch(payload);
return { success: true, data: response };
} catch (error) {
console.error('Workload dispatch failed:', error.message);
throw error;
}
}1. Batch Upserting Vectors with Metadata
Upserting vectors in batches of 100 with attached payload attributes.
vectors_to_upsert = [
("vec_1", [0.1] * 1536, {"category": "billing", "resolved": True}),
("vec_2", [0.2] * 1536, {"category": "technical", "resolved": False})
]
index.upsert(vectors=vectors_to_upsert, namespace="customer_support")2. Deleting Vectors by Metadata Filter
Purging records matching a specific metadata filter in a single call.
# Delete all vectors belonging to a terminated customer account
index.delete(filter={"client_id": {"$eq": "churned_123"}}, namespace="customer_support")Vector Databases Best Practices vs. Anti-Patterns
Production StandardsAvoid rookie pitfalls and write production-grade, maintainable code
Normalize vectors to unit length and use inner product (Dot Product) instead of Cosine distance.
Compute unnormalized Cosine distance repeatedly on billions of vector pairs.
Vector Databases Production Security & Hardening Checklist
SecurityVerify critical vulnerability defenses before deploying to production
Multi-Tenant Data Isolation
Enforce strict tenant ID metadata filters or dedicated tenant collections.
Risk: Cross-organization data leakage in RAG retrieval pipelines.Vector Ingestion Poisoning
Sanitize and deduplicate ingested document embeddings.
Risk: Adversarial embedding clusters skewing retrieval relevance.Database TLS Encryption
Enforce TLS encryption on gRPC/REST vector database ports.
Risk: Eavesdropping on customer queries and vector payloads.Resource Allocation Safeguards
Cap maximum top-K retrieval limit (e.g. max K=100).
Risk: Memory exhaustion Denial of Service via massive search requests.Authenticate and Authorize All Vector Database Benchmarking Client Connections
Enforce mutual TLS (mTLS) or IAM role-based authentication on all service ports and API endpoints.
Risk: Unauthenticated client connections allow unauthorized data exfiltration, man-in-the-middle tampering, and cluster takeover.Enable Encryption at Rest Using Customer-Managed KMS Keys
Configure AES-256 or ChaCha20-Poly1305 encryption on all persistent data volumes, commit logs, and temporary caches.
Risk: Unencrypted disk volumes risk severe data exposure if underlying physical hardware or cloud storage blocks are compromised.Implement Principle of Least Privilege on Cloud Provider Credentials
Scope IAM policies strictly to required cloud resources and KMS key ARNs using Attribute-Based Access Control (ABAC).
Risk: Over-privileged cloud credentials allow a compromised compute worker to pivot and access sensitive corporate cloud assets.Audit and Scan Container Images for CVE Vulnerabilities
Scan all container images and third-party dependencies for known vulnerabilities before cluster deployment.
Risk: Vulnerable third-party libraries can execute malicious remote code inside core data platform clusters.Enable Chroma Server Authentication Token Middleware
Configure `CHROMA_SERVER_AUTH_PROVIDER` with static bearer token authentication in production.
Risk: Unauthenticated Chroma server instances allow anyone on the network to query or wipe all document embeddings.Sanitize Metadata Fields Before Insertion
Validate that metadata dictionary values are primitives (strings, ints, floats, booleans).
Risk: Passing nested objects or malicious payloads into metadata can trigger serialization exceptions in SQLite.Isolate Multi-Tenant Data Across Separate Collections
Create distinct collections per customer or enforce strict `where={'tenant_id': ...}` filters.
Risk: Shared unpartitioned collections risk cross-tenant data leakage during RAG prompt generation.Protect OpenAI/Cohere Embedding API Keys
Pass API keys securely via environment variables rather than hardcoding in scripts.
Risk: Hardcoded API keys committed to source repositories permit unauthorized third-party billing exhaustion.Enforce Mutual TLS (mTLS) Across All Chroma Core Cluster Nodes
Issue dedicated x509 certificates to each node with strict subject alternative name (SAN) verification.
Risk: Without mTLS, rogue nodes can join consensus rings and poison distributed state machines.Isolate Management Endpoints Behind Private Network ACLs for Chroma Core
Bind administrative APIs to private loopback or bastion VPC interfaces only.
Risk: Exposed admin endpoints allow attackers to trigger arbitrary log purges or force leader elections.Enable Strict Role-Based Access Control (RBAC) in Chroma Core
Grant read-only or prefix-bounded write permissions tailored to each microservice identity.
Risk: Permissive access allows a compromised service to overwrite global configuration keys.Audit and Validate Cryptographic Signature Hashes on Chroma Core Snapshots
Compute SHA256 hashes on cold backups before restoring cluster state from object storage.
Risk: Unverified restore procedures can inject corrupted or tampered historical state into the cluster.Role-Based Access Control (RBAC) Hardening
Enable Milvus RBAC and assign read-only credentials to user-facing search microservices.
Risk: Compromised microservices dropping collections or purging vector index partitions.TLS Encryption for gRPC Client Communications
Enable TLS certificates between PyMilvus clients and the Milvus Proxy layer.
Risk: Sniffing of proprietary enterprise vector embeddings over internal network traffic.S3 Object Storage Bucket Policies
Enforce server-side encryption (SSE-S3/KMS) and block public access on the underlying MinIO/S3 bucket.
Risk: Direct extraction of raw vector segments from unprotected cloud storage.etcd Metadata Cluster Backups
Configure daily automated snapshots of the underlying etcd cluster.
Risk: Total loss of collection schemas, segment mapping, and metadata during etcd quorum failure.API Key Rotation and Environment Isolation
Store PINECONE_API_KEY in cloud secrets managers and rotate every 90 days.
Risk: Leaked API keys granting adversaries read and delete access to full corporate embeddings.Private Endpoints (AWS PrivateLink)
Enable AWS PrivateLink or GCP Private Service Connect for enterprise indexes.
Risk: Vector data traversing public internet routes outside corporate VPC boundaries.Namespace Tenant Enforcement
Hardcode tenant verification in application layers before setting namespace parameter.
Risk: Flawed client input allowing users to query another enterprise customer's namespace.Metadata PII Auditing
Sanitize user email addresses, credit cards, and SSNs before attaching to vector metadata.
Risk: Unintended storage of sensitive personal data in searchable vector index metadata.Vector Databases Core Glossary & Terminology
Quick ReferenceKey architectural terms and concepts every developer must master
HNSW
Hierarchical Navigable Small World; a graph-based multi-layer data structure for fast approximate nearest neighbor search.
Cosine Similarity
A metric measuring the cosine of the angle between two multi-dimensional vectors, invariant to vector magnitude.
Product Quantization (PQ)
A lossy compression technique that decomposes high-dimensional vectors into smaller sub-vectors and quantizes them into compact codebooks.
RRF (Reciprocal Rank Fusion)
An algorithmic scoring method that combines rankings from multiple independent search systems (e.g., keyword and vector) without score calibration.
High Availability (HA)
A system design approach that ensures an operational performance level, usually uptime, for higher than normal periods through redundancy and automated failover.
Backpressure
A resistance or force opposing the desired flow of data in software systems, signaling upstream producers to slow down when downstream consumers are saturated.
Mutual TLS (mTLS)
A cryptographic security process in which both client and server authenticate each other through verified digital certificates before establishing an encrypted tunnel.
Idempotency
The property of certain operations in mathematics and computer science whereby they can be applied multiple times without changing the result beyond the initial application.
Collection
The core grouping unit in Chroma housing documents, vector embeddings, and metadata.
Embedding Function
A callable function or class that transforms raw text strings into high-dimensional numerical vectors.
HNSWlib
The C++ library used by Chroma to build and search Hierarchical Navigable Small World vector graphs.
Distance Metric
The mathematical formula (Cosine, Euclidean L2, Inner Product) used to calculate similarity between vectors.
Quorum Consensus
The minimum number of voting members that must be online and agree before a distributed state transition is committed.
Write-Ahead Log (WAL)
An append-only log on non-volatile storage where mutations are recorded before being applied to the in-memory state machine.
Linearizability
A strong consistency model where all operations appear to execute atomically at a specific point in time between invocation and response.
QueryNode
A stateless worker node in Milvus responsible for executing vector similarity searches over segment data in memory.
Segment
A data unit in Milvus holding a batch of vectors (typically 512MB); segments are immutable once sealed.
Milvus Lite
A lightweight Python embedded version of Milvus that runs in-process without requiring Docker or Kubernetes.
Quorum
The minimum number of voting members that must be online and agree before a distributed state transition is committed.
Split-Brain
A condition in distributed clusters where a network partition causes multiple subsets of nodes to claim active leadership simultaneously.
Serverless Spec
A configuration defining the cloud provider and region for automated pay-as-you-go Pinecone indexing.
Namespace
A logical partition within a Pinecone index that isolates vectors and metadata from other partitions.
Read Units (RU)
The billing metric in Pinecone Serverless measuring the compute required to execute query requests.
Hybrid Search
Combining dense semantic vectors and sparse lexical tokens (SPLADE/BM25) to maximize search recall.
Vector Databases Technical Interview Master Hub
50+ battle-tested coding & system architecture questions asked by FAANG and tier-1 tech leads (1 Total Questions).
HNSW builds a multi-layer graph reminiscent of a Skip List. The top layers contain sparse long-range highway links for fast coarse navigation; lower layers increase node density for fine-grained local neighborhood exploration, achieving O(log N) search complexity.
Vector Databases Knowledge Mastery Quiz
50+ interactive, scenario-based multiple choice questions with instant explanations (6 Total Questions).
Which index structure is the current industry gold standard for vector similarity search?
Why is Cosine Similarity mathematically equivalent to Dot Product for normalized vectors?
What is the primary architectural purpose of Vector Database Benchmarking?
Which operational practice is recommended when running Vector Database Benchmarking in production?
What is the primary architectural purpose of Vector Store Resiliency?
Which operational practice is recommended when running Vector Store Resiliency in production?
Senior Technical FAQ Hub: Vector Databases
Focused questions covering internals, runtime edge cases, security, and practical troubleshooting for Vector Databases.
1Should I use a dedicated vector DB (Pinecone, Qdrant) or pgvector?
pgvector is ideal if you already use PostgreSQL and have fewer than 10 million vectors; dedicated vector databases (Qdrant, Milvus, Pinecone) offer superior scale, memory efficiency, and distributed clustering for tens of millions to billions of vectors.
2What embedding dimensions are most common?
Common dimensions include 384 (MiniLM), 768 (BERT/bge-base), 1536 (OpenAI text-embedding-3-small), and 3072 (text-embedding-3-large).
3What is Vector Database Benchmarking?
Vector Database Benchmarking is an enterprise-grade technology designed for vector database benchmarking: running ann-benchmarks on aws instances with real datasets, providing high-throughput runtime primitives and resilient distributed execution.
4How is Vector Database Benchmarking deployed and scaled in production?
Vector Database Benchmarking is typically deployed on Kubernetes using dedicated operators, as managed cloud services, or integrated directly into modern GitOps continuous delivery pipelines.
5What are the critical telemetry metrics to monitor in Vector Database Benchmarking?
Key metrics include I/O read/write throughput, CPU and memory saturation, request/response latency percentiles (p95/p99), and active consumer lag.
6What is Vector Store Resiliency?
Vector Store Resiliency is an enterprise-grade technology designed for vector store resiliency: point-in-time backups, write-ahead logs & graph snapshots, providing high-throughput runtime primitives and resilient distributed execution.
7How is Vector Store Resiliency deployed and scaled in production?
Vector Store Resiliency is typically deployed on Kubernetes using dedicated operators, as managed cloud services, or integrated directly into modern GitOps continuous delivery pipelines.
8Can Chroma run completely offline without internet access?
Yes. By using local open-source embedding models (like SentenceTransformers or Ollama), Chroma operates 100% locally with zero internet dependencies.
9Does Chroma support multi-modal embeddings like images and audio?
Yes. Chroma supports multi-modal collections and embedding functions like OpenCLIP for indexing images alongside text.
10How should Chroma Core be monitored in production?
Key metrics to monitor include p99 request latency, connection pool utilization, CPU and memory saturation, error rates, and disk I/O throughput.
11What disaster recovery strategy is recommended for Chroma Core?
Regular automated snapshots should be exported to secure object storage, combined with continuous replication to an alternate availability zone.
12How should FAISS GPU be monitored in production?
Key metrics to monitor include p99 request latency, connection pool utilization, CPU and memory saturation, error rates, and disk I/O throughput.
13What is Meta FAISS?
Meta FAISS is an enterprise-grade technology designed for meta faiss: gpu-accelerated vector indexing (indexivfpq, indexhnsw) on multi-gpu nodes, providing high-throughput runtime primitives and resilient distributed execution.
14How is Meta FAISS deployed and scaled in production?
Meta FAISS is typically deployed on Kubernetes using dedicated operators, as managed cloud services, or integrated directly into modern GitOps continuous delivery pipelines.
15What is the difference between Milvus Standalone and Milvus Cluster?
Milvus Standalone packages all components into a single container for development and small workloads (<10M vectors). Milvus Cluster splits components into independent microservices on Kubernetes for multi-node scalability and high availability.
16Can Milvus store metadata alongside vectors?
Yes! Milvus supports scalar fields (strings, integers, booleans, JSON, dynamic schemas) and allows rich boolean expressions for hybrid filtering alongside vector similarity.
17How should Milvus be monitored in production?
Key metrics to monitor include p99 request latency, connection pool utilization, CPU and memory saturation, error rates, and disk I/O throughput.
18What is Milvus 2.4?
Milvus 2.4 is an enterprise-grade technology designed for milvus 2.4: distributed cloud-native vector engine, segments & gpu search nodes, providing high-throughput runtime primitives and resilient distributed execution.
19How is Milvus 2.4 deployed and scaled in production?
Milvus 2.4 is typically deployed on Kubernetes using dedicated operators, as managed cloud services, or integrated directly into modern GitOps continuous delivery pipelines.
20What is Milvus 2.5?
Milvus 2.5 is an enterprise-grade technology designed for milvus 2.5: distributed query nodes, segments, data coordinators & s3 persistence, providing high-throughput runtime primitives and resilient distributed execution.
21How is Milvus 2.5 deployed and scaled in production?
Milvus 2.5 is typically deployed on Kubernetes using dedicated operators, as managed cloud services, or integrated directly into modern GitOps continuous delivery pipelines.
22How should Milvus Cluster be monitored in production?
Key metrics to monitor include consensus leader election rate, commit index lag across followers, WAL fsync durations, disk I/O utilization, and memory usage.
23How should Milvus Knowhere be monitored in production?
Key metrics to monitor include p99 request latency, connection pool utilization, CPU and memory saturation, error rates, and disk I/O throughput.
24What is Multi-Layer Video Compositing?
Multi-Layer Video Compositing is an enterprise-grade technology designed for multi-layer video compositing: implementing real-time green screen chroma keying in webgl, providing high-throughput runtime primitives and resilient distributed execution.
25How is Multi-Layer Video Compositing deployed and scaled in production?
Multi-Layer Video Compositing is typically deployed on Kubernetes using dedicated operators, as managed cloud services, or integrated directly into modern GitOps continuous delivery pipelines.
26What is Music Information Retrieval (MIR)?
Music Information Retrieval (MIR) is an enterprise-grade technology designed for music information retrieval (mir): chromagram extraction & automated beat tracking in python, providing high-throughput runtime primitives and resilient distributed execution.
27How is Music Information Retrieval (MIR) deployed and scaled in production?
Music Information Retrieval (MIR) is typically deployed on Kubernetes using dedicated operators, as managed cloud services, or integrated directly into modern GitOps continuous delivery pipelines.
28Does Pinecone support self-hosting on private Kubernetes clusters?
No. Pinecone is exclusively a proprietary managed cloud SaaS service available on AWS, Google Cloud, and Microsoft Azure.
29Can Pinecone perform hybrid keyword and vector search?
Yes! Pinecone supports hybrid search by accepting both dense vectors (embeddings) and sparse vector arrays (indices and values from BM25 or SPLADE) in a single query.
Practice Vector Databases with Interactive Sandboxes & Related Tracks
All Developer ToolsExplore Related Technology Guides
Continue your full-stack & AI learning journey
Database Administrator (DBA)
Master Database Administrator (DBA) with practical code examples, in-depth architectural explanations, interactive runnable code examples and architectural blueprints, and modern best practices on HelloAIHub.
Artificial Intelligence (AI)
Master Artificial Intelligence (AI) with practical code examples, in-depth architectural explanations, interactive runnable code examples and architectural blueprints, and modern best practices on HelloAIHub.
LangChain
Master LangChain and LangChain Expression Language (LCEL): prompt templates, structured output parsers, conversational memory, tool binding, LangSmith tracing, and RAG pipelines.
LlamaIndex
Master LlamaIndex (GPT Index): document ingestion, sentence-window retrieval, auto-merging tree index, hybrid search, rerankers, Router Query Engines, and RAG evaluation with TruLens.