Node Details

  • Name: Faiss

  • Type: Faiss

  • Version: 1.0

  • Category: Vector Stores

Base Classes

  • Faiss

  • VectorStoreRetriever

  • BaseRetriever

Input Parameters

  1. Document (optional, list)

    • Type: Document

    • Description: List of documents to be stored in the vector store

  2. Embeddings

    • Type: Embeddings

    • Description: Embedding model used to convert documents into vector representations

  3. Base Path to load

    • Type: string

    • Description: Path to load or save the faiss.index file

    • Placeholder: C:\Users\User\Desktop

  4. Top K (optional, additional parameter)

    • Type: number

    • Description: Number of top results to fetch (default: 4)

    • Placeholder: 4

Outputs

  1. Faiss Retriever

    • Name: retriever

    • Base Classes: [Faiss, VectorStoreRetriever, BaseRetriever]

  2. Faiss Vector Store

    • Name: vectorStore

    • Base Classes: [Faiss, …FaissStore base classes]

Functionality

The Faiss Vector Store node provides two main functions:

  1. Upsert:

    • Processes input documents

    • Creates vector embeddings using the provided embedding model

    • Stores the vectors in a Faiss index

    • Saves the index to the specified base path

  2. Init:

    • Loads an existing Faiss index from the specified base path

    • Creates either a retriever or a vector store based on the output selection

    • Configures the similarity search function to avoid illegal invocation errors

Use Cases

  • Efficient similarity search in large document collections

  • Building retrieval-augmented generation (RAG) systems

  • Creating semantic search engines

  • Implementing recommendation systems based on content similarity

Notes

  • The node includes a custom implementation of similaritySearchVectorWithScore to handle potential issues with the number of requested results exceeding the total number of stored vectors.

  • It’s designed to work seamlessly within a larger system, likely a node-based workflow for natural language processing tasks.