Skip to main content

sqlite_graphrag/graph/
mod.rs

1//! Entity graph traversal (BFS over memory_entities + relations).
2//!
3//! Queries the SQLite entity and relation tables to expand neighbourhood
4//! sets used by the `related`, `recall`, `hybrid-search`, `deep-research` and
5//! `graph traverse` commands.
6//!
7//! `walk` holds the single BFS engine; the other modules are thin adapters.
8//! `traverse` answers "which memories are within N hops", `bfs` additionally
9//! records the predecessor of each entity so evidence chains can be
10//! reconstructed.
11
12mod bfs;
13mod traverse;
14pub mod walk;
15
16pub use bfs::{bfs_with_predecessors, EntityDepthMap, PredecessorMap};
17pub use traverse::{traverse_from_memories_with_hops, traverse_from_memories_with_hops_capped};
18pub use walk::{
19    EdgeArrival, GraphWalk, InMemoryNeighbors, MemoryEdge, NeighborSource, SqlNeighbors,
20    WalkDirection, WalkOutcome,
21};
22
23#[cfg(test)]
24mod tests;