Edge Weights
Edge Weights
Edge weights control how relevant different relationship types are during context carving (BFS ego-graph extraction). Higher weight = more relevant = prioritized in token budget.
{ "edge_weights": { "CALLS": 1.0, "DATA_FLOWS": 0.95, "IMPLEMENTS": 0.9, "HANDLES": 0.9, "EMBEDS": 0.85, "DEPENDS_ON": 0.8, "DEPLOYS": 0.75, "CONSUMES": 0.75, "IMPORTS": 0.7, "EXPLAINS": 0.7, "CONFIGURED_BY": 0.65, "DOCUMENTS": 0.65, "DOCUMENTED_BY": 0.6, "CONTRADICTS": 0.6, "MENTIONS": 0.55, "EXPORTS": 0.5, "MANUAL": 0.5, "CAUSED_BY": 0.5, "INSTANCE_OF": 0.4, "RELATES_TO": 0.3, "LINKS_TO": 0.3, "DEFINES": 0.15, "CONTAINS": 0.15 }}Default Weights
These are the built-in defaults. You only need to override specific weights you want to change:
| Edge Type | Weight | Domain | Description |
|---|---|---|---|
CALLS | 1.0 | Code | Function calls — highest relevance |
DATA_FLOWS | 0.95 | Code | Data dependency chains |
IMPLEMENTS | 0.9 | Code | Interface implementation |
HANDLES | 0.9 | Code | Route → handler (synthetic) |
EMBEDS | 0.85 | Code | Struct embedding |
DEPENDS_ON | 0.8 | Code | Package dependency |
IMPORTS | 0.7 | Code | Module import |
DEFINES | 0.15 | Code | File → entity containment (low to prevent hub effect) |
DEPLOYS | 0.75 | Cross-domain | Code → infrastructure |
CONSUMES | 0.75 | Cross-domain | Code → API/service |
CONFIGURED_BY | 0.65 | Cross-domain | Code → config |
MENTIONS | 0.55 | Cross-domain | Name-match edges |
Intent-Specific Weight Adjustments
When you use get_context or get_context(mode="intent") with an intent, weights are automatically adjusted:
- modify: Boosts callees (what will break when you change this)
- debug: Boosts
DATA_FLOWSandDEPENDS_ON, inverts direction (trace upstream) - review: Boosts
IMPLEMENTSandEMBEDS(contract surface) - add: Boosts
IMPORTS(follow existing patterns)
You don’t need to configure these — they’re applied automatically based on intent.