AI / LangChain4j interview questions
What EmbeddingStores does LangChain4j support and how do you choose one?
An EmbeddingStore is the vector database layer in LangChain4j's RAG pipeline — it stores embedding vectors alongside their source text and metadata, and supports approximate nearest-neighbor (ANN) similarity search. LangChain4j implements a unified EmbeddingStore<TextSegment> interface across all backends, so swapping stores requires only a dependency and configuration change.
| Store | Type | Best For |
|---|---|---|
| InMemoryEmbeddingStore | In-memory (no persistence) | Development, unit tests, prototyping |
| PgVector | PostgreSQL extension | Teams already on Postgres; no separate vector DB infrastructure |
| Chroma | Open-source vector DB | Local dev/staging, self-hosted deployments |
| Pinecone | Managed cloud vector DB | Production scale, fully managed |
| Weaviate | Open-source / cloud | Multi-modal search, built-in vectorization |
| Qdrant | Open-source / cloud | High-performance filtered search |
| Milvus / Zilliz | Open-source / cloud | Very large-scale vector workloads |
| Elasticsearch | Managed / self-hosted | Teams already running ELK stack |
| Azure AI Search | Managed Azure service | Azure-native deployments |
| Redis Stack | In-memory + persistence | Low-latency, existing Redis infrastructure |
For choosing: start with InMemoryEmbeddingStore during development. For production, use PgVector if you already run PostgreSQL (zero additional infrastructure), or Pinecone/Qdrant if you need a dedicated managed vector database with advanced filtering and scaling controls. The interface is identical across all stores, so the choice is purely operational.
More Related questions...