How It Works
The agent applies the advanced feature transparently, then returns the result to the user.Quick Start
Core SDK Features
Auto-Summarization
Automatically summarize conversations when the context window fills up, preserving important context while reducing token usage.Message Queue
Priority-based message queue for agent prompts with thread-safe operations.MCP Tool Filtering
Filter MCP tools with disabled lists or allowlists.Permission Allowlist
Persistent permission allowlist for pre-approving tools and paths.CLI Features
Safe Shell Execution
Execute shell commands safely with banned command detection.File History & Undo
Track file changes and enable undo operations.Hierarchical Configuration
Load configuration from multiple sources with precedence — project config is discovered by walking up from the current directory to the git root.walk_up: bool = True — when enabled, _find_project_config() walks parent directories from project_dir toward the filesystem root, stopping at the first directory containing a .git marker (or after 10 ancestor levels if no git root is found). The nearest config wins.
See Hierarchical Configuration for the full walk-up diagram, decision flow, and monorepo patterns.
Example .praison.json:
Output Modes
Control CLI output verbosity.Logs Command
View and follow log files.Git Commit Attribution
Add AI attribution to git commits.assisted-by- “Assisted-by: …”co-authored-by- “Co-Authored-By: …”none- No attribution
Tools
Sourcegraph Integration
Search code across repositories.Enhanced Download Tool
Download files with approval and progress tracking.Implementation Notes
DRY Reuse
All features are designed to reuse existing PraisonAI components:- Token tracking → Uses
telemetry/token_collector.py - Permissions → Extends
approval.py - File ops → Uses
file_tools.py - Shell safety → Reuses
sandbox_executor.pypatterns
Thread Safety
All managers are thread-safe:Async Compatibility
Async variants are provided where needed:Configuration Reference
Environment Variables
| Variable | Description |
|---|---|
PRAISON_OUTPUT_MODE | Set output mode: compact, verbose, quiet |
SOURCEGRAPH_URL | Sourcegraph API URL |
SOURCEGRAPH_ACCESS_TOKEN | Sourcegraph access token |
Config Schema
Best Practices
Tune Summarization Threshold
Tune Summarization Threshold
Set the summarization threshold to 80% (
threshold=0.8) for most models. Lower it to 70% for models with smaller context windows. Too low triggers excessive summarization; too high causes context overflow errors.Use Priority Queues for Multi-Agent Systems
Use Priority Queues for Multi-Agent Systems
Assign
URGENT priority to time-sensitive user messages and LOW priority to background tasks. This ensures critical prompts are processed first in high-concurrency scenarios.Restrict Shell Execution Scope
Restrict Shell Execution Scope
Always set an explicit
workspace path when using safe_execute. This prevents agents from executing commands outside the intended directory.Filter MCP Tools per Agent
Filter MCP Tools per Agent
Use MCP tool filtering to give each agent only the tools it needs. Overly broad tool access increases attack surface and LLM confusion about which tool to choose.
Related
Context Compression
Automatic context window management
MCP Tool Filtering
Restrict which MCP tools an agent can access

