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.7.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.7.0
File Size Uploaded
ragleap_graph-0.7.0.tar.gz 89.1 kB Details

Built distribution (wheel)

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

Total release size: 124.6 kB

Release files / ragleap_graph-0.7.0.tar.gz

Download URL ragleap_graph-0.7.0.tar.gz
Size 89.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4e10ecc8da495460a337c43d7bf60a77fa27558d329c30658965cf0c000b95d1
BLAKE2b-256 checksum
How to use checksums
d49a1eedcc9369fec4f5959400a0c83dbaf54d325af9d5038dd3a546493a6b7e
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 9, 2026.

Transparency log

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

Download URL ragleap_graph-0.7.0-py3-none-any.whl
Size 35.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
836a9783ed9285c3e514ebaedf78c524c9a06d829963e1c04c5eb10423c1cbba
BLAKE2b-256 checksum
How to use checksums
35e0a4fbb918dbbf655b8543cb608c13e82fed1043ea677010e69c4d880051a7
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 9, 2026.

Transparency log

Release history Release notifications | RSS feed

0.9.0

2 release files

0.8.0

2 release files

This release

0.7.0 This release

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