Skip to content

feat: add get_popular_entities tool for hub entity discovery#8

Open
magnus919 wants to merge 1 commit into
desimpkins:mainfrom
magnus919:feature/get-popular-entities
Open

feat: add get_popular_entities tool for hub entity discovery#8
magnus919 wants to merge 1 commit into
desimpkins:mainfrom
magnus919:feature/get-popular-entities

Conversation

@magnus919
Copy link
Copy Markdown

Summary

  • Adds get_popular_entities MCP tool wrapping /graph/label/popular
  • Returns the most-connected entities sorted by degree descending
  • Accepts a limit parameter (default 50, max 1000)
  • Validated against a live instance — top results include high-centrality nodes like "AI", "United States", "Google"

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/popular endpoint returns entity names only — numeric degree is not part of the response. The min_degree filter 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 by limit.

Pairs with

search_entity_labels (PR #7): search gives candidate entities by name, get_popular_entities gives the graph's overall center of gravity for strategy decisions.

Closes #6

Test plan

  • Call with default limit and confirm non-empty list returned
  • Call with limit: 5 and confirm exactly 5 results
  • Confirm result is ordered (most-connected entities first)
  • Call with limit: 1000 and confirm max cap respected

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: get_popular_entities — hub entities sorted by degree

1 participant