Files
modules/indexes-search/hyper-p2p-graph-index/docs/architecture.md
T
2026-05-20 23:36:32 -04:00

1.0 KiB

Architecture: hyper-p2p-graph-index

Category: indexes-search
Protocol: graph-index/v1 (local-only)

Purpose

In-memory directed/undirected graph with BFS traversal for peer graphs, capability graphs, or workflow dependencies.

Storage model

_adj: Map<nodeId, Set<neighborId>>

Undirected edges are stored as two directed entries when directed: false.

Wire messages

type fields behavior
No network layer

BFS algorithm

frontier = [start], visited = {start}
for d in 0..maxDepth-1:
  expand frontier via neighbors(node)
  skip visited, append to order/layers

Lifecycle

Construct → addEdge / bfs / removeNodeclose.

Composition

  • ../../_shared/lib/errors.js for validation
  • Combine with hyper-p2p-geo-hint-router or app routers for spatial/logical routing; this module does not pick peers

Limits

  • No edge weights, no persistence, no distributed merge
  • removeNode does not decrement stats.edges