Skip to main content

Answer 'why did the agent do that?' with saliency, rationale, and counterfactuals

Project description

motive

Answer why did the agent do that? with empirically-grounded explanations for AI agent decisions.

motive uses hierarchical occlusion saliency: mask segments of the input context, measure how much each one affects the model's decision, and surface ranked importance scores and counterfactual what-ifs. No model self-reports. No local weights required. Works with any OpenAI-compatible endpoint.

Installation

pip install motive

Quickstart

from openai import AsyncOpenAI
from motive import SaliencyEngine, Segment

engine = SaliencyEngine(
    client=AsyncOpenAI(base_url="...", api_key="..."),
    model="your-model",
)

result = engine.explain(messages=messages, segments=segments, tools=tools)
print(result.summary())

See examples/demo_saliency.py for a full working example.

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

motive-0.0.2.tar.gz (82.8 kB view details)

Uploaded Source

Built Distribution

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

motive-0.0.2-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file motive-0.0.2.tar.gz.

File metadata

  • Download URL: motive-0.0.2.tar.gz
  • Upload date:
  • Size: 82.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for motive-0.0.2.tar.gz
Algorithm Hash digest
SHA256 6cdc9dfbc524199d0818cebd7d6c324a06f40b31200c808a5e926eb2bfe1dc3f
MD5 8f16a0a6bda576cc90f95e7007f599cb
BLAKE2b-256 5d04bb2b51e6ec1d84058d4ec545146f458253eaab93ddadde4c014277b4e62a

See more details on using hashes here.

Provenance

The following attestation bundles were made for motive-0.0.2.tar.gz:

Publisher: publish.yml on VectorInstitute/motive

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

File details

Details for the file motive-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: motive-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for motive-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 554764657ec34d2aee7a1907949ef1d8e1fdc3532e46a5181bb36989d06770a5
MD5 d0e3b1902c0b2834938c495c6150bf02
BLAKE2b-256 72a420c4b332bcac95380b8473d13149ef7d7dcb1af560145d5f1095471f50de

See more details on using hashes here.

Provenance

The following attestation bundles were made for motive-0.0.2-py3-none-any.whl:

Publisher: publish.yml on VectorInstitute/motive

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