Fix/deps - #87
Closed
AsphodelRem wants to merge 65 commits into
Closed
Conversation
* add Neo4j graph storage adapter * serialize non-primitive node fields as json and use entity_type as a Neo4j label
The adapters package imported Neo4jStorage unconditionally, which made the optional neo4j driver a hard requirement: without it ragu.graph.index failed to import at all. _json_fields was a dataclass field on Node, so it reached asdict() and broke NetworkX persistence with "'_json_fields' is not a valid key" on write_gml. The adapter now derives JSON-encoded fields from the declared dataclass types, and picks the node label itself, so domain types carry no backend specifics. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Three divergences from NetworkXStorage, each reproduced against a live Neo4j 5.26 before and after the fix: - get_all_edges_for_nodes reported the queried node as the subject, so an incoming edge came back reversed: "Alice works at Acme" read as the opposite - get_node_edges returned outgoing edges only, dropping half of a node's context - MERGE keyed on the type label, so re-upserting an id whose type changed created a second node with the same id; reads then picked an arbitrary one Adds tests/storage/test_graph_contract.py, a shared suite parameterized over every graph backend, so such divergences surface in tests rather than in production. It was red on neo4j and green on networkx before these fixes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
# Conflicts: # examples/README.md # ragu/search_engine/global_search.py
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.
No description provided.