Spring / Spring AI interview questions
What is a VectorStore in Spring AI and which implementations are available?
A VectorStore is Spring AI's abstraction over a vector database — a storage engine optimised for persisting high-dimensional float vectors (embeddings) and performing approximate nearest-neighbour (ANN) similarity search over them. It is the persistence backbone of the RAG pipeline.
The interface defines two core operations: add(List<Document> documents) which embeds and stores documents, and similaritySearch(SearchRequest request) which returns the top-K documents most semantically similar to a query string.
Spring AI ships auto-configured implementations for:
| Store | Notes |
|---|---|
| SimpleVectorStore | In-memory only — for prototyping and unit tests |
| PgVector | PostgreSQL + pgvector extension — most common for teams already on Postgres |
| Redis (RedisVectorStore) | Uses Redis Stack with vector index |
| Chroma | Open-source; popular for local dev |
| Pinecone | Fully managed cloud vector DB |
| Weaviate | Cloud-native open-source vector DB |
| Milvus | High-throughput distributed vector DB |
| Qdrant | Rust-based, high performance |
| Azure AI Search | Managed Azure vector search |
All implementations satisfy the same VectorStore interface, so switching from SimpleVectorStore in development to PgVector in production is purely a dependency and configuration change — no application code touches the store directly except through the interface.
More Related questions...