Skip to main content

TraceMotive

When an AI agent succeeds once and fails once, the difficult question is often not “did the runs differ?” but “where is the first difference that the evidence actually supports investigating?”

TraceMotive compares AI agent executions and shows where their observed behavior first diverges with enough evidence to support an investigation starting point. It runs locally, keeps the Collector and SQLite data on the machine, and presents uncertainty when the evidence cannot support a narrower claim.

TraceMotive does not claim that an observed divergence caused a later failure. It does not provide automatic RCA, replay, cloud observability, authentication, remote collectors, or broad framework support.

TraceMotive demo

Try it locally in about three minutes

This is the normal installed-user path. It uses a deterministic local pair, so it needs no model provider, API key, Node.js, npm, cloud service, or external network request.

In the first terminal, install the server extra and start the loopback server:

python -m pip install "tracemotive[server]"
tracemotive serve

tracemotive serve binds to 127.0.0.1:8765 and serves the packaged UI and APIs. Keep this terminal running.

In a second terminal, seed the stable identified example:

tracemotive demo

Open the printed comparison URL. In the comparison, use the compact workflow:

  • Look here — the first evidence-supported investigation starting point;
  • What changed — the best supported behavioral description;
  • Evidence — captured observations and their limitations;
  • Next — open the left span, right span, or full comparison; and
  • What TraceMotive does not know — the boundary between observation and explanation.

To see the uncertainty barrier for repeated members, run this in the second terminal instead:

tracemotive demo --scenario uncertain

Each invocation creates a fresh pair and leaves existing traces in place. The default demo is identified; the uncertain demo keeps repeated members unpaired when the evidence cannot establish their identity.

What the comparison means

TraceMotive reports observed evidence, not a diagnosis. A selected starting point means that the comparison found a supported place to begin investigating; it does not mean that TraceMotive knows the cause of a later failure.

The structured diff is deliberately conservative. It compares object keys in a deterministic order and emits bounded add, remove, and replace records at JSON Pointer paths. Arrays do not receive inferred identity or move semantics; complex arrays may fall back to a whole-array replacement. If capture is unavailable or redaction prevents a safe comparison, TraceMotive does not invent a detailed diff.

Evaluation scope

The public evaluation claim is limited to the current V03-10 adversarial corpus. In that 30-scenario corpus:

  • 30 scenarios are mandatory;
  • 15 have an expected confident meaningful-divergence answer;
  • 14 have an expected supported investigation starting point;
  • the false-confident meaningful-divergence target/result for a conforming outcome set is 0; and
  • the false-confident investigation-starting-point target/result for a conforming outcome set is 0.

The corpus is intended to exercise ambiguity, incomplete traces, capture/redaction barriers, repeated tools, context-only changes, and structural divergence ordering. These are corpus-scoped oracle facts, not a universal accuracy guarantee, confidence percentage, causal claim, or independent benchmark.

The reproducible oracle checks are:

python -m unittest tests.test_divergence_evaluation -v
python -m tests.divergence_evaluation

The full report is the v0.3 divergence evaluation.

Supported integration

The validated framework integration is the public OpenAI Agents SDK adapter. The tested support range is openai-agents>=0.17,<0.18, with compatibility checks at versions 0.17.0, 0.17.4, and 0.17.8 for the adapter callbacks, span-data fields, processor registration, model settings, and example construction surface.

Install it separately when you want to instrument a real agent:

python -m pip install "tracemotive[openai-agents]"

The actual-agent example requires the model provider's credentials. It is not needed for the local deterministic demo. With the Collector already running:

python -m examples.openai_agents_example

local_only=True makes TraceMotive the only OpenAI Agents tracing processor in that process. It controls framework tracing processors; it does not make model traffic local. A provider request may still leave the machine.

LangGraph is not a validated integration in this checkout and is not part of the current support claim. It is conditional v0.4 design work only if its full public-runtime GO gate passes; otherwise it is deferred to v0.4.1. No other framework receives a support claim by analogy.

See the OpenAI Agents integration notes and the example README for the validated integration path.

Install a released package

The current release candidate distribution metadata is 0.4.0; this checkout is prepared for release but has not been published. For a normal installation:

python -m pip install tracemotive

For the local Collector and packaged UI:

python -m pip install "tracemotive[server]"

Normal installed users do not install Node.js, run npm, or run the repository bootstrap script.

Contributor setup from a fresh checkout

Contributor setup is separate from the installed-user path. Create and activate a virtual environment, install development dependencies, and then run the one canonical repository bootstrap command.

PowerShell:

python -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install "setuptools>=77,<84" wheel build
python -m pip install -e ".[server]"
python scripts/bootstrap.py

POSIX shells:

python3 -m venv .venv
. .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install "setuptools>=77,<84" wheel build
python -m pip install -e ".[server]"
python scripts/bootstrap.py

python scripts/bootstrap.py runs the locked frontend install and package build from the repository root. It writes only disposable ignored generated UI assets. The development frontend is optional:

cd frontend
npm run dev

The production UI is embedded in the Python package and served by tracemotive serve; Node.js is not a runtime requirement for installed users.

For a maintainer-only direct Uvicorn factory check, the equivalent loopback command is:

python -m uvicorn tracemotive.collector:create_app --factory --host 127.0.0.1 --port 8765

Local SDK usage

TraceMotive and content capture are independently disabled by default. A minimal local trace is:

import tracemotive

tracemotive.configure(
    enabled=True,
    endpoint="http://127.0.0.1:8765",
    capture_content=False,
)

with tracemotive.trace("demo"):
    with tracemotive.span("work"):
        pass

tracemotive.flush()

The stable SDK surface remains configure, trace, span, and flush. Tracing failures, an unavailable Collector, and queue overflow do not fail the instrumented Agent execution.

Privacy and security boundary

  • TraceMotive is disabled by default and includes no analytics or external TraceMotive telemetry.
  • Content capture is independently disabled by default.
  • The supported Collector transport is loopback-only.
  • Framework adapters convert data into Canonical values before the shared privacy boundary redacts and sanitizes values before transport queue ownership.
  • The Collector persists sanitized Canonical-derived data in local SQLite.
  • Captured runtime content is untrusted data. The frontend renders it as data and does not execute embedded HTML, script, or arbitrary code.
  • Tracing and sink failures remain isolated from the user's Agent execution.
  • Provider traffic, such as an OpenAI model request, is separate from TraceMotive telemetry and may leave the machine.

Do not treat these statements as a formal security audit. For sensitive reports, read SECURITY.md and use GitHub Private Vulnerability Reporting rather than a public issue.

Compatibility and documentation layers

The repository intentionally keeps these layers separate:

Layer Meaning
spec/v0.1-frozen-spec.md Historical Frozen compatibility contract for Canonical schema, ingest, privacy, transport, and v1 behavior. It remains authoritative and unchanged.
spec/v0.2-proposed-spec.md and spec/v0.3-proposed-spec.md Historical proposed design documents; they are not permission to rewrite the v0.1 contract.
Package metadata 0.4.0 distribution version; not a Canonical schema, ingest protocol, or automatic API version trigger.
Canonical and ingest Canonical schema 0.1; ingest protocol 1.
Query APIs /api/v1, /api/v2, and /api/v3 remain compatibility surfaces. /api/v4/compare/{left}/{right} is the additive v0.4 structured-diff projection.
docs/v0.4/ Frozen-for-implementation v0.4 design and release requirements; it is not itself a package-version or release declaration.

The v0.4 API v3/v4 decision is contract-driven. /api/v3 remains unchanged. /api/v4 is needed because bounded operation diff records, explicit no-diff capture semantics, conservative array fallback, and cockpit action targets cannot be added to the existing v3 response without changing that contract. This is not API versioning caused by the package number.

Local validation

Python tests:

python -m unittest discover -s tests -v

Frontend tests and production build:

python scripts/bootstrap.py
cd frontend
npm test
npm run build

Packaging and installed-user checks are maintainer validation documented in the historical release-readiness checklist. They are separate from the normal installed-user quickstart.

Contributing

Read CONTRIBUTING.md before making changes. Keep changes within the current v0.4 Core scope while preserving the Frozen v0.1 contract. Do not infer support for deferred or conditional features from the long-term vision or from a passing unit test with a fake framework object.

Security

Do not report security vulnerabilities in public Issues or pull requests. Read SECURITY.md and use GitHub Private Vulnerability Reporting from the repository Security page.

Download files

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

Source Distribution

tracemotive-0.4.0.tar.gz (191.1 kB view details)

Uploaded Source

Built Distribution

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

tracemotive-0.4.0-py3-none-any.whl (200.8 kB view details)

Uploaded Python 3

File details

Details for the file tracemotive-0.4.0.tar.gz.

File metadata

  • Download URL: tracemotive-0.4.0.tar.gz
  • Upload date:
  • Size: 191.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tracemotive-0.4.0.tar.gz
Algorithm Hash digest
SHA256 be413ef292ddf19a47f84af05b40c54a30de03df862d6f0dd781538753c070ba
MD5 96cc232855be7d16ac94bf3a6b944e46
BLAKE2b-256 26916e5eb8c1a50ef6ce85b57b5ab4637081f29141fa3de2465b71de928c3ef6

See more details on using hashes here.

Provenance

The following attestation bundles were made for tracemotive-0.4.0.tar.gz:

Publisher: release.yml on doraemonfv-glitch/tracemotive

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

File details

Details for the file tracemotive-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: tracemotive-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 200.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tracemotive-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 79b515d65f07e6b4746fb0c8bbb26a93f0d9c7b0eebb7856d104008a06a481ed
MD5 6fb8d77fa4c1534da1158685ea100c36
BLAKE2b-256 8c772a55b134cc07c17c9447d80d48481ead047bd686907b9f8c39339a134f89

See more details on using hashes here.

Provenance

The following attestation bundles were made for tracemotive-0.4.0-py3-none-any.whl:

Publisher: release.yml on doraemonfv-glitch/tracemotive

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 Sentry Error logging StatusPage Status page