Protocol Choice
Quick Start
1
Basic Lifecycle
Create agent, environment, session, then send events and stream responses.
2
With Advanced Configuration
Full configuration with packages, networking, and vaults.
How It Works
Protocol Methods
Agent Management
Environment Management
Session Management
Event Handling
Per-call execute() kwargs
AnthropicManagedAgent.execute() and LocalManagedAgent.execute() honour two per-call keyword arguments that ComputeManagedAgent has always honoured.
Fixed in PraisonAI PR #5774 (issue #5773). Before #5774, both
execute() methods were one-liners of the shape await loop.run_in_executor(None, self._execute_sync, prompt), so every caller-supplied kwarg was silently discarded. ComputeManagedAgent honoured timeout, AnthropicManagedAgent used its instance-level self.timeout, and LocalManagedAgent was effectively unbounded. #5774 routes both through a shared ManagedBackendBase._execute_in_executor helper that honours stream_live and timeout and calls interrupt() on timeout. Unknown kwargs are still accepted (not raised as TypeError) to avoid breaking existing callers.Since PraisonAI PR #3908,
agent.start(prompt, stream=True) yields chunks from backend.stream() as they arrive, on both async and sync callers. Earlier releases buffered the full response in the sync (no running event loop) path. See Streaming → Managed-backend streaming.Common Patterns
Multi-Turn Conversation
Agent Version Pinning
Session Cleanup
Best Practices
Resource Management
Resource Management
Create agents and environments once, reuse across sessions:
Error Handling
Error Handling
Handle network failures and provider errors gracefully:
Event Processing
Event Processing
Handle different event types appropriately:
Performance Optimization
Performance Optimization
- Reuse agent/environment definitions across sessions
- Use appropriate session cleanup (archive vs delete)
- Pin agent versions for consistent behavior
- Filter list operations to reduce API calls
Related
Sandboxed Agent
Local agent loop with optional tool sandboxing
Managed Agent Lifecycle
Complete CRUD operations for agents, environments, sessions
Streaming
How
backend= streams each chunk incrementally from sync code
