Replies: 1 comment
-
🤖 Hello, To dynamically pass in 'id' or other metadata as filters when using an Agent with initialize_agent for the Vector Store Toolkit in Qdrant Vector DB, you can use the Here is an example of how you can use it: from qdrant_openapi_client.models.metadata_filter import MetadataFilter
# Create a MetadataFilter instance
metadata_filter = MetadataFilter(
must: {"id": "your_id"}, # Replace 'your_id' with the actual id
should: {},
must_not: {}
)
# Use the filter in the similarity_search_by_vector method
documents = agent.similarity_search_by_vector(
embedding=your_embedding, # Replace 'your_embedding' with the actual embedding
k=4,
filter=metadata_filter
) In this example, As for the I hope this helps! If you have any other questions or need further clarification, feel free to ask. Best, 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. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am currently using an Agent with initialize_agent for the Vector Store Toolkit.
I am using Qdrant as my Vector store and I would like to pass in
id
or some kind metadata dynamically to narrow the filter the search when prompted. Is that possible?If I use the
as_retriever
method I am able to pass in search_kwargs, but I'm not sure how to do it when it comes to Agents using Vector Store Toolkit.Beta Was this translation helpful? Give feedback.
All reactions