Skip to main content

Open-source claim verification engine for high-stakes decisions

Project description

⛏️ Graphite

Open-source claim verification engine for high-stakes decisions.

Turn documents into structured claims with provenance, then verify whether downstream assertions are actually grounded in evidence.

License Python

⚠️ v0.3.x — Experimental. Usable and tested, but API may change before 1.0. Pin your version.


10 lines to your first verified claim

from graphite import Claim, ClaimStore, ClaimType, Provenance
from graphite.enums import SourceType, ConfidenceLevel

# 1. Extract a claim from a document
claim = Claim(
    subject_entities=["company:TSMC"],
    predicate="SUPPLIES_TO",
    object_entities=["company:NVDA"],
    claim_text="TSMC supplies advanced CoWoS packaging to Nvidia.",
    claim_type=ClaimType.RELATIONSHIP,
    supporting_evidence=[Provenance(
        source_id="tsmc-10k-2024",
        source_type=SourceType.SEC_10K,
        evidence_quote="The Company provides advanced packaging services including CoWoS.",
        confidence=ConfidenceLevel.HIGH,
    )],
)

# 2. Persist to a claim registry
store = ClaimStore(db_path="/tmp/demo.db")
store.save_claim(claim)

# 3. Query: does anyone supply to Nvidia?
results = store.search_claims(object_contains="NVDA")
for c in results:
    print(f"{c.claim_text}  [{c.supporting_evidence[0].source_id}]")

Every claim is traceable: source, quote, confidence. No black-box assertions.

See examples/quickstart_verification/ for a fully runnable example.


Quickstart

pip install graphite-engine

Or from source:

git clone https://github.com/graf-research/graphite.git
cd graphite
pip install -e .
python examples/quickstart_verification/run.py

No database. No LLM. No API keys. Start local, stay local.


Why Graphite?

Graphite is built for domains where being wrong is expensive: financial research, regulatory compliance, infrastructure risk.

Problem Most tools Graphite
Unverifiable claims Assertions without audit trail Every claim carries Provenance: source, quote, confidence
No trust scoring Binary pass/fail Explainable ConfidenceScorer with named factors
Opaque pipelines Fragile chains, no persistence ClaimStore with SQLite-backed registry + search

Core primitives

Primitive What it does
Claim The atomic unit of trust — structured assertion with provenance
ClaimStore SQLite-backed registry for persisting and querying claims
Provenance First-class evidence source: document, quote, confidence
ConfidenceScorer Explainable confidence scoring with named factors
BaseFetcher / BaseExtractor Plugin interface for domain-specific extraction

What belongs where

Graphite (engine) Your application
Claim schemas & enums Domain-specific extractors
Claim registry (ClaimStore) Extraction prompts & calibration
Confidence scoring Verification logic
Plugin interfaces (Fetcher, Extractor) UI, API, alerts

Also included: graph assembly & propagation

Graphite also provides graph assembly and shock propagation for supply chain analysis:

from graphite import GraphAssembler, top_k_paths_from_source, build_blast_radius

edges = my_extractor.extract(documents)
G = GraphAssembler().assemble(edges)

paths, _ = top_k_paths_from_source(G, source="country:CD", max_hops=3, k=3)
blast = build_blast_radius(paths, k=3)

See examples/toy_battery_demo/ and examples/flood_replay_demo/ for end-to-end examples.


Built with Graphite: EdgarOS

EdgarOS is the first commercial application built on Graphite — a verification engine for AI-generated financial research memos against SEC evidence.

EdgarOS — verification results with grounding levels and evidence status

  • 📄 Claim verification — every memo claim graded against SEC filings
  • 🔍 Two-axis verdicts — grounding level + evidence conflict detection
  • ⚖️ Explainable scoring — provenance-traced confidence with reason codes

Building on Graphite? Open an issue to get featured.


Benchmark

In EdgarOS benchmark runs built on Graphite primitives:

Metric Score
Conservative Precision 90.5%
Weakest-Link Top-1 Accuracy 69.0%
False Contradiction Rate 0.0%
Neutral Precision 91.7%

100 synthetic memos, 320 claims, evaluated against gold-labeled verdicts. Full methodology and eval harness in the EdgarOS repo.


Optional extras

Core (always included): networkx + pydantic

pip install -e ".[llm]"     # Gemini structured extraction
pip install -e ".[neo4j]"   # Neo4j graph storage
pip install -e ".[pdf]"     # PDF parsing
pip install -e ".[all]"     # Everything

License

Apache-2.0 — see LICENSE.

Project details


Download files

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

Source Distribution

graphite_engine-0.3.0.tar.gz (59.8 kB view details)

Uploaded Source

Built Distribution

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

graphite_engine-0.3.0-py3-none-any.whl (56.1 kB view details)

Uploaded Python 3

File details

Details for the file graphite_engine-0.3.0.tar.gz.

File metadata

  • Download URL: graphite_engine-0.3.0.tar.gz
  • Upload date:
  • Size: 59.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.1

File hashes

Hashes for graphite_engine-0.3.0.tar.gz
Algorithm Hash digest
SHA256 36730bbc8d9b4c9184bb06f5abdd90b5b5306a404448e772884cf1edf3f148f3
MD5 2be8df89a2eb736139d8d1e3265b86a2
BLAKE2b-256 d619d964ec7771fdc314c07f3253e4aad4bcd9466b6cdab84d1d88b122ceaa76

See more details on using hashes here.

File details

Details for the file graphite_engine-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for graphite_engine-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dab84e19ee0d545a21755d37babb43226594c51ff607765f3b23ffa0d10453f2
MD5 d5fd63a42229f9b765603d5fb40ebe1b
BLAKE2b-256 e114e4f520b564017c346772367aa34afd5d592ac63b9300ac7942a6f73b2fb4

See more details on using hashes here.

Supported by

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