Class SimpleVectorStore

All Implemented Interfaces:
Consumer<List<Document>>, DocumentWriter, VectorStore, VectorStoreRetriever

public class SimpleVectorStore extends AbstractObservationVectorStore
A simple, in-memory implementation of the VectorStore interface.

Uses a ConcurrentHashMap to store vectors and their associated metadata. Map keys are document IDs; values are SimpleVectorStoreContent instances that encapsulate each document's text, metadata, and embedding vector.

Similarity search is performed using cosine similarity over all stored vectors. Filter expressions on document metadata are evaluated via SimpleVectorStoreFilterExpressionEvaluator.

The store can be persisted to and restored from a JSON file via the save(java.io.File) and load(java.io.File) / load(org.springframework.core.io.Resource) methods.

NOTE: This implementation is not designed for production use and should only be used for testing or demonstration purposes.

Since:
1.0.0
Author:
Raphael Yu, Dingmeng Xue, Mark Pollack, Christian Tzolov, Sebastien Deleuze, Ilayaperumal Gopinathan, Thomas Vitale, Jemin Huh, David Yu