Skip to main content

Cascade

CI License Python

English | 中文 | 日本語 | Español

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) and promise (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 reason for 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
r = cascade.claim("agent-001")

# Complete with context that flows to downstream agents
# Framework auto-injects produced_at and git_ref into critical
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"],
        "produced_at": 1778050765.98,
        "git_ref": "a3f8c2e..."
      }
    }
  }]
}

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. All methods return Result; typed projections via TaskView.from_result() and NodeInfo.list_from_result(). The underlying tool layer uses (StorageProtocol, 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/        # 298 tests
uv run ruff check src tests  # lint

Documentation

License

Apache-2.0 — see LICENSE.

Release files for cascade-auto 0.4.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cascade-auto 0.4.14
File Size Uploaded
cascade_auto-0.4.14.tar.gz 225.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cascade-auto 0.4.14
File Interpreter ABI Platform
cascade_auto-0.4.14-py3-none-any.whl Python 3 none any Details

Total release size: 333.0 kB

Release files / cascade_auto-0.4.14.tar.gz

Download URL cascade_auto-0.4.14.tar.gz
Size 225.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d67feb68feafa0228c5e5ce3ba03db2d0423a28af0cc5ebfe003b4fa5f3886fb
BLAKE2b-256 checksum
How to use checksums
1518313fb706ac741453fa60819cac3daeda34ca5acb58b5592c5498011cbea6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 10, 2026.

Transparency log

Release files / cascade_auto-0.4.14-py3-none-any.whl

Download URL cascade_auto-0.4.14-py3-none-any.whl
Size 107.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
93c4e312b9db6c9afa667113fab8ac22b2e25b1a30012ceafee938c811e07634
BLAKE2b-256 checksum
How to use checksums
bcd535de6acd43d2f347c3d653fe03faf78582775b6224cbe516440dc92c59bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.14 This release

2 release files

0.4.13

2 release files

0.4.12

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page