SynapsesOS
Reference

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 TypeWeightDomainDescription
CALLS1.0CodeFunction calls — highest relevance
DATA_FLOWS0.95CodeData dependency chains
IMPLEMENTS0.9CodeInterface implementation
HANDLES0.9CodeRoute → handler (synthetic)
EMBEDS0.85CodeStruct embedding
DEPENDS_ON0.8CodePackage dependency
IMPORTS0.7CodeModule import
DEFINES0.15CodeFile → entity containment (low to prevent hub effect)
DEPLOYS0.75Cross-domainCode → infrastructure
CONSUMES0.75Cross-domainCode → API/service
CONFIGURED_BY0.65Cross-domainCode → config
MENTIONS0.55Cross-domainName-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_FLOWS and DEPENDS_ON, inverts direction (trace upstream)
  • review: Boosts IMPLEMENTS and EMBEDS (contract surface)
  • add: Boosts IMPORTS (follow existing patterns)

You don’t need to configure these — they’re applied automatically based on intent.