ragleap-graph (Java)
An early, partial Java port of the ragleap-graph Neo4j graph index, published to Maven Central. Regex entity extraction, document upsert, and relation, lineage and entity queries over the Neo4j HTTP Query API.
Install
<dependency> <groupId>io.github.antonyrag</groupId> <artifactId>ragleap-graph</artifactId> <version>0.1.0</version> </dependency>
Requires Java 21. The only runtime dependency is jackson-databind. You need a Neo4j server with the HTTP Query API; only Neo4j 5.26 Community has been tested.
What is in 0.1.0
- Entity-name normalization, regex entity extraction and composite keys, with Python-compatible string handling
GraphIndex.upsertDocument: the full write path, with retries on transient errors, old-relation cleanup and an optional audit hook- Queries:
findDocumentsByEntities,documentEntities,searchRelatedEntities,findRelations,findLineageandfindEntitiesByType - Talks to Neo4j over the HTTP Query API v2 through a small
CypherRunnerinterface, with no Bolt driver.GraphConfigtakes an HTTP URL, not a Bolt URI. If the server cannot be reached, methods return empty results, like the Python package
Types in the package
The package com.ragleap.graph contains GraphIndex, GraphConfig, CypherRunner, QueryApiRunner, AuditSink, UpsertPlanner, UpsertSummary, EntityExtraction, EntityRef, TypedEntity, CompositeKey, PyText, DocumentHit, RelatedEntity, RelationHit, LineageEntry, GraphException and GraphTransientException. Signatures are in the source.
How it was verified
- Compared with the real Python
ragleap-graph0.9.0, pinned at commit 226fa4d: 252 pure-logic cases, 14 upsert scenarios and 47 query scenarios. For the scenarios, the Cypher statements, parameters (int versus float), return values and audit events had to match. A mutation check confirmed the parity tests fail when behaviour differs - 47 tests in the release build: 0 failures, 13 skipped (the parity and live tests skip when their environment variables are unset, as in CI)
- Live tests passed against Neo4j 5.26.29 Community
- After release, the published jar was resolved from Maven Central in a clean project and one document was upserted into a live Neo4j
Limits
Verified only on Neo4j 5.26.29 Community, on a single server (bookmarks are not passed along).
Not ported yet
- LLM entity extraction, entity deduplication and LLM relation extraction (regex extraction only)
GraphRetriever(hybrid vector and graph retrieval)- Backfills and the migration runner
- The Postgres audit writer (a no-op audit sink is the default)