-
Notifications
You must be signed in to change notification settings - Fork 15.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qdrant - Load the saved vector db/store ? #11471
Comments
🤖 Hello, Thank you for your question. Currently, the from qdrant_client import QdrantClient
from langchain.vectorstores import Qdrant
from langchain.embeddings import OpenAIEmbeddings
embeddings = OpenAIEmbeddings()
collection_name = "MyExistingCollection" # replace with your collection name
qdrant = Qdrant.construct_instance(
texts=[], # no texts to add
embedding=embeddings,
collection_name=collection_name,
) In this code, from langchain.embeddings import OpenAIEmbeddings
embeddings = OpenAIEmbeddings() Please note that this will not check if the collection actually exists in the Qdrant server. If the collection does not exist, any operation that requires the collection (like This approach was derived from the source code of the I hope this helps! If you have any other questions, feel free to ask. Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
hi
|
🤖 Hello, You're correct in your understanding of the Here's a snippet from the LangChain source code that shows this: try:
# Skip any validation in case of forced collection recreate.
if force_recreate:
raise ValueError
# Get the vector configuration of the existing collection and vector, if it
# was specified. If the old configuration does not match the current one,
# an exception is being thrown.
collection_info = client.get_collection(collection_name=collection_name)
current_vector_config = collection_info.config.params.vectors
... In this code, If the collection does not exist and operations such as Regarding the behavior of these methods when the specified collection does not exist in the Qdrant server:
In summary, if the specified collection does not exist in the Qdrant server, these methods will either attempt to recreate the collection (if I hope this clarifies your question. If you have any more questions or need further clarification, feel free to ask. Best regards, SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Hi @VpkPrasanna : Did you find a solution to your requirement? I am also in the need of the same, where I need to load an existing collection? |
here is it the above piece of code helps you to load the saved qdrant path |
🙏 thanks
…On Mon, 8 Jan 2024 at 12:28, V.Prasanna kumar ***@***.***> wrote:
here is it
from qdrant_client import QdrantClient
client = QdrantClient(path=saved_db_path) db = Qdrant( client=client,
collection_name=self.collection_name, embeddings=embeddings, )
the above piece of code helps you to load the saved qdrant path
—
Reply to this email directly, view it on GitHub
<#11471 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AESCYLPP37EKL4Q6GLF2S2DYNOKKFAVCNFSM6AAAAAA5VTWVXCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBQGQ3TCMZTGM>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Issue you'd like to raise.
I use Qdrant through langchain to store vectors. But I can't find any example in docs where the dataset is searched based on a previously created collection. How to load the data? I found that Pinecone has "from_existing_index" function, which probably does the thing. But Qdrant doesn't have such a function. I created my own solution using qdrant_client, but I would like to use Langchain to simplify the script. How to do it?
Suggestion:
No response
The text was updated successfully, but these errors were encountered: