Observed since 20 Oct, 22:54 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
agentplane-primitives
Shared, versioned domain primitives (Trace, Span, Envelope) for the AgentPlane products.
One schema for every agent trace.
Shared, versioned Trace, Span and Envelope models for Chronicle, the control plane and TokenOps.
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.
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 tiers | A 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 repos | Chronicle, the control plane and TokenOps import the same models. None defines its own copy. |
| Closed enums | kind, state, status and the other enumerations are closed sets. A new value is a deliberate schema change. |
| Additive-only versioning | SemVer for the package plus a schema_version on every payload. Nothing breaks within a major version. |
W3C traceparent carrier | Parse and format the trace-context header so a trace follows a request across services. |
| No I/O, one dependency | Data and validation only, on pydantic. No network, no disk, no business logic. |
| Contract you can read | Generated JSON Schema, committed and checked in CI, for anything that is not Python. |
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__)"
| You want to | Go to |
|---|---|
| Understand the entities and why there are three tiers | Design |
| Know what may change between versions | Versioning policy |
| Propose a new field or enum value | Schema change proposal |
| Add a model | Contributing |
| Publish a release | Releasing |
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.
| In scope | Out of scope |
|---|---|
Trace, Span, Envelope and their llm and tool payload variants | Storage, HTTP clients or servers |
The traceparent carrier, id generation and validation | Business logic (pricing, policy, replay matching) |
| Enumerations and well-known metadata keys | Visualization or export (the control plane maps to OpenTelemetry) |
| Committed JSON Schema for every model | HTTP request and response wrappers (the control plane owns them, ADR 0003) |
| Anything that performs I/O |
SemVer for the package, plus a schema_version (major.minor) on every payload.
>=1.2,<2.Full policy: docs/versioning.md.
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
Trace, Span, Envelope, the llm and tool payload variants, enums, idstraceparent carriersrc/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
| Need | Where |
|---|---|
| Bug | Open an issue |
| Schema change | Schema change proposal |
| Security issue | SECURITY.md |
| Real-time help | Slack |
| Talk it through | Office hours |
Thanks to everyone who has contributed.
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
pydanticEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | pydantic<3,>=2.6 | runtime |
bdist_wheel · 39.67 KB · Python py3
sdist · 38.13 KB · Python source
Observed since 20 Oct, 22:54 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:c720dfbee8fa6e83ed0422218a186d5822deb2d7ef1f3cdaa9d0cacdb226e7fe