Description
Budgeted Graph Traversal turns stored relationships into navigable answers. Callers can fetch the immediate neighborhood around an entity, find a shortest path between two entities, or request the subgraph reachable within a bounded number of hops. Traversal works across the polymorphic graph, so a route can move through knowledge rows, conversations, commits, files, and symbols when the connecting edge types permit it.
The feature is designed for interactive product use and agent queries, where an unbounded graph walk would be unsafe. Every request is tenant-scoped, authorization-gated, and constrained by the company’s traversal policy plus a hard platform ceiling. Direction and edge-type filters let consumers narrow the walk to the semantics they need rather than scanning all active connections.
Selling Points
- Answers “what connects to this?” without forcing clients to reconstruct graph logic.
- Finds explainable chains between otherwise distant knowledge and code entities.
- Supports focused direction and relationship filters for precise investigations.
- Enforces hop budgets so interactive queries cannot become uncontrolled graph scans.
- Powers higher-level code callers, callees, impact, trace, and context compositions.
User Story
As an engineer investigating why a plan mentions a function, I ask for a path from the plan row to the code symbol. Dots returns a bounded chain through documented files, commits, or conversations, giving me inspectable evidence instead of an opaque semantic-search guess.
Extension Surface
The rating is configurable because a company can set its traversal hop allowance through packages/knowledge-graph/src/config/company.ts, and callers can select direction, edge types, and requested depth through packages/knowledge-graph/src/service.ts. The query algorithms live in packages/knowledge-graph/src/traversal.ts. Configuration cannot exceed the hard ceiling, preserving predictable resource bounds for every tenant.
Capabilities & Limits
Capabilities include one-hop neighbor reads, bidirectional shortest-path search, and n-hop neighborhood extraction with active-edge filtering. Results preserve endpoint type and identifier pairs, which is essential when the same UUID shape can represent different graph kinds. Limits are explicit: traversal is breadth-first rather than weighted, requests cannot exceed twelve hops, and these primitives do not themselves add code-specific metadata; API composers enrich code results separately.
Implementation Map
packages/knowledge-graph/src/traversal.tspackages/knowledge-graph/src/service.tspackages/knowledge-graph/src/config/company.tspackages/api/src/adapters/code-graph-service.ts