AI Embedding Lookup
read heavySummary
Vector similarity search for semantic retrieval across millions of high-dimensional embeddings. Each query computes approximate nearest neighbors against a vector index that must fit in RAM for acceptable latency. Index build is expensive; incremental updates require re-indexing strategies.
Example Systems
- ·RAG pipeline retrieval layer
- ·Semantic search for documents
- ·Recommendation engine (item similarity)
- ·Image similarity search
- ·Code search by semantic meaning
Characteristics
Capacity
Access Patterns
Recommended Patterns
Patterns to Avoid
Basis
Vector search workloads are relatively new but well-characterized in pgvector, Pinecone, and Weaviate documentation
Related Architecture Knowledge
Outbound: this entity affects
AI embedding lookup workloads are the primary use case for vector similarity search; nearest-neighbor retrieval over high-dimensional embedding spaces requires ANN indexes to achieve sub-second latency.
Full relationship →AI embedding lookup workloads are directly vulnerable to embedding drift when source content changes without triggering re-embedding, silently degrading retrieval quality without any error signal.
Full relationship →AI embedding lookup workloads require the entire vector index to reside in RAM for acceptable latency. When the index size grows beyond available memory, the OS begins paging the HNSW graph to disk, causing query latency to degrade from milliseconds to seconds and eventually OOM-killing the process.
Tradeoffs
- ·Quantization reduces memory by 4-8x but degrades recall slightly: evaluate recall impact before deploying
- ·IVFFlat has lower memory than HNSW but requires training (cluster computation) when adding new vectors
- ·Horizontal scaling (shard vectors across instances) reduces per-node memory at the cost of scatter-gather query overhead
Used In Architecture Scenarios
AI / RAG Application
A Retrieval-Augmented Generation (RAG) architecture that combines vector similarity search for semantic document retrieval with relational metadata filtering, using PostgreSQL with pgvector as the unified store for both embeddings and structured data. Redis provides a semantic cache to avoid redundant embedding model inference and reduce vector index query load for repeated or similar queries. Kafka manages the asynchronous embedding generation pipeline that keeps the vector index current as source documents are added or updated.
AI / RAG Application
A low-latency feature serving platform for ML model inference, providing both batch (offline) and real-time (online) feature access with strict training-serving consistency. Redis serves the hot feature cache with p99 latency targets below 5ms for online inference requests; PostgreSQL provides point-in-time feature lookups for offline training jobs with temporal consistency guarantees; Cassandra stores high-cardinality feature entities at write scale beyond PostgreSQL's single-primary ceiling; Kafka streams feature computation events from online feature pipelines to update the cache; Qdrant stores vector features for embedding-based model inputs and similarity lookups; ClickHouse serves feature analytics and drift monitoring across training dataset populations. Feature versioning is first-class: every feature value is tagged with a pipeline_version and computed_at timestamp to support model reproducibility and training-serving skew diagnosis.