In-Memory Vector Store
The In-Memory Vector Store node is a component used for creating and managing an in-memory vector store. This vector store is designed to store embeddings and perform exact, linear searches for the most similar embeddings.
Node Details
-
Name:
memoryVectorStore
-
Label: In-Memory Vector Store
-
Version: 1.0
-
Type: Memory
-
Category: Vector Stores
Base Classes
-
Memory
-
VectorStoreRetriever
-
BaseRetriever
Input Parameters
-
Document (optional, list)
-
Type: Document
-
Description: A list of documents to be stored in the vector store.
-
-
Embeddings
-
Type: Embeddings
-
Description: The embeddings model used to convert documents into vector representations.
-
-
Top K (optional)
-
Type: number
-
Description: Number of top results to fetch. Defaults to 4 if not specified.
-
Placeholder: 4
-
Outputs
-
Memory Retriever
-
Name: retriever
-
Base Classes: [Memory, VectorStoreRetriever, BaseRetriever]
-
-
Memory Vector Store
-
Name: vectorStore
-
Base Classes: [Memory, …BaseClasses of MemoryVectorStore]
-
Functionality
-
Initialization:
-
Creates a MemoryVectorStore from the provided documents and embeddings.
-
Can return either a retriever or the vector store itself based on the specified output.
-
-
Upsert Method:
-
Allows adding new documents to the vector store.
-
Returns the number of added documents and the added documents themselves.
-
Usage
This node is particularly useful in scenarios where:
-
You need a quick, in-memory solution for storing and retrieving vector embeddings.
-
The dataset is small enough to fit in memory.
-
You want to perform similarity searches on document embeddings.
-
You need a simple integration within a larger language model pipeline.
Note
The in-memory nature of this vector store means that it’s not persistent between runs and may not be suitable for very large datasets or scenarios requiring data persistence.