An agent factory with dynamic DAG scheduling for multi-agent task coordination
Project description
Cascade
An agent factory with dynamic DAG scheduling. Orchestrators build and adapt task graphs in real time while stateless workers claim, execute, and deliver — coordinating through contracts on edges and attributed context flow.
Key Features
- Dynamic DAG — split, rework, refine, remove tasks mid-execution
- Attributed context — each upstream contribution kept separate with provenance (path, distance, contract)
- Contract-driven edges — every edge carries
expectation(consumer needs) andpromise(producer delivers) - Critical path scheduling — READY tasks prioritized by downstream depth
- Cancellation protocol — pull (check token) or push (CancelNotifier) across processes
- ACTIVE protection — cannot remove/split nodes with active agents
- Event sourcing — every mutation recorded with optional
reasonfor audit
Installation
# As a CLI tool
pipx install cascade-auto
# or
uv tool install cascade-auto
# As a Python library
pip install cascade-auto
For development:
git clone https://github.com/autoseek-ai/Cascade.git
cd Cascade
uv sync
Quick Start
from cascade import CascadeClient, Contract
cascade = CascadeClient()
# Build a task graph — split horizontally for parallelism
cascade.add("analyze")
cascade.add("design", deps={
"analyze": Contract("Feature requirements and constraints", "Deliver prioritized feature list"),
})
# Agent claims a task — critical path first
task = cascade.claim("agent-001")
# Complete with context that flows to downstream agents
cascade.complete("analyze",
summary="Requirements: JWT auth + REST API",
critical={"auth_type": "JWT", "endpoints": ["/users", "/posts"]},
)
When agent-002 claims design, it sees:
{
"upstream": [{
"node_id": "analyze",
"state": "COMPLETED",
"distance": 1,
"expectation": "Feature requirements and constraints",
"promise": "Deliver prioritized feature list",
"delivered": {
"summary": "Requirements: JWT auth + REST API",
"critical": {"auth_type": "JWT", "endpoints": ["/users", "/posts"]}
}
}]
}
No merging, no overwriting — each upstream source is a separate entry.
Architecture
types → core → context → view → operations → tools → client
| Package | Purpose |
|---|---|
types |
Value types: Contract, Context, ContextEntry, TokenStatus |
core |
Cascade graph, Node, NodeState (6-state FSM) |
context |
BFS ancestor propagation + cancellation (in-process) |
view |
Upstream view builder (get_node_view) |
events |
Append-only event log (14 event types) |
operations |
Compound mutations: Split, Remove, Rework |
storage |
JSON persistence + file locking + token store |
tools |
12 LLM-facing functions — the dict-based serialization boundary |
client |
CascadeClient — typed Python API wrapping tools with IDE support |
Tools
The typed Python API is CascadeClient. The underlying tool layer uses (GraphStorage, dict) → dict signatures for CLI and JSON boundaries.
| Category | Tools |
|---|---|
| Structure | add_node, remove_node, split_node, refine_node, edit_node |
| Execution | get_task, finish_task |
| Feedback | rework |
| Cancellation | check_task |
| Monitoring | check_timeouts |
| Query | list_nodes, history |
All mutation tools support reason for event log audit.
Context Flow
Three channels, each upstream entry attributed with provenance:
| Channel | Propagation | Use for |
|---|---|---|
critical |
Indefinite | Structured KV data (decisions, configs) |
summary |
2 hops | Brief text description |
artifacts |
Indefinite | Full documents, code, specs |
Cancellation
One semantic, two implementations:
| Scenario | Mechanism |
|---|---|
| Cross-process (CLI, multi-machine) | TokenStore — file-backed .cascade/tokens/ |
| In-process (framework embedding) | CancellationToken — memory, instant callbacks |
Both use the CancelNotifier protocol for push notifications.
Running Tests
uv run pytest tests/ # 196 tests
uv run ruff check src tests # lint
Documentation
- Guide — comprehensive usage walkthrough
- Architecture — system design, state machine, Mermaid diagrams
- CONTRIBUTING.md — development guidelines
- SECURITY.md — vulnerability reporting and security model
License
Apache-2.0 — see LICENSE.
Project details
Release history Release notifications | RSS feed
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 cascade_auto-0.4.8.tar.gz.
File metadata
- Download URL: cascade_auto-0.4.8.tar.gz
- Upload date:
- Size: 144.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
331ec317a2a60f6753f52b3c826296fed27db3799c94b0b3438d04855fa30642
|
|
| MD5 |
2ea566f9ef8f320279ec71be59c1f8df
|
|
| BLAKE2b-256 |
b2fa6c5d7b11a77edda84ced0cfe8b5f55eab4510267b3760c09f24e6ba53cce
|
Provenance
The following attestation bundles were made for cascade_auto-0.4.8.tar.gz:
Publisher:
publish.yml on autoseek-ai/Cascade
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cascade_auto-0.4.8.tar.gz -
Subject digest:
331ec317a2a60f6753f52b3c826296fed27db3799c94b0b3438d04855fa30642 - Sigstore transparency entry: 1447169622
- Sigstore integration time:
-
Permalink:
autoseek-ai/Cascade@5fd6176ac7013e50723a5f5ddc17536780a0fe14 -
Branch / Tag:
refs/tags/v0.4.8 - Owner: https://github.com/autoseek-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5fd6176ac7013e50723a5f5ddc17536780a0fe14 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cascade_auto-0.4.8-py3-none-any.whl.
File metadata
- Download URL: cascade_auto-0.4.8-py3-none-any.whl
- Upload date:
- Size: 84.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9e7cdb6e85d102e390bd89ae9d5ea50334dfc145c5dbb081ff1560e75d88400
|
|
| MD5 |
523e747d460d42d29bbe44f5d3b0efd3
|
|
| BLAKE2b-256 |
b3e4ec67104bef74a20223dc5f329ca2f048c787ea651e6707513dbad0e1ba90
|
Provenance
The following attestation bundles were made for cascade_auto-0.4.8-py3-none-any.whl:
Publisher:
publish.yml on autoseek-ai/Cascade
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cascade_auto-0.4.8-py3-none-any.whl -
Subject digest:
d9e7cdb6e85d102e390bd89ae9d5ea50334dfc145c5dbb081ff1560e75d88400 - Sigstore transparency entry: 1447169700
- Sigstore integration time:
-
Permalink:
autoseek-ai/Cascade@5fd6176ac7013e50723a5f5ddc17536780a0fe14 -
Branch / Tag:
refs/tags/v0.4.8 - Owner: https://github.com/autoseek-ai
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5fd6176ac7013e50723a5f5ddc17536780a0fe14 -
Trigger Event:
push
-
Statement type: