Skip to main content

SemanticRun

Temporal replays code. LangGraph orchestrates graphs.
SemanticRun freezes what your agent already committed — and resumes with proof of what drifted.

Python 3.11+ License: MIT PyPI Status

Artifact-aware durable agent environment for Python.
Survive crashes, human waits, model swaps, and tool drift — without redoing completed work or silently replaying side effects.

from semanticrun import SemanticRun, PolicyMapping

env = SemanticRun.open("./runs.db")

run = env.start(
    intent="Onboard lead_42",
    plan=["research", "draft", "approve", "send"],
    policies=PolicyMapping(
        tool_result_hash_mismatch="revalidate",
        model_id_changed="fail_fast",
        outbound_payload_divergence="fail_fast",
    ),
)

for step in run.steps():  # completed steps skipped on resume
    if step.name == "research":
        lead = step.tool("crm_lookup", lambda: crm.lookup("lead_42"),
                         hash_exclude=["created_at"])
    elif step.name == "draft":
        draft = step.llm(lambda: llm.draft(lead), model="gpt-4.1")
        step.remember("draft_email", draft)
    elif step.name == "approve":
        step.require_approval("send_email", {"draft": draft})
    elif step.name == "send":
        step.tool("send_email", lambda: mail.send(draft),
                  side_effect="external",
                  outbound={"to": lead["email"], "body": draft})

run = env.resume(run_id, artifacts=...)  # matrix + policies; cursor continues

Why SemanticRun

Temporal LangGraph SemanticRun
Core idea Replay workflow code Orchestrate agent graphs Diff committed artifacts on resume
Durability Event history Checkpointers Sync checkpoints + plan cursor
Drift (tools / models / files) App-level App-level Divergence matrix + enforced policies
Side effects Activity semantics App-managed Outbound payload hash gate

Not a Temporal or LangGraph plugin — the environment your agent runs in when the question is “what already happened, and is it still true?”

Install

pip install SemanticRun

# from source:
pip install -e ".[dev]"
pytest
python examples/survive_the_swap.py

What you get

  • Durable plan cursorrun.steps() skips finished work after resume
  • Sync checkpoints — written before the step returns (SQLite)
  • Divergence matrix — mechanical diffs; no LLM guessing
  • Enforced policiesfail_fast / revalidate / strict_reset
  • Outbound replay gate — refuse divergent external side effects

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

semanticrun-0.4.1.tar.gz (65.9 kB view details)

Uploaded Source

Built Distribution

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

semanticrun-0.4.1-py3-none-any.whl (35.3 kB view details)

Uploaded Python 3

File details

Details for the file semanticrun-0.4.1.tar.gz.

File metadata

  • Download URL: semanticrun-0.4.1.tar.gz
  • Upload date:
  • Size: 65.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for semanticrun-0.4.1.tar.gz
Algorithm Hash digest
SHA256 f765bda467aeb2250b9ebbc38a59ac1275b4ba7c771d187f16d62969049652dd
MD5 2baee49b6222a7c62abe2e362f568901
BLAKE2b-256 e27c48756d07118bdd9573ceebd007478a888f8884a9228f6ea41022b4886c6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for semanticrun-0.4.1.tar.gz:

Publisher: publish.yml on rockybalboan19/SemanticRun

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

File details

Details for the file semanticrun-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: semanticrun-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 35.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for semanticrun-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 42629264256c7ce7e9e6563c39e874557a438887db7efa5037f65af9c4e2d8b1
MD5 4d6690b42bf7fcfb36faa8d45537f30a
BLAKE2b-256 c191f34d02f17d409d96270ef4c0e035fb30b16fc1d30d53ff3d175896a48750

See more details on using hashes here.

Provenance

The following attestation bundles were made for semanticrun-0.4.1-py3-none-any.whl:

Publisher: publish.yml on rockybalboan19/SemanticRun

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

Release history Release notifications | RSS feed

0.4.2

2 files

This release

0.4.1 This release

2 files

0.4.0

2 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