An experiment: solve a query's own subgraph instead of using precomputed GraphRAG communities
Standard GraphRAG builds communities (groups of related nodes) over the whole graph ahead of time, summarizes them, and at just hands back the nearest precomputed group. The problem is that group was decided before the question existed, so it's often half off-topic, and the wasted content still eats up space and cost. This experiment tries the opposite: it models the query itself as an electrical circuit — the source entity is set to +1V, the target category to ground (0V), and the relationship weights in the ontology act as conductances.
Solving that circuit gives every entity in the graph a voltage value. On top of that sits a retrieval step (called 'Layer 3'): a that expands paths based on the current (signal) flowing between neighboring nodes, so paths carrying strong signal between source and target get explored first, and dead ends carrying no current never make it into the search. No LLM calls happen during this traversal.
Two things come out of it: ranked, typed paths scored by their current (the weakest link in the path — on a movie demo graph, the 'Nolan to Sci-Fi' path scores 0.394 for Interstellar, 0.301 for Inception, and exactly 0.0 for The Dark Knight), plus a one-pass filter called extract_circuit that returns just those results.
Key points
- Standard GraphRAG precomputes communities (groups) at indexing time and just serves the nearest one at
- That precomputed group is often partly off-topic for a given question, wasting space
- This experiment models the query as an electrical circuit, computing a voltage at every entity
- A then expands paths by edge current (signal strength) with zero LLM calls during traversal
- Results include ranked paths scored by their weakest link, plus a one-pass filter (extract_circuit) for retrieving them