Repository navigation
fix(retrieval): Neo4j subgraph confidence/as_of parity + run integration tests in CI - #828
Merged
Merged
Conversation
…ce/as_of (#826) Neo4jWorldGraphBackend.query_subgraph applied min_confidence/as_of only to the returned edges, so nodes — and their source documents — reachable solely through low-confidence or time-expired edges leaked into results, diverging from InMemoryWorldGraphBackend on confidence-filtered and time-travel (as_of) queries. Prune the node/document traversal with the same per-path validity predicate the in-memory BFS uses, and record relation-provenance documents against both edge endpoints (MENTIONS) so document parity holds too. Verified for parity against a live Neo4j via testcontainers; regression test fails on the pre-fix code. Also documents the WorldModelRAG Neo4j/Memgraph backend (#823) in the changelog. Closes #826. Co-authored-by: Abhay Krishna <[email protected]>
Add an `integration` dependency-group (testcontainers, neo4j, networkx, kuzu) and a dedicated CI job that installs it and runs the container-backed retrieval tests for real. testcontainers was previously undeclared and no CI job installed these backends, so every Neo4j/Kuzu/property-graph test skipped in CI — which is how the #826 parity bug reached main. The fast `test` job stays lean. Closes #827. Co-authored-by: Abhay Krishna <[email protected]>
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.
Summary
Post-merge follow-up to #823 (WorldModelRAG). Two separate concerns:
1. Fix Neo4j backend parity bug — closes #826
Neo4jWorldGraphBackend.query_subgraphapplied themin_confidence/as_offilters only to the returned edges, not to the node/document traversal. So theneo4j/memgraphbackend returned entities (and their source documents) reachable only through low-confidence or time-expired edges — diverging fromInMemoryWorldGraphBackendon confidence-filtered and time-travel queries.all(r IN rels WHERE …)), matching the in-memory BFS.upsert_relationnow writesMENTIONSfor both endpoints, so relation-provenance documents match too (a second, related parity gap).2. Run testcontainers integration tests in CI — closes #827
The bug reached
mainbecause the only Neo4j test wastestcontainers-gated andtestcontainerswas never a declared dependency — so it skipped in CI. Added anintegrationdependency-group + a dedicated CIintegrationjob that runs the container-backed retrieval tests for real (GitHub runners have Docker). The fasttestjob stays lean.Verification (real backends, not mocks)
31 passedacrosstest_world_model.py+test_property_graph.pywith live Neo4j + Kuzu containers.assert 'Bravo' not in {'Alpha','Bravo','Charlie','Delta'}— the expired-edge node leaked) and passes on the fix.Commits (separated by concern)
fix(retrieval): filter Neo4j subgraph nodes and documents by confidence/as_of (#826)ci(test): run testcontainers integration tests in CI (#827)