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
  • DSL import support with Slim-backed LLM nodes
  • 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.14 is currently unsupported because unstructured, which backs part of the document extraction stack, currently declares Requires-Python: <3.14.

Set up the repository

just dev
source .venv/bin/activate
just test

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

Run the Example Workflows

The repository includes minimal runnable Slim LLM examples at examples/slim_llm.

Both versions execute this workflow:

start -> llm -> answer

To run it:

just dev
source .venv/bin/activate
cd examples/slim_llm
cp credentials.example.json credentials.json
python3 dsl.py "Reply with only the word Graphon."
python3 code.py "Reply with only the word Graphon."

Before running the example, fill in the required values in credentials.json.

The example currently expects:

  • OpenAI-compatible model credentials in model_credentials
  • slim.mode set to either local or remote
  • dify-plugin-daemon-slim in PATH, SLIM_BINARY_PATH, or a local slim binary in the example directory
  • for remote mode, daemon_addr and daemon_key

For the exact credential shape and runtime notes, see examples/slim_llm/README.md.

How Graphon Fits Together

At a high level, direct 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.

For Dify DSL documents, use graphon.dsl.loads() to build the engine from the workflow YAML and credentials. The resulting engine uses the DSL Slim adapter for LLM nodes:

engine = loads(
    dsl,
    credentials=credentials,
    workflow_id="example-dsl-openai-slim",
    start_inputs={"query": query},
)

events = list(engine.run())

See examples/slim_llm/dsl.py for the DSL import version and examples/slim_llm/code.py for the Python graph construction version.

Default DSL import currently supports start, end, answer, if-else, template-transform, code, llm, tool, http-request, variable-aggregator, assigner, list-operator, question-classifier, and parameter-extractor. HTTP request import covers text request bodies and text responses; file request bodies still require application-level file adapters.

For direct Python graph construction, use graphon.dsl.slim.SlimLLM as the standard Slim-backed LLM runtime. Integrations that need to replace model execution, routing, credential injection, or token counting can implement graphon.protocols.LLMProtocol. A higher-level model factory/resolver layer is planned as a separate follow-up.

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 shared model entities
  • src/graphon/dsl: DSL import support, including Slim-backed runtime adapters
  • 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 just 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_local-1.1.0.tar.gz (470.4 kB view details)

Uploaded Source

Built Distribution

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

graphon_local-1.1.0-py3-none-any.whl (380.5 kB view details)

Uploaded Python 3

File details

Details for the file graphon_local-1.1.0.tar.gz.

File metadata

  • Download URL: graphon_local-1.1.0.tar.gz
  • Upload date:
  • Size: 470.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for graphon_local-1.1.0.tar.gz
Algorithm Hash digest
SHA256 56f619b8186cf5b3ace5e62050500f3a62040d01d3bb5fef225acbea2c7306c6
MD5 bafdca0d239214424fd217b0c23a69e2
BLAKE2b-256 10b4b00c7144bf5bbd7074b618e724680b509d971d132d04f78aeb8ca6d25e32

See more details on using hashes here.

File details

Details for the file graphon_local-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: graphon_local-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 380.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for graphon_local-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b79f5ccb2c0f346447a700896e75c0f6cbd0dbb291bf8f3f6546e8a5a16dc7bc
MD5 a9e7b3ec65c22482e475effd2b5a04a3
BLAKE2b-256 b6c4cdab8432f13372c6e1d8f6403d2739ce6e173ef99266f7314196dd31f1b4

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