Skip to main content

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 $usage key, 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_NAME for 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's AgentRunStarted/visibility events, coding-agent fields under extensions.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; see CHANGELOG.md for breaking changes).
  • Schema: SCHEMA_VERSION = 2, stamped on KurrentDB metadata under $schema_version by 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

kurrent_agent_schema-0.3.1.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

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

kurrent_agent_schema-0.3.1-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file kurrent_agent_schema-0.3.1.tar.gz.

File metadata

  • Download URL: kurrent_agent_schema-0.3.1.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kurrent_agent_schema-0.3.1.tar.gz
Algorithm Hash digest
SHA256 c0603e597a6c2bcaee45cb4a5b319922da0aba221a8e64252020de2a0d5e4bcc
MD5 10aabfbc2da35aab0228207fa49785c5
BLAKE2b-256 dfb864b0d408ed820b3648fc14667c4901168b9f8c5ed8838794af7f9c54c251

See more details on using hashes here.

Provenance

The following attestation bundles were made for kurrent_agent_schema-0.3.1.tar.gz:

Publisher: schema-publish-pypi.yml on kurrent-io/kurrent-agents

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

File details

Details for the file kurrent_agent_schema-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for kurrent_agent_schema-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c11a5a88633109c1c1ef107c5ee5115aea00319d43b05660235d9b74f77123c
MD5 06991a2ecc0197540ea672391e8fe41f
BLAKE2b-256 e489e32d45fdf21b6b0a5d76c5f53901a4d717217a3739ecabca38fa2d4c6926

See more details on using hashes here.

Provenance

The following attestation bundles were made for kurrent_agent_schema-0.3.1-py3-none-any.whl:

Publisher: schema-publish-pypi.yml on kurrent-io/kurrent-agents

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