ragleap-graph
Knowledge-graph-augmented retrieval for RAG systems — entity extraction, co-occurrence graphs, and graph-based document retrieval via Neo4j.
pip install ragleap-graph
Quickstart
from ragleap_graph import GraphConfig, GraphIndex
graph = GraphIndex(config=GraphConfig(
uri="bolt://localhost:7687",
user="neo4j",
password="...",
))
graph.upsert_document(
document_id="doc-1",
title="Q3 Report",
chunks=[{"text": "Acme Corp reported strong Q3 revenue growth."}],
)
docs = graph.find_documents_by_entities(["Acme Corp"])
related = graph.search_related_entities(["Acme Corp"], max_depth=2)
Current: v0.6.5 · 87 tests (86 passed, 1 skipped)
Architecture
LLM-based extraction and dedup (v0.2.0+)
The default entity extraction is regex/heuristic-based (fast, free, zero
dependencies). For messier input — e.g. inconsistent capitalization like
"Acme Corp" vs "ACME Corp." — LLM-based extraction and dedup produce
cleaner graphs. Requires the llm extra: pip install ragleap-graph[llm]
from ragleap.generation import ProviderConfig
from ragleap_graph import GraphConfig, GraphIndex, ExtractionConfig
graph = GraphIndex(
config=GraphConfig(uri="bolt://localhost:7687", user="neo4j", password="..."),
extraction=ExtractionConfig(
method="llm",
provider=ProviderConfig(provider="gemini", api_key="...", model="gemini-3.6-flash"),
dedup_enabled=True,
),
)
Note: EntityDeduplicator merges spelling variants of an already-extracted
name; it does not fix fragmentation caused by the regex extractor splitting
one real-world entity into multiple candidates in the first place — see
CHANGELOG.md for a real, measured example of this and how method="llm"
avoids it at the source.
Status
v0.6.5. Ported from a real production GraphService, adapted for standalone open-source use — see HANDOFF.md for the full design history. ragleap-rag >=0.12.0 is an optional dependency, required only for method="llm".
License
MIT
Release files for ragleap-graph 0.6.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ragleap_graph-0.6.9.tar.gz | 80.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ragleap_graph-0.6.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 111.2 kB
Release files / ragleap_graph-0.6.9.tar.gz
| Download URL | ragleap_graph-0.6.9.tar.gz |
|---|---|
| Size | 80.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8c914007532ebb252f9874918d3706e25d2d7a6ce396c637bf207a436be35694
|
|
BLAKE2b-256 checksum How to use checksums |
7402950590b5c890a36cccf1470f6bedc302eba479bf5f53df2084f295abac4d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency logRelease files / ragleap_graph-0.6.9-py3-none-any.whl
| Download URL | ragleap_graph-0.6.9-py3-none-any.whl |
|---|---|
| Size | 30.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f55ad9e267f6a0828929d0e706e28112e0aa3c7e905d7dbc20f6290934956d28
|
|
BLAKE2b-256 checksum How to use checksums |
40289b6991b6dc54c880bbf510a1dc9307f095813953e13721dce65abcf3db34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.
Transparency log