Quick Start
1
Step Callback
Monitor each agent step:
2
Tool Call Callback
Monitor tool executions:
Configuration Options
Common Patterns
Pattern 1: Logging All Events
Pattern 2: Custom Middleware
Best Practices
Keep Callbacks Lightweight
Keep Callbacks Lightweight
Callbacks run synchronously. Keep them fast to avoid slowing down the agent.
Use Middleware for Cross-Cutting Concerns
Use Middleware for Cross-Cutting Concerns
Middleware is ideal for logging, metrics, authentication, etc.
Handle Errors in Callbacks
Handle Errors in Callbacks
Wrap callback logic in try/except to prevent callback errors from crashing the agent.
Related
See also — don’t confuse the three systems.
HooksConfig on this page is the live path, consumed by Agent(hooks=...). It is not the same as .praisonai/hooks.json (the standalone Memory HooksManager utility you call yourself). For the full live-hooks package see Hooks.Hooks System
Learn about the hooks system
Memory HooksManager
Standalone
.praisonai/hooks.json utility you invoke yourselfObservability
Monitoring and tracing

