feat(mcp): improve VFromType with filter support#871
Open
nodfans wants to merge 2 commits intoHelixDB:mainfrom
Open
feat(mcp): improve VFromType with filter support#871nodfans wants to merge 2 commits intoHelixDB:mainfrom
nodfans wants to merge 2 commits intoHelixDB:mainfrom
Conversation
Member
|
thanks for this will review |
Member
|
@greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR enhances the MCP toolset by improving the
VFromTypetool and removing redundant functionality:NFromTypeandEFromType.Checklist when merging to main
rustfmthelix-cli/Cargo.tomlandhelixdb/Cargo.tomlGreptile Summary
This PR adds a new
VFromTypeMCP tool that retrieves vectors by type label with optional metadata filtering support. The implementation follows the existing pattern used byOutStep,InStep, and other tools that support optional filters by wrapping the base traversal withapply_filterwhen a filter is provided. The code is well-structured and integrates cleanly with the existing traversal system.Key changes:
VFromTypeAdapterimport from the source moduleVFromTypevariant to theToolArgsenum withvector_type: Stringandfilter: Option<FilterTraversal>fieldsVFromTypecase inapply_stepthat callsv_from_type(label, true)to retrieve vector data and conditionally applies filteringThe implementation is correct and follows established patterns in the codebase.
Important Files Changed
VFromTypetool with optional filter support for retrieving vectors by typeFlowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[VFromType Tool Args] --> B{Parse vector_type and filter} B --> C[Allocate label in arena] C --> D[Call G.v_from_type with label and get_vector_data=true] D --> E[Create TraversalStream from iterator] E --> F{Filter provided?} F -->|Yes| G[apply_filter with FilterTraversal] F -->|No| H[Return unfiltered stream] G --> I[Filter by properties and/or sub-traversals] I --> J[Return filtered TraversalStream] H --> J J --> K[Results ready for consumption]Last reviewed commit: dbcdf25
(2/5) Greptile learns from your feedback when you react with thumbs up/down!