Skip to content

vectorstore_Faiss

Mehraneh-Barani edited this page Jul 26, 2024 · 1 revision

Faiss

class FAISSVectorStore(embedding)

Bases: VectorStore

A concrete implementation of VectorStoreBase using FAISS for storage.

Attributes:

db (FAISS): The FAISS vector store.

add_document(docs)

Adds documents to the FAISS vector store.

Args:

docs: The documents to be added to the vector store.

retrieve(query, top_k=5)

Retrieves documents similar to the given query from the FAISS vector store.

Args:

  • query (str): The query to retrieve similar documents.
  • top_k (int, optional): The number of top similar documents to retrieve. Defaults to 5.

Returns:

Tuple[List[str], List[float]]: The context and scores of the retrieved documents.

Clone this wiki locally