Skip to main content

AbstractRuntime

AbstractRuntime is a durable workflow runtime (interrupt → checkpoint → resume) with an append-only execution ledger.

It is designed for long-running workflows that must survive restarts and explicitly model blocking (human input, timers, external events, subworkflows) without keeping Python stacks alive.

Version: 0.4.34 • Python: 3.10+

Status: pre-1.0 (API may evolve). For production use, pin versions and follow CHANGELOG.md.

AbstractFramework ecosystem

AbstractRuntime is one component of the wider AbstractFramework ecosystem:

  • AbstractRuntime (this repo) — durable workflow kernel (src/abstractruntime/core/*)
  • AbstractCore — LLM + tools integration (wired via src/abstractruntime/integrations/abstractcore/*)
    Repo: lpalbou/abstractcore

At a high level, hosts define workflow graphs (WorkflowSpec) and AbstractRuntime executes them durably. When nodes request LLM/tool work (EffectType.LLM_CALL, EffectType.TOOL_CALLS), those effects are typically handled via AbstractCore.

flowchart LR
  Host["Host app / orchestrator"] -->|"WorkflowSpec"| RT["AbstractRuntime"]
  RT -->|"LLM_CALL / TOOL_CALLS"| AC["AbstractCore"]
  AC -->|"results / waits"| RT

Install

Remote-light runtime:

pip install abstractruntime

The base install includes AbstractCore 2.15.1 or newer with remote provider, tool, vision, voice, audio, and music integration, plus the abstractruntime-mcp-worker entry point. It keeps inference remote/light by default: local engines such as MLX, vLLM, HuggingFace/Torch, Diffusers, and sentence-transformer embeddings are not selected unless you choose a hardware profile or another package-specific local extra.

VisualFlow document nodes use permissive dependencies in Runtime's base install: Read PDF extracts text and metadata with pypdf, Write PDF renders text or Markdown-style report content to real PDF bytes with reportlab, and Write DOCX renders Markdown-style report content to Word-compatible .docx bytes with the Python standard library.

Native Python hardware profiles add local inferencer stacks:

pip install "abstractruntime[apple]"
pip install "abstractruntime[gpu]"

abstractruntime[apple] delegates to AbstractCore's native Apple aggregate; abstractruntime[gpu] delegates to AbstractCore's GPU aggregate.

Quick start (pause + resume)

from abstractruntime import Effect, EffectType, Runtime, StepPlan, WorkflowSpec
from abstractruntime.storage import InMemoryLedgerStore, InMemoryRunStore


def ask(run, ctx):
    return StepPlan(
        node_id="ask",
        effect=Effect(
            type=EffectType.ASK_USER,
            payload={"prompt": "Continue?"},
            result_key="user_answer",
        ),
        next_node="done",
    )


def done(run, ctx):
    answer = run.vars.get("user_answer") or {}
    text = answer.get("text") if isinstance(answer, dict) else None
    return StepPlan(node_id="done", complete_output={"answer": text})


wf = WorkflowSpec(workflow_id="demo", entry_node="ask", nodes={"ask": ask, "done": done})
rt = Runtime(run_store=InMemoryRunStore(), ledger_store=InMemoryLedgerStore())

run_id = rt.start(workflow=wf)
state = rt.tick(workflow=wf, run_id=run_id)
assert state.status.value == "waiting"

state = rt.resume(
    workflow=wf,
    run_id=run_id,
    wait_key=state.waiting.wait_key,
    payload={"text": "yes"},
)
assert state.status.value == "completed"

What’s included (v0.4.34)

Kernel (import-light):

  • workflow graphs: WorkflowSpec (src/abstractruntime/core/spec.py)
  • durable execution: Runtime.start/tick/resume (src/abstractruntime/core/runtime.py)
  • durable waits/events: WAIT_EVENT, WAIT_UNTIL, ASK_USER, EMIT_EVENT
  • append-only ledger (StepRecord) + node traces (vars["_runtime"]["node_traces"])
  • retries/idempotency hooks: src/abstractruntime/core/policy.py
  • runtime-aware limits (_limits) with a default iteration budget of 20 (docs/limits.md)
  • Stop that reaches the running effect: Runtime.cancel_run(...) signals the in-flight model or tool call, which ends as a cancelled ledger record (never retried); a model unload stops the calls using that model first (docs/api.md)
  • host pause at step boundaries: Runtime.tick(..., step_gate=...)
  • run-tree tool ceiling: an explicit allowed_tools list can only narrow across child runs, and approval policy never widens it

Durability + storage:

  • stores: in-memory, JSON/JSONL, SQLite (src/abstractruntime/storage/*)
  • durable command inbox primitives (idempotent, append-only): CommandStore, CommandCursorStore (src/abstractruntime/storage/commands.py, src/abstractruntime/storage/sqlite.py)
  • artifacts + offloading (store large payloads by reference)
  • snapshots/bookmarks (docs/snapshots.md)
  • tamper-evident hash-chained ledger (docs/provenance.md)

Drivers + distribution:

  • scheduler: create_scheduled_runtime() (src/abstractruntime/scheduler/*)
  • VisualFlow compiler + WorkflowBundles (src/abstractruntime/visualflow_compiler/*, src/abstractruntime/workflow_bundle/*)
  • VisualFlow multi-entry execution lowering for fan-in routes and per-entry input overrides (docs/workflow-bundles.md)
  • VisualFlow LLM Call and Agent nodes propagate Core generation params such as thinking and speculation through Runtime effects; _runtime.speculation sets a run-wide MTP preference that nested workflows and Agent loops inherit. Provider Models nodes can apply Core capability_route filters so run-time model discovery matches Gateway/Flow authoring.
  • VisualFlow image/video nodes and Runtime media helpers preserve task-specific Core media controls, including count/n, seeds, ordered lora_adapters, and video flow_shift, while keeping provider/model/task truth in AbstractCore and AbstractVision.
  • history_bundle now exports replay-safe resolved_actions summaries derived from Core request/output route resolution, so thin clients can reconstruct what capability ran without reverse-engineering prompt prose.
  • VisualFlow structured LLM/Agent results preserve response as text and expose the schema-conformant object on data, so Break Object and Switch can consume fields without reparsing the response string.
  • run history export: export_run_history_bundle(...) (src/abstractruntime/history_bundle.py)

Runtime-owned integrations:

  • AbstractCore (LLM + tools, MODEL_RESIDENCY with residency locks and context estimates, public discovery/host/run facades, cached sessions with per-session prompt-cache listing/clearing, host memory snapshots, local-only prompt-cache export/import admin, durable bloc prompt-cache controls, bindings, lifecycle operations, generated image/video/voice/music outputs with progress events, host email helpers, Telegram host wrappers, and tool approval waits): docs/integrations/abstractcore.md
  • AbstractCore models and engines for hosts (AbstractCore 2.14.0+): config_facade passes through the host profile, local-engine status and installs, the model catalog with fit verdicts, installed models, deletes, host jobs and the embeddable console screens: docs/integrations/abstractcore.md#models-engines-and-host-jobs-config-facade
  • For outbound comms, use the durable run facade when the send belongs to a run: get_abstractcore_run_facade(...).send_email(...) / send_telegram_message(...). If that child run pauses for approval or passthrough execution, resume it through resume_tool_calls(...). Direct host-facade send helpers and the standalone email comms facade remain host-local and nondurable.
  • AbstractMemory TripleStore integration for MEMORY_KG_* effects. Runtime depends on the light AbstractMemory contract; hosts choose storage backends such as LanceDB, SQLite, or in-memory stores.
  • comms toolset gating (email/WhatsApp/Telegram): docs/tools-comms.md

Built-in scheduler (zero-config)

from abstractruntime import create_scheduled_runtime

sr = create_scheduled_runtime()
run_id, state = sr.run(my_workflow)

if state.status.value == "waiting":
    state = sr.respond(run_id, {"text": "yes"})

sr.stop()

For persistent storage:

from abstractruntime import create_scheduled_runtime, JsonFileRunStore, JsonlLedgerStore

sr = create_scheduled_runtime(
    run_store=JsonFileRunStore("./data"),
    ledger_store=JsonlLedgerStore("./data"),
)

Documentation

Document Description
Getting Started Install + first durable workflow
API Reference Public API surface (imports + pointers)
Docs Index Full docs map (guides + reference)
FAQ Common questions and gotchas
Troubleshooting Symptom-oriented setup, runtime, and integration fixes
Architecture Component map + diagrams
Overview Design goals, core concepts, and scope
Integrations Integration guides (AbstractCore)
Snapshots Named checkpoints for run state
Provenance Tamper-evident ledger documentation
Evidence Artifact-backed evidence capture for web/command tools
Limits _limits namespace and RuntimeConfig
WorkflowBundles .flow bundle format (VisualFlow distribution)
MCP Worker abstractruntime-mcp-worker CLI
Changelog Release notes
Contributing How to build/test and submit changes
Code of Conduct Contributor conduct expectations
Security Responsible vulnerability reporting
Acknowledgments Credits
ROADMAP Prioritized next steps

Development

python -m venv .venv
source .venv/bin/activate
python -m pip install -U pip
python -m pip install -e ".[test,docs]"
python -m pytest -q

See CONTRIBUTING.md for contribution guidelines and doc conventions.

Release files for AbstractRuntime 0.4.34

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

Source distribution (sdist)

Source distribution for AbstractRuntime 0.4.34
File Size Uploaded
abstractruntime-0.4.34.tar.gz 2.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for AbstractRuntime 0.4.34
File Interpreter ABI Platform
abstractruntime-0.4.34-py3-none-any.whl Python 3 none any Details

Total release size: 3.1 MB

Release files / abstractruntime-0.4.34.tar.gz

Download URL abstractruntime-0.4.34.tar.gz
Size 2.0 MB
Tags Source
SHA-256 checksum
How to use checksums
de1ca7e5286fc1a5fc944cfe75a27a599155abe4ce2a32f3175e3fabcbab9f92
BLAKE2b-256 checksum
How to use checksums
38c944d95cc6cda9dc366d1a90e926800effc7f183d61b3ed726b17189137e1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 24, 2026.

Transparency log

Release files / abstractruntime-0.4.34-py3-none-any.whl

Download URL abstractruntime-0.4.34-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
c3fa0d28d6930c2ebf48192dbf3213c637661aa4ecacb78a021f162bc0871ea8
BLAKE2b-256 checksum
How to use checksums
e1054a8cdbe682c5113c0705b58d63ca39daafc3ebb501a37434599485b79148
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 24, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.35

2 release files

This release

0.4.34 This release

2 release files

0.4.33

2 release files

0.4.32

2 release files

0.4.29

2 release files

0.4.28

2 release files

0.4.26

2 release files

0.4.25

2 release files

0.4.24

2 release files

0.4.23

2 release files

0.4.22

2 release files

0.4.21

2 release files

0.4.20

2 release files

0.4.19

2 release files

0.4.18

2 release files

0.4.17

2 release files

0.4.16

2 release files

0.4.15

2 release files

0.4.14

2 release files

0.4.13

2 release files

0.4.12

2 release files

0.4.11

2 release files

0.4.10

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.2.0

2 release files

0.0.1

2 release files

0.0.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