PraisonAI 2.3.4__tar.gz → 2.3.36__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. praisonai-2.3.36/PKG-INFO +2430 -0
  2. praisonai-2.3.36/PraisonAI.egg-info/PKG-INFO +2430 -0
  3. {praisonai-2.3.4 → praisonai-2.3.36}/PraisonAI.egg-info/SOURCES.txt +22 -1
  4. {praisonai-2.3.4 → praisonai-2.3.36}/PraisonAI.egg-info/requires.txt +1 -1
  5. praisonai-2.3.36/README.md +2333 -0
  6. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/agents_generator.py +67 -1
  7. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/auto.py +222 -1
  8. praisonai-2.3.36/praisonai/cli/__init__.py +19 -0
  9. praisonai-2.3.36/praisonai/cli/features/__init__.py +98 -0
  10. praisonai-2.3.36/praisonai/cli/features/auto_memory.py +173 -0
  11. praisonai-2.3.36/praisonai/cli/features/base.py +168 -0
  12. praisonai-2.3.36/praisonai/cli/features/fast_context.py +189 -0
  13. praisonai-2.3.36/praisonai/cli/features/flow_display.py +566 -0
  14. praisonai-2.3.36/praisonai/cli/features/guardrail.py +165 -0
  15. praisonai-2.3.36/praisonai/cli/features/handoff.py +166 -0
  16. praisonai-2.3.36/praisonai/cli/features/image.py +207 -0
  17. praisonai-2.3.36/praisonai/cli/features/knowledge.py +236 -0
  18. praisonai-2.3.36/praisonai/cli/features/mcp.py +169 -0
  19. praisonai-2.3.36/praisonai/cli/features/metrics.py +167 -0
  20. praisonai-2.3.36/praisonai/cli/features/n8n.py +673 -0
  21. praisonai-2.3.36/praisonai/cli/features/router.py +160 -0
  22. praisonai-2.3.36/praisonai/cli/features/session.py +222 -0
  23. praisonai-2.3.36/praisonai/cli/features/telemetry.py +179 -0
  24. praisonai-2.3.36/praisonai/cli/features/todo.py +334 -0
  25. praisonai-2.3.36/praisonai/cli/features/tools.py +218 -0
  26. praisonai-2.3.36/praisonai/cli/features/workflow.py +653 -0
  27. praisonai-2.3.36/praisonai/cli/main.py +3610 -0
  28. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/deploy.py +1 -1
  29. praisonai-2.3.36/praisonai/version.py +1 -0
  30. {praisonai-2.3.4 → praisonai-2.3.36}/pyproject.toml +1 -1
  31. praisonai-2.3.36/tests/test_cli_features.py +179 -0
  32. praisonai-2.3.36/tests/test_n8n_integration.py +246 -0
  33. {praisonai-2.3.4 → praisonai-2.3.36}/tests/test_phase2_refactor.py +9 -1
  34. {praisonai-2.3.4 → praisonai-2.3.36}/tests/test_runner.py +1 -1
  35. praisonai-2.3.4/PKG-INFO +0 -1145
  36. praisonai-2.3.4/PraisonAI.egg-info/PKG-INFO +0 -1145
  37. praisonai-2.3.4/README.md +0 -1048
  38. praisonai-2.3.4/praisonai/cli.py +0 -1389
  39. praisonai-2.3.4/praisonai/version.py +0 -1
  40. {praisonai-2.3.4 → praisonai-2.3.36}/PraisonAI.egg-info/dependency_links.txt +0 -0
  41. {praisonai-2.3.4 → praisonai-2.3.36}/PraisonAI.egg-info/entry_points.txt +0 -0
  42. {praisonai-2.3.4 → praisonai-2.3.36}/PraisonAI.egg-info/top_level.txt +0 -0
  43. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/__init__.py +0 -0
  44. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/__main__.py +0 -0
  45. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/api/call.py +0 -0
  46. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/chainlit_ui.py +0 -0
  47. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/inbuilt_tools/__init__.py +0 -0
  48. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/inbuilt_tools/autogen_tools.py +0 -0
  49. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/inc/__init__.py +0 -0
  50. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/inc/config.py +0 -0
  51. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/inc/models.py +0 -0
  52. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/scheduler.py +0 -0
  53. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/setup/__init__.py +0 -0
  54. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/setup/build.py +0 -0
  55. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/setup/post_install.py +0 -0
  56. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/setup/setup_conda_env.py +0 -0
  57. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/setup.py +0 -0
  58. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/test.py +0 -0
  59. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/train.py +0 -0
  60. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/train_vision.py +0 -0
  61. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/ui/agents.py +0 -0
  62. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/ui/callbacks.py +0 -0
  63. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/ui/chat.py +0 -0
  64. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/ui/code.py +0 -0
  65. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/ui/colab.py +0 -0
  66. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/ui/colab_chainlit.py +0 -0
  67. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/ui/components/aicoder.py +0 -0
  68. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/ui/context.py +0 -0
  69. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/ui/database_config.py +0 -0
  70. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/ui/db.py +0 -0
  71. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/ui/realtime.py +0 -0
  72. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/ui/realtimeclient/__init__.py +0 -0
  73. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/ui/realtimeclient/tools.py +0 -0
  74. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/ui/sql_alchemy.py +0 -0
  75. {praisonai-2.3.4 → praisonai-2.3.36}/praisonai/upload_vision.py +0 -0
  76. {praisonai-2.3.4 → praisonai-2.3.36}/setup.cfg +0 -0
  77. {praisonai-2.3.4 → praisonai-2.3.36}/tests/test.py +0 -0
  78. {praisonai-2.3.4 → praisonai-2.3.36}/tests/test_agents_playbook.py +0 -0
  79. {praisonai-2.3.4 → praisonai-2.3.36}/tests/test_basic.py +0 -0
  80. {praisonai-2.3.4 → praisonai-2.3.36}/tests/test_custom_tools_fix.py +0 -0
  81. {praisonai-2.3.4 → praisonai-2.3.36}/tests/test_double_api_fix.py +0 -0
@@ -0,0 +1,2430 @@
1
+ Metadata-Version: 2.4
2
+ Name: PraisonAI
3
+ Version: 2.3.36
4
+ Summary: PraisonAI is an AI Agents Framework with Self Reflection. PraisonAI application combines PraisonAI Agents, AutoGen, and CrewAI into a low-code solution for building and managing multi-agent LLM systems, focusing on simplicity, customisation, and efficient human-agent collaboration.
5
+ Author: Mervin Praison
6
+ License: MIT
7
+ Project-URL: Homepage, https://docs.praison.ai
8
+ Project-URL: Repository, https://github.com/mervinpraison/PraisonAI
9
+ Requires-Python: >=3.10
10
+ Description-Content-Type: text/markdown
11
+ Requires-Dist: rich>=13.7
12
+ Requires-Dist: markdown>=3.5
13
+ Requires-Dist: pyparsing>=3.0.0
14
+ Requires-Dist: praisonaiagents>=0.1.14
15
+ Requires-Dist: python-dotenv>=0.19.0
16
+ Requires-Dist: instructor>=1.3.3
17
+ Requires-Dist: PyYAML>=6.0
18
+ Requires-Dist: mcp>=1.6.0
19
+ Provides-Extra: ui
20
+ Requires-Dist: chainlit==2.5.5; extra == "ui"
21
+ Requires-Dist: sqlalchemy>=2.0.36; extra == "ui"
22
+ Requires-Dist: aiosqlite>=0.20.0; extra == "ui"
23
+ Requires-Dist: greenlet>=3.0.3; extra == "ui"
24
+ Requires-Dist: pydantic<=2.10.1; extra == "ui"
25
+ Provides-Extra: gradio
26
+ Requires-Dist: gradio>=4.26.0; extra == "gradio"
27
+ Provides-Extra: api
28
+ Requires-Dist: flask>=3.0.0; extra == "api"
29
+ Requires-Dist: fastapi>=0.115.0; extra == "api"
30
+ Requires-Dist: uvicorn>=0.34.0; extra == "api"
31
+ Provides-Extra: agentops
32
+ Requires-Dist: agentops>=0.3.12; extra == "agentops"
33
+ Provides-Extra: google
34
+ Requires-Dist: langchain-google-genai>=2.1.0; extra == "google"
35
+ Provides-Extra: openai
36
+ Requires-Dist: langchain-openai<0.3.0,>=0.2.1; extra == "openai"
37
+ Provides-Extra: anthropic
38
+ Requires-Dist: langchain-anthropic>=0.3.0; extra == "anthropic"
39
+ Provides-Extra: cohere
40
+ Requires-Dist: langchain-cohere<0.4.0,>=0.3.0; extra == "cohere"
41
+ Provides-Extra: chat
42
+ Requires-Dist: chainlit==2.5.5; extra == "chat"
43
+ Requires-Dist: litellm>=1.72.6; extra == "chat"
44
+ Requires-Dist: aiosqlite>=0.20.0; extra == "chat"
45
+ Requires-Dist: greenlet>=3.0.3; extra == "chat"
46
+ Requires-Dist: tavily-python==0.5.0; extra == "chat"
47
+ Requires-Dist: crawl4ai>=0.7.0; extra == "chat"
48
+ Requires-Dist: sqlalchemy>=2.0.36; extra == "chat"
49
+ Requires-Dist: playwright>=1.47.0; extra == "chat"
50
+ Requires-Dist: rich; extra == "chat"
51
+ Requires-Dist: pydantic<=2.10.1; extra == "chat"
52
+ Provides-Extra: code
53
+ Requires-Dist: chainlit==2.5.5; extra == "code"
54
+ Requires-Dist: litellm>=1.72.6; extra == "code"
55
+ Requires-Dist: aiosqlite>=0.20.0; extra == "code"
56
+ Requires-Dist: greenlet>=3.0.3; extra == "code"
57
+ Requires-Dist: tavily-python==0.5.0; extra == "code"
58
+ Requires-Dist: crawl4ai>=0.7.0; extra == "code"
59
+ Requires-Dist: sqlalchemy>=2.0.36; extra == "code"
60
+ Requires-Dist: playwright>=1.47.0; extra == "code"
61
+ Requires-Dist: pydantic<=2.10.1; extra == "code"
62
+ Provides-Extra: realtime
63
+ Requires-Dist: chainlit==2.5.5; extra == "realtime"
64
+ Requires-Dist: litellm>=1.72.6; extra == "realtime"
65
+ Requires-Dist: aiosqlite>=0.20.0; extra == "realtime"
66
+ Requires-Dist: greenlet>=3.0.3; extra == "realtime"
67
+ Requires-Dist: tavily-python==0.5.0; extra == "realtime"
68
+ Requires-Dist: crawl4ai>=0.7.0; extra == "realtime"
69
+ Requires-Dist: websockets>=12.0; extra == "realtime"
70
+ Requires-Dist: plotly>=5.24.0; extra == "realtime"
71
+ Requires-Dist: yfinance>=0.2.44; extra == "realtime"
72
+ Requires-Dist: duckduckgo_search>=6.3.0; extra == "realtime"
73
+ Requires-Dist: sqlalchemy>=2.0.36; extra == "realtime"
74
+ Provides-Extra: call
75
+ Requires-Dist: twilio>=7.0.0; extra == "call"
76
+ Requires-Dist: fastapi>=0.95.0; extra == "call"
77
+ Requires-Dist: uvicorn>=0.20.0; extra == "call"
78
+ Requires-Dist: websockets>=12.0; extra == "call"
79
+ Requires-Dist: flaml[automl]>=2.3.1; extra == "call"
80
+ Requires-Dist: pyngrok>=1.4.0; extra == "call"
81
+ Requires-Dist: rich; extra == "call"
82
+ Requires-Dist: openai>=1.54.0; extra == "call"
83
+ Provides-Extra: train
84
+ Provides-Extra: crewai
85
+ Requires-Dist: crewai>=0.157.0; extra == "crewai"
86
+ Requires-Dist: praisonai-tools>=0.0.22; extra == "crewai"
87
+ Provides-Extra: autogen
88
+ Requires-Dist: pyautogen==0.2.29; extra == "autogen"
89
+ Requires-Dist: praisonai-tools>=0.0.22; extra == "autogen"
90
+ Requires-Dist: crewai; extra == "autogen"
91
+ Provides-Extra: autogen-v4
92
+ Requires-Dist: autogen-agentchat>=0.4.0; extra == "autogen-v4"
93
+ Requires-Dist: autogen-ext[openai]>=0.4.0; extra == "autogen-v4"
94
+ Requires-Dist: autogen-core>=0.4.0; extra == "autogen-v4"
95
+ Requires-Dist: praisonai-tools>=0.0.22; extra == "autogen-v4"
96
+ Requires-Dist: crewai; extra == "autogen-v4"
97
+
98
+ <p align="center">
99
+ <picture>
100
+ <source media="(prefers-color-scheme: dark)" srcset="docs/logo/dark.png" />
101
+ <source media="(prefers-color-scheme: light)" srcset="docs/logo/light.png" />
102
+ <img alt="PraisonAI Logo" src="docs/logo/light.png" />
103
+ </picture>
104
+ </p>
105
+
106
+ <p align="center">
107
+ <a href="https://github.com/MervinPraison/PraisonAI"><img src="https://static.pepy.tech/badge/PraisonAI" alt="Total Downloads" /></a>
108
+ <a href="https://github.com/MervinPraison/PraisonAI"><img src="https://img.shields.io/github/v/release/MervinPraison/PraisonAI" alt="Latest Stable Version" /></a>
109
+ <a href="https://github.com/MervinPraison/PraisonAI"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License" /></a>
110
+ </p>
111
+
112
+ <div align="center">
113
+
114
+ # Praison AI
115
+
116
+ <a href="https://trendshift.io/repositories/9130" target="_blank"><img src="https://trendshift.io/api/badge/repositories/9130" alt="MervinPraison%2FPraisonAI | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
117
+
118
+ </div>
119
+
120
+ PraisonAI is a production-ready Multi-AI Agents framework with self-reflection, designed to create AI Agents to automate and solve problems ranging from simple tasks to complex challenges. By integrating PraisonAI Agents, AG2 (Formerly AutoGen), and CrewAI into a low-code solution, it streamlines the building and management of multi-agent LLM systems, emphasising simplicity, customisation, and effective human-agent collaboration.
121
+
122
+ <div align="center">
123
+ <a href="https://docs.praison.ai">
124
+ <p align="center">
125
+ <img src="https://img.shields.io/badge/📚_Documentation-Visit_docs.praison.ai-blue?style=for-the-badge&logo=bookstack&logoColor=white" alt="Documentation" />
126
+ </p>
127
+ </a>
128
+ </div>
129
+
130
+ ---
131
+
132
+ ## 📑 Table of Contents
133
+
134
+ - [⚡ Performance](#-performance)
135
+ - [🚀 Quick Start](#-quick-start)
136
+ - [📦 Installation](#-installation)
137
+ - [Python SDK](#python-sdk)
138
+ - [JavaScript SDK](#javascript-sdk)
139
+ - [💻 Usage](#-usage)
140
+ - [Python Code Examples](#python-code-examples)
141
+ - [CLI / No-Code Interface](#cli--no-code-interface)
142
+ - [JavaScript Code Examples](#javascript-code-examples)
143
+ - [✨ Key Features](#-key-features)
144
+ - [🌐 Supported Providers](#-supported-providers)
145
+ - [🛠️ Custom Tools](#️-custom-tools)
146
+ - [🔧 Configuration & Integration](#-configuration--integration)
147
+ - [Ollama Integration](#ollama-integration)
148
+ - [Groq Integration](#groq-integration)
149
+ - [100+ Models Support](#100-models-support)
150
+ - [📋 Workflows](#-workflows)
151
+ - [Workflow Patterns](#workflow-patterns)
152
+ - [YAML Configuration](#yaml-configuration)
153
+ - [Agents Playbook](#agents-playbook)
154
+ - [🧠 Memory & Context](#-memory--context)
155
+ - [🔬 Advanced Features](#-advanced-features)
156
+ - [Research & Intelligence](#research--intelligence)
157
+ - [Planning & Workflows](#planning--workflows)
158
+ - [Specialised Agents](#specialised-agents)
159
+ - [MCP Protocol](#mcp-protocol)
160
+ - [Safety & Control](#safety--control)
161
+ - [Developer Tools](#developer-tools)
162
+ - [📊 Process Types & Patterns](#-process-types--patterns)
163
+ - [Sequential Process](#sequential-process)
164
+ - [Hierarchical Process](#hierarchical-process)
165
+ - [Workflow Process](#workflow-process)
166
+ - [Agentic Patterns](#agentic-patterns)
167
+ - [🎓 Video Tutorials](#-video-tutorials)
168
+ - [⭐ Star History](#-star-history)
169
+ - [👥 Contributing](#-contributing)
170
+ - [🔧 Development](#-development)
171
+
172
+ ---
173
+
174
+ ## ⚡ Performance
175
+
176
+ PraisonAI Agents is the **fastest AI agent framework** for agent instantiation.
177
+
178
+ | Framework | Avg Time (μs) | Relative |
179
+ |-----------|---------------|----------|
180
+ | **PraisonAI** | **3.77** | **1.00x (fastest)** |
181
+ | OpenAI Agents SDK | 5.26 | 1.39x |
182
+ | Agno | 5.64 | 1.49x |
183
+ | PraisonAI (LiteLLM) | 7.56 | 2.00x |
184
+ | PydanticAI | 226.94 | 60.16x |
185
+ | LangGraph | 4,558.71 | 1,209x |
186
+ | CrewAI | 15,607.92 | 4,138x |
187
+
188
+ <details>
189
+ <summary>Run benchmarks yourself</summary>
190
+
191
+ ```bash
192
+ cd praisonai-agents
193
+ python benchmarks/simple_benchmark.py
194
+ ```
195
+
196
+ </details>
197
+
198
+ ---
199
+
200
+ ## 🚀 Quick Start
201
+
202
+ Get started with PraisonAI in under 1 minute:
203
+
204
+ ```bash
205
+ # Install
206
+ pip install praisonaiagents
207
+
208
+ # Set API key
209
+ export OPENAI_API_KEY=your_key_here
210
+
211
+ # Create a simple agent
212
+ python -c "from praisonaiagents import Agent; Agent(instructions='You are a helpful AI assistant').start('Write a haiku about AI')"
213
+ ```
214
+
215
+ ---
216
+
217
+ ## 📦 Installation
218
+
219
+ ### Python SDK
220
+
221
+ Lightweight package dedicated for coding:
222
+
223
+ ```bash
224
+ pip install praisonaiagents
225
+ ```
226
+
227
+ For the full framework with CLI support:
228
+
229
+ ```bash
230
+ pip install praisonai
231
+ ```
232
+
233
+ ### JavaScript SDK
234
+
235
+ ```bash
236
+ npm install praisonai
237
+ ```
238
+
239
+ ---
240
+
241
+ ## 💻 Usage
242
+
243
+ ### Python Code Examples
244
+
245
+ - [📘 Complete Python Examples](#using-python-code)
246
+ - [🔧 Custom Tools](#️-custom-tools)
247
+ - [🧠 Memory Configuration](#-memory--context)
248
+
249
+ ### CLI / No-Code Interface
250
+
251
+ - [🎯 Auto Mode](#auto-mode)
252
+ - [🔬 Deep Research](#deep-research-cli)
253
+ - [📋 Planning Mode](#planning-mode-cli)
254
+ - [💾 Memory Management](#memory-cli)
255
+ - [🔄 Workflow Execution](#workflow-cli)
256
+
257
+ ### JavaScript Code Examples
258
+
259
+ - [💻 JavaScript Usage](#using-javascript-code)
260
+
261
+ ---
262
+
263
+ ## ✨ Key Features
264
+
265
+ | Feature | Code | Docs |
266
+ |---------|:----:|:----:|
267
+ | 🚀 Single Agent | [Example](examples/python/agents/single-agent.py) | [📖](https://docs.praison.ai/agents/single) |
268
+ | 🤝 Multi Agents | [Example](examples/python/general/mini_agents_example.py) | [📖](https://docs.praison.ai/concepts/agents) |
269
+ | 🤖 Auto Agents | [Example](examples/python/general/auto_agents_example.py) | [📖](https://docs.praison.ai/features/autoagents) |
270
+ | 🔄 Self Reflection AI Agents | [Example](examples/python/concepts/self-reflection-details.py) | [📖](https://docs.praison.ai/features/selfreflection) |
271
+ | 🧠 Reasoning AI Agents | [Example](examples/python/concepts/reasoning-extraction.py) | [📖](https://docs.praison.ai/features/reasoning) |
272
+ | 👁️ Multi Modal AI Agents | [Example](examples/python/general/multimodal.py) | [📖](https://docs.praison.ai/features/multimodal) |
273
+ | **🔄 Workflows** | | |
274
+ | ↳ Simple Workflow | [Example](examples/python/workflows/simple_workflow.py) | [📖](https://docs.praison.ai/features/workflows) |
275
+ | ↳ Workflow with Agents | [Example](examples/python/workflows/workflow_with_agents.py) | [📖](https://docs.praison.ai/features/workflows) |
276
+ | ↳ Agentic Routing (`route()`) | [Example](examples/python/workflows/workflow_routing.py) | [📖](https://docs.praison.ai/features/routing) |
277
+ | ↳ Parallel Execution (`parallel()`) | [Example](examples/python/workflows/workflow_parallel.py) | [📖](https://docs.praison.ai/features/parallelisation) |
278
+ | ↳ Loop over List/CSV (`loop()`) | [Example](examples/python/workflows/workflow_loop_csv.py) | [📖](https://docs.praison.ai/features/repetitive) |
279
+ | ↳ Evaluator-Optimizer (`repeat()`) | [Example](examples/python/workflows/workflow_repeat.py) | [📖](https://docs.praison.ai/features/evaluator-optimiser) |
280
+ | ↳ Conditional Steps | [Example](examples/python/workflows/workflow_conditional.py) | [📖](https://docs.praison.ai/features/workflows) |
281
+ | ↳ Workflow Branching | [Example](examples/python/workflows/workflow_branching.py) | [📖](https://docs.praison.ai/features/workflows) |
282
+ | ↳ Workflow Early Stop | [Example](examples/python/workflows/workflow_early_stop.py) | [📖](https://docs.praison.ai/features/workflows) |
283
+ | ↳ Workflow Checkpoints | [Example](examples/python/workflows/workflow_checkpoints.py) | [📖](https://docs.praison.ai/features/workflows) |
284
+ | 📚 Add Custom Knowledge | [Example](examples/python/concepts/knowledge-agents.py) | [📖](https://docs.praison.ai/features/knowledge) |
285
+ | 🧠 Memory (Short & Long Term) | [Example](examples/python/general/memory_example.py) | [📖](https://docs.praison.ai/concepts/memory) |
286
+ | 📄 Chat with PDF Agents | [Example](examples/python/concepts/chat-with-pdf.py) | [📖](https://docs.praison.ai/features/chat-with-pdf) |
287
+ | 💻 Code Interpreter Agents | [Example](examples/python/agents/code-agent.py) | [📖](https://docs.praison.ai/features/codeagent) |
288
+ | 📚 RAG Agents | [Example](examples/python/concepts/rag-agents.py) | [📖](https://docs.praison.ai/features/rag) |
289
+ | 🤔 Async & Parallel Processing | [Example](examples/python/general/async_example.py) | [📖](https://docs.praison.ai/features/async) |
290
+ | 🔢 Math Agents | [Example](examples/python/agents/math-agent.py) | [📖](https://docs.praison.ai/features/mathagent) |
291
+ | 🎯 Structured Output Agents | [Example](examples/python/general/structured_agents_example.py) | [📖](https://docs.praison.ai/features/structured) |
292
+ | 🔗 LangChain Integrated Agents | [Example](examples/python/general/langchain_example.py) | [📖](https://docs.praison.ai/features/langchain) |
293
+ | 📞 Callback Agents | [Example](examples/python/general/advanced-callback-systems.py) | [📖](https://docs.praison.ai/features/callbacks) |
294
+ | 🛠️ 100+ Custom Tools | [Example](examples/python/general/tools_example.py) | [📖](https://docs.praison.ai/tools/tools) |
295
+ | 📄 YAML Configuration | [Example](examples/cookbooks/yaml/secondary_market_research_agents.yaml) | [📖](https://docs.praison.ai/developers/agents-playbook) |
296
+ | 💯 100+ LLM Support | [Example](examples/python/providers/openai/openai_gpt4_example.py) | [📖](https://docs.praison.ai/models) |
297
+ | 🔬 Deep Research Agents | [Example](examples/python/agents/research-agent.py) | [📖](https://docs.praison.ai/agents/deep-research) |
298
+ | 🔄 Query Rewriter Agent | [Example](#5-query-rewriter-agent) | [📖](https://docs.praison.ai/agents/query-rewriter) |
299
+ | 🌐 Native Web Search | [Example](examples/python/agents/websearch-agent.py) | [📖](https://docs.praison.ai/agents/websearch) |
300
+ | 📥 Web Fetch (Anthropic) | [Example](#web-search-web-fetch--prompt-caching) | [📖](https://docs.praison.ai/features/model-capabilities) |
301
+ | 💾 Prompt Caching | [Example](#web-search-web-fetch--prompt-caching) | [📖](https://docs.praison.ai/features/model-capabilities) |
302
+ | 🧠 Claude Memory Tool | [Example](#claude-memory-tool-cli) | [📖](https://docs.praison.ai/features/claude-memory-tool) |
303
+ | 💾 File-Based Memory | [Example](examples/python/general/memory_example.py) | [📖](https://docs.praison.ai/concepts/memory) |
304
+ | 🔍 Built-in Search Tools | [Example](examples/python/agents/websearch-agent.py) | [📖](https://docs.praison.ai/tools/tavily) |
305
+ | 📋 Planning Mode | [Example](examples/python/agents/planning-agent.py) | [📖](https://docs.praison.ai/features/planning-mode) |
306
+ | 🔧 Planning Tools | [Example](#3-agent-with-planning-mode) | [📖](https://docs.praison.ai/features/planning-mode) |
307
+ | 🧠 Planning Reasoning | [Example](#3-agent-with-planning-mode) | [📖](https://docs.praison.ai/features/planning-mode) |
308
+ | 🔌 MCP Transports | [Example](examples/python/mcp/mcp-transports-overview.py) | [📖](https://docs.praison.ai/mcp/transports) |
309
+ | 🌐 WebSocket MCP | [Example](examples/python/mcp/websocket-mcp.py) | [📖](https://docs.praison.ai/mcp/sse-transport) |
310
+ | 🔐 MCP Security | [Example](examples/python/mcp/mcp-security.py) | [📖](https://docs.praison.ai/mcp/transports) |
311
+ | 🔄 MCP Resumability | [Example](examples/python/mcp/mcp-resumability.py) | [📖](https://docs.praison.ai/mcp/sse-transport) |
312
+ | ⚡ Fast Context | [Example](examples/context/00_agent_fast_context_basic.py) | [📖](https://docs.praison.ai/features/fast-context) |
313
+ | 🖼️ Image Generation Agent | [Example](examples/python/image/image-agent.py) | [📖](https://docs.praison.ai/features/image-generation) |
314
+ | 📷 Image to Text Agent | [Example](examples/python/agents/image-to-text-agent.py) | [📖](https://docs.praison.ai/agents/image-to-text) |
315
+ | 🎬 Video Agent | [Example](examples/python/agents/video-agent.py) | [📖](https://docs.praison.ai/agents/video) |
316
+ | 📊 Data Analyst Agent | [Example](examples/python/agents/data-analyst-agent.py) | [📖](https://docs.praison.ai/agents/data-analyst) |
317
+ | 💰 Finance Agent | [Example](examples/python/agents/finance-agent.py) | [📖](https://docs.praison.ai/agents/finance) |
318
+ | 🛒 Shopping Agent | [Example](examples/python/agents/shopping-agent.py) | [📖](https://docs.praison.ai/agents/shopping) |
319
+ | ⭐ Recommendation Agent | [Example](examples/python/agents/recommendation-agent.py) | [📖](https://docs.praison.ai/agents/recommendation) |
320
+ | 📖 Wikipedia Agent | [Example](examples/python/agents/wikipedia-agent.py) | [📖](https://docs.praison.ai/agents/wikipedia) |
321
+ | 💻 Programming Agent | [Example](examples/python/agents/programming-agent.py) | [📖](https://docs.praison.ai/agents/programming) |
322
+ | 📝 Markdown Agent | [Example](examples/python/agents/markdown-agent.py) | [📖](https://docs.praison.ai/agents/markdown) |
323
+ | 📝 Prompt Expander Agent | [Example](#prompt-expansion) | [📖](https://docs.praison.ai/agents/prompt-expander) |
324
+ | 🔀 Router Agent | [Example](examples/python/agents/router-agent-cost-optimization.py) | [📖](https://docs.praison.ai/features/routing) |
325
+ | ⛓️ Prompt Chaining | [Example](examples/python/general/prompt_chaining.py) | [📖](https://docs.praison.ai/features/promptchaining) |
326
+ | 🔍 Evaluator Optimiser | [Example](examples/python/general/evaluator-optimiser.py) | [📖](https://docs.praison.ai/features/evaluator-optimiser) |
327
+ | 👷 Orchestrator Workers | [Example](examples/python/general/orchestrator-workers.py) | [📖](https://docs.praison.ai/features/orchestrator-worker) |
328
+ | ⚡ Parallelisation | [Example](examples/python/general/parallelisation.py) | [📖](https://docs.praison.ai/features/parallelisation) |
329
+ | 🔁 Repetitive Agents | [Example](examples/python/concepts/repetitive-agents.py) | [📖](https://docs.praison.ai/features/repetitive) |
330
+ | 🤝 Agent Handoffs | [Example](examples/python/handoff/handoff_basic.py) | [📖](https://docs.praison.ai/features/handoffs) |
331
+ | 🛡️ Guardrails | [Example](examples/python/guardrails/comprehensive-guardrails-example.py) | [📖](https://docs.praison.ai/features/guardrails) |
332
+ | 💬 Sessions Management | [Example](examples/python/sessions/comprehensive-session-management.py) | [📖](https://docs.praison.ai/features/sessions) |
333
+ | ✅ Human Approval | [Example](examples/python/general/human_approval_example.py) | [📖](https://docs.praison.ai/features/approval) |
334
+ | 🔄 Stateful Agents | [Example](examples/python/stateful/workflow-state-example.py) | [📖](https://docs.praison.ai/features/stateful-agents) |
335
+ | 🤖 Autonomous Workflow | [Example](examples/python/general/autonomous-agent.py) | [📖](https://docs.praison.ai/features/autonomous-workflow) |
336
+ | 📜 Rules & Instructions | [Example](#6-rules--instructions) | [📖](https://docs.praison.ai/features/rules) |
337
+ | 🪝 Hooks | [Example](#9-hooks) | [📖](https://docs.praison.ai/features/hooks) |
338
+ | 📈 Telemetry | [Example](examples/python/telemetry/production-telemetry-example.py) | [📖](https://docs.praison.ai/features/telemetry) |
339
+ | 📹 Camera Integration | [Example](examples/python/camera/) | [📖](https://docs.praison.ai/features/camera-integration) |
340
+ | 📄 Project Docs (.praison/docs/) | [Example](#docs-cli) | [📖](https://docs.praison.ai/cli/docs) |
341
+ | 🔌 MCP Config Management | [Example](#mcp-config-cli) | [📖](https://docs.praison.ai/cli/mcp) |
342
+ | 💬 AI Commit Messages | [Example](#ai-commit-cli) | [📖](https://docs.praison.ai/cli/commit) |
343
+ | @ @Mentions in Prompts | [Example](#mentions-in-prompts) | [📖](https://docs.praison.ai/cli/mentions) |
344
+ | 💾 Auto-Save Sessions | [Example](#session-management-python) | [📖](https://docs.praison.ai/cli/session) |
345
+ | 📜 History in Context | [Example](#session-management-python) | [📖](https://docs.praison.ai/cli/session) |
346
+
347
+ ---
348
+
349
+ ## 🌐 Supported Providers
350
+
351
+ PraisonAI supports 100+ LLM providers through seamless integration:
352
+
353
+ | Provider | Example |
354
+ |----------|:-------:|
355
+ | OpenAI | [Example](examples/python/providers/openai/openai_gpt4_example.py) |
356
+ | Anthropic | [Example](examples/python/providers/anthropic/anthropic_claude_example.py) |
357
+ | Google Gemini | [Example](examples/python/providers/google/google_gemini_example.py) |
358
+ | Ollama | [Example](examples/python/providers/ollama/ollama-agents.py) |
359
+ | Groq | [Example](examples/python/providers/groq/kimi_with_groq_example.py) |
360
+ | DeepSeek | [Example](examples/python/providers/deepseek/deepseek_example.py) |
361
+ | xAI Grok | [Example](examples/python/providers/xai/xai_grok_example.py) |
362
+ | Mistral | [Example](examples/python/providers/mistral/mistral_example.py) |
363
+ | Cohere | [Example](examples/python/providers/cohere/cohere_example.py) |
364
+ | Perplexity | [Example](examples/python/providers/perplexity/perplexity_example.py) |
365
+ | Fireworks | [Example](examples/python/providers/fireworks/fireworks_example.py) |
366
+ | Together AI | [Example](examples/python/providers/together/together_ai_example.py) |
367
+ | OpenRouter | [Example](examples/python/providers/openrouter/openrouter_example.py) |
368
+ | HuggingFace | [Example](examples/python/providers/huggingface/huggingface_example.py) |
369
+ | Azure OpenAI | [Example](examples/python/providers/azure/azure_openai_example.py) |
370
+ | AWS Bedrock | [Example](examples/python/providers/aws/aws_bedrock_example.py) |
371
+ | Google Vertex | [Example](examples/python/providers/vertex/vertex_example.py) |
372
+ | Databricks | [Example](examples/python/providers/databricks/databricks_example.py) |
373
+ | Cloudflare | [Example](examples/python/providers/cloudflare/cloudflare_example.py) |
374
+ | AI21 | [Example](examples/python/providers/ai21/ai21_example.py) |
375
+ | Replicate | [Example](examples/python/providers/replicate/replicate_example.py) |
376
+ | SageMaker | [Example](examples/python/providers/sagemaker/sagemaker_example.py) |
377
+ | Moonshot | [Example](examples/python/providers/moonshot/moonshot_example.py) |
378
+ | vLLM | [Example](examples/python/providers/vllm/vllm_example.py) |
379
+
380
+ ---
381
+
382
+ ## 📘 Using Python Code
383
+
384
+ Light weight package dedicated for coding:
385
+
386
+ ```bash
387
+ pip install praisonaiagents
388
+ export OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxx
389
+ ```
390
+
391
+ ### 1. Single Agent
392
+
393
+ Create app.py file and add the code below:
394
+ ```python
395
+ from praisonaiagents import Agent
396
+ agent = Agent(instructions="Your are a helpful AI assistant")
397
+ agent.start("Write a movie script about a robot in Mars")
398
+ ```
399
+
400
+ Run:
401
+ ```bash
402
+ python app.py
403
+ ```
404
+
405
+ ### 2. Multi Agents
406
+
407
+ Create app.py file and add the code below:
408
+ ```python
409
+ from praisonaiagents import Agent, PraisonAIAgents
410
+
411
+ research_agent = Agent(instructions="Research about AI")
412
+ summarise_agent = Agent(instructions="Summarise research agent's findings")
413
+ agents = PraisonAIAgents(agents=[research_agent, summarise_agent])
414
+ agents.start()
415
+ ```
416
+
417
+ Run:
418
+ ```bash
419
+ python app.py
420
+ ```
421
+
422
+ ### 3. Agent with Planning Mode
423
+
424
+ Enable planning for any agent - the agent creates a plan, then executes step by step:
425
+
426
+ ```python
427
+ from praisonaiagents import Agent
428
+
429
+ def search_web(query: str) -> str:
430
+ return f"Search results for: {query}"
431
+
432
+ agent = Agent(
433
+ name="AI Assistant",
434
+ instructions="Research and write about topics",
435
+ planning=True, # Enable planning mode
436
+ planning_tools=[search_web], # Tools for planning research
437
+ planning_reasoning=True # Chain-of-thought reasoning
438
+ )
439
+
440
+ result = agent.start("Research AI trends in 2025 and write a summary")
441
+ ```
442
+
443
+ **What happens:**
444
+ 1. 📋 Agent creates a multi-step plan
445
+ 2. 🚀 Executes each step sequentially
446
+ 3. 📊 Shows progress with context passing
447
+ 4. ✅ Returns final result
448
+
449
+ ### 4. Deep Research Agent
450
+
451
+ Automated research with real-time streaming, web search, and citations using OpenAI or Gemini Deep Research APIs.
452
+
453
+ ```python
454
+ from praisonaiagents import DeepResearchAgent
455
+
456
+ # OpenAI Deep Research
457
+ agent = DeepResearchAgent(
458
+ model="o4-mini-deep-research", # or "o3-deep-research"
459
+ verbose=True
460
+ )
461
+
462
+ result = agent.research("What are the latest AI trends in 2025?")
463
+ print(result.report)
464
+ print(f"Citations: {len(result.citations)}")
465
+ ```
466
+
467
+ ```python
468
+ # Gemini Deep Research
469
+ from praisonaiagents import DeepResearchAgent
470
+
471
+ agent = DeepResearchAgent(
472
+ model="deep-research-pro", # Auto-detected as Gemini
473
+ verbose=True
474
+ )
475
+
476
+ result = agent.research("Research quantum computing advances")
477
+ print(result.report)
478
+ ```
479
+
480
+ **Features:**
481
+ - 🔍 Multi-provider support (OpenAI, Gemini, LiteLLM)
482
+ - 📡 Real-time streaming with reasoning summaries
483
+ - 📚 Structured citations with URLs
484
+ - 🛠️ Built-in tools: web search, code interpreter, MCP, file search
485
+ - 🔄 Automatic provider detection from model name
486
+
487
+ ### 5. Query Rewriter Agent
488
+
489
+ Transform user queries to improve RAG retrieval quality using multiple strategies.
490
+
491
+ ```python
492
+ from praisonaiagents import QueryRewriterAgent, RewriteStrategy
493
+
494
+ agent = QueryRewriterAgent(model="gpt-4o-mini")
495
+
496
+ # Basic - expands abbreviations, adds context
497
+ result = agent.rewrite("AI trends")
498
+ print(result.primary_query) # "What are the current trends in Artificial Intelligence?"
499
+
500
+ # HyDE - generates hypothetical document for semantic matching
501
+ result = agent.rewrite("What is quantum computing?", strategy=RewriteStrategy.HYDE)
502
+
503
+ # Step-back - generates broader context question
504
+ result = agent.rewrite("GPT-4 vs Claude 3?", strategy=RewriteStrategy.STEP_BACK)
505
+
506
+ # Sub-queries - decomposes complex questions
507
+ result = agent.rewrite("RAG setup and best embedding models?", strategy=RewriteStrategy.SUB_QUERIES)
508
+
509
+ # Contextual - resolves references using chat history
510
+ result = agent.rewrite("What about cost?", chat_history=[...])
511
+ ```
512
+
513
+ **Strategies:**
514
+ - **BASIC**: Expand abbreviations, fix typos, add context
515
+ - **HYDE**: Generate hypothetical document for semantic matching
516
+ - **STEP_BACK**: Generate higher-level concept questions
517
+ - **SUB_QUERIES**: Decompose multi-part questions
518
+ - **MULTI_QUERY**: Generate multiple paraphrased versions
519
+ - **CONTEXTUAL**: Resolve references using conversation history
520
+ - **AUTO**: Automatically detect best strategy
521
+
522
+ ### 6. Agent Memory (Zero Dependencies)
523
+
524
+ Enable persistent memory for agents - works out of the box without any extra packages.
525
+
526
+ ```python
527
+ from praisonaiagents import Agent
528
+ from praisonaiagents.memory import FileMemory
529
+
530
+ # Enable memory with a single parameter
531
+ agent = Agent(
532
+ name="Personal Assistant",
533
+ instructions="You are a helpful assistant that remembers user preferences.",
534
+ memory=True, # Enables file-based memory (no extra deps!)
535
+ user_id="user123" # Isolate memory per user
536
+ )
537
+
538
+ # Memory is automatically injected into conversations
539
+ result = agent.start("My name is John and I prefer Python")
540
+ # Agent will remember this for future conversations
541
+ ```
542
+
543
+ **Memory Types:**
544
+ - **Short-term**: Rolling buffer of recent context (auto-expires)
545
+ - **Long-term**: Persistent important facts (sorted by importance)
546
+ - **Entity**: People, places, organizations with attributes
547
+ - **Episodic**: Date-based interaction history
548
+
549
+ **Advanced Features:**
550
+ ```python
551
+ from praisonaiagents.memory import FileMemory
552
+
553
+ memory = FileMemory(user_id="user123")
554
+
555
+ # Session Save/Resume
556
+ memory.save_session("project_session", conversation_history=[...])
557
+ memory.resume_session("project_session")
558
+
559
+ # Context Compression
560
+ memory.compress(llm_func=lambda p: agent.chat(p), max_items=10)
561
+
562
+ # Checkpointing
563
+ memory.create_checkpoint("before_refactor", include_files=["main.py"])
564
+ memory.restore_checkpoint("before_refactor", restore_files=True)
565
+
566
+ # Slash Commands
567
+ memory.handle_command("/memory show")
568
+ memory.handle_command("/memory save my_session")
569
+ ```
570
+
571
+ **Storage Options:**
572
+ | Option | Dependencies | Description |
573
+ |--------|-------------|-------------|
574
+ | `memory=True` | None | File-based JSON storage (default) |
575
+ | `memory="file"` | None | Explicit file-based storage |
576
+ | `memory="sqlite"` | Built-in | SQLite with indexing |
577
+ | `memory="chromadb"` | chromadb | Vector/semantic search |
578
+
579
+ ### 6. Rules & Instructions
580
+
581
+ PraisonAI auto-discovers instruction files from your project root and git root:
582
+
583
+ | File | Description | Priority |
584
+ |------|-------------|----------|
585
+ | `PRAISON.md` | PraisonAI native instructions | High |
586
+ | `PRAISON.local.md` | Local overrides (gitignored) | Higher |
587
+ | `CLAUDE.md` | Claude Code memory file | High |
588
+ | `CLAUDE.local.md` | Local overrides (gitignored) | Higher |
589
+ | `AGENTS.md` | OpenAI Codex CLI instructions | High |
590
+ | `GEMINI.md` | Gemini CLI memory file | High |
591
+ | `.cursorrules` | Cursor IDE rules | High |
592
+ | `.windsurfrules` | Windsurf IDE rules | High |
593
+ | `.claude/rules/*.md` | Claude Code modular rules | Medium |
594
+ | `.windsurf/rules/*.md` | Windsurf modular rules | Medium |
595
+ | `.cursor/rules/*.mdc` | Cursor modular rules | Medium |
596
+ | `.praison/rules/*.md` | Workspace rules | Medium |
597
+ | `~/.praison/rules/*.md` | Global rules | Low |
598
+
599
+ ```python
600
+ from praisonaiagents import Agent
601
+
602
+ # Agent auto-discovers CLAUDE.md, AGENTS.md, GEMINI.md, etc.
603
+ agent = Agent(name="Assistant", instructions="You are helpful.")
604
+ # Rules are injected into system prompt automatically
605
+ ```
606
+
607
+ **@Import Syntax:**
608
+ ```markdown
609
+ # CLAUDE.md
610
+ See @README for project overview
611
+ See @docs/architecture.md for system design
612
+ @~/.praison/my-preferences.md
613
+ ```
614
+
615
+ **Rule File Format (with YAML frontmatter):**
616
+ ```markdown
617
+ ---
618
+ description: Python coding guidelines
619
+ globs: ["**/*.py"]
620
+ activation: always # always, glob, manual, ai_decision
621
+ ---
622
+
623
+ # Guidelines
624
+ - Use type hints
625
+ - Follow PEP 8
626
+ ```
627
+
628
+ ### 7. Auto-Generated Memories
629
+
630
+ ```python
631
+ from praisonaiagents.memory import FileMemory, AutoMemory
632
+
633
+ memory = FileMemory(user_id="user123")
634
+ auto = AutoMemory(memory, enabled=True)
635
+
636
+ # Automatically extracts and stores memories from conversations
637
+ memories = auto.process_interaction(
638
+ "My name is John and I prefer Python for backend work"
639
+ )
640
+ # Extracts: name="John", preference="Python for backend"
641
+ ```
642
+
643
+ ### 8. Agentic Workflows
644
+
645
+ Create powerful multi-agent workflows with the `Workflow` class:
646
+
647
+ ```python
648
+ from praisonaiagents import Agent, Workflow
649
+
650
+ # Create agents
651
+ researcher = Agent(
652
+ name="Researcher",
653
+ role="Research Analyst",
654
+ goal="Research topics thoroughly",
655
+ instructions="Provide concise, factual information."
656
+ )
657
+
658
+ writer = Agent(
659
+ name="Writer",
660
+ role="Content Writer",
661
+ goal="Write engaging content",
662
+ instructions="Write clear, engaging content based on research."
663
+ )
664
+
665
+ # Create workflow with agents as steps
666
+ workflow = Workflow(steps=[researcher, writer])
667
+
668
+ # Run workflow - agents process sequentially
669
+ result = workflow.start("What are the benefits of AI agents?")
670
+ print(result["output"])
671
+ ```
672
+
673
+ **Key Features:**
674
+ - **Agent-first** - Pass `Agent` objects directly as workflow steps
675
+ - **Pattern helpers** - Use `route()`, `parallel()`, `loop()`, `repeat()`
676
+ - **Planning mode** - Enable with `planning=True`
677
+ - **Callbacks** - Monitor with `on_step_complete`, `on_workflow_complete`
678
+ - **Async execution** - Use `workflow.astart()` for async
679
+
680
+ ### Workflow Patterns (route, parallel, loop, repeat)
681
+
682
+ ```python
683
+ from praisonaiagents import Agent, Workflow
684
+ from praisonaiagents.workflows import route, parallel, loop, repeat
685
+
686
+ # 1. ROUTING - Classifier agent routes to specialized agents
687
+ classifier = Agent(name="Classifier", instructions="Respond with 'technical' or 'creative'")
688
+ tech_agent = Agent(name="TechExpert", role="Technical Expert")
689
+ creative_agent = Agent(name="Creative", role="Creative Writer")
690
+
691
+ workflow = Workflow(steps=[
692
+ classifier,
693
+ route({
694
+ "technical": [tech_agent],
695
+ "creative": [creative_agent]
696
+ })
697
+ ])
698
+
699
+ # 2. PARALLEL - Multiple agents work concurrently
700
+ market_agent = Agent(name="Market", role="Market Researcher")
701
+ competitor_agent = Agent(name="Competitor", role="Competitor Analyst")
702
+ aggregator = Agent(name="Aggregator", role="Synthesizer")
703
+
704
+ workflow = Workflow(steps=[
705
+ parallel([market_agent, competitor_agent]),
706
+ aggregator
707
+ ])
708
+
709
+ # 3. LOOP - Agent processes each item
710
+ processor = Agent(name="Processor", role="Item Processor")
711
+ summarizer = Agent(name="Summarizer", role="Summarizer")
712
+
713
+ workflow = Workflow(
714
+ steps=[loop(processor, over="items"), summarizer],
715
+ variables={"items": ["AI", "ML", "NLP"]}
716
+ )
717
+
718
+ # 4. REPEAT - Evaluator-Optimizer pattern
719
+ generator = Agent(name="Generator", role="Content Generator")
720
+ evaluator = Agent(name="Evaluator", instructions="Say 'APPROVED' if good")
721
+
722
+ workflow = Workflow(steps=[
723
+ generator,
724
+ repeat(evaluator, until=lambda ctx: "approved" in ctx.previous_result.lower(), max_iterations=3)
725
+ ])
726
+
727
+ # 5. CALLBACKS
728
+ workflow = Workflow(
729
+ steps=[researcher, writer],
730
+ on_step_complete=lambda name, r: print(f"✅ {name} done")
731
+ )
732
+
733
+ # 6. WITH PLANNING & REASONING
734
+ workflow = Workflow(
735
+ steps=[researcher, writer],
736
+ planning=True,
737
+ reasoning=True
738
+ )
739
+
740
+ # 7. ASYNC EXECUTION
741
+ result = asyncio.run(workflow.astart("input"))
742
+
743
+ # 8. STATUS TRACKING
744
+ workflow.status # "not_started" | "running" | "completed"
745
+ workflow.step_statuses # {"step1": "completed", "step2": "skipped"}
746
+ ```
747
+
748
+ ### YAML Workflow Template
749
+
750
+ ```yaml
751
+ # .praison/workflows/research.yaml
752
+ name: Research Workflow
753
+ description: Research and write content with all patterns
754
+
755
+ agents:
756
+ researcher:
757
+ role: Research Expert
758
+ goal: Find accurate information
759
+ tools: [tavily_search, web_scraper]
760
+ writer:
761
+ role: Content Writer
762
+ goal: Write engaging content
763
+ editor:
764
+ role: Editor
765
+ goal: Polish content
766
+
767
+ steps:
768
+ # Sequential
769
+ - agent: researcher
770
+ action: Research {{topic}}
771
+ output_variable: research_data
772
+
773
+ # Routing
774
+ - name: classifier
775
+ action: Classify content type
776
+ route:
777
+ technical: [tech_handler]
778
+ creative: [creative_handler]
779
+ default: [general_handler]
780
+
781
+ # Parallel
782
+ - name: parallel_research
783
+ parallel:
784
+ - agent: researcher
785
+ action: Research market
786
+ - agent: researcher
787
+ action: Research competitors
788
+
789
+ # Loop
790
+ - agent: writer
791
+ action: Write about {{item}}
792
+ loop_over: topics
793
+ loop_var: item
794
+
795
+ # Repeat (evaluator-optimizer)
796
+ - agent: editor
797
+ action: Review and improve
798
+ repeat:
799
+ until: "quality > 8"
800
+ max_iterations: 3
801
+
802
+ # Output to file
803
+ - agent: writer
804
+ action: Write final report
805
+ output_file: output/{{topic}}_report.md
806
+
807
+ variables:
808
+ topic: AI trends
809
+ topics: [ML, NLP, Vision]
810
+
811
+ workflow:
812
+ planning: true
813
+ planning_llm: gpt-4o
814
+ memory_config:
815
+ provider: chroma
816
+ persist: true
817
+ ```
818
+
819
+ ### Loading YAML Workflows
820
+
821
+ ```python
822
+ from praisonaiagents.workflows import YAMLWorkflowParser, WorkflowManager
823
+
824
+ # Option 1: Parse YAML string
825
+ parser = YAMLWorkflowParser()
826
+ workflow = parser.parse_string(yaml_content)
827
+ result = workflow.start("Research AI trends")
828
+
829
+ # Option 2: Load from file with WorkflowManager
830
+ manager = WorkflowManager()
831
+ workflow = manager.load_yaml("research_workflow.yaml")
832
+ result = workflow.start("Research AI trends")
833
+
834
+ # Option 3: Execute YAML directly
835
+ result = manager.execute_yaml(
836
+ "research_workflow.yaml",
837
+ input_data="Research AI trends",
838
+ variables={"topic": "Machine Learning"}
839
+ )
840
+ ```
841
+
842
+ ### Complete workflow.yaml Reference
843
+
844
+ ```yaml
845
+ # workflow.yaml - Full feature reference
846
+ name: Complete Workflow
847
+ description: Demonstrates all workflow.yaml features
848
+ framework: praisonai # praisonai, crewai, autogen
849
+ process: workflow # sequential, hierarchical, workflow
850
+
851
+ workflow:
852
+ planning: true
853
+ planning_llm: gpt-4o
854
+ reasoning: true
855
+ verbose: true
856
+ memory_config:
857
+ provider: chroma
858
+ persist: true
859
+
860
+ variables:
861
+ topic: AI trends
862
+ items: [ML, NLP, Vision]
863
+
864
+ agents:
865
+ researcher:
866
+ name: Researcher
867
+ role: Research Analyst
868
+ goal: Research topics thoroughly
869
+ instructions: "Provide detailed research findings"
870
+ backstory: "Expert researcher with 10 years experience" # alias for instructions
871
+ llm: gpt-4o-mini
872
+ function_calling_llm: gpt-4o # For tool calls
873
+ max_rpm: 10 # Rate limiting
874
+ max_execution_time: 300 # Timeout in seconds
875
+ reflect_llm: gpt-4o # For self-reflection
876
+ min_reflect: 1
877
+ max_reflect: 3
878
+ system_template: "You are a helpful assistant"
879
+ tools:
880
+ - tavily_search
881
+
882
+ writer:
883
+ name: Writer
884
+ role: Content Writer
885
+ goal: Write clear content
886
+ instructions: "Write engaging content"
887
+
888
+ steps:
889
+ - name: research_step
890
+ agent: researcher
891
+ action: "Research {{topic}}"
892
+ expected_output: "Comprehensive research report"
893
+ output_file: "output/research.md"
894
+ create_directory: true
895
+
896
+ - name: writing_step
897
+ agent: writer
898
+ action: "Write article based on research"
899
+ context: # Task dependencies
900
+ - research_step
901
+ output_json: # Structured output
902
+ type: object
903
+ properties:
904
+ title: { type: string }
905
+ content: { type: string }
906
+
907
+ callbacks:
908
+ on_workflow_start: log_start
909
+ on_step_complete: log_step
910
+ on_workflow_complete: log_complete
911
+ ```
912
+
913
+ ### 9. Hooks
914
+
915
+ Configure in `.praison/hooks.json`:
916
+
917
+ ```python
918
+ from praisonaiagents.memory import HooksManager
919
+
920
+ hooks = HooksManager()
921
+
922
+ # Register Python hooks
923
+ hooks.register("pre_write_code", lambda ctx: print(f"Writing {ctx['file']}"))
924
+
925
+ # Execute hooks
926
+ result = hooks.execute("pre_write_code", {"file": "main.py"})
927
+ ```
928
+
929
+ ### 10. Field Names Reference (A-I-G-S)
930
+
931
+ PraisonAI accepts both old (agents.yaml) and new (workflow.yaml) field names. Use the **canonical names** for new projects:
932
+
933
+ | Canonical (Recommended) | Alias (Also Works) | Purpose |
934
+ |-------------------------|-------------------|---------|
935
+ | `agents` | `roles` | Define agent personas |
936
+ | `instructions` | `backstory` | Agent behavior/persona |
937
+ | `action` | `description` | What the step does |
938
+ | `steps` | `tasks` (nested) | Define work items |
939
+ | `name` | `topic` | Workflow identifier |
940
+
941
+ **A-I-G-S Mnemonic** - Easy to remember:
942
+ - **A**gents - Who does the work
943
+ - **I**nstructions - How they behave
944
+ - **G**oal - What they achieve
945
+ - **S**teps - What they do
946
+
947
+ ```yaml
948
+ # Quick Reference - Canonical Format
949
+ name: My Workflow # Workflow name (not 'topic')
950
+ agents: # Define agents (not 'roles')
951
+ my_agent:
952
+ role: Job Title # Agent's role
953
+ goal: What to achieve # Agent's goal
954
+ instructions: How to act # Agent's behavior (not 'backstory')
955
+
956
+ steps: # Define steps (not 'tasks')
957
+ - agent: my_agent
958
+ action: What to do # Step action (not 'description')
959
+ ```
960
+
961
+ > **Note:** The parser accepts both old and new names. Run `praisonai workflow validate <file.yaml>` to see suggestions for canonical names.
962
+
963
+ ### 11. Extended agents.yaml with Workflow Patterns
964
+
965
+ **Feature Parity:** Both `agents.yaml` and `workflow.yaml` now support the same features:
966
+ - All workflow patterns (route, parallel, loop, repeat)
967
+ - All agent fields (function_calling_llm, max_rpm, max_execution_time, reflect_llm, templates)
968
+ - All step fields (expected_output, context, output_json, create_directory, callback)
969
+ - Framework support (praisonai, crewai, autogen)
970
+ - Process types (sequential, hierarchical, workflow)
971
+
972
+ You can use advanced workflow patterns directly in agents.yaml by setting `process: workflow`:
973
+
974
+ ```yaml
975
+ # agents.yaml with workflow patterns
976
+ framework: praisonai
977
+ process: workflow # Enables workflow mode
978
+ topic: "Research AI trends"
979
+
980
+ workflow:
981
+ planning: true
982
+ reasoning: true
983
+ verbose: true
984
+
985
+ variables:
986
+ topic: AI trends
987
+
988
+ agents: # Canonical: use 'agents' instead of 'roles'
989
+ classifier:
990
+ role: Request Classifier
991
+ instructions: "Classify requests into categories" # Canonical: use 'instructions' instead of 'backstory'
992
+ goal: Classify requests
993
+
994
+ researcher:
995
+ role: Research Analyst
996
+ instructions: "Expert researcher" # Canonical: use 'instructions' instead of 'backstory'
997
+ goal: Research topics
998
+ tools:
999
+ - tavily_search
1000
+
1001
+ steps:
1002
+ # Sequential step
1003
+ - agent: classifier
1004
+ action: "Classify: {{topic}}"
1005
+
1006
+ # Route pattern - decision-based branching
1007
+ - name: routing
1008
+ route:
1009
+ technical: [tech_expert]
1010
+ default: [researcher]
1011
+
1012
+ # Parallel pattern - concurrent execution
1013
+ - name: parallel_research
1014
+ parallel:
1015
+ - agent: researcher
1016
+ action: "Research market trends"
1017
+ - agent: researcher
1018
+ action: "Research competitors"
1019
+
1020
+ # Loop pattern - iterate over items
1021
+ - agent: researcher
1022
+ action: "Analyze {{item}}"
1023
+ loop:
1024
+ over: topics
1025
+
1026
+ # Repeat pattern - evaluator-optimizer
1027
+ - agent: aggregator
1028
+ action: "Synthesize findings"
1029
+ repeat:
1030
+ until: "comprehensive"
1031
+ max_iterations: 3
1032
+ ```
1033
+
1034
+ Run with the same simple command:
1035
+ ```bash
1036
+ praisonai agents.yaml
1037
+ ```
1038
+
1039
+ ---
1040
+
1041
+ ## 🎯 CLI / No-Code Interface
1042
+
1043
+ PraisonAI provides a powerful CLI for no-code automation and quick prototyping.
1044
+
1045
+ ### Auto Mode
1046
+ ```bash
1047
+ pip install praisonai
1048
+ export OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxx
1049
+ praisonai --auto create a movie script about Robots in Mars
1050
+ ```
1051
+
1052
+ ### Query Rewriting (works with any command):
1053
+ ```bash
1054
+ # Rewrite query for better results (uses QueryRewriterAgent)
1055
+ praisonai "AI trends" --query-rewrite
1056
+
1057
+ # Rewrite with search tools (agent decides when to search)
1058
+ praisonai "latest developments" --query-rewrite --rewrite-tools "internet_search"
1059
+
1060
+ # Works with any prompt
1061
+ praisonai "explain quantum computing" --query-rewrite -v
1062
+ ```
1063
+
1064
+ ### Deep Research CLI:
1065
+ ```bash
1066
+ # Default: OpenAI (o4-mini-deep-research)
1067
+ praisonai research "What are the latest AI trends in 2025?"
1068
+
1069
+ # Use Gemini
1070
+ praisonai research --model deep-research-pro "Your research query"
1071
+
1072
+ # Rewrite query before research
1073
+ praisonai research --query-rewrite "AI trends"
1074
+
1075
+ # Rewrite with search tools
1076
+ praisonai research --query-rewrite --rewrite-tools "internet_search" "AI trends"
1077
+
1078
+ # Use custom tools from file (gathers context before deep research)
1079
+ praisonai research --tools tools.py "Your research query"
1080
+ praisonai research -t my_tools.py "Your research query"
1081
+
1082
+ # Use built-in tools by name (comma-separated)
1083
+ praisonai research --tools "internet_search,wiki_search" "Your query"
1084
+ praisonai research -t "yfinance,calculator_tools" "Stock analysis query"
1085
+
1086
+ # Save output to file (output/research/{query}.md)
1087
+ praisonai research --save "Your research query"
1088
+ praisonai research -s "Your research query"
1089
+
1090
+ # Combine options
1091
+ praisonai research --query-rewrite --tools tools.py --save "Your research query"
1092
+
1093
+ # Verbose mode (show debug logs)
1094
+ praisonai research -v "Your research query"
1095
+ ```
1096
+
1097
+ ### Planning Mode CLI:
1098
+ ```bash
1099
+ # Enable planning mode - agent creates a plan before execution
1100
+ praisonai "Research AI trends and write a summary" --planning
1101
+
1102
+ # Planning with tools for research
1103
+ praisonai "Analyze market trends" --planning --planning-tools tools.py
1104
+
1105
+ # Planning with chain-of-thought reasoning
1106
+ praisonai "Complex analysis task" --planning --planning-reasoning
1107
+
1108
+ # Auto-approve plans without confirmation
1109
+ praisonai "Task" --planning --auto-approve-plan
1110
+ ```
1111
+
1112
+ ### Memory CLI:
1113
+ ```bash
1114
+ # Enable memory for agent (persists across sessions)
1115
+ praisonai "My name is John" --memory
1116
+
1117
+ # Memory with user isolation
1118
+ praisonai "Remember my preferences" --memory --user-id user123
1119
+
1120
+ # Memory management commands
1121
+ praisonai memory show # Show memory statistics
1122
+ praisonai memory add "User prefers Python" # Add to long-term memory
1123
+ praisonai memory search "Python" # Search memories
1124
+ praisonai memory clear # Clear short-term memory
1125
+ praisonai memory clear all # Clear all memory
1126
+ praisonai memory save my_session # Save session
1127
+ praisonai memory resume my_session # Resume session
1128
+ praisonai memory sessions # List saved sessions
1129
+ praisonai memory checkpoint # Create checkpoint
1130
+ praisonai memory restore <checkpoint_id> # Restore checkpoint
1131
+ praisonai memory checkpoints # List checkpoints
1132
+ praisonai memory help # Show all commands
1133
+ ```
1134
+
1135
+ ### Rules CLI:
1136
+ ```bash
1137
+ # List all loaded rules (from PRAISON.md, CLAUDE.md, etc.)
1138
+ praisonai rules list
1139
+
1140
+ # Show specific rule details
1141
+ praisonai rules show <rule_name>
1142
+
1143
+ # Create a new rule
1144
+ praisonai rules create my_rule "Always use type hints"
1145
+
1146
+ # Delete a rule
1147
+ praisonai rules delete my_rule
1148
+
1149
+ # Show rules statistics
1150
+ praisonai rules stats
1151
+
1152
+ # Include manual rules with prompts
1153
+ praisonai "Task" --include-rules security,testing
1154
+ ```
1155
+
1156
+ ### Workflow CLI:
1157
+ ```bash
1158
+ # List available workflows
1159
+ praisonai workflow list
1160
+
1161
+ # Execute a workflow with tools and save output
1162
+ praisonai workflow run "Research Blog" --tools tavily --save
1163
+
1164
+ # Execute with variables
1165
+ praisonai workflow run deploy --workflow-var environment=staging --workflow-var branch=main
1166
+
1167
+ # Execute with planning mode (AI creates sub-steps for each workflow step)
1168
+ praisonai workflow run "Research Blog" --planning --verbose
1169
+
1170
+ # Execute with reasoning mode (chain-of-thought)
1171
+ praisonai workflow run "Analysis" --reasoning --verbose
1172
+
1173
+ # Execute with memory enabled
1174
+ praisonai workflow run "Research" --memory
1175
+
1176
+ # Show workflow details
1177
+ praisonai workflow show deploy
1178
+
1179
+ # Create a new workflow template
1180
+ praisonai workflow create my_workflow
1181
+
1182
+ # Inline workflow (no template file needed)
1183
+ praisonai "What is AI?" --workflow "Research,Summarize" --save
1184
+
1185
+ # Inline workflow with step actions
1186
+ praisonai "GPT-5" --workflow "Research:Search for info,Write:Write blog" --tools tavily
1187
+
1188
+ # Workflow CLI help
1189
+ praisonai workflow help
1190
+ ```
1191
+
1192
+ #### YAML Workflow Files:
1193
+ ```bash
1194
+ # Run a YAML workflow file
1195
+ praisonai workflow run research.yaml
1196
+
1197
+ # Run with variables
1198
+ praisonai workflow run research.yaml --var topic="AI trends"
1199
+
1200
+ # Validate a YAML workflow
1201
+ praisonai workflow validate research.yaml
1202
+
1203
+ # Create from template (simple, routing, parallel, loop, evaluator-optimizer)
1204
+ praisonai workflow template routing --output my_workflow.yaml
1205
+ ```
1206
+
1207
+ #### Auto-Generate Workflows:
1208
+ ```bash
1209
+ # Auto-generate a sequential workflow from topic
1210
+ praisonai workflow auto "Research AI trends"
1211
+
1212
+ # Generate parallel workflow (multiple agents work concurrently)
1213
+ praisonai workflow auto "Research AI trends" --pattern parallel
1214
+
1215
+ # Generate routing workflow (classifier routes to specialists)
1216
+ praisonai workflow auto "Build a chatbot" --pattern routing
1217
+
1218
+ # Specify output file
1219
+ praisonai workflow auto "Research AI" --pattern sequential --output my_workflow.yaml
1220
+ ```
1221
+
1222
+ **Workflow CLI Options:**
1223
+ | Flag | Description |
1224
+ |------|-------------|
1225
+ | `--workflow-var key=value` | Set workflow variable (can be repeated) |
1226
+ | `--var key=value` | Set variable for YAML workflows |
1227
+ | `--pattern <pattern>` | Pattern for auto-generation (sequential, parallel, routing, loop) |
1228
+ | `--output <file>` | Output file for auto-generation |
1229
+ | `--llm <model>` | LLM model (e.g., openai/gpt-4o-mini) |
1230
+ | `--tools <tools>` | Tools (comma-separated, e.g., tavily) |
1231
+ | `--planning` | Enable planning mode |
1232
+ | `--reasoning` | Enable reasoning mode |
1233
+ | `--memory` | Enable memory |
1234
+ | `--verbose` | Enable verbose output |
1235
+ | `--save` | Save output to file |
1236
+
1237
+ ### Hooks CLI:
1238
+ ```bash
1239
+ # List configured hooks
1240
+ praisonai hooks list
1241
+
1242
+ # Show hooks statistics
1243
+ praisonai hooks stats
1244
+
1245
+ # Create hooks.json template
1246
+ praisonai hooks init
1247
+ ```
1248
+
1249
+ ### Claude Memory Tool CLI:
1250
+ ```bash
1251
+ # Enable Claude Memory Tool (Anthropic models only)
1252
+ praisonai "Research and remember findings" --claude-memory --llm anthropic/claude-sonnet-4-20250514
1253
+ ```
1254
+
1255
+ ### Guardrail CLI:
1256
+ ```bash
1257
+ # Validate output with LLM guardrail
1258
+ praisonai "Write code" --guardrail "Ensure code is secure and follows best practices"
1259
+
1260
+ # Combine with other flags
1261
+ praisonai "Generate SQL query" --guardrail "No DROP or DELETE statements" --save
1262
+ ```
1263
+
1264
+ ### Metrics CLI:
1265
+ ```bash
1266
+ # Display token usage and cost metrics
1267
+ praisonai "Analyze this data" --metrics
1268
+
1269
+ # Combine with other features
1270
+ praisonai "Complex task" --metrics --planning
1271
+ ```
1272
+
1273
+ ### Image Processing CLI:
1274
+ ```bash
1275
+ # Process images with vision-based tasks
1276
+ praisonai "Describe this image" --image path/to/image.png
1277
+
1278
+ # Analyze image content
1279
+ praisonai "What objects are in this photo?" --image photo.jpg --llm openai/gpt-4o
1280
+ ```
1281
+
1282
+ ### Telemetry CLI:
1283
+ ```bash
1284
+ # Enable usage monitoring and analytics
1285
+ praisonai "Task" --telemetry
1286
+
1287
+ # Combine with metrics for full observability
1288
+ praisonai "Complex analysis" --telemetry --metrics
1289
+ ```
1290
+
1291
+ ### MCP (Model Context Protocol) CLI:
1292
+ ```bash
1293
+ # Use MCP server tools
1294
+ praisonai "Search files" --mcp "npx -y @modelcontextprotocol/server-filesystem ."
1295
+
1296
+ # MCP with environment variables
1297
+ praisonai "Search web" --mcp "npx -y @modelcontextprotocol/server-brave-search" --mcp-env "BRAVE_API_KEY=your_key"
1298
+
1299
+ # Multiple MCP options
1300
+ praisonai "Task" --mcp "npx server" --mcp-env "KEY1=value1,KEY2=value2"
1301
+ ```
1302
+
1303
+ ### Fast Context CLI:
1304
+ ```bash
1305
+ # Search codebase for relevant context
1306
+ praisonai "Find authentication code" --fast-context ./src
1307
+
1308
+ # Add code context to any task
1309
+ praisonai "Explain this function" --fast-context /path/to/project
1310
+ ```
1311
+
1312
+ ### Knowledge CLI:
1313
+ ```bash
1314
+ # Add documents to knowledge base
1315
+ praisonai knowledge add document.pdf
1316
+ praisonai knowledge add ./docs/
1317
+
1318
+ # Search knowledge base
1319
+ praisonai knowledge search "API authentication"
1320
+
1321
+ # List indexed documents
1322
+ praisonai knowledge list
1323
+
1324
+ # Clear knowledge base
1325
+ praisonai knowledge clear
1326
+
1327
+ # Show knowledge base info
1328
+ praisonai knowledge info
1329
+
1330
+ # Show all commands
1331
+ praisonai knowledge help
1332
+ ```
1333
+
1334
+ ### Session CLI:
1335
+ ```bash
1336
+ # List all saved sessions
1337
+ praisonai session list
1338
+
1339
+ # Show session details
1340
+ praisonai session show my-project
1341
+
1342
+ # Resume a session (load into memory)
1343
+ praisonai session resume my-project
1344
+
1345
+ # Delete a session
1346
+ praisonai session delete my-project
1347
+
1348
+ # Auto-save session after each run
1349
+ praisonai "Analyze this code" --auto-save my-project
1350
+
1351
+ # Load history from last N sessions into context
1352
+ praisonai "Continue our discussion" --history 5
1353
+ ```
1354
+
1355
+ ### Session Management (Python):
1356
+ ```python
1357
+ from praisonaiagents import Agent
1358
+
1359
+ # Auto-save session after each run
1360
+ agent = Agent(
1361
+ name="Assistant",
1362
+ memory=True,
1363
+ auto_save="my-project"
1364
+ )
1365
+
1366
+ # Load history from last 5 sessions
1367
+ agent = Agent(
1368
+ name="Assistant",
1369
+ memory=True,
1370
+ history_in_context=5
1371
+ )
1372
+ ```
1373
+
1374
+ ### Workflow Checkpoints:
1375
+ ```python
1376
+ from praisonaiagents.memory.workflows import WorkflowManager
1377
+
1378
+ manager = WorkflowManager()
1379
+
1380
+ # Save checkpoint after each step
1381
+ result = manager.execute("deploy", checkpoint="deploy-v1")
1382
+
1383
+ # Resume from checkpoint
1384
+ result = manager.execute("deploy", resume="deploy-v1")
1385
+
1386
+ # List/delete checkpoints
1387
+ manager.list_checkpoints()
1388
+ manager.delete_checkpoint("deploy-v1")
1389
+ ```
1390
+
1391
+ ### Tools CLI:
1392
+ ```bash
1393
+ # List all available tools
1394
+ praisonai tools list
1395
+
1396
+ # Get info about a specific tool
1397
+ praisonai tools info internet_search
1398
+
1399
+ # Search for tools
1400
+ praisonai tools search "web"
1401
+
1402
+ # Show all commands
1403
+ praisonai tools help
1404
+ ```
1405
+
1406
+ ### Handoff CLI:
1407
+ ```bash
1408
+ # Enable agent-to-agent task delegation
1409
+ praisonai "Research and write article" --handoff "researcher,writer,editor"
1410
+
1411
+ # Complex multi-agent workflow
1412
+ praisonai "Analyze data and create report" --handoff "analyst,visualizer,writer"
1413
+ ```
1414
+
1415
+ ### Auto Memory CLI:
1416
+ ```bash
1417
+ # Enable automatic memory extraction
1418
+ praisonai "Learn about user preferences" --auto-memory
1419
+
1420
+ # Combine with user isolation
1421
+ praisonai "Remember my settings" --auto-memory --user-id user123
1422
+ ```
1423
+
1424
+ ### Todo CLI:
1425
+ ```bash
1426
+ # Generate todo list from task
1427
+ praisonai "Plan the project" --todo
1428
+
1429
+ # Add a todo item
1430
+ praisonai todo add "Implement feature X"
1431
+
1432
+ # List all todos
1433
+ praisonai todo list
1434
+
1435
+ # Complete a todo
1436
+ praisonai todo complete 1
1437
+
1438
+ # Delete a todo
1439
+ praisonai todo delete 1
1440
+
1441
+ # Clear all todos
1442
+ praisonai todo clear
1443
+
1444
+ # Show all commands
1445
+ praisonai todo help
1446
+ ```
1447
+
1448
+ ### Router CLI:
1449
+ ```bash
1450
+ # Auto-select best model based on task complexity
1451
+ praisonai "Simple question" --router
1452
+
1453
+ # Specify preferred provider
1454
+ praisonai "Complex analysis" --router --router-provider anthropic
1455
+
1456
+ # Router automatically selects:
1457
+ # - Simple tasks → gpt-4o-mini, claude-3-haiku
1458
+ # - Complex tasks → gpt-4-turbo, claude-3-opus
1459
+ ```
1460
+
1461
+ ### Flow Display CLI:
1462
+ ```bash
1463
+ # Enable visual workflow tracking
1464
+ praisonai agents.yaml --flow-display
1465
+
1466
+ # Combine with other features
1467
+ praisonai "Multi-step task" --planning --flow-display
1468
+ ```
1469
+
1470
+ ### Docs CLI:
1471
+ ```bash
1472
+ # List all project docs
1473
+ praisonai docs list
1474
+
1475
+ # Create a new doc
1476
+ praisonai docs create project-overview "This project is a Python web app..."
1477
+
1478
+ # Show a specific doc
1479
+ praisonai docs show project-overview
1480
+
1481
+ # Delete a doc
1482
+ praisonai docs delete old-doc
1483
+
1484
+ # Show all commands
1485
+ praisonai docs help
1486
+ ```
1487
+
1488
+ ### MCP Config CLI:
1489
+ ```bash
1490
+ # List all MCP configurations
1491
+ praisonai mcp list
1492
+
1493
+ # Create a new MCP config
1494
+ praisonai mcp create filesystem npx -y @modelcontextprotocol/server-filesystem .
1495
+
1496
+ # Show a specific config
1497
+ praisonai mcp show filesystem
1498
+
1499
+ # Enable/disable a config
1500
+ praisonai mcp enable filesystem
1501
+ praisonai mcp disable filesystem
1502
+
1503
+ # Delete a config
1504
+ praisonai mcp delete filesystem
1505
+
1506
+ # Show all commands
1507
+ praisonai mcp help
1508
+ ```
1509
+
1510
+ ### AI Commit CLI:
1511
+ ```bash
1512
+ # Generate AI commit message for staged changes
1513
+ praisonai commit
1514
+
1515
+ # Generate, commit, and push
1516
+ praisonai commit --push
1517
+ ```
1518
+
1519
+ ### Serve CLI (API Server):
1520
+ ```bash
1521
+ # Start API server for agents defined in YAML
1522
+ praisonai serve agents.yaml
1523
+
1524
+ # With custom port and host
1525
+ praisonai serve agents.yaml --port 8005 --host 0.0.0.0
1526
+
1527
+ # Alternative flag style
1528
+ praisonai agents.yaml --serve
1529
+
1530
+ # The server provides:
1531
+ # POST /agents - Run all agents sequentially
1532
+ # POST /agents/{name} - Run specific agent (e.g., /agents/researcher)
1533
+ # GET /agents/list - List available agents
1534
+ ```
1535
+
1536
+ ### n8n Integration CLI:
1537
+ ```bash
1538
+ # Export workflow to n8n and open in browser
1539
+ praisonai agents.yaml --n8n
1540
+
1541
+ # With custom n8n URL
1542
+ praisonai agents.yaml --n8n --n8n-url http://localhost:5678
1543
+
1544
+ # Set N8N_API_KEY for auto-import
1545
+ export N8N_API_KEY="your-api-key"
1546
+ praisonai agents.yaml --n8n
1547
+ ```
1548
+
1549
+ ### @Mentions in Prompts:
1550
+ ```bash
1551
+ # Include file content in prompt
1552
+ praisonai "@file:src/main.py explain this code"
1553
+
1554
+ # Include project doc
1555
+ praisonai "@doc:project-overview help me add a feature"
1556
+
1557
+ # Search the web
1558
+ praisonai "@web:python best practices give me tips"
1559
+
1560
+ # Fetch URL content
1561
+ praisonai "@url:https://docs.python.org summarize this"
1562
+
1563
+ # Combine multiple mentions
1564
+ praisonai "@file:main.py @doc:coding-standards review this code"
1565
+ ```
1566
+
1567
+ ## Prompt Expansion
1568
+
1569
+ Expand short prompts into detailed, actionable prompts:
1570
+
1571
+ ### CLI Usage
1572
+ ```bash
1573
+ # Expand a short prompt into detailed prompt
1574
+ praisonai "write a movie script in 3 lines" --expand-prompt
1575
+
1576
+ # With verbose output
1577
+ praisonai "blog about AI" --expand-prompt -v
1578
+
1579
+ # With tools for context gathering
1580
+ praisonai "latest AI trends" --expand-prompt --expand-tools tools.py
1581
+
1582
+ # Combine with query rewrite
1583
+ praisonai "AI news" --query-rewrite --expand-prompt
1584
+ ```
1585
+
1586
+ ### Programmatic Usage
1587
+ ```python
1588
+ from praisonaiagents import PromptExpanderAgent, ExpandStrategy
1589
+
1590
+ # Basic usage
1591
+ agent = PromptExpanderAgent()
1592
+ result = agent.expand("write a movie script in 3 lines")
1593
+ print(result.expanded_prompt)
1594
+
1595
+ # With specific strategy
1596
+ result = agent.expand("blog about AI", strategy=ExpandStrategy.DETAILED)
1597
+
1598
+ # Available strategies: BASIC, DETAILED, STRUCTURED, CREATIVE, AUTO
1599
+ ```
1600
+
1601
+ **Key Difference:**
1602
+ - `--query-rewrite`: Optimizes queries for search/retrieval (RAG)
1603
+ - `--expand-prompt`: Expands prompts for detailed task execution
1604
+
1605
+ ## Web Search, Web Fetch & Prompt Caching
1606
+
1607
+ ### CLI Usage
1608
+ ```bash
1609
+ # Web Search - Get real-time information
1610
+ praisonai "What are the latest AI news today?" --web-search --llm openai/gpt-4o-search-preview
1611
+
1612
+ # Web Fetch - Retrieve and analyze URL content (Anthropic only)
1613
+ praisonai "Summarize https://docs.praison.ai" --web-fetch --llm anthropic/claude-sonnet-4-20250514
1614
+
1615
+ # Prompt Caching - Reduce costs for repeated prompts
1616
+ praisonai "Analyze this document..." --prompt-caching --llm anthropic/claude-sonnet-4-20250514
1617
+ ```
1618
+
1619
+ ### Programmatic Usage
1620
+ ```python
1621
+ from praisonaiagents import Agent
1622
+
1623
+ # Web Search
1624
+ agent = Agent(
1625
+ instructions="You are a research assistant",
1626
+ llm="openai/gpt-4o-search-preview",
1627
+ web_search=True
1628
+ )
1629
+
1630
+ # Web Fetch (Anthropic only)
1631
+ agent = Agent(
1632
+ instructions="You are a content analyzer",
1633
+ llm="anthropic/claude-sonnet-4-20250514",
1634
+ web_fetch=True
1635
+ )
1636
+
1637
+ # Prompt Caching
1638
+ agent = Agent(
1639
+ instructions="You are an AI assistant..." * 50, # Long system prompt
1640
+ llm="anthropic/claude-sonnet-4-20250514",
1641
+ prompt_caching=True
1642
+ )
1643
+ ```
1644
+
1645
+ **Supported Providers:**
1646
+ | Feature | Providers |
1647
+ |---------|----------|
1648
+ | Web Search | OpenAI, Gemini, Anthropic, xAI, Perplexity |
1649
+ | Web Fetch | Anthropic |
1650
+ | Prompt Caching | OpenAI (auto), Anthropic, Bedrock, Deepseek |
1651
+
1652
+ ## MCP (Model Context Protocol)
1653
+
1654
+ PraisonAI supports MCP Protocol Revision 2025-11-25 with multiple transports.
1655
+
1656
+ ### MCP Client (Consume MCP Servers)
1657
+ ```python
1658
+ from praisonaiagents import Agent, MCP
1659
+
1660
+ # stdio - Local NPX/Python servers
1661
+ agent = Agent(tools=MCP("npx @modelcontextprotocol/server-memory"))
1662
+
1663
+ # Streamable HTTP - Production servers
1664
+ agent = Agent(tools=MCP("https://api.example.com/mcp"))
1665
+
1666
+ # WebSocket - Real-time bidirectional
1667
+ agent = Agent(tools=MCP("wss://api.example.com/mcp", auth_token="token"))
1668
+
1669
+ # SSE (Legacy) - Backward compatibility
1670
+ agent = Agent(tools=MCP("http://localhost:8080/sse"))
1671
+
1672
+ # With environment variables
1673
+ agent = Agent(
1674
+ tools=MCP(
1675
+ command="npx",
1676
+ args=["-y", "@modelcontextprotocol/server-brave-search"],
1677
+ env={"BRAVE_API_KEY": "your-key"}
1678
+ )
1679
+ )
1680
+
1681
+ # Multiple MCP servers + regular functions
1682
+ def my_custom_tool(query: str) -> str:
1683
+ """Custom tool function."""
1684
+ return f"Result: {query}"
1685
+
1686
+ agent = Agent(
1687
+ name="MultiToolAgent",
1688
+ instructions="Agent with multiple MCP servers",
1689
+ tools=[
1690
+ MCP("uvx mcp-server-time"), # Time tools
1691
+ MCP("npx @modelcontextprotocol/server-memory"), # Memory tools
1692
+ my_custom_tool # Regular function
1693
+ ]
1694
+ )
1695
+ ```
1696
+
1697
+ ### MCP Server (Expose Tools as MCP Server)
1698
+
1699
+ Expose your Python functions as MCP tools for Claude Desktop, Cursor, and other MCP clients:
1700
+
1701
+ ```python
1702
+ from praisonaiagents.mcp import ToolsMCPServer
1703
+
1704
+ def search_web(query: str, max_results: int = 5) -> dict:
1705
+ """Search the web for information."""
1706
+ return {"results": [f"Result for {query}"]}
1707
+
1708
+ def calculate(expression: str) -> dict:
1709
+ """Evaluate a mathematical expression."""
1710
+ return {"result": eval(expression)}
1711
+
1712
+ # Create and run MCP server
1713
+ server = ToolsMCPServer(name="my-tools")
1714
+ server.register_tools([search_web, calculate])
1715
+ server.run() # stdio for Claude Desktop
1716
+ # server.run_sse(host="0.0.0.0", port=8080) # SSE for web clients
1717
+ ```
1718
+
1719
+ ### MCP Features
1720
+ | Feature | Description |
1721
+ |---------|-------------|
1722
+ | Session Management | Automatic Mcp-Session-Id handling |
1723
+ | Protocol Versioning | Mcp-Protocol-Version header |
1724
+ | Resumability | SSE stream recovery via Last-Event-ID |
1725
+ | Security | Origin validation, DNS rebinding prevention |
1726
+ | WebSocket | Auto-reconnect with exponential backoff |
1727
+
1728
+ ## CLI Features
1729
+
1730
+ | Feature | Docs |
1731
+ |---------|:----:|
1732
+ | 🔄 Query Rewrite - RAG optimization | [📖](https://docs.praison.ai/cli/query-rewrite) |
1733
+ | 🔬 Deep Research - Automated research | [📖](https://docs.praison.ai/cli/deep-research) |
1734
+ | 📋 Planning - Step-by-step execution | [📖](https://docs.praison.ai/cli/planning) |
1735
+ | 💾 Memory - Persistent agent memory | [📖](https://docs.praison.ai/cli/memory) |
1736
+ | 📜 Rules - Auto-discovered instructions | [📖](https://docs.praison.ai/cli/rules) |
1737
+ | 🔄 Workflow - Multi-step workflows | [📖](https://docs.praison.ai/cli/workflow) |
1738
+ | 🪝 Hooks - Event-driven actions | [📖](https://docs.praison.ai/cli/hooks) |
1739
+ | 🧠 Claude Memory - Anthropic memory tool | [📖](https://docs.praison.ai/cli/claude-memory) |
1740
+ | 🛡️ Guardrail - Output validation | [📖](https://docs.praison.ai/cli/guardrail) |
1741
+ | 📊 Metrics - Token usage tracking | [📖](https://docs.praison.ai/cli/metrics) |
1742
+ | 🖼️ Image - Vision processing | [📖](https://docs.praison.ai/cli/image) |
1743
+ | 📡 Telemetry - Usage monitoring | [📖](https://docs.praison.ai/cli/telemetry) |
1744
+ | 🔌 MCP - Model Context Protocol | [📖](https://docs.praison.ai/cli/mcp) |
1745
+ | ⚡ Fast Context - Codebase search | [📖](https://docs.praison.ai/cli/fast-context) |
1746
+ | 📚 Knowledge - RAG management | [📖](https://docs.praison.ai/cli/knowledge) |
1747
+ | 💬 Session - Conversation management | [📖](https://docs.praison.ai/cli/session) |
1748
+ | 🔧 Tools - Tool discovery | [📖](https://docs.praison.ai/cli/tools) |
1749
+ | 🤝 Handoff - Agent delegation | [📖](https://docs.praison.ai/cli/handoff) |
1750
+ | 🧠 Auto Memory - Memory extraction | [📖](https://docs.praison.ai/cli/auto-memory) |
1751
+ | 📋 Todo - Task management | [📖](https://docs.praison.ai/cli/todo) |
1752
+ | 🎯 Router - Smart model selection | [📖](https://docs.praison.ai/cli/router) |
1753
+ | 📈 Flow Display - Visual workflow | [📖](https://docs.praison.ai/cli/flow-display) |
1754
+ | ✨ Prompt Expansion - Detailed prompts | [📖](https://docs.praison.ai/cli/prompt-expansion) |
1755
+ | 🌐 Web Search - Real-time search | [📖](https://docs.praison.ai/cli/web-search) |
1756
+ | 📥 Web Fetch - URL content retrieval | [📖](https://docs.praison.ai/cli/web-fetch) |
1757
+ | 💾 Prompt Caching - Cost reduction | [📖](https://docs.praison.ai/cli/prompt-caching) |
1758
+
1759
+ ---
1760
+
1761
+ ## 💻 Using JavaScript Code
1762
+
1763
+ ```bash
1764
+ npm install praisonai
1765
+ export OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxx
1766
+ ```
1767
+
1768
+ ```javascript
1769
+ const { Agent } = require('praisonai');
1770
+ const agent = new Agent({ instructions: 'You are a helpful AI assistant' });
1771
+ agent.start('Write a movie script about a robot in Mars');
1772
+ ```
1773
+
1774
+ ![PraisonAI CLI Demo](docs/demo/praisonai-cli-demo.gif)
1775
+
1776
+ ---
1777
+
1778
+ ## ⭐ Star History
1779
+
1780
+ [![Star History Chart](https://api.star-history.com/svg?repos=MervinPraison/PraisonAI&type=Date)](https://docs.praison.ai)
1781
+
1782
+ ---
1783
+
1784
+ ## 📊 Process Types & Patterns
1785
+
1786
+ ### AI Agents Flow
1787
+
1788
+ ```mermaid
1789
+ graph LR
1790
+ %% Define the main flow
1791
+ Start([▶ Start]) --> Agent1
1792
+ Agent1 --> Process[⚙ Process]
1793
+ Process --> Agent2
1794
+ Agent2 --> Output([✓ Output])
1795
+ Process -.-> Agent1
1796
+
1797
+ %% Define subgraphs for agents and their tasks
1798
+ subgraph Agent1[ ]
1799
+ Task1[📋 Task]
1800
+ AgentIcon1[🤖 AI Agent]
1801
+ Tools1[🔧 Tools]
1802
+
1803
+ Task1 --- AgentIcon1
1804
+ AgentIcon1 --- Tools1
1805
+ end
1806
+
1807
+ subgraph Agent2[ ]
1808
+ Task2[📋 Task]
1809
+ AgentIcon2[🤖 AI Agent]
1810
+ Tools2[🔧 Tools]
1811
+
1812
+ Task2 --- AgentIcon2
1813
+ AgentIcon2 --- Tools2
1814
+ end
1815
+
1816
+ classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
1817
+ classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
1818
+ classDef tools fill:#2E8B57,stroke:#7C90A0,color:#fff
1819
+ classDef transparent fill:none,stroke:none
1820
+
1821
+ class Start,Output,Task1,Task2 input
1822
+ class Process,AgentIcon1,AgentIcon2 process
1823
+ class Tools1,Tools2 tools
1824
+ class Agent1,Agent2 transparent
1825
+ ```
1826
+
1827
+ ## AI Agents with Tools
1828
+
1829
+ Create AI agents that can use tools to interact with external systems and perform actions.
1830
+
1831
+ ```mermaid
1832
+ flowchart TB
1833
+ subgraph Tools
1834
+ direction TB
1835
+ T3[Internet Search]
1836
+ T1[Code Execution]
1837
+ T2[Formatting]
1838
+ end
1839
+
1840
+ Input[Input] ---> Agents
1841
+ subgraph Agents
1842
+ direction LR
1843
+ A1[Agent 1]
1844
+ A2[Agent 2]
1845
+ A3[Agent 3]
1846
+ end
1847
+ Agents ---> Output[Output]
1848
+
1849
+ T3 --> A1
1850
+ T1 --> A2
1851
+ T2 --> A3
1852
+
1853
+ style Tools fill:#189AB4,color:#fff
1854
+ style Agents fill:#8B0000,color:#fff
1855
+ style Input fill:#8B0000,color:#fff
1856
+ style Output fill:#8B0000,color:#fff
1857
+ ```
1858
+
1859
+ ## AI Agents with Memory
1860
+
1861
+ Create AI agents with memory capabilities for maintaining context and information across tasks.
1862
+
1863
+ ```mermaid
1864
+ flowchart TB
1865
+ subgraph Memory
1866
+ direction TB
1867
+ STM[Short Term]
1868
+ LTM[Long Term]
1869
+ end
1870
+
1871
+ subgraph Store
1872
+ direction TB
1873
+ DB[(Vector DB)]
1874
+ end
1875
+
1876
+ Input[Input] ---> Agents
1877
+ subgraph Agents
1878
+ direction LR
1879
+ A1[Agent 1]
1880
+ A2[Agent 2]
1881
+ A3[Agent 3]
1882
+ end
1883
+ Agents ---> Output[Output]
1884
+
1885
+ Memory <--> Store
1886
+ Store <--> A1
1887
+ Store <--> A2
1888
+ Store <--> A3
1889
+
1890
+ style Memory fill:#189AB4,color:#fff
1891
+ style Store fill:#2E8B57,color:#fff
1892
+ style Agents fill:#8B0000,color:#fff
1893
+ style Input fill:#8B0000,color:#fff
1894
+ style Output fill:#8B0000,color:#fff
1895
+ ```
1896
+
1897
+ ## AI Agents with Different Processes
1898
+
1899
+ ### Sequential Process
1900
+
1901
+ The simplest form of task execution where tasks are performed one after another.
1902
+
1903
+ ```mermaid
1904
+ graph LR
1905
+ Input[Input] --> A1
1906
+ subgraph Agents
1907
+ direction LR
1908
+ A1[Agent 1] --> A2[Agent 2] --> A3[Agent 3]
1909
+ end
1910
+ A3 --> Output[Output]
1911
+
1912
+ classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
1913
+ classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
1914
+ classDef transparent fill:none,stroke:none
1915
+
1916
+ class Input,Output input
1917
+ class A1,A2,A3 process
1918
+ class Agents transparent
1919
+ ```
1920
+
1921
+ ### Hierarchical Process
1922
+
1923
+ Uses a manager agent to coordinate task execution and agent assignments.
1924
+
1925
+ ```mermaid
1926
+ graph TB
1927
+ Input[Input] --> Manager
1928
+
1929
+ subgraph Agents
1930
+ Manager[Manager Agent]
1931
+
1932
+ subgraph Workers
1933
+ direction LR
1934
+ W1[Worker 1]
1935
+ W2[Worker 2]
1936
+ W3[Worker 3]
1937
+ end
1938
+
1939
+ Manager --> W1
1940
+ Manager --> W2
1941
+ Manager --> W3
1942
+ end
1943
+
1944
+ W1 --> Manager
1945
+ W2 --> Manager
1946
+ W3 --> Manager
1947
+ Manager --> Output[Output]
1948
+
1949
+ classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
1950
+ classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
1951
+ classDef transparent fill:none,stroke:none
1952
+
1953
+ class Input,Output input
1954
+ class Manager,W1,W2,W3 process
1955
+ class Agents,Workers transparent
1956
+ ```
1957
+
1958
+ ### Workflow Process
1959
+
1960
+ Advanced process type supporting complex task relationships and conditional execution.
1961
+
1962
+ ```mermaid
1963
+ graph LR
1964
+ Input[Input] --> Start
1965
+
1966
+ subgraph Workflow
1967
+ direction LR
1968
+ Start[Start] --> C1{Condition}
1969
+ C1 --> |Yes| A1[Agent 1]
1970
+ C1 --> |No| A2[Agent 2]
1971
+ A1 --> Join
1972
+ A2 --> Join
1973
+ Join --> A3[Agent 3]
1974
+ end
1975
+
1976
+ A3 --> Output[Output]
1977
+
1978
+ classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
1979
+ classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
1980
+ classDef decision fill:#2E8B57,stroke:#7C90A0,color:#fff
1981
+ classDef transparent fill:none,stroke:none
1982
+
1983
+ class Input,Output input
1984
+ class Start,A1,A2,A3,Join process
1985
+ class C1 decision
1986
+ class Workflow transparent
1987
+ ```
1988
+
1989
+ #### Agentic Routing Workflow
1990
+
1991
+ Create AI agents that can dynamically route tasks to specialized LLM instances.
1992
+
1993
+ ```mermaid
1994
+ flowchart LR
1995
+ In[In] --> Router[LLM Call Router]
1996
+ Router --> LLM1[LLM Call 1]
1997
+ Router --> LLM2[LLM Call 2]
1998
+ Router --> LLM3[LLM Call 3]
1999
+ LLM1 --> Out[Out]
2000
+ LLM2 --> Out
2001
+ LLM3 --> Out
2002
+
2003
+ style In fill:#8B0000,color:#fff
2004
+ style Router fill:#2E8B57,color:#fff
2005
+ style LLM1 fill:#2E8B57,color:#fff
2006
+ style LLM2 fill:#2E8B57,color:#fff
2007
+ style LLM3 fill:#2E8B57,color:#fff
2008
+ style Out fill:#8B0000,color:#fff
2009
+ ```
2010
+
2011
+ #### Agentic Orchestrator Worker
2012
+
2013
+ Create AI agents that orchestrate and distribute tasks among specialized workers.
2014
+
2015
+ ```mermaid
2016
+ flowchart LR
2017
+ In[In] --> Router[LLM Call Router]
2018
+ Router --> LLM1[LLM Call 1]
2019
+ Router --> LLM2[LLM Call 2]
2020
+ Router --> LLM3[LLM Call 3]
2021
+ LLM1 --> Synthesizer[Synthesizer]
2022
+ LLM2 --> Synthesizer
2023
+ LLM3 --> Synthesizer
2024
+ Synthesizer --> Out[Out]
2025
+
2026
+ style In fill:#8B0000,color:#fff
2027
+ style Router fill:#2E8B57,color:#fff
2028
+ style LLM1 fill:#2E8B57,color:#fff
2029
+ style LLM2 fill:#2E8B57,color:#fff
2030
+ style LLM3 fill:#2E8B57,color:#fff
2031
+ style Synthesizer fill:#2E8B57,color:#fff
2032
+ style Out fill:#8B0000,color:#fff
2033
+ ```
2034
+
2035
+ #### Agentic Autonomous Workflow
2036
+
2037
+ Create AI agents that can autonomously monitor, act, and adapt based on environment feedback.
2038
+
2039
+ ```mermaid
2040
+ flowchart LR
2041
+ Human[Human] <--> LLM[LLM Call]
2042
+ LLM -->|ACTION| Environment[Environment]
2043
+ Environment -->|FEEDBACK| LLM
2044
+ LLM --> Stop[Stop]
2045
+
2046
+ style Human fill:#8B0000,color:#fff
2047
+ style LLM fill:#2E8B57,color:#fff
2048
+ style Environment fill:#8B0000,color:#fff
2049
+ style Stop fill:#333,color:#fff
2050
+ ```
2051
+
2052
+ #### Agentic Parallelization
2053
+
2054
+ Create AI agents that can execute tasks in parallel for improved performance.
2055
+
2056
+ ```mermaid
2057
+ flowchart LR
2058
+ In[In] --> LLM2[LLM Call 2]
2059
+ In --> LLM1[LLM Call 1]
2060
+ In --> LLM3[LLM Call 3]
2061
+ LLM1 --> Aggregator[Aggregator]
2062
+ LLM2 --> Aggregator
2063
+ LLM3 --> Aggregator
2064
+ Aggregator --> Out[Out]
2065
+
2066
+ style In fill:#8B0000,color:#fff
2067
+ style LLM1 fill:#2E8B57,color:#fff
2068
+ style LLM2 fill:#2E8B57,color:#fff
2069
+ style LLM3 fill:#2E8B57,color:#fff
2070
+ style Aggregator fill:#fff,color:#000
2071
+ style Out fill:#8B0000,color:#fff
2072
+ ```
2073
+
2074
+ #### Agentic Prompt Chaining
2075
+
2076
+ Create AI agents with sequential prompt chaining for complex workflows.
2077
+
2078
+ ```mermaid
2079
+ flowchart LR
2080
+ In[In] --> LLM1[LLM Call 1] --> Gate{Gate}
2081
+ Gate -->|Pass| LLM2[LLM Call 2] -->|Output 2| LLM3[LLM Call 3] --> Out[Out]
2082
+ Gate -->|Fail| Exit[Exit]
2083
+
2084
+ style In fill:#8B0000,color:#fff
2085
+ style LLM1 fill:#2E8B57,color:#fff
2086
+ style LLM2 fill:#2E8B57,color:#fff
2087
+ style LLM3 fill:#2E8B57,color:#fff
2088
+ style Out fill:#8B0000,color:#fff
2089
+ style Exit fill:#8B0000,color:#fff
2090
+ ```
2091
+
2092
+ #### Agentic Evaluator Optimizer
2093
+
2094
+ Create AI agents that can generate and optimize solutions through iterative feedback.
2095
+
2096
+ ```mermaid
2097
+ flowchart LR
2098
+ In[In] --> Generator[LLM Call Generator]
2099
+ Generator -->|SOLUTION| Evaluator[LLM Call Evaluator] -->|ACCEPTED| Out[Out]
2100
+ Evaluator -->|REJECTED + FEEDBACK| Generator
2101
+
2102
+ style In fill:#8B0000,color:#fff
2103
+ style Generator fill:#2E8B57,color:#fff
2104
+ style Evaluator fill:#2E8B57,color:#fff
2105
+ style Out fill:#8B0000,color:#fff
2106
+ ```
2107
+
2108
+ #### Repetitive Agents
2109
+
2110
+ Create AI agents that can efficiently handle repetitive tasks through automated loops.
2111
+
2112
+ ```mermaid
2113
+ flowchart LR
2114
+ In[Input] --> LoopAgent[("Looping Agent")]
2115
+ LoopAgent --> Task[Task]
2116
+ Task --> |Next iteration| LoopAgent
2117
+ Task --> |Done| Out[Output]
2118
+
2119
+ style In fill:#8B0000,color:#fff
2120
+ style LoopAgent fill:#2E8B57,color:#fff,shape:circle
2121
+ style Task fill:#2E8B57,color:#fff
2122
+ style Out fill:#8B0000,color:#fff
2123
+ ```
2124
+
2125
+ ---
2126
+
2127
+ ## 🔧 Configuration & Integration
2128
+
2129
+ ### Ollama Integration
2130
+
2131
+ ```bash
2132
+ export OPENAI_BASE_URL=http://localhost:11434/v1
2133
+ ```
2134
+
2135
+ ### Groq Integration
2136
+
2137
+ Replace xxxx with Groq API KEY:
2138
+
2139
+ ```bash
2140
+ export OPENAI_API_KEY=xxxxxxxxxxx
2141
+ export OPENAI_BASE_URL=https://api.groq.com/openai/v1
2142
+ ```
2143
+
2144
+ ### 100+ Models Support
2145
+
2146
+ PraisonAI supports 100+ LLM models from various providers. Visit our [models documentation](https://docs.praison.ai/models/) for the complete list.
2147
+
2148
+ <div align="center">
2149
+ <a href="https://docs.praison.ai/models">
2150
+ <p align="center">
2151
+ <img src="https://img.shields.io/badge/📚_Models_Documentation-Visit_docs.praison.ai-blue?style=for-the-badge&logo=bookstack&logoColor=white" alt="Models Documentation" />
2152
+ </p>
2153
+ </a>
2154
+ </div>
2155
+
2156
+ ---
2157
+
2158
+ ## 📋 Agents Playbook
2159
+
2160
+ ### Simple Playbook Example
2161
+
2162
+ Create `agents.yaml` file and add the code below:
2163
+
2164
+ ```yaml
2165
+ framework: praisonai
2166
+ topic: Artificial Intelligence
2167
+ agents: # Canonical: use 'agents' instead of 'roles'
2168
+ screenwriter:
2169
+ instructions: "Skilled in crafting scripts with engaging dialogue about {topic}." # Canonical: use 'instructions' instead of 'backstory'
2170
+ goal: Create scripts from concepts.
2171
+ role: Screenwriter
2172
+ tasks:
2173
+ scriptwriting_task:
2174
+ description: "Develop scripts with compelling characters and dialogue about {topic}."
2175
+ expected_output: "Complete script ready for production."
2176
+ ```
2177
+
2178
+ *To run the playbook:*
2179
+ ```bash
2180
+ praisonai agents.yaml
2181
+ ```
2182
+
2183
+ ---
2184
+
2185
+ ## 🛠️ Custom Tools / Create Plugins
2186
+
2187
+ PraisonAI supports multiple ways to create and integrate custom tools (plugins) into your agents.
2188
+
2189
+ ### Using `@tool` Decorator
2190
+
2191
+ ```python
2192
+ from praisonaiagents import Agent, tool
2193
+
2194
+ @tool
2195
+ def search(query: str) -> str:
2196
+ """Search the web for information."""
2197
+ return f"Results for: {query}"
2198
+
2199
+ @tool
2200
+ def calculate(expression: str) -> float:
2201
+ """Evaluate a math expression."""
2202
+ return eval(expression)
2203
+
2204
+ agent = Agent(
2205
+ instructions="You are a helpful assistant",
2206
+ tools=[search, calculate]
2207
+ )
2208
+ agent.start("Search for AI news and calculate 15*4")
2209
+ ```
2210
+
2211
+ ### Using `BaseTool` Class
2212
+
2213
+ ```python
2214
+ from praisonaiagents import Agent, BaseTool
2215
+
2216
+ class WeatherTool(BaseTool):
2217
+ name = "weather"
2218
+ description = "Get current weather for a location"
2219
+
2220
+ def run(self, location: str) -> str:
2221
+ return f"Weather in {location}: 72°F, Sunny"
2222
+
2223
+ agent = Agent(
2224
+ instructions="You are a weather assistant",
2225
+ tools=[WeatherTool()]
2226
+ )
2227
+ agent.start("What's the weather in Paris?")
2228
+ ```
2229
+
2230
+ ### Creating a Tool Package (pip installable)
2231
+
2232
+ ```toml
2233
+ # pyproject.toml
2234
+ [project]
2235
+ name = "my-praisonai-tools"
2236
+ version = "1.0.0"
2237
+ dependencies = ["praisonaiagents"]
2238
+
2239
+ [project.entry-points."praisonaiagents.tools"]
2240
+ my_tool = "my_package:MyTool"
2241
+ ```
2242
+
2243
+ ```python
2244
+ # my_package/__init__.py
2245
+ from praisonaiagents import BaseTool
2246
+
2247
+ class MyTool(BaseTool):
2248
+ name = "my_tool"
2249
+ description = "My custom tool"
2250
+
2251
+ def run(self, param: str) -> str:
2252
+ return f"Result: {param}"
2253
+ ```
2254
+
2255
+ After `pip install`, tools are auto-discovered:
2256
+ ```python
2257
+ agent = Agent(tools=["my_tool"]) # Works automatically!
2258
+ ```
2259
+
2260
+ ---
2261
+
2262
+ ## 🧠 Memory & Context
2263
+
2264
+ PraisonAI provides zero-dependency persistent memory for agents. For detailed examples, see [section 6. Agent Memory](#6-agent-memory-zero-dependencies) in the Python Code Examples.
2265
+
2266
+ ---
2267
+
2268
+ ## 🔬 Advanced Features
2269
+
2270
+ ### Research & Intelligence
2271
+
2272
+ - 🔬 **Deep Research Agents** - OpenAI & Gemini support for automated research
2273
+ - 🔄 **Query Rewriter Agent** - HyDE, Step-back, Multi-query strategies for RAG optimization
2274
+ - 🌐 **Native Web Search** - Real-time search via OpenAI, Gemini, Anthropic, xAI, Perplexity
2275
+ - 📥 **Web Fetch** - Retrieve full content from URLs (Anthropic)
2276
+ - 📝 **Prompt Expander Agent** - Expand short prompts into detailed instructions
2277
+
2278
+ ### Memory & Caching
2279
+
2280
+ - 💾 **Prompt Caching** - Reduce costs & latency (OpenAI, Anthropic, Bedrock, Deepseek)
2281
+ - 🧠 **Claude Memory Tool** - Persistent cross-conversation memory (Anthropic Beta)
2282
+ - 💾 **File-Based Memory** - Zero-dependency persistent memory for all agents
2283
+ - 🔍 **Built-in Search Tools** - Tavily, You.com, Exa for web search, news, content extraction
2284
+
2285
+ ### Planning & Workflows
2286
+
2287
+ - 📋 **Planning Mode** - Plan before execution for agents & multi-agent systems
2288
+ - 🔧 **Planning Tools** - Research with tools during planning phase
2289
+ - 🧠 **Planning Reasoning** - Chain-of-thought planning for complex tasks
2290
+ - ⛓️ **Prompt Chaining** - Sequential prompt workflows with conditional gates
2291
+ - 🔍 **Evaluator Optimiser** - Generate and optimize through iterative feedback
2292
+ - 👷 **Orchestrator Workers** - Distribute tasks among specialised workers
2293
+ - ⚡ **Parallelisation** - Execute tasks in parallel for improved performance
2294
+ - 🔁 **Repetitive Agents** - Handle repetitive tasks through automated loops
2295
+ - 🤖 **Autonomous Workflow** - Monitor, act, adapt based on environment feedback
2296
+
2297
+ ### Specialised Agents
2298
+
2299
+ - 🖼️ **Image Generation Agent** - Create images from text descriptions
2300
+ - 📷 **Image to Text Agent** - Extract text and descriptions from images
2301
+ - 🎬 **Video Agent** - Analyse and process video content
2302
+ - 📊 **Data Analyst Agent** - Analyse data and generate insights
2303
+ - 💰 **Finance Agent** - Financial analysis and recommendations
2304
+ - 🛒 **Shopping Agent** - Price comparison and shopping assistance
2305
+ - ⭐ **Recommendation Agent** - Personalised recommendations
2306
+ - 📖 **Wikipedia Agent** - Search and extract Wikipedia information
2307
+ - 💻 **Programming Agent** - Code development and analysis
2308
+ - 📝 **Markdown Agent** - Generate and format Markdown content
2309
+ - 🔀 **Router Agent** - Dynamic task routing with cost optimisation
2310
+
2311
+ ### MCP Protocol
2312
+
2313
+ - 🔌 **MCP Transports** - stdio, Streamable HTTP, WebSocket, SSE (Protocol 2025-11-25)
2314
+ - 🌐 **WebSocket MCP** - Real-time bidirectional connections with auto-reconnect
2315
+ - 🔐 **MCP Security** - Origin validation, DNS rebinding prevention, secure sessions
2316
+ - 🔄 **MCP Resumability** - SSE stream recovery via Last-Event-ID
2317
+
2318
+ ### Safety & Control
2319
+
2320
+ - 🤝 **Agent Handoffs** - Transfer context between specialised agents
2321
+ - 🛡️ **Guardrails** - Input/output validation and safety checks
2322
+ - ✅ **Human Approval** - Require human confirmation for critical actions
2323
+ - 💬 **Sessions Management** - Isolated conversation contexts
2324
+ - 🔄 **Stateful Agents** - Maintain state across interactions
2325
+
2326
+ ### Developer Tools
2327
+
2328
+ - ⚡ **Fast Context** - Rapid parallel code search (10-20x faster)
2329
+ - 📜 **Rules & Instructions** - Auto-discover CLAUDE.md, AGENTS.md, GEMINI.md
2330
+ - 🪝 **Hooks** - Pre/post operation hooks for custom logic
2331
+ - 📈 **Telemetry** - Track agent performance and usage
2332
+ - 📹 **Camera Integration** - Capture and analyse camera input
2333
+
2334
+ ### Other Features
2335
+
2336
+ - 🔄 **CrewAI & AG2 Integration** - Use CrewAI or AG2 (Formerly AutoGen) Framework
2337
+ - 💻 **Codebase Chat** - Chat with entire codebase
2338
+ - 🎨 **Interactive UIs** - Multiple interactive interfaces
2339
+ - 📄 **YAML Configuration** - YAML-based agent and workflow configuration
2340
+ - 🛠️ **Custom Tools** - Easy custom tool integration
2341
+ - 🔍 **Internet Search** - Multiple providers (Tavily, You.com, Exa, DuckDuckGo, Crawl4AI)
2342
+ - 🖼️ **VLM Support** - Vision Language Model support
2343
+ - 🎙️ **Voice Interaction** - Real-time voice interaction
2344
+
2345
+ ---
2346
+
2347
+ ## 🎓 Video Tutorials
2348
+
2349
+ Learn PraisonAI through our comprehensive video series:
2350
+
2351
+ | Topic | Video |
2352
+ |-------|--------|
2353
+ | AI Agents with Self Reflection | [![Self Reflection](https://img.youtube.com/vi/vLXobEN2Vc8/0.jpg)](https://www.youtube.com/watch?v=vLXobEN2Vc8) |
2354
+ | Reasoning Data Generating Agent | [![Reasoning Data](https://img.youtube.com/vi/fUT332Y2zA8/0.jpg)](https://www.youtube.com/watch?v=fUT332Y2zA8) |
2355
+ | AI Agents with Reasoning | [![Reasoning](https://img.youtube.com/vi/KNDVWGN3TpM/0.jpg)](https://www.youtube.com/watch?v=KNDVWGN3TpM) |
2356
+ | Multimodal AI Agents | [![Multimodal](https://img.youtube.com/vi/hjAWmUT1qqY/0.jpg)](https://www.youtube.com/watch?v=hjAWmUT1qqY) |
2357
+ | AI Agents Workflow | [![Workflow](https://img.youtube.com/vi/yWTH44QPl2A/0.jpg)](https://www.youtube.com/watch?v=yWTH44QPl2A) |
2358
+ | Async AI Agents | [![Async](https://img.youtube.com/vi/VhVQfgo00LE/0.jpg)](https://www.youtube.com/watch?v=VhVQfgo00LE) |
2359
+ | Mini AI Agents | [![Mini](https://img.youtube.com/vi/OkvYp5aAGSg/0.jpg)](https://www.youtube.com/watch?v=OkvYp5aAGSg) |
2360
+ | AI Agents with Memory | [![Memory](https://img.youtube.com/vi/1hVfVxvPnnQ/0.jpg)](https://www.youtube.com/watch?v=1hVfVxvPnnQ) |
2361
+ | Repetitive Agents | [![Repetitive](https://img.youtube.com/vi/dAYGxsjDOPg/0.jpg)](https://www.youtube.com/watch?v=dAYGxsjDOPg) |
2362
+ | Introduction | [![Introduction](https://img.youtube.com/vi/Fn1lQjC0GO0/0.jpg)](https://www.youtube.com/watch?v=Fn1lQjC0GO0) |
2363
+ | Tools Overview | [![Tools Overview](https://img.youtube.com/vi/XaQRgRpV7jo/0.jpg)](https://www.youtube.com/watch?v=XaQRgRpV7jo) |
2364
+ | Custom Tools | [![Custom Tools](https://img.youtube.com/vi/JSU2Rndh06c/0.jpg)](https://www.youtube.com/watch?v=JSU2Rndh06c) |
2365
+ | Firecrawl Integration | [![Firecrawl](https://img.youtube.com/vi/UoqUDcLcOYo/0.jpg)](https://www.youtube.com/watch?v=UoqUDcLcOYo) |
2366
+ | User Interface | [![UI](https://img.youtube.com/vi/tg-ZjNl3OCg/0.jpg)](https://www.youtube.com/watch?v=tg-ZjNl3OCg) |
2367
+ | Crawl4AI Integration | [![Crawl4AI](https://img.youtube.com/vi/KAvuVUh0XU8/0.jpg)](https://www.youtube.com/watch?v=KAvuVUh0XU8) |
2368
+ | Chat Interface | [![Chat](https://img.youtube.com/vi/sw3uDqn2h1Y/0.jpg)](https://www.youtube.com/watch?v=sw3uDqn2h1Y) |
2369
+ | Code Interface | [![Code](https://img.youtube.com/vi/_5jQayO-MQY/0.jpg)](https://www.youtube.com/watch?v=_5jQayO-MQY) |
2370
+ | Mem0 Integration | [![Mem0](https://img.youtube.com/vi/KIGSgRxf1cY/0.jpg)](https://www.youtube.com/watch?v=KIGSgRxf1cY) |
2371
+ | Training | [![Training](https://img.youtube.com/vi/aLawE8kwCrI/0.jpg)](https://www.youtube.com/watch?v=aLawE8kwCrI) |
2372
+ | Realtime Voice Interface | [![Realtime](https://img.youtube.com/vi/frRHfevTCSw/0.jpg)](https://www.youtube.com/watch?v=frRHfevTCSw) |
2373
+ | Call Interface | [![Call](https://img.youtube.com/vi/m1cwrUG2iAk/0.jpg)](https://www.youtube.com/watch?v=m1cwrUG2iAk) |
2374
+ | Reasoning Extract Agents | [![Reasoning Extract](https://img.youtube.com/vi/2PPamsADjJA/0.jpg)](https://www.youtube.com/watch?v=2PPamsADjJA) |
2375
+
2376
+ ---
2377
+
2378
+ ## 👥 Contributing
2379
+
2380
+ We welcome contributions from the community! Here's how you can contribute:
2381
+
2382
+ 1. **Fork on GitHub** - Use the "Fork" button on the [repository page](https://github.com/MervinPraison/PraisonAI)
2383
+ 2. **Clone your fork** - `git clone https://github.com/yourusername/praisonAI.git`
2384
+ 3. **Create a branch** - `git checkout -b new-feature`
2385
+ 4. **Make changes and commit** - `git commit -am "Add some feature"`
2386
+ 5. **Push to your fork** - `git push origin new-feature`
2387
+ 6. **Submit a pull request** - Via GitHub's web interface
2388
+ 7. **Await feedback** - From project maintainers
2389
+
2390
+ ---
2391
+
2392
+ ## 🔧 Development
2393
+
2394
+ ### Using uv
2395
+
2396
+ ```bash
2397
+ # Install uv if you haven't already
2398
+ pip install uv
2399
+
2400
+ # Install from requirements
2401
+ uv pip install -r pyproject.toml
2402
+
2403
+ # Install with extras
2404
+ uv pip install -r pyproject.toml --extra code
2405
+ uv pip install -r pyproject.toml --extra "crewai,autogen"
2406
+ ```
2407
+
2408
+ ### Bump and Release
2409
+
2410
+ ```bash
2411
+ # From project root - bumps version and releases in one command
2412
+ python src/praisonai/scripts/bump_and_release.py 2.2.99
2413
+
2414
+ # With praisonaiagents dependency
2415
+ python src/praisonai/scripts/bump_and_release.py 2.2.99 --agents 0.0.169
2416
+
2417
+ # Then publish
2418
+ cd src/praisonai && uv publish
2419
+ ```
2420
+
2421
+ ---
2422
+
2423
+ <div align="center">
2424
+ <p><strong>Made with ❤️ by the PraisonAI Team</strong></p>
2425
+ <p>
2426
+ <a href="https://docs.praison.ai">Documentation</a> •
2427
+ <a href="https://github.com/MervinPraison/PraisonAI">GitHub</a> •
2428
+ <a href="https://github.com/MervinPraison/PraisonAI/issues">Issues</a>
2429
+ </p>
2430
+ </div>