Skip to content
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

Support Custom Search Query for VectorStore #2368

Open
rst0070 opened this issue Mar 12, 2025 · 0 comments · May be fixed by #2372
Open

Support Custom Search Query for VectorStore #2368

rst0070 opened this issue Mar 12, 2025 · 0 comments · May be fixed by #2372

Comments

@rst0070
Copy link
Contributor

rst0070 commented 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.

  • 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!

@rst0070 rst0070 changed the title Support Custom Search Queries for VectorStore Support Custom Search Query for VectorStore Mar 12, 2025
@rst0070 rst0070 linked a pull request Mar 13, 2025 that will close this issue
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant