Trace Profiling Schema
Trace Profiling Schema
Chronologue uses profiling metadata to measure, evaluate, and improve agent behavior over time. Inspired by execution profiling systems like CUDA’s CUPTI, this schema enables precise tracking of when agent actions are executed, how well they align with planned time, and how users respond.
Profiling is essential for trust, tuning, and feedback-driven refinement in agent orchestration.
1. Introduction
- Profiling provides runtime visibility into execution latency, feedback alignment, and temporal coherence.
- It applies to all traces involving scheduled or autonomous agent behavior, such as
agent_plan
,calendar_event
, andreflection
. - This schema standardizes profiling for auditability, learning, and reward modeling.
2. Profiling Objectives
- Measure timing accuracy: Compare
scheduled_for
vs.executed_at
- Track duration: How long execution took
- Detect temporal misalignment: With respect to
tempo_tokens
- Support user feedback integration: Ratings, flags, comments
- Enable time-aware optimization: Align planning with real-world timing constraints
- Support retries and agent fallbacks: Track execution attempts and failures
3. Core Profiling Fields
Field | Type | Description |
---|---|---|
schema_version | string | Version of the profiling schema (e.g. v1 ) |
executed_at | string | Timestamp when the action completed |
duration_ms | number | Milliseconds from start to finish |
deviation_ms | number | Difference from scheduled_for (can be negative) |
tempo_token | string | Time anchor for plan evaluation (e.g., <tempo:EveningReview> ) |
tempo_alignment | string | Enum: exact , partial , misaligned |
feedback_score | number | User rating (1–5) post execution |
reward_signal | number | Optional numeric score derived from feedback and tempo adherence |
agent_latency_ms | number | Time taken by the agent/LLM to generate output |
user_delay_ms | number | Time from agent action to user response (e.g., feedback) |
4. Execution Result Metadata (Optional)
Field | Type | Description |
---|---|---|
status | string | One of: completed , failed , skipped , cancelled |
return_type | string | Type of object produced: trace , text , error |
trace_id | string | UID of resulting trace (if applicable) |
planned_by | string | Source of plan (agent name, model ID, or user) |
5. Retry and Attempt Tracking
Chronologue supports structured retries. Each execution attempt can be recorded:
Field | Type | Description |
---|---|---|
attempts[] | array | List of execution attempts, each with its own executed_at , duration_ms , status , and feedback_score |
This is useful for debugging fallbacks, retries, or user rescheduling flows.
6. Embedded Profiling Format
Profiling metadata is stored as an optional nested object in traces.
Example:
7. Tempo Token Alignment Evaluation
Chronologue uses tempo_token
matching to assess execution timing relative to user preferences or agent plan intent.
Alignment | Definition |
---|---|
exact | Executed within ±15 minutes of target window |
partial | Within ±90 minutes, not tightly aligned |
misaligned | More than 90 minutes offset or outside token boundary |
8. Feedback and Reward Integration
Field | Type | Description |
---|---|---|
feedback_score | number | Numeric rating from 1 to 5 |
reward_signal | number | Optional derived reward (e.g., RLHF) |
Agents can be optimized based on both execution accuracy and user perception of value.
9. Implementation Notes
- Profiling should be written post-execution by
executor.py
or a background queue. - Use
schema_version
to ensure future compatibility. - Avoid injecting profiling on static memory traces (e.g., unexecuted logs).
- Store
attempts[]
only when retries or fallback logic is relevant. - Validate
tempo_alignment
against actual time + preferred token rules.
10. Example Payloads
On-Time Reflection with Positive Feedback
Delayed Execution with Retry
Rejected Plan (Not Executed)
Chronologue’s profiling schema creates a consistent and inspectable record of agent performance over time. It bridges scheduled intent with real-world execution, unlocking deeper optimization, personalization, and explainability across memory and planning systems.