Canonical event schema for Kurrent agent integrations (schema v2)
Project description
kurrent-agent-schema
Canonical event schema types for Kurrent agent integrations — schema version 2.
This package is the Python mirror of the canonical agent event schema shared across Kurrent's agent-framework integrations (Google ADK, Microsoft Agent Framework, Strands, OpenAI Agents, Claude Agent SDK) and Capacitor. The prose specification lives in schema/SCHEMA_v2.md; the .NET mirror is Kurrent.Agent.Schema.
Wire format
Backed by Protobuf codegen from schema/proto/. The JSON wire format follows the proto3 canonical mapping with preserve_proto_field_name (snake_case on the wire). The sanctioned JSON entry points are to_json(event) and from_json(cls, src) — direct calls to google.protobuf.json_format are not supported.
What's here
- Canonical event models (generated Protobuf message classes):
SessionStarted,SessionEnded,SessionContinuedAs,UserMessageReceived,AssistantTextGenerated,AssistantToolCallsGenerated,AssistantThinkingGenerated,ToolResultReceived,InterruptIssued,InterruptResolved,SubagentStarted,SubagentCompleted,FactRetained,ArtifactVersionCreated,EvalRunStarted,TurnScored,EvalRunCompleted. - Value types:
AgentConfig,ToolSpec,ToolCallInfo. - Usage metadata:
TokenUsage(carried on KurrentDB event metadata under the$usagekey, not as a standalone event). - Stream-name builders:
agent_session_stream,agent_subsession_stream,agent_memory_stream,agent_artifact_stream,eval_run_stream. - Type-name registry:
EVENT_TYPE_NAMES/EVENT_TYPE_BY_NAMEfor wiring up KurrentDB event-type to/from CLR-type conversion.
What's not here
- Framework-specific events and extension shapes. ADK's
AgentTransferred/Rewind, AFW's workflow checkpoints, Capacitor'sAgentRunStarted/visibility events, coding-agent fields underextensions.claude_code.*, etc. Those live in their owning integration packages — this package deliberately carries only the portable vocabulary.
Usage
from datetime import datetime, timezone
from kurrent_agent_schema import (
SessionStarted, UserMessageReceived, AssistantTextGenerated,
TokenUsage, USAGE_METADATA_KEY, agent_session_stream,
)
stream = agent_session_stream("sess-0001") # "AgentSession-sess-0001"
event = UserMessageReceived(
content="hello",
message_index=0,
timestamp=datetime.now(tz=timezone.utc),
extensions={"adk": {"invocation_id": "inv_abc"}},
)
# $usage goes on KurrentDB metadata, not the payload
usage = TokenUsage(input_tokens=1507, output_tokens=203, model="claude-sonnet-4-6")
Drift guard
Every canonical event has a JSON fixture under schema/fixtures/events/. The test suite here runs a round-trip assertion per fixture; an equivalent suite in the .NET package runs against the same fixtures. Adding or modifying a canonical field requires a coordinated PR: update the model and the fixture, in both Python and .NET packages. CI fails otherwise.
cd schema/python
uv pip install -e ".[dev]"
pytest
Version
- Package:
0.2.0(Protobuf-generated source; seeCHANGELOG.mdfor breaking changes). - Schema:
SCHEMA_VERSION = 2, stamped on KurrentDB metadata under$schema_versionby integration writers.
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
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 kurrent_agent_schema-0.2.0.tar.gz.
File metadata
- Download URL: kurrent_agent_schema-0.2.0.tar.gz
- Upload date:
- Size: 18.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26504a969e5ad1a79e02e7fea7936b629e0714396701089392a018f8119e4fad
|
|
| MD5 |
26b950b5ba45cc519b4c1196df7212d1
|
|
| BLAKE2b-256 |
bc72cae9bb584a72d6b902308458e9c215e20c6d3d9159883f240368c23d0906
|
Provenance
The following attestation bundles were made for kurrent_agent_schema-0.2.0.tar.gz:
Publisher:
schema-publish-pypi.yml on kurrent-io/kurrent-agents
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kurrent_agent_schema-0.2.0.tar.gz -
Subject digest:
26504a969e5ad1a79e02e7fea7936b629e0714396701089392a018f8119e4fad - Sigstore transparency entry: 1394196355
- Sigstore integration time:
-
Permalink:
kurrent-io/kurrent-agents@a5992b7e98c87dfe65dfbd658a0c92bc8847014d -
Branch / Tag:
refs/tags/schema-python-v0.2.0 - Owner: https://github.com/kurrent-io
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
schema-publish-pypi.yml@a5992b7e98c87dfe65dfbd658a0c92bc8847014d -
Trigger Event:
push
-
Statement type:
File details
Details for the file kurrent_agent_schema-0.2.0-py3-none-any.whl.
File metadata
- Download URL: kurrent_agent_schema-0.2.0-py3-none-any.whl
- Upload date:
- Size: 17.5 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 |
0049b5771bc2982c8eea3904b4b58cf116f9901cead067c18b75f5a451246e05
|
|
| MD5 |
6f9188c3ab9f7ddd9be15df28dfe3e77
|
|
| BLAKE2b-256 |
f96f919ace1c7091358af2386b743ae9949ec3f0f97363c60e55b097511c5cdf
|
Provenance
The following attestation bundles were made for kurrent_agent_schema-0.2.0-py3-none-any.whl:
Publisher:
schema-publish-pypi.yml on kurrent-io/kurrent-agents
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kurrent_agent_schema-0.2.0-py3-none-any.whl -
Subject digest:
0049b5771bc2982c8eea3904b4b58cf116f9901cead067c18b75f5a451246e05 - Sigstore transparency entry: 1394196439
- Sigstore integration time:
-
Permalink:
kurrent-io/kurrent-agents@a5992b7e98c87dfe65dfbd658a0c92bc8847014d -
Branch / Tag:
refs/tags/schema-python-v0.2.0 - Owner: https://github.com/kurrent-io
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
schema-publish-pypi.yml@a5992b7e98c87dfe65dfbd658a0c92bc8847014d -
Trigger Event:
push
-
Statement type: