query_ranked
Ranks natural-language query results by combining semantic vector scores with graph centrality and proximity, using hybrid or personalized PageRank modes. Returns explainable ranked lists for Swift codebase knowledge graph queries.
Instructions
Rank query results using CodeRank-enhanced hybrid or personalized PageRank.
Combines semantic seed scores from the vector index with structural centrality and graph proximity to produce a final ranked list with explainability components.
Two modes are available:
hybrid(default): 0.60 × semantic + 0.25 × centrality + 0.15 × proximityppr: 0.70 × personalized PageRank + 0.30 × semantic
:param q: Natural-language query string.
:param k: Number of semantic seed nodes to retrieve (default 8).
:param mode: Ranking mode — "hybrid" (default) or "ppr".
:param top: Maximum ranked results to return (default 25).
:param rels: Comma-separated relations to include in the local graph.
:param radius: Graph expansion radius around seeds (default 2).
:param exclude_tests: Exclude test-path nodes (default True).
:return: JSON array of ranked result dicts with score components and
why explanation strings. sym: import stub nodes are
always excluded from the output.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| k | No | ||
| q | Yes | ||
| top | No | ||
| mode | No | hybrid | |
| rels | No | CALLS,IMPORTS,INHERITS,CONFORMS,EXTENDS | |
| radius | No | ||
| exclude_tests | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |