You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose adding support for custom search queries in VectorStore, allowing more flexible search functionality beyond vector search.
Motivation, pitch
Currently, VectorStore only supports vector-based search for retrieving memories. However, many VectorStore implementations offer additional search capabilities, such as keyword-based search or hybrid search. By allowing customizable search queries, developers can leverage these features to improve search performance and relevance.
Proposed solution
Introduce a query_dict parameter to support custom queries in search functions.
Modify mem0.memory.main.Memory.search to accept a query_dict parameter.
This parameter (a dictionary) will store custom query data for flexible search execution.
Update mem0.vector_stores.VectorStoreBase.search and its implementations to support query_dict.
This ensures that all vector store backends can process custom queries.
Introduce a custom_search_query configuration parameter in VectorStore configs.
This parameter will accept a function that generates queries based on search parameters.
This feature will increase flexibility in retrieving memories based on different use cases.
Would love to hear thoughts from maintainers on this!
Let me know if there's anything I should adjust before submitting a PR!
The text was updated successfully, but these errors were encountered:
rst0070
changed the title
Support Custom Search Queries for VectorStore
Support Custom Search Query for VectorStore
Mar 12, 2025
🚀 The feature
I propose adding support for custom search queries in
VectorStore
, allowing more flexible search functionality beyond vector search.Motivation, pitch
Currently,
VectorStore
only supports vector-based search for retrieving memories. However, many VectorStore implementations offer additional search capabilities, such as keyword-based search or hybrid search. By allowing customizable search queries, developers can leverage these features to improve search performance and relevance.Proposed solution
Introduce a query_dict parameter to support custom queries in search functions.
mem0.memory.main.Memory.search
to accept aquery_dict
parameter.mem0.vector_stores.VectorStoreBase.search
and its implementations to supportquery_dict
.custom_search_query
configuration parameter inVectorStore
configs.This feature will increase flexibility in retrieving memories based on different use cases.
Would love to hear thoughts from maintainers on this!
Let me know if there's anything I should adjust before submitting a PR!
The text was updated successfully, but these errors were encountered: