Skip to main content

zymi

zymi-core

Compile what your agent figured out into pipelines that run without it — declarative, event-sourced, approval-gated, callable from any MCP host.

Pronounced zoomi — like dog zoomies.

PyPI Python versions CI License: MIT llms.txt


Why zymi-core?

You ask your coding agent to add a VPN user, deploy a service, or clean up a server. It figures it out — after some trial and error. A week later you ask again, and it figures it out again, slightly differently. Then the agent is rate-limited, offline, or simply not there, and nobody remembers the steps.

zymi is for the moment you notice that. The procedure the agent converged on gets compiled into a YAML pipeline — most steps are plain deterministic tool calls, an LLM appears only where judgment is actually needed — and from then on:

  • It runs without the agent. zymi run add_vpn_user from any terminal. Tool-only pipelines need no model and no API key at all, and missing inputs are asked interactively.
  • Your agent still uses it — as one MCP tool, via zymi mcp serve, instead of re-deriving the procedure every time.
  • Dangerous steps wait for a human. Steps emit intentions (shell, file write, HTTP) that pass policy, contracts and optional approval before anything happens. Over MCP the approval is a native approve/deny form in the calling agent's UI.
  • Every run is on the record. Each state change is an immutable, hash-chained event: replay it, fork-resume it from any step, browse it in a TUI, or let the agent read its own run trace to explain a failure.

zymi is deliberately not an autonomous agent, an IDE plugin or a chat UI. It is the governed, reproducible layer underneath them: the place where the behaviour you want to keep stops being emergent.


Two minutes: a personal pipeline library

uv tool install zymi-core       # one-time; puts `zymi` on PATH globally
zymi init --home                # your library at ~/.zymi
zymi ls                         # from any directory
zymi run hello                  # asks for its input, runs, no LLM involved

Don't have uv? curl -LsSf https://astral.sh/uv/install.sh | sh (macOS/Linux) or irm https://astral.sh/uv/install.ps1 | iex (Windows).

~/.zymi is an ordinary zymi project that every command falls back to when you're not inside another one (ADR-0044). Add your own pipeline — say, a site check:

# ~/.zymi/tools/http_status.yml
name: http_status
description: "HTTP status code of a URL"
parameters:
  type: object
  properties:
    url: { type: string }
  required: [url]
implementation:
  kind: shell
  command_template: "curl -sS -o /dev/null -w '%{http_code}' ${args.url}"
# ~/.zymi/pipelines/site_check.yml
name: site_check
description: "Is the site up?"
inputs:
  - name: url
    required: true
    description: "Full URL, e.g. https://example.com"
steps:
  - id: status
    tool: http_status
    args: { url: "${inputs.url}" }
output:
  step: status

Allow the command in ~/.zymi/project.yml (policy.allow: ["curl *"] — anything unlisted asks for approval first), then zymi run site_check. The run, its arguments and its output are now in ~/.zymi/.zymi/events.db; zymi observe shows them.

Hand it to your agent. Point any MCP host at the library and every pipeline with an expose.mcp: block becomes a tool:

{ "command": "zymi", "args": ["mcp", "serve", "--dir", "/Users/you/.zymi"] }

Add a model only where it earns its place. Declare endpoints once per machine in ~/.zymi/providers.yml and reference them by name from any project — llm: neuraldeep, or llm: { use: neuraldeep, model: other }. Keys live in ~/.zymi/.env. A provider that can't be resolved only disables agent steps; the tool-only pipelines keep working.

Full walkthrough in docs/getting-started.md.


What's in the box

Pipelines — DAGs of agent, tool and ask steps

A pipeline is a list of steps with depends_on: edges; independent steps run in parallel. Each step is one of:

  • a deterministic tool step (ADR-0024) — direct dispatch with templated args, no LLM hop;
  • an agent step — an LLM ReAct loop with a tool allowlist;
  • an ask step (ADR-0042) — the run parks and asks whoever called it (a human at the terminal under zymi run, the connected agent under zymi mcp serve), then resumes with the answer. No second model to configure.
steps:
  - id: recon                            # deterministic — no LLM
    tool: disk_report
    args: { host: "${inputs.host}" }

  - id: analyse                          # LLM, only for the judgment call
    agent: sysadmin
    task: "What is eating the disk? ${steps.recon.output}"
    depends_on: [recon]

  - id: confirm                          # the caller answers
    ask: "Clean up as proposed?\n${steps.analyse.output}"
    depends_on: [analyse]

Branches (ADR-0028) — a step can carry when:; skipped branches cascade to descendants and land in the trace as StepSkipped events. One pipeline can serve several actions:

- id: add_client
  tool: vpn_add_client
  args: { email: "${inputs.email}" }
  depends_on: [route]
  when: "${inputs.action} == 'add'"

Schema, examples, gotchas → docs/pipelines.md.

Tools — four kinds, one catalogue

  • Declarative shell / HTTP in tools/<name>.yml — no code.
  • Python @tool in tools/<name>.py — sync or async, signature → JSON Schema, auto-discovered; runs in the project's own .venv (ADR-0032).
  • MCP servers — one mcp_servers: entry gives N tools, namespaced mcp__<server>__<tool> (ADR-0023).
  • Builtins — read_file, write_file, write_memory, execute_shell_command, spawn_sub_agent.

All four emit the same ToolCallRequested / ToolCallCompleted events. → docs/tools.md

zymi as an MCP server

zymi mcp serve exposes pipelines as MCP tools over stdio to Claude Code, Claude Desktop, Cursor, or any framework with an MCP adapter (ADR-0033). Exposure is opt-in per pipeline:

expose:
  mcp:
    name: vpn_provision
    description: "Provision a VPN client: preflight, then an approval-gated add."
    mode: sync                 # or async — the caller task-augments (SEP-1686)
  • Approvals render in the caller's UI — a gated step sends elicitation/create back through the live tools/call; in Claude Code that's an approve/deny form. Clients without elicitation fail closed.
  • ask: steps borrow the caller's brain — on a task-augmented call the task goes input_required with { prompt, resume_token }, the agent answers via zymi/reasoning/resume. The answer is recorded, so replay is byte-identical.
  • The agent can debug its own runs — --expose-observability adds read-only zymi.runs.list / .get / .events / .step_io (ADR-0034).

Honest limits: approvals inside async tasks wait on host adoption and time out (sync calls are fully interactive); cancellation is best-effort; arguments cross the boundary as strings; mcp serve is Unix-only for now.

Approvals — event-sourced, restart-safe

requires_approval: true on a tool publishes ApprovalRequested; a channel routes the human decision back. Channels: terminal, http, telegram, mcp_elicitation (ADR-0022). Resolution: pipeline override → project default → fail-closed. A crash mid-approval is repaired on restart. → docs/approvals.md

Replay, resume, observe

zymi runs                                   # pipeline runs
zymi events --stream <run-id>               # every event of one run
zymi verify                                 # hash-chain integrity, with its denominator
zymi observe                                # TUI: runs / DAG / events, live
zymi resume <run-id> --from-step <id>       # fork-resume; upstream steps stay frozen

→ docs/events-and-replay.md

Long-running services

zymi serve reacts to events from declarative connectors — http_inbound, http_poll, cron, file_read, stdin — and answers through outputs (http_post, file_append, stdout). That's enough for a full chat bot in YAML: zymi init --example telegram scaffolds one with approvals over Telegram buttons. SQLite by default; one store: postgres://… line for multi-process serving against shared state. → docs/connectors.md · docs/store-backends.md

Context window management

An agent's context is reconstructed from the event log each iteration, not accumulated in a buffer: older observations are masked in place, and only when the budget is still tight does one summarisation call compact the oldest batch (ADR-0016). → docs/context.md


Python embedding

With zymi-core in a project's venv (uv add zymi-core), the same wheel exposes Runtime, Event, EventBus, EventStore, ToolRegistry and the @tool decorator:

from zymi import Runtime

rt = Runtime.for_project(".", approval="terminal")
result = rt.run_pipeline("site_check", {"url": "https://example.com"})
print(result.success, result.final_output)

Cross-process patterns (a web app driving zymi serve over the shared store) → docs/python-api.md.


CLI cheatsheet

zymi init [--home | --example telegram]     # scaffold a project, or the ~/.zymi library
zymi ls                                     # what can I run (falls back to ~/.zymi)
zymi run <pipeline> [-i key=value …]        # one-shot run; asks for missing inputs on a TTY
zymi fetch                                  # uv sync — build ./.venv for @tool deps
zymi serve <pipeline…> | --all              # long-running, event-driven

zymi pipelines                              # step-level view of every pipeline
zymi runs · zymi events · zymi verify · zymi observe · zymi resume

zymi mcp serve [--expose-observability]     # pipelines as MCP tools
zymi mcp probe <name> -- <cmd> [args …]     # smoke a third-party MCP server
zymi schema {project|agent|pipeline|tool|--all}

Commands use --dir, else the current directory if it is a project, else ~/.zymi. Full reference → docs/cli.md.


Documentation


Contributing & License

zymi-core is built in Rust and shipped via PyPI. Bug reports, examples and PRs welcome — see CONTRIBUTING.md for the dev loop, test matrix and ADR workflow.

MIT — see LICENSE.

Metadata

Release files for zymi-core 0.9.3

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

Source distribution (sdist)

Source distribution for zymi-core 0.9.3
File Size Uploaded
zymi_core-0.9.3.tar.gz 1.1 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for zymi-core 0.9.3
File
zymi_core-0.9.3-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
zymi_core-0.9.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details
zymi_core-0.9.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
zymi_core-0.9.3-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
zymi_core-0.9.3-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details

Total release size: 30.9 MB

Release files / zymi_core-0.9.3.tar.gz

Download URL zymi_core-0.9.3.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
477b8a227e6200ad4f9faefeebe4a22b4fe9c7bf046b288dae7f7ae82a4e3e32
BLAKE2b-256 checksum
How to use checksums
643e38e139fb895f613643a891389e1b782fa732d4308c5101187ca417e824ef
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 Oct 5, 2026.

Transparency log

Release files / zymi_core-0.9.3-cp39-abi3-win_amd64.whl

Download URL zymi_core-0.9.3-cp39-abi3-win_amd64.whl
Size 6.5 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3c49d58ba8ed7a24b25763dda3967f3af6c780cb05f6bf084dbd02f029d57a28
BLAKE2b-256 checksum
How to use checksums
9fd618f6d8323da62de915c9d8d17ca7f32c98fb6d8c7c9e51b1d92439ff740f
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 Oct 5, 2026.

Transparency log

Release files / zymi_core-0.9.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL zymi_core-0.9.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 6.1 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
7f40cd146fc451bac1ad3ac34030c3a13fb9ed2e8cdcaa05bcc2fbea341532b1
BLAKE2b-256 checksum
How to use checksums
2a6eac452427cb6f3b65e509158bf4d84fd647f7f0d647057d431532b3c950a7
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 Oct 5, 2026.

Transparency log

Release files / zymi_core-0.9.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL zymi_core-0.9.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 5.7 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
9c2c2ec2d80d0bdb07ffcfdb22a9a4ec91d68647077c96895f17606b06d236e0
BLAKE2b-256 checksum
How to use checksums
3873ab69f4c15307d1e56541417ab097f449a06c58b4da8ac98908e6cdf6ba8e
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 Oct 5, 2026.

Transparency log

Release files / zymi_core-0.9.3-cp39-abi3-macosx_11_0_arm64.whl

Download URL zymi_core-0.9.3-cp39-abi3-macosx_11_0_arm64.whl
Size 5.6 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
aa9242a64a57f615bf070505de6d47a9737f8278c9771b8af7f3ed92ad4ed6d7
BLAKE2b-256 checksum
How to use checksums
48e88784425eee9d5f1630f0721bc87791ba778e423bbbb1f8aeb18fcb03bb00
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 Oct 5, 2026.

Transparency log

Release files / zymi_core-0.9.3-cp39-abi3-macosx_10_12_x86_64.whl

Download URL zymi_core-0.9.3-cp39-abi3-macosx_10_12_x86_64.whl
Size 5.9 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
0c6039d64f7261733e4f94155171f1b816298a6b0736aaa4879e51426b6e7fbc
BLAKE2b-256 checksum
How to use checksums
dadba232717db944a9dfd893473622e105cee1d12efbc7e1c35acdd2deb805b1
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 Oct 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.9.3 This release

6 release files

0.9.2

6 release files

0.9.1

6 release files

0.9.0

6 release files

0.8.1

6 release files

0.8.0

6 release files

0.7.3

6 release files

0.7.2

6 release files

0.7.1

6 release files

0.7.0

6 release files

0.6.13

6 release files

0.6.12

6 release files

0.6.11

6 release files

0.6.10

6 release files

0.6.9

6 release files

0.6.8

6 release files

0.6.7

6 release files

0.6.6

6 release files

0.6.5

6 release files

0.6.4

6 release files

0.6.3

6 release files

0.6.2

6 release files

0.6.1

6 release files

0.6.0

6 release files

0.5.1

6 release files

0.5.0

6 release files

0.4.0

6 release files

0.3.0

6 release files

0.2.2

6 release files

0.2.1

6 release files

0.2.0

6 release files

0.1.8

6 release files

0.1.7

6 release files

0.1.6

6 release files

0.1.5

6 release files

0.1.4

6 release files

0.1.3

6 release files

0.1.2

6 release files

0.1.1

6 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