-
Notifications
You must be signed in to change notification settings - Fork 2
Add hybrid_search tool for OceanBase/SeekDB #4
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: whhe <27404407+whhe@users.noreply.github.com>
Co-authored-by: whhe <27404407+whhe@users.noreply.github.com>
|
@copilot I would like to change the following definitions:
|
Co-authored-by: whhe <27404407+whhe@users.noreply.github.com>
Co-authored-by: whhe <27404407+whhe@users.noreply.github.com>
Done! Changes implemented in commit 07cd644:
The filter is properly integrated into the search body as a bool query with the hybrid search in the |
f4e6986 to
257554f
Compare
Implements hybrid search combining vector similarity and full-text search via the
DBMS_HYBRID_SEARCHAPI, supported on OceanBase 4.4.1+ and SeekDB.Changes
Tool implementation (
tools/hybrid_search.py)DBMS_HYBRID_SEARCH.SEARCH()Tool definition (
tools/hybrid_search.yaml)table_names(required),query(required),top_k(default 10),embedding_model(required),rerank_model(conditional),filter(optional)Dependencies
pyobvectorfrom 0.2.16 to 0.2.22 forHybridSearchclientDocumentation
Usage
Query body structure sent to
DBMS_HYBRID_SEARCH:{ "query": { "hybrid": { "queries": [ {"knn": {"field": "embedding", "query_vector": [...], "k": 10}}, {"match": {"content": "query text"}} ] } }, "size": 10 }With filter:
{ "query": { "bool": { "must": [ { "hybrid": { "queries": [ {"knn": {"field": "embedding", "query_vector": [...], "k": 10}}, {"match": {"content": "query text"}} ] } } ], "filter": {"range": {"price": {"gte": 10, "lte": 100}}} } }, "size": 10 }Original prompt
hybrid searchtool to execute hybrid search on OceanBase or SeekDB #1💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.