feat: add search_entity_labels tool for fuzzy entity search#7
Open
magnus919 wants to merge 1 commit into
Open
Conversation
Wraps /graph/label/search to support batch queries — multiple search terms in one call, each returning a list of fuzzy-matched entity names. Useful for pre-query entity confirmation, post-insert verification, and finding canonical entity names before graph traversal. Note: LightRAG's search endpoint returns names only; degree is not available from this endpoint. Closes desimpkins#5 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4 tasks
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.
Summary
search_entity_labelsMCP tool wrapping/graph/label/searchInterface
search_entity_labels(queries: ["Brynjolfsson", "Generative AI"], limit: 5){ "results": [ {"query": "Brynjolfsson", "matches": ["Brynjolfsson", "Brynjolfsson And Mitchell", ...]}, {"query": "Generative AI", "matches": ["Generative AI", "Generative Ai", ...]} ] }Note on degree
The
/graph/label/searchendpoint returns entity names only — degree is not part of the response. Themin_degreefilter proposed in the issue cannot be implemented without additional per-entity lookups, which would be expensive at scale. Entity names alone are sufficient for the primary use cases (pre-query confirmation, post-insert verification, canonical name lookup).Closes #5
Test plan
matches: []limitand confirm result count is capped🤖 Generated with Claude Code