A DOT-based pipeline runner for AI workflows
Project description
Attractor
A DOT-based pipeline runner that uses directed graphs (defined in Graphviz DOT syntax) to orchestrate multi-stage AI workflows.
Overview
Attractor lets you define multi-stage AI workflows as directed graphs using Graphviz DOT syntax. The graph is the workflow: nodes are tasks, edges are transitions, and attributes configure behavior.
Based on the Attractor Specification.
Features
- Declarative pipelines defined in DOT syntax
- Pluggable handlers for different node types (LLM calls, conditionals, human gates)
- Checkpoint and resume for crash recovery
- Goal gates to enforce critical stages
- Edge-based routing with conditions and priorities
- Retry logic with exponential backoff
- Comprehensive validation and linting
Installation
pip install -e .
Quick Start
Create a simple pipeline in example.dot:
digraph Simple {
graph [goal="Run tests and report"]
start [shape=Mdiamond, label="Start"]
exit [shape=Msquare, label="Exit"]
run_tests [label="Run Tests", prompt="Run the test suite"]
report [label="Report", prompt="Summarize results for $goal"]
start -> run_tests -> report -> exit
}
Run the pipeline:
# Validate the pipeline
python -m attractor.cli example.dot --validate-only
# Execute the pipeline
python -m attractor.cli example.dot
Or use the Python API:
from attractor import parse_dot, run_pipeline
graph = parse_dot("example.dot")
outcome = run_pipeline(graph)
print(f"Pipeline completed with status: {outcome.status.value}")
Documentation
- Usage Guide - Detailed usage and examples
- Attractor Specification - Complete specification
Testing
# Run all tests
pytest tests/
# Run with verbose output
pytest tests/ -v
Currently 27 tests passing, including:
- DOT parser tests
- Validation and linting tests
- Execution engine tests
- Condition evaluation tests
- Integration tests matching the spec's smoke test
Examples
See the examples/ directory for complete working pipelines:
simple.dot- Basic linear workflowbranching.dot- Conditional branching with goal gates
Implementation Status
Core features implemented:
- ✅ DOT parser for the supported subset
- ✅ Validation with 7 built-in lint rules
- ✅ Execution engine with retry logic and checkpointing
- ✅ Edge selection with 5-step priority algorithm
- ✅ Condition evaluation (=, !=, && operators)
- ✅ Basic handlers (start, exit, codergen, conditional)
- ✅ CLI interface
- ✅ Variable expansion ($goal)
Not yet implemented:
- ⏳ Human-in-the-loop (hexagon nodes)
- ⏳ Parallel execution (component nodes)
- ⏳ Model stylesheet
- ⏳ HTTP server mode
- ⏳ Observability events
License
MIT
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_attractor-0.2.0.tar.gz.
File metadata
- Download URL: py_attractor-0.2.0.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df6bfd329e639b59c5728962aafa2f67085347c34435ad7ac5dfc3593f509f0a
|
|
| MD5 |
2261882fc9afa07f2e2b58b9e45accc9
|
|
| BLAKE2b-256 |
f3fb22eb4510f4dfd3c15e0e0f5d14f651e0bd7ed1fd94ee4da3b278d7dba474
|
Provenance
The following attestation bundles were made for py_attractor-0.2.0.tar.gz:
Publisher:
publish.yml on anishkny/attractor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_attractor-0.2.0.tar.gz -
Subject digest:
df6bfd329e639b59c5728962aafa2f67085347c34435ad7ac5dfc3593f509f0a - Sigstore transparency entry: 927284320
- Sigstore integration time:
-
Permalink:
anishkny/attractor@89644a3a0fd78654b01a11ccca1d46a06c0bd68b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/anishkny
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@89644a3a0fd78654b01a11ccca1d46a06c0bd68b -
Trigger Event:
push
-
Statement type:
File details
Details for the file py_attractor-0.2.0-py3-none-any.whl.
File metadata
- Download URL: py_attractor-0.2.0-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afdba8a6de0c5bdd94394302133c92de71cd58ade045651d801116fad1e1bd5f
|
|
| MD5 |
405e01a8ba36feddd706c5bb43cfba27
|
|
| BLAKE2b-256 |
e8f721153d0bfcac0472653f9e7e96581410638b991cabfd18e89a47f6d9bd0d
|
Provenance
The following attestation bundles were made for py_attractor-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on anishkny/attractor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
py_attractor-0.2.0-py3-none-any.whl -
Subject digest:
afdba8a6de0c5bdd94394302133c92de71cd58ade045651d801116fad1e1bd5f - Sigstore transparency entry: 927284321
- Sigstore integration time:
-
Permalink:
anishkny/attractor@89644a3a0fd78654b01a11ccca1d46a06c0bd68b -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/anishkny
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@89644a3a0fd78654b01a11ccca1d46a06c0bd68b -
Trigger Event:
push
-
Statement type: