Skip to main content

exprag

PyPI version

PyPI platforms

exprag is an experiment memory for coding agents with zero dependencies.

It is intentionally small: one JSONL file per run, plus enough structured context for an agent to answer questions about past experiments, compare runs, and recover the exact code state that produced a result.

This is not trying to be another ML dashboard. The main interface is your agent.

Ask things like:

"Which run had the best validation accuracy?"

"Compare the latest two runs and explain what changed."

"Find the best run, inspect the code that produced it, and tell me why it won."

"Restore the repository to the code state from the run with the lowest loss."

Every run records git state at startup: commit, branch, dirty status, status output. For dirty repositories, exprag creates a dedicated run/<uuid> branch that captures the exact commit plus any uncommitted edits that existed when the run started. That means an agent can always reconstruct the true code state.

The result is a lightweight loop:

  1. Run experiments from normal Python.
  2. Track structured values with short semantic notes.
  3. Let an agent inspect .exprag/runs/*.jsonl.
  4. Ask the agent to compare, explain, or roll code back to any run.

Install

uv pip install exprag

Install For Local Development

uv pip install -e . --group=dev

Create Agent-Readable Experiment Memory

from exprag import Experiment

exp = Experiment(
    "training my neural network",
    # this metadata is captured only once at the experiment start
    metadata={
        "hparams": {
            "learning_rate": 0.03,
            "batch_size": 32,
        }
    },
)

for step in range(5):
    loss = 1.0 / (step + 1)
    acc = 0.6 + step * 0.05

    exp.track(
        {"step": step, "metrics": {"loss": loss, "acc": acc}},
        note="training metrics after each step",
    )

Run:

python examples/track_experiment.py

The runs are written to:

.exprag/runs/<run_id>.jsonl

Each run starts with a run_start record containing process, host, metadata, and git state. Each track record contains your structured value, wall-clock time, monotonic elapsed_ms, and optional note context for the agent.

Give Your Agent the Exprag Skill

Write the SKILL.md to the appropriate place so your agent finds it:

exprag-skill --write .claude/skills/exprag/SKILL.md
exprag-skill --write .agents/skills/exprag/SKILL.md
exprag-skill --write .opencode/skills/exprag/SKILL.md

Then ask your agent questions in terms of outcomes, not files:

"Which run in the last two weeks has the highest accuracy?"

"Show me the git diff between the two latest runs."

"Which learning rates result in accuracies above 90%?"

"Compare the best run against the latest run."

"Show the metric history for the run where batch size was 32."

"Restore the code to the state from the run that achieved the highest accuracy."

"Check out the exact code for run X."

Code-State Rollback

The powerful part is that exprag captures git context per run.

A run_start record includes enough information for an agent to reason about the source tree at experiment time:

  • commit: the commit to check out (snapshot commit for dirty runs, HEAD for clean)
  • branch: the branch to check out (run/<uuid> for dirty runs, original branch for clean)
  • dirty: whether the worktree had uncommitted changes
  • process cwd and argv

That lets an agent perform a workflow like:

  1. Find the run with the best metric.
  2. Read its run_start git state.
  3. git checkout <branch> always works — branch is either run/<uuid> (dirty) or the original branch (clean).
  4. Compare with git diff between any two runs.
  5. To get the base commit for a dirty run: git log --oneline -1 <commit>^.

So a prompt like this is meaningful:

"Find the run with the best validation accuracy, reconstruct the code from that run, and show me the exact code changes compared with my current checkout."

Metadata

Release files for exprag 0.1.2

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

Source distribution (sdist)

Source distribution for exprag 0.1.2
File Size Uploaded Provenance
exprag-0.1.2.tar.gz 25.2 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for exprag 0.1.2
File
exprag-0.1.2-cp38-abi3-win_arm64.whl CPython 3.8 abi3 Windows ARM64 Details
exprag-0.1.2-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details
exprag-0.1.2-cp38-abi3-musllinux_1_2_x86_64.whl CPython 3.8 abi3 Linux musl 1.2+ x86-64 Details
exprag-0.1.2-cp38-abi3-musllinux_1_2_aarch64.whl CPython 3.8 abi3 Linux musl 1.2+ ARM64 Details
exprag-0.1.2-cp38-abi3-manylinux_2_28_x86_64.whl CPython 3.8 abi3 Linux glibc 2.28+ x86-64 Details
exprag-0.1.2-cp38-abi3-manylinux_2_28_aarch64.whl CPython 3.8 abi3 Linux glibc 2.28+ ARM64 Details
exprag-0.1.2-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details

Total release size: 2.5 MB

Release files / exprag-0.1.2.tar.gz

Download URL exprag-0.1.2.tar.gz
Size 25.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1c93d6afe1a20087e2e603c94f65c26a4d4fe2b2a60a45d419f6a36546d8e3a1
BLAKE2b-256 checksum
How to use checksums
ffd695899afb58b05388abeb7d2a7a452d69d8c8a3eb140371124ab355f19dc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 29, 2026.

Transparency log

Release files / exprag-0.1.2-cp38-abi3-win_arm64.whl

Download URL exprag-0.1.2-cp38-abi3-win_arm64.whl
Size 249.3 kB
Tags CPython 3.8 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
c1bd58fb69972f87a1dd0dadbcead1b8947c5cf4c2f5793f03514b0c3fa9b1e8
BLAKE2b-256 checksum
How to use checksums
db0dc79286ce6129b8aeaee59ab4cfe4c3a1fb288481df3dbdb99fa3ae06796d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 29, 2026.

Transparency log

Release files / exprag-0.1.2-cp38-abi3-win_amd64.whl

Download URL exprag-0.1.2-cp38-abi3-win_amd64.whl
Size 261.6 kB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
c47c9d232c2b0b65d76970a43fc07401dcdcbf893ab6b43f07f27d5dfcfa86fe
BLAKE2b-256 checksum
How to use checksums
f32550d7e54d5f946f03966bf6284f8075cd2c9ab36c67ee2c984e2b685819fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 29, 2026.

Transparency log

Release files / exprag-0.1.2-cp38-abi3-musllinux_1_2_x86_64.whl

Download URL exprag-0.1.2-cp38-abi3-musllinux_1_2_x86_64.whl
Size 459.4 kB
Tags CPython 3.8 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
e95cc3a0fbec393dcbb90e446028042638159ec02773308905c5907a64b0f0c6
BLAKE2b-256 checksum
How to use checksums
91ff3cb74ef2092fa8d7b72f00260684cc0fdb66f1280d22f5af3e99ffeb6d14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 29, 2026.

Transparency log

Release files / exprag-0.1.2-cp38-abi3-musllinux_1_2_aarch64.whl

Download URL exprag-0.1.2-cp38-abi3-musllinux_1_2_aarch64.whl
Size 437.2 kB
Tags CPython 3.8 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
a925a8018d7c93a8a373e9ffd81184af2c7bcce52a8874408441d464dac69282
BLAKE2b-256 checksum
How to use checksums
219927c3e270bb26f0d4b14beec5600250e8ecdf669da97a1f68991cf0bbc2eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 29, 2026.

Transparency log

Release files / exprag-0.1.2-cp38-abi3-manylinux_2_28_x86_64.whl

Download URL exprag-0.1.2-cp38-abi3-manylinux_2_28_x86_64.whl
Size 385.9 kB
Tags CPython 3.8 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
f1c4f6be807895387e7ec547d33374c38c4f575e098bc551e4f85c75176a77ea
BLAKE2b-256 checksum
How to use checksums
5abe88bec8ed373a52d54ec46618f461d2b0146aa2571070303e31223b1b30f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 29, 2026.

Transparency log

Release files / exprag-0.1.2-cp38-abi3-manylinux_2_28_aarch64.whl

Download URL exprag-0.1.2-cp38-abi3-manylinux_2_28_aarch64.whl
Size 371.8 kB
Tags CPython 3.8 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
6d8702d9c974c9e161cc3e45742b0c3d204b1b204001b1b35413380aed16cd83
BLAKE2b-256 checksum
How to use checksums
3fb272b60cad08ce26afcacdf87460bd0d308c413f73e47adbc178e46a972ee9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 29, 2026.

Transparency log

Release files / exprag-0.1.2-cp38-abi3-macosx_11_0_arm64.whl

Download URL exprag-0.1.2-cp38-abi3-macosx_11_0_arm64.whl
Size 324.1 kB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6cd2bfbbed9c6480e476a7bb9e9f9a8d6b287f1e1409910369f41cf7f10808bb
BLAKE2b-256 checksum
How to use checksums
50f6e1b5827a0bbf0339220ff8dae5228897e59263349a1bc43452dee2179570
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Apr 29, 2026.

Transparency log

Security for exprag 0.1.2

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

All 8 files in this release have been uploaded with provenance metadata.

Select from 8 files

Attestation for exprag-0.1.2.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 Apr 29, 2026.

Transparency log

A 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.

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