Context Events • AI Agent SDK

Context Events for PraisonAI Agents.

context_events

AI Agent

Context Events for PraisonAI Agents.

Provides context-level tracing for replay functionality. Tracks context changes during agent execution for debugging and replay.

Zero Performance Impact:

  • NoOpSink is the default (zero overhead when not used)
  • Disabled emitter has near-zero overhead
  • Uses __slots__ for memory efficiency

Schema Version: 1.1 (adds optional run_id / parent_seq / node_id; 1.0 files still load)

Import

python
from praisonaiagents.trace import context_events

Classes

Functions

Constants

NameValue
CONTEXT_SCHEMA_VERSION'1.1'
_SPAN_START{'session_start': 'session', 'agent_start': 'agent', 'tool_call_start': 'tool_call', 'workflow_start': 'workflow', 'task_start': 'task', 'step_start': 'step', 'approval_requested': 'approval'}
_SPAN_END{'session_end': 'session', 'agent_end': 'agent', 'tool_call_end': 'tool_call', 'workflow_end': 'workflow', 'task_end': 'task', 'step_end': 'step', 'approval_decided': 'approval'}
_PREVIEW_LIMIT500
_UNSETobject()

Related Documentation