Skip to main content

An agent factory with dynamic DAG scheduling for multi-agent task coordination

Project description

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.

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

cascade_auto-0.4.10.tar.gz (155.7 kB view details)

Uploaded Source

Built Distribution

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

cascade_auto-0.4.10-py3-none-any.whl (90.9 kB view details)

Uploaded Python 3

File details

Details for the file cascade_auto-0.4.10.tar.gz.

File metadata

  • Download URL: cascade_auto-0.4.10.tar.gz
  • Upload date:
  • Size: 155.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cascade_auto-0.4.10.tar.gz
Algorithm Hash digest
SHA256 fec06ff81881329d0763ed72a8859acd135c7a5760a0b14cb37246d020d4d6d7
MD5 8d1fc7891eabf3d63f5ee2e1513ac9cf
BLAKE2b-256 0a1a0d182f9f080162a2840e61b26c5c2c9d0412fc77e2cdc8ae30965988032a

See more details on using hashes here.

Provenance

The following attestation bundles were made for cascade_auto-0.4.10.tar.gz:

Publisher: publish.yml on autoseek-ai/Cascade

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

File details

Details for the file cascade_auto-0.4.10-py3-none-any.whl.

File metadata

  • Download URL: cascade_auto-0.4.10-py3-none-any.whl
  • Upload date:
  • Size: 90.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cascade_auto-0.4.10-py3-none-any.whl
Algorithm Hash digest
SHA256 3a88502548a8ce02f0eea187f950fa64ab925deb0a4b03e55956b3afc2f7067d
MD5 a68058b84f787f27700aade1aa0e05ff
BLAKE2b-256 75aed0389f748e88e02691bafabad835a6514738524b0bb710745a77eb61495b

See more details on using hashes here.

Provenance

The following attestation bundles were made for cascade_auto-0.4.10-py3-none-any.whl:

Publisher: publish.yml on autoseek-ai/Cascade

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