Repository navigation
feat(ai): add bounded graph traversal recall - #884
Open
apex-mochen wants to merge 1 commit into
Open
apex-mochen wants to merge 1 commit into
apex-mochen wants to merge 1 commit into
Conversation
Author
|
Hi @yaozhongq, could you please help approve the JDK 8 and JDK 11 workflow runs for this PR at |
Contributor
Started |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #861.
This adds a read-only traversal recall operator over GraphAccessor, with weighted random walks with restart, breadth-first search and depth-limited depth-first search. It aggregates candidate visits across anchors, excludes anchors from results, and returns path provenance alongside explicit scan, traversal, vertex, depth and result limits.
Weighted sampling caches a scaled cumulative distribution and uses binary search for repeated draws. The DFS implementation re-expands vertices reached later at a shallower depth, so an earlier deep arrival does not hide reachable descendants.
The local accessor emits the same backing self-loop multiple times through its adjacency indexes. The operator accounts for that loop once when constructing transition weights while still charging every scanned record to the scan budget. Distinct parallel edges are preserved. Edge properties participate in deterministic transition ordering.
Semantics for review
Provenance is the shortest observed walk, not a guaranteed globally shortest path. If the graph has A→C and A→B→C but only the latter was sampled, the sampled path is retained. This differs from the issue's shortest-path wording and needs agreement.
Random-walk scores sum per-anchor visit frequencies; they are not exact stationary PageRank probabilities. BFS/DFS scores count supporting anchors. Results are truncated after ranking, while separate traversal budgets bound the work. Cancellation and deadlines are cooperative and cannot preempt blocking accessor I/O.
Validation
On base 3c24c8e, local commit c52ff03:
Command: mvn -B -ntp -pl geaflow-ai -am -Djacoco.skip=true -DcoverageAgent= test
Environment: Windows 11, Maven 3.9.11, Java 21.0.5, upstream Java 11 compilation target. The default reactor also succeeds, but JaCoCo 0.8.8 emits Java21 instrumentation errors; the command above disables coverage collection, not tests. No coverage, benchmark or production result is claimed. The skipped existing stress test requires graphrag.answer.input.
Existing retrieval pipelines are unchanged. The proposed API keeps Limits, Hit, Result and Strategy nested under GraphTraversalRecall. Upstream CI was not run as part of the local validation above.