Node Details

  • Name: memoryVectorStore

  • Label: In-Memory Vector Store

  • Version: 1.0

  • Type: Memory

  • Category: Vector Stores

Base Classes

  • Memory

  • VectorStoreRetriever

  • BaseRetriever

Input Parameters

  1. Document (optional, list)

    • Type: Document

    • Description: A list of documents to be stored in the vector store.

  2. Embeddings

    • Type: Embeddings

    • Description: The embeddings model used to convert documents into vector representations.

  3. Top K (optional)

    • Type: number

    • Description: Number of top results to fetch. Defaults to 4 if not specified.

    • Placeholder: 4

Outputs

  1. Memory Retriever

    • Name: retriever

    • Base Classes: [Memory, VectorStoreRetriever, BaseRetriever]

  2. Memory Vector Store

    • Name: vectorStore

    • Base Classes: [Memory, …BaseClasses of MemoryVectorStore]

Functionality

  1. 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.

  2. 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.