Expand description
Graph traversal helpers over the entities and relationships tables. Entity graph traversal (BFS over memory_entities + relations).
Queries the SQLite entity and relation tables to expand neighbourhood
sets used by the related, recall, hybrid-search, deep-research and
graph traverse commands.
walk holds the single BFS engine; the other modules are thin adapters.
traverse answers “which memories are within N hops”, bfs additionally
records the predecessor of each entity so evidence chains can be
reconstructed.
Re-exports§
pub use walk::EdgeArrival;pub use walk::GraphWalk;pub use walk::InMemoryNeighbors;pub use walk::MemoryEdge;pub use walk::NeighborSource;pub use walk::SqlNeighbors;pub use walk::WalkDirection;pub use walk::WalkOutcome;
Modules§
- walk
- Single bounded-BFS engine behind every graph traversal in the codebase.
Functions§
- bfs_
with_ predecessors - BFS that also returns a predecessor map for path reconstruction.
- traverse_
from_ memories_ with_ hops - BFS graph traversal returning the hop distance for each reached memory.
- traverse_
from_ memories_ with_ hops_ capped - Extended variant that accepts an optional neighbour cap per hop.
Type Aliases§
- Entity
Depth Map - Depth map from BFS: entity_id → hop distance from seeds.
- Predecessor
Map - Predecessor map from BFS: entity_id → (parent_entity_id, relation_type, edge_weight).