sqrlly
A high-level interface to and extension of LangGraph for agents in local environments. Declare a workflow in YAML; sqrlly compiles it to a runnable StateGraph and adds the runtime extensions agent workflows need:
- Nodes execute one of: an LLM prompt (agent-with-tools or text-only), an interpreted script (
.py/.js/.ts/.sh), a binary, or a recursive subgraph. - Local context — when run inside a git repo, every node gets its own isolated worktree; agents read dep outputs, edit files on disk, and run tools.
- Quality gates — a script or LLM scorer judges output; failing gates re-run the node with feedback injected, up to a configurable retry budget.
- Branching —
route:sends flow conditionally;fan_out:spawns parallel branches over a JSON manifest. - Fault-recovery resume — state checkpoints to SQLite;
--resumere-runs seeded with the prior run's state and clears failures to retry.
Install
For CLI use (recommended — isolated venv, doesn't touch your project's environment):
pipx install sqrlly # or: uv tool install sqrlly
uvx sqrlly --help # run once, no install
As a project dependency:
uv add sqrlly # or: pip install sqrlly
LLM dispatch uses a local authenticated agent CLI. Codex is the default:
transport: cli,provider: openai—codex execsubprocess-per-call (no warm process, realasyncioparallelism). Requirescodexon PATH.transport: cli,provider: anthropic— the opt-inclaude -psubprocess backend. Requiresclaudeon PATH.
The direct-API backends (Anthropic / OpenAI / DeepSeek / custom
OpenAI-compatible endpoints) were removed in 0.2.x while the project
consolidates around local agent CLIs; restoring transport: api remains
on the roadmap.
Auth is per-CLI, not sqrlly's job. Each CLI you point sqrlly at handles its own credentials independently. Authenticate Codex or Claude with that CLI's normal login flow; sqrlly never reads or stores API keys.
Python 3.11+. From source: git clone then uv sync.
Using sqrlly from a coding agent? sqrlly init --skill installs the
agent skill into your repo at .agents/skills/sqrlly/SKILL.md
(repo-aware) so the agent auto-discovers how to author and run
workflows.
Quickstart
Bootstrap a runnable workflow in two commands — no git clone needed:
sqrlly init my-workflow
cd my-workflow && sqrlly run workflow.yaml
sqrlly init scaffolds workflow.yaml (one prompt node, CLI preset) and prompts/hello.md you can edit in place.
For something more substantive, the shipped example is two nodes — generate jokes, gate them, pick the best (examples/jokes/):
name: "Joke Generator"
version: "0.1.0"
nodes:
- id: generate
name: "Generate Jokes"
execute:
url: "examples/jokes/generate.md"
evaluation:
validator: "examples/jokes/gates/validate_jokes.py"
threshold: 1.0
blocking: true
max_retries: 2
- id: select
name: "Select Best Joke"
depends_on: ["generate"]
execute:
url: "examples/jokes/select.md"
settings:
presets:
default:
transport: cli
provider: openai
model: gpt-5.6-luna
default: true
sqrlly validate examples/jokes/workflow.yaml
sqrlly run examples/jokes/workflow.yaml --log run.jsonl
validate— compiles the graph and reports the node count.run— executes the workflow; with--log, writes a JSONL event stream (workflow_start,node_model,node_completed,node_failed,gate_evaluated,node_retried,workflow_end).
How it works
- URL-based dispatch —
execute.url's extension picks the handler:.md/.txt/.prompt→ LLM prompt,.py/.js/.ts/.sh→ script,.yaml→ subgraph, anything else → binary. - Jinja2 templates — prompt files are full Jinja2;
{{generate}}interpolates an upstream node's output;{% if %}/{% for %}/ filters all work. - Retry feedback loop — when a gate scores below
threshold, the next attempt's context gets{{_retry_reason}}auto-populated with the previous score, per-dimension thresholds, and feedback. - Worktree isolation — inside a git repo, each node runs in its own
git worktreeunder<workdir>/.sqrlly/, reused across retries so prompt nodes can iterate on prior files. - Checkpointed state — runs persist to
<workdir>/.sqrlly-checkpoint.db(LangGraphAsyncSqliteSaver);--resumere-runs seeded with that state, clearing failed nodes to retry. Completed nodes skip by default (fault-recovery re-run, not full replay) unless--rerun-allis set. For fan-out branches: failed children re-run, but completed siblings stay frozen (no re-billing). - Recursive subgraphs — a
.yamlURL runs another sqrlly workflow; the same file works standalone or as a subgraph reference.
Backends and presets
LLM and script execution is configured by presets under settings.presets — named bundles referenced by a node's params.preset. Exactly one LLM preset is marked default: true:
settings:
presets:
default:
transport: cli
provider: openai # Codex CLI
model: gpt-5.6-luna
default: true
When no global Codex model_reasoning_effort override is configured, the
installed Codex model catalog currently gives gpt-5.6-luna its medium
default effort. sqrlly does not set that effort in workflow YAML. Claude
remains available as an explicit provider: anthropic preset.
cli is the only transport. The provider picks the CLI:
| Provider | Invocation |
|---|---|
openai |
codex exec ... - |
anthropic |
claude -p |
Each call is its own subprocess, so fan-out gets real asyncio parallelism.
transport defaults to cli and provider defaults to openai, so a
preset needs only model for the default Codex CLI. Use
provider: anthropic for Claude. Multiple presets can coexist in one workflow; only
one is default: true, and nodes select alternatives with params.preset.
Declare presets explicitly. sqrlly doesn't probe your environment
or synthesize defaults. Empty settings.presets is valid for
script-only workflows; any LLM-dispatching node will fail at its call
site with a clear "no prompt backend wired" error. If a backend's
toolchain is missing at run time (codex or claude),
the backend surfaces a clear error at the first prompt call — never
as a pre-flight check (a pre-flight would forbid workflows that
install the toolchain in an earlier script node).
Full reference (including CommandPreset for custom script interpreters): SCHEMA.md.
CLI
| Command | Purpose |
|---|---|
sqrlly init [<dir>] |
Scaffold a minimal runnable workflow into <dir> (default .). |
sqrlly init --example <name> |
Scaffold a bundled example into ./<name> (--list-examples to see them). |
sqrlly validate <config> |
Compile the workflow; report node count and lint warnings. |
sqrlly run <config> |
Execute the workflow. |
sqrlly graph <config> |
Print the topology as a Mermaid diagram. |
sqrlly view <config> |
Render a self-contained interactive HTML viewer. |
run flags:
--workdir / -w <dir>— working directory (default.).--dry-run— trace topology without executing.--preset / -p <name>— force a named preset as the default.--resume— re-run seeded with the prior run's state, clearing failures to retry. Completed nodes skip by default; use--rerun-allto re-execute every node.--entry <node>— cold-start at<node>: run it and everything downstream WITHOUT a checkpoint (the upstream artifacts must already be on disk). Mutually exclusive with--resume/--resume-from/--rerun-all.--log <path>— write a JSONL event log.--quiet / -q— suppress the live terminal renderer (use in CI / piped runs).--safe-mode / --no-safe-mode— run Anthropic's CLI provider with Claude operator customizations (output styles, CLAUDE.md, skills, MCP, hooks) disabled. It has no effect on Codex. Overridessettings.safe_mode; absent, the setting applies.
run shows a live per-node status grid + a clock-driven aliveness spinner when stdout is a TTY. Non-TTY runs (piped, redirected, CI) fall through to the plain summary output automatically. Workflow events only — no LLM-token streaming. On completion run prints a where to find things summary — the produced output files, the log path (or how to capture one with --log), and run artifacts (checkpoint DB + worktree pool); --quiet suppresses it.
init --example <name> scaffolds a runnable bundled example (jokes, route_classify, explicit_join, pipeline_style, absurd-paper) — handy after uv tool install sqrlly when you have no repo checkout. init --list-examples lists them.
Examples
Render any example's interactive view with sqrlly view <workflow.yaml>; examples/regenerate_views.sh rebuilds views (and, for the deterministic script-only examples, debug views from a captured log) locally.
| Workflow | What it shows |
|---|---|
examples/jokes/ |
Minimal: prompt + script gate + select. Start here. |
examples/route_classify/ |
Inline route: case ladder over structured state. |
examples/pipeline_style/ |
route: { goto: <next> } forward-edge authoring; a linear pipeline. |
examples/absurd-paper/ |
Full pipeline: prompts, multi-dim quality gates, a subgraph, and a rendered PDF. Try sqrlly init --example absurd-paper. |
examples/wave_planner/ |
Wave-driven dynamic-task pattern — goto: loop-back to a fan-out parent. |
Documentation
- SCHEMA.md — every Settings / Node / Execute / preset / route / evaluation field, the URL dispatch table, and the route-predicate namespace.
- SKILLS.md — agent skill doc: instructions for an AI coding agent authoring and running sqrlly workflows.
Contributing
- Three-layer split —
schema/(Pydantic models) →compile/(YAML → LangGraph) →runtime/(executors, backends). Layer rules enforced at CI time by an AST import check. - No mocks of external systems — tests run real subprocesses, real
git worktree, and real backends. - Layer rules —
tests/architecture/test_layers.pyenforces the import boundaries;CLAUDE.mdhas the architecture sketch + contributor reading order.
uv run pytest tests/ --ignore=tests/cli # ~1k tests
uv run pytest tests/cli # CLI backend integration (needs `codex` and `claude` on PATH)
License
Apache-2.0 — see LICENSE.
Metadata
Release files for sqrlly 0.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sqrlly-0.10.0.tar.gz | 467.3 kB | With provenance | Details for sqrlly-0.10.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sqrlly-0.10.0-py3-none-any.whl | Python 3 | none | any | Details for sqrlly-0.10.0-py3-none-any.whl |
Total release size: 648.6 kB
Release files / sqrlly-0.10.0.tar.gz
| Download URL | sqrlly-0.10.0.tar.gz |
|---|---|
| Size | 467.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6860e2ec195c97e00ff9b3459fe3f0ba819dd6d041e09959fe8a994ae248e8ba
|
|
BLAKE2b-256 checksum How to use checksums |
1c25c4fd6f06569e1b56ffea81b92c75a60b4c62f91795e29138f92f1d6589b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 15, 2026.
Transparency logRelease files / sqrlly-0.10.0-py3-none-any.whl
| Download URL | sqrlly-0.10.0-py3-none-any.whl |
|---|---|
| Size | 181.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
91b02037916556b8e363591a6a9af27dea6f08a66d336065ebf11d57f5cb101b
|
|
BLAKE2b-256 checksum How to use checksums |
3fcf08646bb56611bc1a9d5e42263ce13f969e4d294e2051cfb50183c5959634
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 15, 2026.
Transparency logSecurity for sqrlly 0.10.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for sqrlly-0.10.0.tar.gz
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 Nov 15, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.