Budgeted Graph Traversal

Query neighbors, shortest paths, and bounded multi-hop neighborhoods across the company knowledge graph.

Overview

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.ts
  • packages/knowledge-graph/src/service.ts
  • packages/knowledge-graph/src/config/company.ts
  • packages/api/src/adapters/code-graph-service.ts

Properties

Property
Value
product
dots-platform
extensibility
configurable
module
Repo Graph, Search
packages
knowledge-graph, api
status
shipped
surface
api
summary
Query neighbors, shortest paths, and bounded multi-hop neighborhoods across the company knowledge graph.

Connections

Budgeted Graph Traversal · Explore connections

  • implemented bytopackages/knowledge-graph/src/service.ts
  • implemented bytopackages/knowledge-graph/src/traversal.ts
  • implemented bytopackages/knowledge-graph/src/config/company.ts
  • implemented bytoshortestPathQuery
  • implemented bytonHopQuery
  • implemented bytoneighborsQuery
  • requirestoEdge CRUD and Bulk Management
  • complementsfromGit Commit History Ingest
  • complementsfromGraph Analytics
  • complementsfromEdge CRUD and Bulk Management

Connected Records10

Complements
Implemented by
neighborsQuery
nHopQuery
packages/knowledge-graph/src/config/company.ts
packages/knowledge-graph/src/service.ts
packages/knowledge-graph/src/traversal.ts
shortestPathQuery
Requires
10 connections.