Skip to content

Is it possible to save Recursive_index in Faiss Vector store locally? #15034

Answered by dosubot bot
mraguth asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, it is possible to save a Recursive_index in a Faiss Vector store locally. Below are detailed code samples for both Faiss and ChromaDB to store and retrieve vectors for querying.

Faiss

Storing Vectors

from llama_index.legacy.vector_stores.faiss import FaissVectorStore
import faiss
import numpy as np
from llama_index.legacy.schema import BaseNode

# Create a faiss index
d = 1536  # dimension
faiss_index = faiss.IndexFlatL2(d)

# Initialize the vector store
vector_store = FaissVectorStore(faiss_index=faiss_index)

# Add vectors to the store
vectors = [np.random.rand(d).astype('float32') for _ in range(10)]
nodes = [BaseNode(embedding=vector) for vector in vectors]
vector_store.add(nodes)…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mraguth
Comment options

@dosubot
Comment options

Answer selected by mraguth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant