Skip to main content

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

ragleap-graph write/read/hybrid-retrieval 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.

Operations

ragleap-graph is a knowledge-graph retrieval library, not a database administration tool. Backup and restore of the underlying Neo4j database are explicitly the operator's responsibility, not something this library wraps or automates -- see docs/operations/backup-and-restore.md for a concrete, tested procedure using Neo4j's native neo4j-admin tooling, and docs/adr/0001-backup-restore-ownership.md for the reasoning behind this scope decision.

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.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ragleap-graph 0.9.0
File Size Uploaded
ragleap_graph-0.9.0.tar.gz 96.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ragleap-graph 0.9.0
File Interpreter ABI Platform
ragleap_graph-0.9.0-py3-none-any.whl Python 3 none any Details

Total release size: 133.4 kB

Release files / ragleap_graph-0.9.0.tar.gz

Download URL ragleap_graph-0.9.0.tar.gz
Size 96.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6562a052af004cbb01e4c60b74b02252227b5f34e1fd746deb828984270e46a6
BLAKE2b-256 checksum
How to use checksums
58c9ef8d259195dbcf373bd16241e6b679b5e4f5882ab6f057d8fa2aa1325911
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 12, 2026.

Transparency log

Release files / ragleap_graph-0.9.0-py3-none-any.whl

Download URL ragleap_graph-0.9.0-py3-none-any.whl
Size 36.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b0918a93b27d9d9603848d1afa5b502feff222d8d1eac4be2dcd399f939a1d1
BLAKE2b-256 checksum
How to use checksums
c4900469d0499a3afc47980918cbff87ea92d459c4f79d17b77bbabb88c63db5
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 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.9

2 release files

0.6.8

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page