Add documents to the vector store
Documents to add (embeddings will be generated if not provided)
Number of documents added
Search for similar documents
Search query
Matching documents with similarity scores
Get a document by ID
Document ID
The document or null if not found
Update a document
Document ID
Updated document
true if updated, false if not found
Delete a document
Document ID
true if deleted, false if not found
Delete multiple documents matching a filter
Metadata filter
Number of documents deleted
Get total number of documents
Document count
Clear all documents
List all documents (optionally filtered)
Optionalfilter: MetadataFilterOptional metadata filter
All matching documents
Get number of stored documents (for testing)
In-memory vector store implementation.
Uses cosine similarity for vector search and stores all documents in memory. Suitable for development, testing, and small-scale applications.
For production use with large datasets, consider using persistent vector stores like Pinecone, Weaviate, or Chroma.
Example