Skip to main content

Graph execution engine for agentic AI workflows.

Project description

Graphon

Graphon is a Python graph execution engine for agentic AI workflows.

The repository is still evolving, but it already contains a working execution engine, built-in workflow nodes, model runtime abstractions, integration protocols, and a runnable end-to-end example.

Highlights

  • Queue-based GraphEngine orchestration with event-driven execution
  • Graph parsing, validation, and fluent graph building
  • Shared runtime state, variable pool, and workflow execution domain models
  • Built-in node implementations for common workflow patterns
  • Pluggable model runtime interfaces, including a local SlimRuntime
  • HTTP, file, tool, and human-input integration protocols
  • Extensible engine layers and external command channels

Repository modules currently cover node types such as start, end, answer, llm, if-else, code, template-transform, question-classifier, http-request, tool, variable-aggregator, variable-assigner, loop, iteration, parameter-extractor, document-extractor, list-operator, and human-input.

Quick Start

Graphon is currently easiest to evaluate from a source checkout.

Requirements

  • Python 3.12 or 3.13
  • uv
  • make

Python 3.14 is currently unsupported because unstructured, which backs part of the document extraction stack, currently declares Requires-Python: <3.14.

Set up the repository

make dev
source .venv/bin/activate
make test

make dev installs the project, syncs development dependencies, and sets up prek Git hooks. make test is the progressive local validation entrypoint: it formats, applies lint fixes, runs ty check, and then runs pytest.

Run the Example Workflow

The repository includes a minimal runnable example at examples/graphon_openai_slim.

It builds and executes this workflow:

start -> llm -> output

To run it:

make dev
source .venv/bin/activate
cd examples/graphon_openai_slim
cp .env.example .env
python3 workflow.py "Explain Graphon in one short sentence."

Before running the example, fill in the required values in .env.

The example currently expects:

  • an OPENAI_API_KEY
  • a SLIM_PLUGIN_ID
  • a local dify-plugin-daemon-slim setup or equivalent Slim runtime

For the exact environment variables and runtime notes, see examples/graphon_openai_slim/README.md.

How Graphon Fits Together

At a high level, Graphon usage looks like this:

  1. Build or load a graph and instantiate nodes into a Graph.
  2. Prepare GraphRuntimeState and seed the VariablePool.
  3. Configure model, file, HTTP, tool, or human-input adapters as needed.
  4. Run GraphEngine and consume emitted graph events.
  5. Read final outputs from runtime state.

The bundled example follows exactly that path. The execution loop is centered around GraphEngine.run():

engine = GraphEngine(
    workflow_id="example-start-llm-output",
    graph=graph,
    graph_runtime_state=graph_runtime_state,
    command_channel=InMemoryChannel(),
)

for event in engine.run():
    ...

See examples/graphon_openai_slim/workflow.py for the full example, including SlimRuntime, SlimPreparedLLM, graph construction, input seeding, and streamed output handling.

Project Layout

  • src/graphon/graph: graph structures, parsing, validation, and builders
  • src/graphon/graph_engine: orchestration, workers, command channels, and layers
  • src/graphon/runtime: runtime state, read-only wrappers, and variable pool
  • src/graphon/nodes: built-in workflow node implementations
  • src/graphon/model_runtime: provider/model abstractions and Slim runtime
  • src/graphon/graph_events: event models emitted during execution
  • src/graphon/http: HTTP client abstractions and default implementation
  • src/graphon/file: workflow file models and file runtime helpers
  • src/graphon/protocols: public protocol re-exports for integrations
  • examples/: runnable examples
  • tests/: unit and integration-style coverage

Internal Docs

Development

Contributor setup, tooling details, CLA notes, and commit/PR conventions live in CONTRIBUTING.md.

CI currently validates pull request titles, runs make check including uv.lock freshness validation, and runs uv run pytest on Python 3.12 and 3.13. Python 3.14 is currently excluded because unstructured does not yet support it.

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

graphon-0.3.1.tar.gz (242.2 kB view details)

Uploaded Source

Built Distribution

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

graphon-0.3.1-py3-none-any.whl (349.4 kB view details)

Uploaded Python 3

File details

Details for the file graphon-0.3.1.tar.gz.

File metadata

  • Download URL: graphon-0.3.1.tar.gz
  • Upload date:
  • Size: 242.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for graphon-0.3.1.tar.gz
Algorithm Hash digest
SHA256 49971baed1eb16c8e1983f755e659902e4f117a68dc62fad19e91472950b937d
MD5 623ffd4f50e11cb365047ba3852a6e38
BLAKE2b-256 5aef43217842e84160acca64a95858f1689389a50e04a53fc94f2aa836b4eaf7

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphon-0.3.1.tar.gz:

Publisher: release.yml on langgenius/graphon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file graphon-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: graphon-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 349.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for graphon-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e6422c7e3f1ce7d2185979c17e08201816ca25d46d400ebdd035c95d501c04fe
MD5 7ebedd219e0a44f14a6520c13d4e0b92
BLAKE2b-256 6237bef16ed3d6da7446b36769fa388f4dc79f95337ffa16d6dfc3177152507e

See more details on using hashes here.

Provenance

The following attestation bundles were made for graphon-0.3.1-py3-none-any.whl:

Publisher: release.yml on langgenius/graphon

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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