Find answers from the community

Updated 7 months ago

How to extract similar documents?

How to extract similar documents?

Plain Text
vector_store = QdrantVectorStore(client=client, collection_name="data")
storage_context = StorageContext.from_defaults(vector_store=vector_store)
index = VectorStoreIndex.from_documents(
    documents=documents,
    storage_context=storage_context
)

I don't want to use query engine, because I don't need LLM generation. I just want to retireve similar docs. How can I do it?
L
1 comment
Plain Text
retriever = index.as_retriever(similarity_top_k=2)
retriever.retrieve("query")
Add a reply
Sign up and join the conversation on Discord