Skip to main content
Profile agent runs with bounded buffers that stay safe in long-lived production workloads.
The user runs a profiled task; timing and memory stats accumulate in a bounded buffer.

How It Works

Quick Start

1

Simple Usage

Enable profiling and wrap an agent turn:
2

With Configuration

Time blocks and export a report:

How It Works

Profiling is off by default — decorators and context managers are no-ops until you call Profiler.enable() or set PRAISONAI_PROFILE=1. Each buffer uses a bounded deque — when full, oldest records drop. See Performance Profiling for per-agent isolation via set_profiler().

Configuration Options


Best Practices

Enable only when debugging — overhead is near zero when off, but reports and tracemalloc add cost when on.
Default 10k records ≈ 1–2 MB per buffer. Lower PRAISONAI_PROFILE_MAX in containers.
Ring buffers keep recent data only — export JSON/HTML before buffers rotate.
Profiler.block("llm_call") and Profiler.block("tool_execution") make reports readable.

Performance Profiling

Per-agent profiler isolation for multi-agent runs

Observability Overview

Traces, metrics, and logging