Temporal replays code. LangGraph orchestrates graphs.
SemanticRun freezes what your agent already committed — and resumes with proof of what drifted.
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 semarun 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
# import stays: from semarun import SemanticRun
# from source:
pip install -e ".[dev]"
pytest
python examples/survive_the_swap.py
What you get
- Durable plan cursor —
run.steps()skips finished work after resume - Sync checkpoints — written before the step returns (SQLite)
- Divergence matrix — mechanical diffs; no LLM guessing
- Enforced policies —
fail_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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file semanticrun-0.4.0.tar.gz.
File metadata
- Download URL: semanticrun-0.4.0.tar.gz
- Upload date:
- Size: 93.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fd1ae030fd86c985914105c1135c71839b57e59a883db52775ad29351b88158
|
|
| MD5 |
13e55d76fb9748e77789e621e0f4a0d5
|
|
| BLAKE2b-256 |
8427ab5953b61a894e84261d2f5c07064f8c04493bdf4125a006940d926ffd3a
|
Provenance
The following attestation bundles were made for semanticrun-0.4.0.tar.gz:
Publisher:
publish.yml on rockybalboan19/SemanticRun
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
semanticrun-0.4.0.tar.gz -
Subject digest:
3fd1ae030fd86c985914105c1135c71839b57e59a883db52775ad29351b88158 - Sigstore transparency entry: 2340380652
- Sigstore integration time:
-
Permalink:
rockybalboan19/SemanticRun@a17fc8a7ee7f9ae9e8ebc69ff5db88dcc3601911 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/rockybalboan19
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a17fc8a7ee7f9ae9e8ebc69ff5db88dcc3601911 -
Trigger Event:
push
-
Statement type:
File details
Details for the file semanticrun-0.4.0-py3-none-any.whl.
File metadata
- Download URL: semanticrun-0.4.0-py3-none-any.whl
- Upload date:
- Size: 35.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e984cdd4ca9f9b7a3d9f9ddff9d271b1f5e0fadbd77aa87e772ccd1e9f5df690
|
|
| MD5 |
344916acb909bafa0ab4158aef902d8d
|
|
| BLAKE2b-256 |
bd8caa4c24cc56190c34594a17e40f546cb1cae5b5656454f187153da0689a20
|
Provenance
The following attestation bundles were made for semanticrun-0.4.0-py3-none-any.whl:
Publisher:
publish.yml on rockybalboan19/SemanticRun
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
semanticrun-0.4.0-py3-none-any.whl -
Subject digest:
e984cdd4ca9f9b7a3d9f9ddff9d271b1f5e0fadbd77aa87e772ccd1e9f5df690 - Sigstore transparency entry: 2340380662
- Sigstore integration time:
-
Permalink:
rockybalboan19/SemanticRun@a17fc8a7ee7f9ae9e8ebc69ff5db88dcc3601911 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/rockybalboan19
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a17fc8a7ee7f9ae9e8ebc69ff5db88dcc3601911 -
Trigger Event:
push
-
Statement type: