Semantic side-effect tracking for AI agents
Project description
effect-log
Semantic side-effect tracking for AI agents.
When an AI agent crashes mid-task, what happens on restart? Without effect-log, irreversible actions (emails, payments, deployments) get repeated. With effect-log, the system knows what completed and what didn't — it returns sealed results for finished work and resumes from where it left off.
The Core Idea
Every tool declares its effect kind at registration time. This drives all recovery behavior:
| EffectKind | Recovery (completed) | Recovery (crashed) |
|---|---|---|
| ReadOnly | Replay for fresh data | Replay safely |
| IdempotentWrite | Return sealed result | Replay with same key |
| Compensatable | Return sealed result | Compensate, then replay |
| IrreversibleWrite | Return sealed result | Escalate to human |
| ReadThenWrite | Return sealed result | Escalate to human |
Quick Start
from effect_log import EffectKind, EffectLog, ToolDef
def send_email(args):
return smtp.send(args["to"], args["subject"], args["body"])
tools = [
ToolDef("read_file", EffectKind.ReadOnly, read_file),
ToolDef("send_email", EffectKind.IrreversibleWrite, send_email),
ToolDef("upsert", EffectKind.IdempotentWrite, upsert_record),
]
log = EffectLog(execution_id="task-001", tools=tools, storage="sqlite:///effects.db")
log.execute("read_file", {"path": "/tmp/report.csv"})
log.execute("send_email", {"to": "ceo@co.com", "subject": "Report", "body": "..."})
log.execute("upsert", {"id": "report-001", "data": data})
Recovery — just add recover=True, re-run the same steps:
log = EffectLog(execution_id="task-001", tools=tools, storage="sqlite:///effects.db", recover=True)
log.execute("read_file", {"path": "/tmp/report.csv"}) # Replayed (fresh data)
log.execute("send_email", {"to": "ceo@co.com", ...}) # Sealed — NOT re-sent
log.execute("upsert", {"id": "report-001", ...}) # Replayed (idempotent)
Framework Integration
Built-in middleware for major agent frameworks:
| Framework | Middleware | Entry Point |
|---|---|---|
| LangGraph | effect_log.middleware.langgraph |
EffectLogToolNode, effect_logged_tools |
| OpenAI Agents SDK | effect_log.middleware.openai_agents |
effect_logged_agent, wrap_function_tool |
| CrewAI | effect_log.middleware.crewai |
effect_logged_crew, effect_logged_tool |
See examples/ for runnable demos:
crash_recovery.py— Core crash recovery demo (Phase 1 milestone)langgraph_integration.py— LangGraph ToolNode + tool wrappingopenai_agents_integration.py— OpenAI Agents SDK wrappingcrewai_integration.py— CrewAI tool + crew wrapping
How It Works
A write-ahead log with two record types:
- Intent — written before execution (tool name, effect kind, input, cursor)
- Completion — written after execution (outcome, sealed response)
Intent without completion = crash detected. The recovery engine uses the effect kind to decide: replay, return sealed, compensate, or escalate.
Building from Source
# Rust
cargo build --release
cargo test --workspace --all-features
# Python
cd bindings/python
pip install maturin
maturin develop --all-features
pytest tests/ -v
Roadmap
- Core library — WAL engine, recovery engine, SQLite + in-memory backends
- Python bindings — PyO3 + maturin
- Framework middleware — LangGraph, OpenAI Agents SDK, CrewAI
- TypeScript bindings — napi-rs, Vercel AI SDK
- Additional backends — RocksDB, S3, Restate journal
- Auto-classification — infer effect kind from HTTP methods / API metadata
Inspiration
The idea behind this project was inspired by a blog post from Guanlan Dai. He introduced the concepts of effect log and semantic correctness.
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
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 ai_effectlog-0.1.0.tar.gz.
File metadata
- Download URL: ai_effectlog-0.1.0.tar.gz
- Upload date:
- Size: 41.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fe20c1c633b070ef3e573b95a1260be68fb398e6473a9201ac21f48727172b7
|
|
| MD5 |
f3a2ee655a9fbaeec53b5bf87b874264
|
|
| BLAKE2b-256 |
1b53ac072b5d0d99625d8dce9dee7111a70f22668d5deb987ee6acbd0538ea67
|
Provenance
The following attestation bundles were made for ai_effectlog-0.1.0.tar.gz:
Publisher:
release.yml on xudong963/effect-log
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_effectlog-0.1.0.tar.gz -
Subject digest:
3fe20c1c633b070ef3e573b95a1260be68fb398e6473a9201ac21f48727172b7 - Sigstore transparency entry: 1107332967
- Sigstore integration time:
-
Permalink:
xudong963/effect-log@a31b1d2d43a8fe6f9b654e6e4f4ef048b3887865 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/xudong963
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a31b1d2d43a8fe6f9b654e6e4f4ef048b3887865 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ai_effectlog-0.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: ai_effectlog-0.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.13, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2383ee19431e3da47113cfdf56dfc52d2856e0265e1588f98fed7a1e34415fc0
|
|
| MD5 |
df78a5a255507a7ed12ace355dbffd3c
|
|
| BLAKE2b-256 |
8195378d9fedbe37229380d3a200be401255a54d8e48ed04f58d297672ab08d6
|
Provenance
The following attestation bundles were made for ai_effectlog-0.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release.yml on xudong963/effect-log
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_effectlog-0.1.0-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
2383ee19431e3da47113cfdf56dfc52d2856e0265e1588f98fed7a1e34415fc0 - Sigstore transparency entry: 1107333191
- Sigstore integration time:
-
Permalink:
xudong963/effect-log@a31b1d2d43a8fe6f9b654e6e4f4ef048b3887865 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/xudong963
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a31b1d2d43a8fe6f9b654e6e4f4ef048b3887865 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ai_effectlog-0.1.0-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: ai_effectlog-0.1.0-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66a5e203c4a4ade8d58ddbbadd37c2fc0f64919238b766e67dadf372e7dd9ddb
|
|
| MD5 |
719d9cb66c64a20e720ba7310537b003
|
|
| BLAKE2b-256 |
4d251eadff93db93e8c424f088b2dedcaf8d08a46f3e9d7abfb4a4ca9476f52a
|
Provenance
The following attestation bundles were made for ai_effectlog-0.1.0-cp312-cp312-win_amd64.whl:
Publisher:
release.yml on xudong963/effect-log
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_effectlog-0.1.0-cp312-cp312-win_amd64.whl -
Subject digest:
66a5e203c4a4ade8d58ddbbadd37c2fc0f64919238b766e67dadf372e7dd9ddb - Sigstore transparency entry: 1107333111
- Sigstore integration time:
-
Permalink:
xudong963/effect-log@a31b1d2d43a8fe6f9b654e6e4f4ef048b3887865 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/xudong963
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a31b1d2d43a8fe6f9b654e6e4f4ef048b3887865 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ai_effectlog-0.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: ai_effectlog-0.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
655b2e73f8ef6a75eb9ad810fc7aa474d65c030ca6654e2c8020049c35c6e0e3
|
|
| MD5 |
45ada262505d4f1fb7b714462aa32ac2
|
|
| BLAKE2b-256 |
0ca18333d628a7bb4d8cc3af8ae8de93326e1a148d082841ec939d460cbbf038
|
Provenance
The following attestation bundles were made for ai_effectlog-0.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release.yml on xudong963/effect-log
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_effectlog-0.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
655b2e73f8ef6a75eb9ad810fc7aa474d65c030ca6654e2c8020049c35c6e0e3 - Sigstore transparency entry: 1107333225
- Sigstore integration time:
-
Permalink:
xudong963/effect-log@a31b1d2d43a8fe6f9b654e6e4f4ef048b3887865 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/xudong963
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a31b1d2d43a8fe6f9b654e6e4f4ef048b3887865 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ai_effectlog-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: ai_effectlog-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a126a3e28371e393030eb1bec6bb8e7eef0aa699f2bd703a893553af29bb97f
|
|
| MD5 |
c178fa89feab7ffb9cb609d7456f28b0
|
|
| BLAKE2b-256 |
4fb556a727c1616152dd831f36d802d3aa0757d777e2c5fd94a369fe5a6c7f8e
|
Provenance
The following attestation bundles were made for ai_effectlog-0.1.0-cp312-cp312-macosx_11_0_arm64.whl:
Publisher:
release.yml on xudong963/effect-log
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_effectlog-0.1.0-cp312-cp312-macosx_11_0_arm64.whl -
Subject digest:
3a126a3e28371e393030eb1bec6bb8e7eef0aa699f2bd703a893553af29bb97f - Sigstore transparency entry: 1107333299
- Sigstore integration time:
-
Permalink:
xudong963/effect-log@a31b1d2d43a8fe6f9b654e6e4f4ef048b3887865 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/xudong963
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a31b1d2d43a8fe6f9b654e6e4f4ef048b3887865 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ai_effectlog-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl.
File metadata
- Download URL: ai_effectlog-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.7 MB
- Tags: CPython 3.12, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66bc7136a71db1f989762b6e04f881882f8ec2ef9ee4136a1be0bc22c0da3a62
|
|
| MD5 |
8beb8e56e7776b82fc0b10286c873418
|
|
| BLAKE2b-256 |
60b8e1fe1390f5c2cd09ffdd12229764065f68c10e8b11b313e91867bd8f8341
|
Provenance
The following attestation bundles were made for ai_effectlog-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl:
Publisher:
release.yml on xudong963/effect-log
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_effectlog-0.1.0-cp312-cp312-macosx_10_12_x86_64.whl -
Subject digest:
66bc7136a71db1f989762b6e04f881882f8ec2ef9ee4136a1be0bc22c0da3a62 - Sigstore transparency entry: 1107333360
- Sigstore integration time:
-
Permalink:
xudong963/effect-log@a31b1d2d43a8fe6f9b654e6e4f4ef048b3887865 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/xudong963
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a31b1d2d43a8fe6f9b654e6e4f4ef048b3887865 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ai_effectlog-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: ai_effectlog-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82fbe4483409a74d0b9fd9da508bc6b42b58588fe2f7b48e1c0beae879426990
|
|
| MD5 |
15c77b71190724969ecce94a72840646
|
|
| BLAKE2b-256 |
ef4f26130f8db5abaa21317fcce48d5cb2f21cbb8037c626c03468401b1b950d
|
Provenance
The following attestation bundles were made for ai_effectlog-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release.yml on xudong963/effect-log
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_effectlog-0.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
82fbe4483409a74d0b9fd9da508bc6b42b58588fe2f7b48e1c0beae879426990 - Sigstore transparency entry: 1107333017
- Sigstore integration time:
-
Permalink:
xudong963/effect-log@a31b1d2d43a8fe6f9b654e6e4f4ef048b3887865 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/xudong963
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a31b1d2d43a8fe6f9b654e6e4f4ef048b3887865 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ai_effectlog-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: ai_effectlog-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d80f418a0fba704a80fa1e4a73c8aa4e3ccd4e018ff2076f2665bd1ca38c1ae2
|
|
| MD5 |
f24294b4d2b1aeacc9eb00d5e4ee663f
|
|
| BLAKE2b-256 |
986b3183824ffba0004512cd4824d9ed367bf9741bb63da21ecae55db7ace305
|
Provenance
The following attestation bundles were made for ai_effectlog-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release.yml on xudong963/effect-log
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_effectlog-0.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
d80f418a0fba704a80fa1e4a73c8aa4e3ccd4e018ff2076f2665bd1ca38c1ae2 - Sigstore transparency entry: 1107333436
- Sigstore integration time:
-
Permalink:
xudong963/effect-log@a31b1d2d43a8fe6f9b654e6e4f4ef048b3887865 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/xudong963
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a31b1d2d43a8fe6f9b654e6e4f4ef048b3887865 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ai_effectlog-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: ai_effectlog-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a1dd708ed74de3cf4eacc97286f48a5c83deca50d151761440ab2e5f104471d
|
|
| MD5 |
193e9591b6734f055e683121ee4fe116
|
|
| BLAKE2b-256 |
9e6a82f4a8c2d1f4987fcee43e18f54ab4c465f1694587909e57c44769d91cd4
|
Provenance
The following attestation bundles were made for ai_effectlog-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release.yml on xudong963/effect-log
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_effectlog-0.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
1a1dd708ed74de3cf4eacc97286f48a5c83deca50d151761440ab2e5f104471d - Sigstore transparency entry: 1107333158
- Sigstore integration time:
-
Permalink:
xudong963/effect-log@a31b1d2d43a8fe6f9b654e6e4f4ef048b3887865 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/xudong963
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a31b1d2d43a8fe6f9b654e6e4f4ef048b3887865 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ai_effectlog-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: ai_effectlog-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33f689768483d3ddffff1d25ac25abce06354948fc18cae9886d12103db42e5d
|
|
| MD5 |
83680e0d417c50ad32618cfa53548f81
|
|
| BLAKE2b-256 |
d2c7712a7ddc39b357b8c570b0cb205b3c34cf0159a6cd2c3ab4d2ee9815d530
|
Provenance
The following attestation bundles were made for ai_effectlog-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on xudong963/effect-log
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_effectlog-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
33f689768483d3ddffff1d25ac25abce06354948fc18cae9886d12103db42e5d - Sigstore transparency entry: 1107333067
- Sigstore integration time:
-
Permalink:
xudong963/effect-log@a31b1d2d43a8fe6f9b654e6e4f4ef048b3887865 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/xudong963
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a31b1d2d43a8fe6f9b654e6e4f4ef048b3887865 -
Trigger Event:
push
-
Statement type: