Find answers from the community

Updated 3 months ago

Hi Team, i am using lancedb, i have

Hi Team, i am using lancedb, i have created a index and i want to query the vectorindex of lancedb using embedding not string, so i am using the following code, help me in resolving the error code ; ->? db = lancedb.connect(lancedb_path)


vector_store = LanceDBVectorStore(
uri=lancedb_path, table_name = self.index_name, query_type="vector",connection = db,embeddong=self.embeddings)

storage_context = StorageContext.from_defaults(vector_store=vector_store)

self.db = VectorStoreIndex.from_documents(
self.documents, storage_context=storage_context,vector_store=vector_store
)
retriever = VectorIndexRetriever(index=self.db, similarity_top_k=3)

# create QueryBundle for your query and add embeddings
embed_query = QueryBundle(query_str="unused", embedding = query)

# pass this object in your retriever to get nodes
return retriever.retrieve(embed_query) ERROR --->> AttributeError: 'LanceDBVectorStore' object has no attribute 'vector_store' and this line is where it throwing an error retriever = VectorIndexRetriever(index=self.db, similarity_top_k=3)
L
M
3 comments
mmmm somehow this looks like self.db is being set to the vector store object?

If you code is exactly as you pasted though, this doesn't seem possible lol
@Logan M yes this looks very strange, this is the output of type(self.db) <class 'llama_index.core.indices.vector_store.base.VectorStoreIndex'>
Yea that's correct πŸ€”
Add a reply
Sign up and join the conversation on Discord