kgeval
kgeval is an evaluation framework for knowledge graphs.
It measures the quality of the knowledge graphs behind GraphRAG and other retrieval-augmented generation (RAG) applications, and reports every defect with the nodes and relationships involved. It reads Neo4j graphs from LLM Graph Builder, neo4j-graphrag, LangChain, LlamaIndex, Microsoft GraphRAG, and Graphiti without configuration, and scores them with deterministic metrics and with an LLM as a judge.
Features
- Score a graph on 29 built-in metrics
- Define custom metrics in one sentence
- Trace every finding to the nodes and relationships involved
- Run reference-free and reference-based evaluation
- Compare evaluation runs over time
- Unit test graph quality in CI with pytest
Requirements
- Python 3.11+
- Neo4j 5.10+ or Aura, or a graph snapshot
Installation
pip install kgeval
Usage
CLI
kgeval run
Python
import kgeval
from neo4j import GraphDatabase
with GraphDatabase.driver("<uri>", auth=("<username>", "<password>")) as driver:
graph = kgeval.Neo4jSource(driver).load()
report = kgeval.evaluate(graph)
print(report.to_markdown())
pytest
import kgeval
from neo4j import GraphDatabase
def test_entities_are_unique():
with GraphDatabase.driver("<uri>", auth=("<username>", "<password>")) as driver:
graph = kgeval.Neo4jSource(driver).load()
kgeval.assert_passes(graph, [kgeval.EntityUniqueness(threshold=0.95)])
Metrics
| Metrics | Evaluate |
|---|---|
| Intrinsic | Uniqueness, connectivity, naming, provenance, consistency, and coverage |
| Schema | Conformance and completeness |
| Reference | Graph precision, recall, F1, and answerability |
| Model | Accuracy, resolution, disambiguation, and extraction completeness |
| Retrieval | Retriever precision and recall |
See the metrics guide for the full list.
Documentation
For the full guide, see the documentation. For a complete walkthrough, see the example notebook.
Metadata
Release files for kgeval 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| kgeval-0.2.0.tar.gz | 84.5 kB | With provenance | Details for kgeval-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| kgeval-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for kgeval-0.2.0-py3-none-any.whl |
Total release size: 199.1 kB
Release files / kgeval-0.2.0.tar.gz
| Download URL | kgeval-0.2.0.tar.gz |
|---|---|
| Size | 84.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d129ef3530a39e3a0e97baae8de06f51a266ecc66b5c587a1259f606f51eb3e7
|
|
BLAKE2b-256 checksum How to use checksums |
f34ac5917c23d11b2d3768e51a9e8a53d858c092d569d0564d81164f627d851b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 27, 2026.
Transparency logRelease files / kgeval-0.2.0-py3-none-any.whl
| Download URL | kgeval-0.2.0-py3-none-any.whl |
|---|---|
| Size | 114.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aec659b9204b1d5995bcf6849a491fc0f98577b9df8a7cb6ae37b855a6667468
|
|
BLAKE2b-256 checksum How to use checksums |
87287ed303e3637861be94c63ad15652dd8d7016a075ba47321b47a725475fab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 27, 2026.
Transparency logSecurity for kgeval 0.2.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for kgeval-0.2.0.tar.gz
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 Nov 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.