Catalog PyPI
Back to packageRELEASE DETAILS

0.2.0

PyPI

agentplane-primitives

Shared, versioned domain primitives (Trace, Span, Envelope) for the AgentPlane products.

agentsllmobservabilitypydanticschematracing
Published14 Oct 2026
Direct dependencies1
Transitive dependenciesNot calculated

README

Version 0.2.0 documentation

AgentPlane Primitives

One schema for every agent trace.
Shared, versioned Trace, Span and Envelope models for Chronicle, the control plane and TokenOps.

CI Python License: MIT Typed GitHub stars LinkedIn

Built by Susheem Koul and Tisha Chawla


Core features · Quickstart · How it fits · Scope · Versioning · Development · Support

🚧 Pre-alpha

This release is the repository scaffold. The models land in follow-up releases (see the roadmap). Everything under Core features describes the design these releases implement.

✨ Core features

Chronicle records what an agent did, the control plane stores and shows it, and TokenOps reads it to govern spend. Those three only work together if they agree on the shape of the data. This package is that agreement, and nothing else.

Three tiersA Trace is one request across services, a Span is one service's handling of it, an Envelope is one boundary crossing inside the span.
One definition, three reposChronicle, the control plane and TokenOps import the same models. None defines its own copy.
Closed enumskind, state, status and the other enumerations are closed sets. A new value is a deliberate schema change.
Additive-only versioningSemVer for the package plus a schema_version on every payload. Nothing breaks within a major version.
W3C traceparent carrierParse and format the trace-context header so a trace follows a request across services.
No I/O, one dependencyData and validation only, on pydantic. No network, no disk, no business logic.
Contract you can readGenerated JSON Schema, committed and checked in CI, for anything that is not Python.

🚀 Quickstart

Requires Python 3.10+. The package is typed (PEP 561).

pip install agentplane-primitives

Or install from source:

git clone https://github.com/theagentplane/primitives.git
cd primitives
pip install -e .
python -c "import agentplane_primitives as p; print(p.__version__)"

When you need more

You want toGo to
Understand the entities and why there are three tiersDesign
Know what may change between versionsVersioning policy
Propose a new field or enum valueSchema change proposal
Add a modelContributing
Publish a releaseReleasing

🧩 How it fits

flowchart LR
    P["primitives<br/>Trace · Span · Envelope"]
    C["Chronicle<br/>edge SDK: record, save, replay"]
    CP["Control plane<br/>storage, query, visualization"]
    T["TokenOps<br/>governance"]

    C -->|imports| P
    CP -->|imports| P
    T -->|imports| P
    C -->|"envelopes over HTTP"| CP
    T -->|"reads cost data"| CP

The control plane owns the schema, and this package is where that schema is defined and shared. Chronicle never talks to a database. It sends envelopes to the control plane, which keeps its own storage layout and maps from these models.

🎯 Scope

In scopeOut of scope
Trace, Span, Envelope and their llm and tool payload variantsStorage, HTTP clients or servers
The traceparent carrier, id generation and validationBusiness logic (pricing, policy, replay matching)
Enumerations and well-known metadata keysVisualization or export (the control plane maps to OpenTelemetry)
Committed JSON Schema for every modelHTTP request and response wrappers (the control plane owns them, ADR 0003)
Anything that performs I/O

🔖 Versioning

SemVer for the package, plus a schema_version (major.minor) on every payload.

  • Additive-only within a major. New optional fields are allowed. A new enum member is additive for the writer, but older readers reject it, so consumers upgrade before emitters.
  • A breaking change is a new major. The control plane accepts the current and previous major.
  • Pre-1.0: pin the exact minor. From 1.0: >=1.2,<2.

Full policy: docs/versioning.md.

🛠 Development

Uses uv.

uv sync                                   # environment with the dev group
uv run pytest --cov                       # tests
uv run ruff check . && uv run ruff format --check .
uv run mypy                               # strict type check
uv build                                  # sdist and wheel

🗺 Roadmap

  1. ✅ Repository scaffold
  2. ✅ Trace, Span, Envelope, the llm and tool payload variants, enums, ids
  3. ✅ The traceparent carrier
  4. ✅ Committed JSON Schema and the CI drift check
  5. First release (0.1.0): see RELEASING.md

Reference

Project structure
src/agentplane_primitives/   # installable package (typed; version in _version.py)
├── enums/                   # closed lists, one file each: kind, state, status, link type
├── types/                   # field types: id types, metadata key and label types
├── models/                  # the models: base class now; Trace, Span, Envelope to come
├── utils/                   # helper functions: id generation, reserved-key check (traceparent later)
└── schemas/                 # generated JSON Schema, committed and drift-checked in CI
                             # (more models and the traceparent carrier arrive in later PRs)
docs/                        # design notes and the versioning policy
tests/                       # unit tests
.github/                     # CI, release, dependency updates, templates
More documentation

🛟 Support

NeedWhere
BugOpen an issue
Schema changeSchema change proposal
Security issueSECURITY.md
Real-time helpSlack
Talk it throughOffice hours

Contributors

Thanks to everyone who has contributed.

Contributors


Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 1

Native requirements
1 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
pydantic
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
pydantic<3,>=2.6runtime

Distribution files

2 collected
agentplane_primitives-0.2.0-py3-none-any.whl

bdist_wheel · 39.67 KB · Python py3

Source file
agentplane_primitives-0.2.0.tar.gz

sdist · 38.13 KB · Python source

Source file

Repository

PENDING
theagentplane/primitives

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:54 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:c720dfbee8fa6e83ed0422218a186d5822deb2d7ef1f3cdaa9d0cacdb226e7fe

Other collected versions

View all collected versions →