Skip to content

Dev - #82

Merged
AsphodelRem merged 44 commits into
mainfrom
dev
Jul 25, 2026
Merged

Dev#82
AsphodelRem merged 44 commits into
mainfrom
dev

Conversation

@AsphodelRem

@AsphodelRem AsphodelRem commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Release 0.0.4: dev → main

This release introduces a major storage layer update with a new Neo4j backend,
significantly improves retrieval performance through batched and streaming
execution, and includes a number of stability and correctness fixes.

Highlights

  • Neo4j backend: Added a pluggable Neo4j graph storage implementation alongside the default NetworkX backend.
  • Batched & streaming search: All search engines (Local, Global, Naive, and Mix) now support shared batched retrieval and batched LLM generation. Added stream_query for streaming responses.
  • Vector storage improvements
    • Configurable dense vector distance metric (cosine or dot)
    • ~3× faster Qdrant uploads using models.Batch
    • Native batched vector search for improved throughput

Breaking changes

  • BaseGraphStorage.get_edges, Index.get_edges, and KnowledgeGraph.get_relations now return List[List[Edge]] instead of List[Optional[Edge]], reflecting native multigraph support where multiple edges may exist between the same pair of nodes.
  • neo4j is now a standard dependency instead of an optional extra.

Bug fixes

  • Fixed incorrect vector ordering returned by get_points_by_ids.
  • Made storage writes atomic using temporary files and os.replace.
  • Fixed community summaries reappearing after empty reclustering.
  • Fixed overly strict embedding dimension validation.
  • Fixed module list aliasing in KnowledgeGraph.
  • Added a guard against None edges during retrieval.

Co-authored-by: Yulia Vyaznikova twthlmn898@gmail.com

AsphodelRem and others added 30 commits June 29, 2026 00:59
* 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>
@AsphodelRem
AsphodelRem merged commit ce2eae8 into main Jul 25, 2026
0 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants