feat: add get_popular_entities tool for hub entity discovery#8
Open
magnus919 wants to merge 1 commit into
Open
feat: add get_popular_entities tool for hub entity discovery#8magnus919 wants to merge 1 commit into
magnus919 wants to merge 1 commit into
Conversation
Wraps /graph/label/popular to return the most-connected entities sorted by degree. Useful for session-start orientation (what is the graph good at?), query anchor selection, and post-batch auditing after large indexing runs. Note: LightRAG's endpoint returns entity names only; numeric degree values are not exposed by the API. Closes desimpkins#6 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
get_popular_entitiesMCP tool wrapping/graph/label/popularlimitparameter (default 50, max 1000)Interface
get_popular_entities(limit: 10){ "entities": ["Narrator", "Concept", "Hugo", "OpenCode", "United States", "AI", "Google", ...], "limit": 10 }Note on degree values and min_degree
The
/graph/label/popularendpoint returns entity names only — numeric degree is not part of the response. Themin_degreefilter proposed in the issue cannot be implemented without additional per-entity lookups. The ordered list still achieves the core use cases: highest-degree entities first, truncated bylimit.Pairs with
search_entity_labels(PR #7): search gives candidate entities by name,get_popular_entitiesgives the graph's overall center of gravity for strategy decisions.Closes #6
Test plan
limitand confirm non-empty list returnedlimit: 5and confirm exactly 5 resultslimit: 1000and confirm max cap respected🤖 Generated with Claude Code