Skip to main content

Experiment tracker made for LLM interaction.

Project description

exprag

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, and the working-tree diff. That means an agent can reconstruct not only the checked-in commit, but also the uncommitted edits that existed when the run was made.

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 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?"

"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 back to the run that achieved the highest accuracy."

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:

  • current commit
  • current branch
  • whether the worktree was dirty
  • git status --porcelain
  • git diff --no-ext-diff HEAD
  • 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. Check out the recorded commit.
  4. Reapply the recorded dirty diff if needed.
  5. Verify that the repository matches the code that produced the run.

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 changes compared with my current checkout."

Project details


Download files

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

Source Distribution

exprag-0.1.0.tar.gz (20.7 kB view details)

Uploaded Source

Built Distributions

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

exprag-0.1.0-cp38-abi3-win_arm64.whl (245.4 kB view details)

Uploaded CPython 3.8+Windows ARM64

exprag-0.1.0-cp38-abi3-win_amd64.whl (254.2 kB view details)

Uploaded CPython 3.8+Windows x86-64

exprag-0.1.0-cp38-abi3-musllinux_1_2_x86_64.whl (452.8 kB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ x86-64

exprag-0.1.0-cp38-abi3-musllinux_1_2_aarch64.whl (431.4 kB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARM64

exprag-0.1.0-cp38-abi3-manylinux_2_28_x86_64.whl (380.1 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ x86-64

exprag-0.1.0-cp38-abi3-manylinux_2_28_aarch64.whl (366.3 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ ARM64

exprag-0.1.0-cp38-abi3-macosx_11_0_arm64.whl (319.7 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

Details for the file exprag-0.1.0.tar.gz.

File metadata

  • Download URL: exprag-0.1.0.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for exprag-0.1.0.tar.gz
Algorithm Hash digest
SHA256 73088619bf0151d6265a4d30e556a8a7ffd4b04ed8e4865589e9e51bc4679e66
MD5 dea3e29bf04a07fa5f48c52ec16bf49a
BLAKE2b-256 cd5ab660c643029c812d7f4c4962899f8b9f8568907dda392f9e6e09a3599c34

See more details on using hashes here.

Provenance

The following attestation bundles were made for exprag-0.1.0.tar.gz:

Publisher: cd.yml on pfackeldey/exprag

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

File details

Details for the file exprag-0.1.0-cp38-abi3-win_arm64.whl.

File metadata

  • Download URL: exprag-0.1.0-cp38-abi3-win_arm64.whl
  • Upload date:
  • Size: 245.4 kB
  • Tags: CPython 3.8+, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for exprag-0.1.0-cp38-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 b703740ab246769a42880d83b131744382032bff913ab87e6fb2b24983293178
MD5 73dbeab552b6eb156336b20eb0712bcb
BLAKE2b-256 6762da80fc9b0cfb95bb79e9738c946855fead437c92ce45b5fbfae0772e50d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for exprag-0.1.0-cp38-abi3-win_arm64.whl:

Publisher: cd.yml on pfackeldey/exprag

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

File details

Details for the file exprag-0.1.0-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: exprag-0.1.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 254.2 kB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for exprag-0.1.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5548430564c6f86cdd2dcba37b4d628a3367ac5d06770ae9b8896c5a85f55f88
MD5 8009ce3cb80296c1883803809212535a
BLAKE2b-256 50a736c719f7563516ec7457f651551b6abc8ba0fc796d9eb9bcc83462ee09fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for exprag-0.1.0-cp38-abi3-win_amd64.whl:

Publisher: cd.yml on pfackeldey/exprag

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

File details

Details for the file exprag-0.1.0-cp38-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for exprag-0.1.0-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9f5705ce43dd0b9032ab98f8de771a11e57ab46100d10f63df1202dbd58d052e
MD5 63f9084d55bf3462fd9b052c11e88b45
BLAKE2b-256 0c8053ca7a9b3d149b056273b4bcdcd3dbf9cc6526648019f4748305eda970fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for exprag-0.1.0-cp38-abi3-musllinux_1_2_x86_64.whl:

Publisher: cd.yml on pfackeldey/exprag

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

File details

Details for the file exprag-0.1.0-cp38-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for exprag-0.1.0-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 48dd097f68bd13115366fda7203695e965b68c6e115f4014813d4fc2ec2dffd3
MD5 00d8b04ca31806921b1b9610590f24dc
BLAKE2b-256 9a2fba7e5eee199aee63fd1a0ad0042263ef105c7d3821f9447785f65081b235

See more details on using hashes here.

Provenance

The following attestation bundles were made for exprag-0.1.0-cp38-abi3-musllinux_1_2_aarch64.whl:

Publisher: cd.yml on pfackeldey/exprag

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

File details

Details for the file exprag-0.1.0-cp38-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for exprag-0.1.0-cp38-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 87c67bb59ac6349e94ef9b1b5eb8eed57d1b12dc90f71b2fc3b426fa9a0a8944
MD5 178c0c85193363006144efa62d4a60a9
BLAKE2b-256 fc9ce93875d33688acef4ef0e0343565970540a1b100636fa2ca5aaa5a47cd32

See more details on using hashes here.

Provenance

The following attestation bundles were made for exprag-0.1.0-cp38-abi3-manylinux_2_28_x86_64.whl:

Publisher: cd.yml on pfackeldey/exprag

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

File details

Details for the file exprag-0.1.0-cp38-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for exprag-0.1.0-cp38-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2971a5b3d416b99a5773d04fd56629632f732f9c22fdd24ed7b6064dc8734c46
MD5 ad9f3b335b9cf2b833a37c8c8516dd47
BLAKE2b-256 0b9143fbacdf1d847aac5a7f31f84a723decd6017138a9b5441bc6ecbe54cba1

See more details on using hashes here.

Provenance

The following attestation bundles were made for exprag-0.1.0-cp38-abi3-manylinux_2_28_aarch64.whl:

Publisher: cd.yml on pfackeldey/exprag

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

File details

Details for the file exprag-0.1.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: exprag-0.1.0-cp38-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 319.7 kB
  • Tags: CPython 3.8+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for exprag-0.1.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 30d1886e5b00a6c7b462fafee8b76fda17e1b09a77cd2c757a2fc5894e3526db
MD5 df5460bc66a0ed6d8e9376b740927466
BLAKE2b-256 37530476619138d2d9250a9fb15db22cc7a7f18a2eb3400bd4b1af2953284591

See more details on using hashes here.

Provenance

The following attestation bundles were made for exprag-0.1.0-cp38-abi3-macosx_11_0_arm64.whl:

Publisher: cd.yml on pfackeldey/exprag

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page