Pydantic models for the Agent Trajectory Interchange Format (ATIF v1.7).
Project description
atif
Pydantic models for the Agent Trajectory Interchange Format (ATIF), a standardized JSON schema for logging the complete interaction history of autonomous LLM agents — user messages, agent responses, tool calls, observations, metrics, and embedded subagent trajectories. Implements ATIF v1.7.
Install
pip install atif
Usage
from atif import Trajectory
data = {
"schema_version": "ATIF-v1.7",
"agent": {"name": "my-agent", "version": "1.0.0", "model_name": "claude-sonnet-4-6"},
"steps": [
{"step_id": 1, "source": "user", "message": "What time is it?"},
{
"step_id": 2,
"source": "agent",
"message": "Let me check.",
"tool_calls": [
{"tool_call_id": "c1", "function_name": "now", "arguments": {}}
],
"observation": {
"results": [{"source_call_id": "c1", "content": "2026-05-16T12:00:00Z"}]
},
"metrics": {"prompt_tokens": 120, "completion_tokens": 18},
},
],
}
trajectory = Trajectory.model_validate(data)
print(trajectory.steps[1].tool_calls[0].function_name) # "now"
print(trajectory.to_json_dict(exclude_none=True))
Validation enforces the ATIF rules: sequential step_ids, ISO 8601 timestamps,
agent-only fields gated on source == "agent", tool-call / observation
correlation, embedded-subagent trajectory_id uniqueness, and
ContentPart text/image XOR.
Versioning
atif's MAJOR.MINOR tracks the ATIF RFC version it implements
(1.7.x ⇔ ATIF v1.7); PATCH is reserved for library-only fixes. Because
the ATIF RFC occasionally introduces breaking changes on a MINOR bump
(e.g. v1.7's SubagentTrajectoryRef resolution change), a MINOR bump of
this library may be breaking too — pin to atif~=1.7.0 if you need to
stay on a single ATIF version.
AI disclosure
Parts of this project, including code, tests, and documentation, were written with the assistance of AI tooling. Readers should be aware that AI was involved in its production.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file atif-1.7.0.tar.gz.
File metadata
- Download URL: atif-1.7.0.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
668cf3d4592a2147e62a4c2fc3663faacb3217a1627b395a1e0f354076f79d3f
|
|
| MD5 |
e75d5cd0070b925fcc9d56959efdd5df
|
|
| BLAKE2b-256 |
c114b0629cab0a86470c31d530498fc39c65a8385eaf95f4f39dbcde695284c5
|
Provenance
The following attestation bundles were made for atif-1.7.0.tar.gz:
Publisher:
publish.yml on bolu61/python-atif
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
atif-1.7.0.tar.gz -
Subject digest:
668cf3d4592a2147e62a4c2fc3663faacb3217a1627b395a1e0f354076f79d3f - Sigstore transparency entry: 1552401942
- Sigstore integration time:
-
Permalink:
bolu61/python-atif@ae2ebbbc566c5b87ee9a1a376a0a53e2f2e85fbd -
Branch / Tag:
refs/tags/v1.7.0 - Owner: https://github.com/bolu61
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ae2ebbbc566c5b87ee9a1a376a0a53e2f2e85fbd -
Trigger Event:
release
-
Statement type:
File details
Details for the file atif-1.7.0-py3-none-any.whl.
File metadata
- Download URL: atif-1.7.0-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bb0c09a6d94ff5a73f6253a2aeb101d41d0724cfd0cdb8d96541ac4f2b7ab6c
|
|
| MD5 |
d0b8303c2de05ebcf35f16c5d24ed13e
|
|
| BLAKE2b-256 |
ba97cddb7c5cebe218534563533600eacc57beaace90ee85c435126214f5b18b
|
Provenance
The following attestation bundles were made for atif-1.7.0-py3-none-any.whl:
Publisher:
publish.yml on bolu61/python-atif
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
atif-1.7.0-py3-none-any.whl -
Subject digest:
7bb0c09a6d94ff5a73f6253a2aeb101d41d0724cfd0cdb8d96541ac4f2b7ab6c - Sigstore transparency entry: 1552401962
- Sigstore integration time:
-
Permalink:
bolu61/python-atif@ae2ebbbc566c5b87ee9a1a376a0a53e2f2e85fbd -
Branch / Tag:
refs/tags/v1.7.0 - Owner: https://github.com/bolu61
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ae2ebbbc566c5b87ee9a1a376a0a53e2f2e85fbd -
Trigger Event:
release
-
Statement type: