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.

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ragleap_graph-0.6.6.tar.gz (51.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ragleap_graph-0.6.6-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

File details

Details for the file ragleap_graph-0.6.6.tar.gz.

File metadata

  • Download URL: ragleap_graph-0.6.6.tar.gz
  • Upload date:
  • Size: 51.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for ragleap_graph-0.6.6.tar.gz
Algorithm Hash digest
SHA256 5961f5b040fecc3f0cc82f29ac6bd3315ed34f16a345b55b9a5fa434d7b59b5d
MD5 a024b0b4d52f932c0973157fffecc434
BLAKE2b-256 cc0a53bfef68ab67b1088fff68edf04a598b49a9bba302e6bc67b963b14d0f0c

See more details on using hashes here.

File details

Details for the file ragleap_graph-0.6.6-py3-none-any.whl.

File metadata

  • Download URL: ragleap_graph-0.6.6-py3-none-any.whl
  • Upload date:
  • Size: 26.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.10.12

File hashes

Hashes for ragleap_graph-0.6.6-py3-none-any.whl
Algorithm Hash digest
SHA256 fe9d92a4fcc25f64ec14ddc2e824440503ecf7af96815d4220d95e87bb11df00
MD5 1b309610c89cfe7f467b7fd83bd3a273
BLAKE2b-256 1cbd20b3d13079eeda3054a74c55d252e7c65bbf1ab56617657aac2eff73c5c5

See more details on using hashes here.

Release history Release notifications | RSS feed

0.6.7

2 files

This release

0.6.6 This release

2 files

0.6.5

2 files

0.6.4

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.4

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page