Skip to main content

Experiment tracker made for LLM interaction.

Project description

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, 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

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

"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.1.tar.gz (24.9 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.1-cp38-abi3-win_arm64.whl (249.4 kB view details)

Uploaded CPython 3.8+Windows ARM64

exprag-0.1.1-cp38-abi3-win_amd64.whl (261.6 kB view details)

Uploaded CPython 3.8+Windows x86-64

exprag-0.1.1-cp38-abi3-musllinux_1_2_x86_64.whl (459.4 kB view details)

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

exprag-0.1.1-cp38-abi3-musllinux_1_2_aarch64.whl (437.3 kB view details)

Uploaded CPython 3.8+musllinux: musl 1.2+ ARM64

exprag-0.1.1-cp38-abi3-manylinux_2_28_x86_64.whl (385.9 kB view details)

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

exprag-0.1.1-cp38-abi3-manylinux_2_28_aarch64.whl (371.7 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.28+ ARM64

exprag-0.1.1-cp38-abi3-macosx_11_0_arm64.whl (324.0 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: exprag-0.1.1.tar.gz
  • Upload date:
  • Size: 24.9 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.1.tar.gz
Algorithm Hash digest
SHA256 b46c28fa7946be2981396eb281bbf5a5e09ee85136e056930993e0cde19241fd
MD5 68c969238c44e6e31771194986a747dc
BLAKE2b-256 6d79b62c0f192f7b0b9a5cfccfc922adb9b6b51f65870471b6d4c1ab3915db4e

See more details on using hashes here.

Provenance

The following attestation bundles were made for exprag-0.1.1.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.1-cp38-abi3-win_arm64.whl.

File metadata

  • Download URL: exprag-0.1.1-cp38-abi3-win_arm64.whl
  • Upload date:
  • Size: 249.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.1-cp38-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 1019b280527bb65e632a59890aa8fdd61b137bb404554356be3636761de4223e
MD5 08f2788fb5d6e43a37015e8db03dda40
BLAKE2b-256 1164c0bed79d9b7a89de49e5173b4bf95ce18b26dccbca305f923914158969d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for exprag-0.1.1-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.1-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: exprag-0.1.1-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 261.6 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.1-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c5aa256aff14a36e024a5a58fae32c21e4357d40eae10075969ed2f350087738
MD5 373753bc31cad0ed9bcedf27a4e8e6ad
BLAKE2b-256 56fbac2e7d28ead59e5152b26e24bb9e676b4559b47e9d13f73b8125dd886448

See more details on using hashes here.

Provenance

The following attestation bundles were made for exprag-0.1.1-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.1-cp38-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for exprag-0.1.1-cp38-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c6b012738948b6835983a24757432920db455b82865ee6da36629c00cfd753fd
MD5 e0d88f9bd27a29493048116b5b97f9d3
BLAKE2b-256 f1b0ce88e0a50c6d674cb8932a3adc11365e558bb8d048641a5a135dc3f09126

See more details on using hashes here.

Provenance

The following attestation bundles were made for exprag-0.1.1-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.1-cp38-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for exprag-0.1.1-cp38-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 20e6df1811faf81d64f0dd2dad5c4590fb81e937fae2106f79c7beb5cb2fd58e
MD5 02b515ddf87660415e7e9319f8216bc8
BLAKE2b-256 1c09e0a75014a195b0f2feee1856b2a17e64f47531d09a5b0d99e1da6fbbfa62

See more details on using hashes here.

Provenance

The following attestation bundles were made for exprag-0.1.1-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.1-cp38-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for exprag-0.1.1-cp38-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 70597a0d209f5754325cdfe86768207fe594bccc6960449cdb21307be012328b
MD5 3b980eb4a72a2c24a3074c3604423cc6
BLAKE2b-256 984486a478d8a5603b710b72f3f9c02a80e06960e9a176dc14b8ea98a74ce4a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for exprag-0.1.1-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.1-cp38-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for exprag-0.1.1-cp38-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a477b0d4f94d2e0437562a21473d08f211cf9179182e1fa61ddfba44243f74fb
MD5 30dd68a939e30364e897a62db66e0ec2
BLAKE2b-256 7b77db31a2b09c456dd6fc8734778c00f350117b5c060c145a35bf7d252cede4

See more details on using hashes here.

Provenance

The following attestation bundles were made for exprag-0.1.1-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.1-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: exprag-0.1.1-cp38-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 324.0 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.1-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cb58e5b2ed3b8154591879249d7f37b82db607ea77a7ca4967805c614370b144
MD5 dbbac4699698bde65f88ec7ebaee0f33
BLAKE2b-256 a361fc7b3d23f27113ba0056f0a1041e278e11e80a51db6cbeacfc70c2f57992

See more details on using hashes here.

Provenance

The following attestation bundles were made for exprag-0.1.1-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