Skip to main content
Context observability provides optimization history tracking, event logging, and debugging tools. The user debugs a run; context observability logs compaction and overflow events with token savings.

How It Works

Quick Start

1

Process messages and read history

2

Inspect via chat commands

Optimization Events

OptimizationEvent

Sinks may see a result with emergency_truncated: True even when the configured strategy raised. This is the failure-fallback path from PraisonAI PR #4242 — the strategy failed, so the manager fell back to emergency truncation to keep the request inside the model window. Treat it as expected, not an error state, and distinguish it from a normal strategy-driven optimization event (where emergency_truncated is absent). See Context Strategies → Failure Fallback.

History Tracking

CLI Commands

Context Stats

CLI Stats Commands

Monitoring Integration

Events are included in monitor snapshots:

Best Practices

Check which optimisations ran when answers suddenly degrade mid-session.
A reverted compression means the strategy did not help — try retrieval or summarisation instead.
Treat overflow warnings as action items, not noise — fix before the API rejects the request.

Context Monitor

Real-time context snapshots

Context Strategies

Optimisation strategies and defaults

Gateway Tracing Hook

Emit OpenTelemetry spans across each gateway pipeline stage