Skip to main content
Send agent events to any destination - HTTP endpoints, databases, cloud services, or your own systems.
PraisonAI uses a protocol-driven design. Implement 3 methods and your sink works with any agent.

Quick Start

1

Create Your Sink

Implement 3 methods: emit(), flush(), close()
2

Connect to Agent

Use trace_context() to capture all agent events

How It Works

The Protocol

Your sink must implement 3 methods. That’s it!
ContextTraceSink is a backward-compatible alias for ContextTraceSinkProtocol.

Example Sinks

Send events to a remote HTTP endpoint with batching.
Store events in SQLite database for later analysis.
Print events to console for debugging.

Event Types

Event Data

Architecture

Best Practices

Buffer Events

Batch events before sending to reduce network calls

Handle Errors

Sink errors are caught silently - tracing never crashes agents

Use trace_context

Automatic cleanup even if exceptions occur

Thread Safety

Use locks if your sink is accessed from multiple threads

Zero Overhead

When tracing is disabled, there’s zero performance impact:

API Reference

ContextTraceEmitter

trace_context

Built-in Sinks

CLI Commands

Use the CLI to manage traces:

Context Replay

Debug agent execution step-by-step

Observability

20+ provider integrations

Observability Hooks — Third-party sink plugins

Register sinks via the praisonai.observability_sinks entry-point group