Skip to main content

An idea-graph engine: turn articles into a navigable graph of statements and their relationships

Project description

ideagraph

Python CI pre-commit.ci status Documentation Status codecov PyPI Version Python Versions License Ruff DOI SPEC 0 — Minimum Supported Dependencies

ideagraph is an idea-graph engine for scientific writing and reading.

It turns an article into a reusable asset: a graph whose nodes are the article's statements (its ideas) and whose edges are the relationships between them — elaboration, contrast, dependence, citation. The graph is structured data that lets humans and AI agents navigate the relationships of ideas quickly, track a draft's structure and gaps, and connect ideas across articles.

Building the graph is a judgement call — deciding what counts as a statement, and how statements relate, is left to a human or an LLM driving the same CLI. ideagraph provides the framework, storage, and navigation, not automatic extraction. Every interface is machine-readable so humans and agents share one tool.

Provenance is one built-in layer: a statement can carry evidence, be validated against it, and be flagged stale when that evidence changes — but it is a facet of a statement node, not the whole story.

ideagraph was previously released as ClaimKit. The claimkit import and CLI still work as a deprecated alias and will be removed in a future release.

Core concepts

  • Statement — a unit of meaning in an article: a typed node (claim, finding, background, method, definition, motivation, result, …) with a stable id, text, and metadata. claim is one statement type, not the whole model.
  • Relation — a typed, directed edge between statements: discourse links (elaborates, contrasts, depends_on, cites, motivates) and provenance links.
  • Evidence — a link from a statement to an artefact (code, data, a run, literature, …) that supports, refutes, or contextualises it.
  • Activity — a process (computation, measurement, analysis, review) that consumed and produced artefacts.
  • ProvenanceGraph — the container of nodes and edges; supports traversal, coverage, validation, staleness detection, and reporting.

An asserting statement's provenance status is one of unresolved, valid, invalid, stale, or needs_review.

Installation

pip install ideagraph

Requires Python 3.12+.

Command-line quickstart

Build a graph, link evidence, and check it — all from the terminal:

ideagraph init graph.json
CLAIM=$(ideagraph add-claim graph.json "Half-life measured at 5.2 days." --tag decay)
ideagraph add-evidence graph.json "$CLAIM" \
    --kind workflow --reference run-42 --digest sha256:abc123

ideagraph validate graph.json            # resolve status from evidence
ideagraph stale graph.json               # flag claims whose artefacts changed
ideagraph report graph.json              # human-readable Markdown report
ideagraph export graph.json -o prov.json # export to W3C PROV-JSON
ideagraph import prov.json restored.json # import PROV-JSON back into a graph

validate and stale accept --json for machine-readable output; report and export accept -o to write to a file. Run ideagraph --help for the full command list.

Python quickstart

from ideagraph import (
    Claim, Evidence, EvidenceKind, NodeType,
    ProvenanceGraph, ProvenancePredicate, ProvenanceRelation,
    validate_claim, render_report,
)

graph = ProvenanceGraph()
graph.add_claim(Claim(statement="Half-life measured at 5.2 days.", id="c1"))
graph.add_evidence(
    Evidence(claim_id="c1", kind=EvidenceKind.WORKFLOW, reference="run-42", id="e1")
)
graph.add_relation(
    ProvenanceRelation(
        subject_type=NodeType.CLAIM, subject_id="c1",
        predicate=ProvenancePredicate.SUPPORTED_BY,
        object_type=NodeType.EVIDENCE, object_id="e1",
    )
)

result = validate_claim(graph, "c1")
print(result.status, "—", result.reason)   # valid — supported by 1 piece(s) of evidence
print(render_report(graph))

Interoperability

ideagraph graphs serialise to a versioned JSON format for storage (save_graph / load_graph) and export to / import from W3C PROV-JSON (to_prov / from_prov) for interchange with the wider provenance ecosystem.

License

BSD 3-Clause. 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

ideagraph-1.0.0.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

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

ideagraph-1.0.0-py3-none-any.whl (927.5 kB view details)

Uploaded Python 3

File details

Details for the file ideagraph-1.0.0.tar.gz.

File metadata

  • Download URL: ideagraph-1.0.0.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.30 {"installer":{"name":"uv","version":"0.11.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ideagraph-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c1754b85e7421959975c348f80da66b922decaea14fc5d4b9abdd825e951357b
MD5 2827724c21a8f6298ce73304217b4649
BLAKE2b-256 6288f6cd77b9ba8c5e20791b149231b3400d8b30895ee35924546aae906f0cdf

See more details on using hashes here.

File details

Details for the file ideagraph-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ideagraph-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 927.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.30 {"installer":{"name":"uv","version":"0.11.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ideagraph-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3354dab4629ec6f4d1ae38ef847f48c4cc2ebbbc400855cea88c41ced9ec5037
MD5 0cdcbb42be1c910e4aa90b51a5197384
BLAKE2b-256 2224c232b472b31259b60f39e0fa410c142711ecdabbc2a9905ef6b4bc1b2ad9

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