-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Semantic Search MCP for Valkey #1862
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?
Semantic Search MCP for Valkey #1862
Conversation
src/valkey-mcp-server/awslabs/valkey_mcp_server/embeddings/__init__.py
Outdated
Show resolved
Hide resolved
src/valkey-mcp-server/awslabs/valkey_mcp_server/tools/semantic_search.py
Show resolved
Hide resolved
| Example: | ||
| provider = BedrockEmbeddings( | ||
| region_name="us-east-1", | ||
| model_id="amazon.titan-embed-text-v1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, there is a newer V2 version now: https://docs.aws.amazon.com/bedrock/latest/userguide/titan-embedding-models.html
src/valkey-mcp-server/awslabs/valkey_mcp_server/tools/semantic_search.py
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| except Exception as e: | ||
| return f"Error adding documents: {str(e)}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We didn't tell in our docstring about this return structure. Could we rather return here a dict smilar to that from the happy path? Something like:
return {
"status": "failure",
"added": 0,
"failure_reason": str(e)
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, the other methods return a list, so they're keeping the union of list and string for now. Might be worth thinking about that further though, I just wanted to keep the return structure clutter-free.
Summary
Changes
Provides a full semantic search MCP for Valkey, leveraging its VSS capabilities, and encapsulating vector embeddings so that agents can interop using pure natural language and/or keywords.
User experience
The role of a data scientist would first add documents to the Valkey database using the
add_documentsMCP, under a specifically named collection, that can be sought using semantic search. The role of researcher would leverage thesemantic_searchMCP to seek for documents added under a specifically named collection, or query thelist_collectionsMCP to find out what named collections are available for searching.Checklist
If your change doesn't seem to apply, please leave them unchecked.
Not a breaking change.
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.