PraisonAI 3.0.0__py3-none-any.whl

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 (393) hide show
  1. praisonai/__init__.py +54 -0
  2. praisonai/__main__.py +15 -0
  3. praisonai/acp/__init__.py +54 -0
  4. praisonai/acp/config.py +159 -0
  5. praisonai/acp/server.py +587 -0
  6. praisonai/acp/session.py +219 -0
  7. praisonai/adapters/__init__.py +50 -0
  8. praisonai/adapters/readers.py +395 -0
  9. praisonai/adapters/rerankers.py +315 -0
  10. praisonai/adapters/retrievers.py +394 -0
  11. praisonai/adapters/vector_stores.py +409 -0
  12. praisonai/agent_scheduler.py +337 -0
  13. praisonai/agents_generator.py +903 -0
  14. praisonai/api/call.py +292 -0
  15. praisonai/auto.py +1197 -0
  16. praisonai/capabilities/__init__.py +275 -0
  17. praisonai/capabilities/a2a.py +140 -0
  18. praisonai/capabilities/assistants.py +283 -0
  19. praisonai/capabilities/audio.py +320 -0
  20. praisonai/capabilities/batches.py +469 -0
  21. praisonai/capabilities/completions.py +336 -0
  22. praisonai/capabilities/container_files.py +155 -0
  23. praisonai/capabilities/containers.py +93 -0
  24. praisonai/capabilities/embeddings.py +158 -0
  25. praisonai/capabilities/files.py +467 -0
  26. praisonai/capabilities/fine_tuning.py +293 -0
  27. praisonai/capabilities/guardrails.py +182 -0
  28. praisonai/capabilities/images.py +330 -0
  29. praisonai/capabilities/mcp.py +190 -0
  30. praisonai/capabilities/messages.py +270 -0
  31. praisonai/capabilities/moderations.py +154 -0
  32. praisonai/capabilities/ocr.py +217 -0
  33. praisonai/capabilities/passthrough.py +204 -0
  34. praisonai/capabilities/rag.py +207 -0
  35. praisonai/capabilities/realtime.py +160 -0
  36. praisonai/capabilities/rerank.py +165 -0
  37. praisonai/capabilities/responses.py +266 -0
  38. praisonai/capabilities/search.py +109 -0
  39. praisonai/capabilities/skills.py +133 -0
  40. praisonai/capabilities/vector_store_files.py +334 -0
  41. praisonai/capabilities/vector_stores.py +304 -0
  42. praisonai/capabilities/videos.py +141 -0
  43. praisonai/chainlit_ui.py +304 -0
  44. praisonai/chat/__init__.py +106 -0
  45. praisonai/chat/app.py +125 -0
  46. praisonai/cli/__init__.py +26 -0
  47. praisonai/cli/app.py +213 -0
  48. praisonai/cli/commands/__init__.py +75 -0
  49. praisonai/cli/commands/acp.py +70 -0
  50. praisonai/cli/commands/completion.py +333 -0
  51. praisonai/cli/commands/config.py +166 -0
  52. praisonai/cli/commands/debug.py +142 -0
  53. praisonai/cli/commands/diag.py +55 -0
  54. praisonai/cli/commands/doctor.py +166 -0
  55. praisonai/cli/commands/environment.py +179 -0
  56. praisonai/cli/commands/lsp.py +112 -0
  57. praisonai/cli/commands/mcp.py +210 -0
  58. praisonai/cli/commands/profile.py +457 -0
  59. praisonai/cli/commands/run.py +228 -0
  60. praisonai/cli/commands/schedule.py +150 -0
  61. praisonai/cli/commands/serve.py +97 -0
  62. praisonai/cli/commands/session.py +212 -0
  63. praisonai/cli/commands/traces.py +145 -0
  64. praisonai/cli/commands/version.py +101 -0
  65. praisonai/cli/configuration/__init__.py +18 -0
  66. praisonai/cli/configuration/loader.py +353 -0
  67. praisonai/cli/configuration/paths.py +114 -0
  68. praisonai/cli/configuration/schema.py +164 -0
  69. praisonai/cli/features/__init__.py +268 -0
  70. praisonai/cli/features/acp.py +236 -0
  71. praisonai/cli/features/action_orchestrator.py +546 -0
  72. praisonai/cli/features/agent_scheduler.py +773 -0
  73. praisonai/cli/features/agent_tools.py +474 -0
  74. praisonai/cli/features/agents.py +375 -0
  75. praisonai/cli/features/at_mentions.py +471 -0
  76. praisonai/cli/features/auto_memory.py +182 -0
  77. praisonai/cli/features/autonomy_mode.py +490 -0
  78. praisonai/cli/features/background.py +356 -0
  79. praisonai/cli/features/base.py +168 -0
  80. praisonai/cli/features/capabilities.py +1326 -0
  81. praisonai/cli/features/checkpoints.py +338 -0
  82. praisonai/cli/features/code_intelligence.py +652 -0
  83. praisonai/cli/features/compaction.py +294 -0
  84. praisonai/cli/features/compare.py +534 -0
  85. praisonai/cli/features/cost_tracker.py +514 -0
  86. praisonai/cli/features/debug.py +810 -0
  87. praisonai/cli/features/deploy.py +517 -0
  88. praisonai/cli/features/diag.py +289 -0
  89. praisonai/cli/features/doctor/__init__.py +63 -0
  90. praisonai/cli/features/doctor/checks/__init__.py +24 -0
  91. praisonai/cli/features/doctor/checks/acp_checks.py +240 -0
  92. praisonai/cli/features/doctor/checks/config_checks.py +366 -0
  93. praisonai/cli/features/doctor/checks/db_checks.py +366 -0
  94. praisonai/cli/features/doctor/checks/env_checks.py +543 -0
  95. praisonai/cli/features/doctor/checks/lsp_checks.py +199 -0
  96. praisonai/cli/features/doctor/checks/mcp_checks.py +349 -0
  97. praisonai/cli/features/doctor/checks/memory_checks.py +268 -0
  98. praisonai/cli/features/doctor/checks/network_checks.py +251 -0
  99. praisonai/cli/features/doctor/checks/obs_checks.py +328 -0
  100. praisonai/cli/features/doctor/checks/performance_checks.py +235 -0
  101. praisonai/cli/features/doctor/checks/permissions_checks.py +259 -0
  102. praisonai/cli/features/doctor/checks/selftest_checks.py +322 -0
  103. praisonai/cli/features/doctor/checks/serve_checks.py +426 -0
  104. praisonai/cli/features/doctor/checks/skills_checks.py +231 -0
  105. praisonai/cli/features/doctor/checks/tools_checks.py +371 -0
  106. praisonai/cli/features/doctor/engine.py +266 -0
  107. praisonai/cli/features/doctor/formatters.py +310 -0
  108. praisonai/cli/features/doctor/handler.py +397 -0
  109. praisonai/cli/features/doctor/models.py +264 -0
  110. praisonai/cli/features/doctor/registry.py +239 -0
  111. praisonai/cli/features/endpoints.py +1019 -0
  112. praisonai/cli/features/eval.py +560 -0
  113. praisonai/cli/features/external_agents.py +231 -0
  114. praisonai/cli/features/fast_context.py +410 -0
  115. praisonai/cli/features/flow_display.py +566 -0
  116. praisonai/cli/features/git_integration.py +651 -0
  117. praisonai/cli/features/guardrail.py +171 -0
  118. praisonai/cli/features/handoff.py +185 -0
  119. praisonai/cli/features/hooks.py +583 -0
  120. praisonai/cli/features/image.py +384 -0
  121. praisonai/cli/features/interactive_runtime.py +585 -0
  122. praisonai/cli/features/interactive_tools.py +380 -0
  123. praisonai/cli/features/interactive_tui.py +603 -0
  124. praisonai/cli/features/jobs.py +632 -0
  125. praisonai/cli/features/knowledge.py +531 -0
  126. praisonai/cli/features/lite.py +244 -0
  127. praisonai/cli/features/lsp_cli.py +225 -0
  128. praisonai/cli/features/mcp.py +169 -0
  129. praisonai/cli/features/message_queue.py +587 -0
  130. praisonai/cli/features/metrics.py +211 -0
  131. praisonai/cli/features/n8n.py +673 -0
  132. praisonai/cli/features/observability.py +293 -0
  133. praisonai/cli/features/ollama.py +361 -0
  134. praisonai/cli/features/output_style.py +273 -0
  135. praisonai/cli/features/package.py +631 -0
  136. praisonai/cli/features/performance.py +308 -0
  137. praisonai/cli/features/persistence.py +636 -0
  138. praisonai/cli/features/profile.py +226 -0
  139. praisonai/cli/features/profiler/__init__.py +81 -0
  140. praisonai/cli/features/profiler/core.py +558 -0
  141. praisonai/cli/features/profiler/optimizations.py +652 -0
  142. praisonai/cli/features/profiler/suite.py +386 -0
  143. praisonai/cli/features/profiling.py +350 -0
  144. praisonai/cli/features/queue/__init__.py +73 -0
  145. praisonai/cli/features/queue/manager.py +395 -0
  146. praisonai/cli/features/queue/models.py +286 -0
  147. praisonai/cli/features/queue/persistence.py +564 -0
  148. praisonai/cli/features/queue/scheduler.py +484 -0
  149. praisonai/cli/features/queue/worker.py +372 -0
  150. praisonai/cli/features/recipe.py +1723 -0
  151. praisonai/cli/features/recipes.py +449 -0
  152. praisonai/cli/features/registry.py +229 -0
  153. praisonai/cli/features/repo_map.py +860 -0
  154. praisonai/cli/features/router.py +466 -0
  155. praisonai/cli/features/sandbox_executor.py +515 -0
  156. praisonai/cli/features/serve.py +829 -0
  157. praisonai/cli/features/session.py +222 -0
  158. praisonai/cli/features/skills.py +856 -0
  159. praisonai/cli/features/slash_commands.py +650 -0
  160. praisonai/cli/features/telemetry.py +179 -0
  161. praisonai/cli/features/templates.py +1384 -0
  162. praisonai/cli/features/thinking.py +305 -0
  163. praisonai/cli/features/todo.py +334 -0
  164. praisonai/cli/features/tools.py +680 -0
  165. praisonai/cli/features/tui/__init__.py +83 -0
  166. praisonai/cli/features/tui/app.py +580 -0
  167. praisonai/cli/features/tui/cli.py +566 -0
  168. praisonai/cli/features/tui/debug.py +511 -0
  169. praisonai/cli/features/tui/events.py +99 -0
  170. praisonai/cli/features/tui/mock_provider.py +328 -0
  171. praisonai/cli/features/tui/orchestrator.py +652 -0
  172. praisonai/cli/features/tui/screens/__init__.py +50 -0
  173. praisonai/cli/features/tui/screens/main.py +245 -0
  174. praisonai/cli/features/tui/screens/queue.py +174 -0
  175. praisonai/cli/features/tui/screens/session.py +124 -0
  176. praisonai/cli/features/tui/screens/settings.py +148 -0
  177. praisonai/cli/features/tui/widgets/__init__.py +56 -0
  178. praisonai/cli/features/tui/widgets/chat.py +261 -0
  179. praisonai/cli/features/tui/widgets/composer.py +224 -0
  180. praisonai/cli/features/tui/widgets/queue_panel.py +200 -0
  181. praisonai/cli/features/tui/widgets/status.py +167 -0
  182. praisonai/cli/features/tui/widgets/tool_panel.py +248 -0
  183. praisonai/cli/features/workflow.py +720 -0
  184. praisonai/cli/legacy.py +236 -0
  185. praisonai/cli/main.py +5559 -0
  186. praisonai/cli/schedule_cli.py +54 -0
  187. praisonai/cli/state/__init__.py +31 -0
  188. praisonai/cli/state/identifiers.py +161 -0
  189. praisonai/cli/state/sessions.py +313 -0
  190. praisonai/code/__init__.py +93 -0
  191. praisonai/code/agent_tools.py +344 -0
  192. praisonai/code/diff/__init__.py +21 -0
  193. praisonai/code/diff/diff_strategy.py +432 -0
  194. praisonai/code/tools/__init__.py +27 -0
  195. praisonai/code/tools/apply_diff.py +221 -0
  196. praisonai/code/tools/execute_command.py +275 -0
  197. praisonai/code/tools/list_files.py +274 -0
  198. praisonai/code/tools/read_file.py +206 -0
  199. praisonai/code/tools/search_replace.py +248 -0
  200. praisonai/code/tools/write_file.py +217 -0
  201. praisonai/code/utils/__init__.py +46 -0
  202. praisonai/code/utils/file_utils.py +307 -0
  203. praisonai/code/utils/ignore_utils.py +308 -0
  204. praisonai/code/utils/text_utils.py +276 -0
  205. praisonai/db/__init__.py +64 -0
  206. praisonai/db/adapter.py +531 -0
  207. praisonai/deploy/__init__.py +62 -0
  208. praisonai/deploy/api.py +231 -0
  209. praisonai/deploy/docker.py +454 -0
  210. praisonai/deploy/doctor.py +367 -0
  211. praisonai/deploy/main.py +327 -0
  212. praisonai/deploy/models.py +179 -0
  213. praisonai/deploy/providers/__init__.py +33 -0
  214. praisonai/deploy/providers/aws.py +331 -0
  215. praisonai/deploy/providers/azure.py +358 -0
  216. praisonai/deploy/providers/base.py +101 -0
  217. praisonai/deploy/providers/gcp.py +314 -0
  218. praisonai/deploy/schema.py +208 -0
  219. praisonai/deploy.py +185 -0
  220. praisonai/endpoints/__init__.py +53 -0
  221. praisonai/endpoints/a2u_server.py +410 -0
  222. praisonai/endpoints/discovery.py +165 -0
  223. praisonai/endpoints/providers/__init__.py +28 -0
  224. praisonai/endpoints/providers/a2a.py +253 -0
  225. praisonai/endpoints/providers/a2u.py +208 -0
  226. praisonai/endpoints/providers/agents_api.py +171 -0
  227. praisonai/endpoints/providers/base.py +231 -0
  228. praisonai/endpoints/providers/mcp.py +263 -0
  229. praisonai/endpoints/providers/recipe.py +206 -0
  230. praisonai/endpoints/providers/tools_mcp.py +150 -0
  231. praisonai/endpoints/registry.py +131 -0
  232. praisonai/endpoints/server.py +161 -0
  233. praisonai/inbuilt_tools/__init__.py +24 -0
  234. praisonai/inbuilt_tools/autogen_tools.py +117 -0
  235. praisonai/inc/__init__.py +2 -0
  236. praisonai/inc/config.py +96 -0
  237. praisonai/inc/models.py +155 -0
  238. praisonai/integrations/__init__.py +56 -0
  239. praisonai/integrations/base.py +303 -0
  240. praisonai/integrations/claude_code.py +270 -0
  241. praisonai/integrations/codex_cli.py +255 -0
  242. praisonai/integrations/cursor_cli.py +195 -0
  243. praisonai/integrations/gemini_cli.py +222 -0
  244. praisonai/jobs/__init__.py +67 -0
  245. praisonai/jobs/executor.py +425 -0
  246. praisonai/jobs/models.py +230 -0
  247. praisonai/jobs/router.py +314 -0
  248. praisonai/jobs/server.py +186 -0
  249. praisonai/jobs/store.py +203 -0
  250. praisonai/llm/__init__.py +66 -0
  251. praisonai/llm/registry.py +382 -0
  252. praisonai/mcp_server/__init__.py +152 -0
  253. praisonai/mcp_server/adapters/__init__.py +74 -0
  254. praisonai/mcp_server/adapters/agents.py +128 -0
  255. praisonai/mcp_server/adapters/capabilities.py +168 -0
  256. praisonai/mcp_server/adapters/cli_tools.py +568 -0
  257. praisonai/mcp_server/adapters/extended_capabilities.py +462 -0
  258. praisonai/mcp_server/adapters/knowledge.py +93 -0
  259. praisonai/mcp_server/adapters/memory.py +104 -0
  260. praisonai/mcp_server/adapters/prompts.py +306 -0
  261. praisonai/mcp_server/adapters/resources.py +124 -0
  262. praisonai/mcp_server/adapters/tools_bridge.py +280 -0
  263. praisonai/mcp_server/auth/__init__.py +48 -0
  264. praisonai/mcp_server/auth/api_key.py +291 -0
  265. praisonai/mcp_server/auth/oauth.py +460 -0
  266. praisonai/mcp_server/auth/oidc.py +289 -0
  267. praisonai/mcp_server/auth/scopes.py +260 -0
  268. praisonai/mcp_server/cli.py +852 -0
  269. praisonai/mcp_server/elicitation.py +445 -0
  270. praisonai/mcp_server/icons.py +302 -0
  271. praisonai/mcp_server/recipe_adapter.py +573 -0
  272. praisonai/mcp_server/recipe_cli.py +824 -0
  273. praisonai/mcp_server/registry.py +703 -0
  274. praisonai/mcp_server/sampling.py +422 -0
  275. praisonai/mcp_server/server.py +490 -0
  276. praisonai/mcp_server/tasks.py +443 -0
  277. praisonai/mcp_server/transports/__init__.py +18 -0
  278. praisonai/mcp_server/transports/http_stream.py +376 -0
  279. praisonai/mcp_server/transports/stdio.py +132 -0
  280. praisonai/persistence/__init__.py +84 -0
  281. praisonai/persistence/config.py +238 -0
  282. praisonai/persistence/conversation/__init__.py +25 -0
  283. praisonai/persistence/conversation/async_mysql.py +427 -0
  284. praisonai/persistence/conversation/async_postgres.py +410 -0
  285. praisonai/persistence/conversation/async_sqlite.py +371 -0
  286. praisonai/persistence/conversation/base.py +151 -0
  287. praisonai/persistence/conversation/json_store.py +250 -0
  288. praisonai/persistence/conversation/mysql.py +387 -0
  289. praisonai/persistence/conversation/postgres.py +401 -0
  290. praisonai/persistence/conversation/singlestore.py +240 -0
  291. praisonai/persistence/conversation/sqlite.py +341 -0
  292. praisonai/persistence/conversation/supabase.py +203 -0
  293. praisonai/persistence/conversation/surrealdb.py +287 -0
  294. praisonai/persistence/factory.py +301 -0
  295. praisonai/persistence/hooks/__init__.py +18 -0
  296. praisonai/persistence/hooks/agent_hooks.py +297 -0
  297. praisonai/persistence/knowledge/__init__.py +26 -0
  298. praisonai/persistence/knowledge/base.py +144 -0
  299. praisonai/persistence/knowledge/cassandra.py +232 -0
  300. praisonai/persistence/knowledge/chroma.py +295 -0
  301. praisonai/persistence/knowledge/clickhouse.py +242 -0
  302. praisonai/persistence/knowledge/cosmosdb_vector.py +438 -0
  303. praisonai/persistence/knowledge/couchbase.py +286 -0
  304. praisonai/persistence/knowledge/lancedb.py +216 -0
  305. praisonai/persistence/knowledge/langchain_adapter.py +291 -0
  306. praisonai/persistence/knowledge/lightrag_adapter.py +212 -0
  307. praisonai/persistence/knowledge/llamaindex_adapter.py +256 -0
  308. praisonai/persistence/knowledge/milvus.py +277 -0
  309. praisonai/persistence/knowledge/mongodb_vector.py +306 -0
  310. praisonai/persistence/knowledge/pgvector.py +335 -0
  311. praisonai/persistence/knowledge/pinecone.py +253 -0
  312. praisonai/persistence/knowledge/qdrant.py +301 -0
  313. praisonai/persistence/knowledge/redis_vector.py +291 -0
  314. praisonai/persistence/knowledge/singlestore_vector.py +299 -0
  315. praisonai/persistence/knowledge/surrealdb_vector.py +309 -0
  316. praisonai/persistence/knowledge/upstash_vector.py +266 -0
  317. praisonai/persistence/knowledge/weaviate.py +223 -0
  318. praisonai/persistence/migrations/__init__.py +10 -0
  319. praisonai/persistence/migrations/manager.py +251 -0
  320. praisonai/persistence/orchestrator.py +406 -0
  321. praisonai/persistence/state/__init__.py +21 -0
  322. praisonai/persistence/state/async_mongodb.py +200 -0
  323. praisonai/persistence/state/base.py +107 -0
  324. praisonai/persistence/state/dynamodb.py +226 -0
  325. praisonai/persistence/state/firestore.py +175 -0
  326. praisonai/persistence/state/gcs.py +155 -0
  327. praisonai/persistence/state/memory.py +245 -0
  328. praisonai/persistence/state/mongodb.py +158 -0
  329. praisonai/persistence/state/redis.py +190 -0
  330. praisonai/persistence/state/upstash.py +144 -0
  331. praisonai/persistence/tests/__init__.py +3 -0
  332. praisonai/persistence/tests/test_all_backends.py +633 -0
  333. praisonai/profiler.py +1214 -0
  334. praisonai/recipe/__init__.py +134 -0
  335. praisonai/recipe/bridge.py +278 -0
  336. praisonai/recipe/core.py +893 -0
  337. praisonai/recipe/exceptions.py +54 -0
  338. praisonai/recipe/history.py +402 -0
  339. praisonai/recipe/models.py +266 -0
  340. praisonai/recipe/operations.py +440 -0
  341. praisonai/recipe/policy.py +422 -0
  342. praisonai/recipe/registry.py +849 -0
  343. praisonai/recipe/runtime.py +214 -0
  344. praisonai/recipe/security.py +711 -0
  345. praisonai/recipe/serve.py +859 -0
  346. praisonai/recipe/server.py +613 -0
  347. praisonai/scheduler/__init__.py +45 -0
  348. praisonai/scheduler/agent_scheduler.py +552 -0
  349. praisonai/scheduler/base.py +124 -0
  350. praisonai/scheduler/daemon_manager.py +225 -0
  351. praisonai/scheduler/state_manager.py +155 -0
  352. praisonai/scheduler/yaml_loader.py +193 -0
  353. praisonai/scheduler.py +194 -0
  354. praisonai/setup/__init__.py +1 -0
  355. praisonai/setup/build.py +21 -0
  356. praisonai/setup/post_install.py +23 -0
  357. praisonai/setup/setup_conda_env.py +25 -0
  358. praisonai/setup.py +16 -0
  359. praisonai/templates/__init__.py +116 -0
  360. praisonai/templates/cache.py +364 -0
  361. praisonai/templates/dependency_checker.py +358 -0
  362. praisonai/templates/discovery.py +391 -0
  363. praisonai/templates/loader.py +564 -0
  364. praisonai/templates/registry.py +511 -0
  365. praisonai/templates/resolver.py +206 -0
  366. praisonai/templates/security.py +327 -0
  367. praisonai/templates/tool_override.py +498 -0
  368. praisonai/templates/tools_doctor.py +256 -0
  369. praisonai/test.py +105 -0
  370. praisonai/train.py +562 -0
  371. praisonai/train_vision.py +306 -0
  372. praisonai/ui/agents.py +824 -0
  373. praisonai/ui/callbacks.py +57 -0
  374. praisonai/ui/chainlit_compat.py +246 -0
  375. praisonai/ui/chat.py +532 -0
  376. praisonai/ui/code.py +717 -0
  377. praisonai/ui/colab.py +474 -0
  378. praisonai/ui/colab_chainlit.py +81 -0
  379. praisonai/ui/components/aicoder.py +284 -0
  380. praisonai/ui/context.py +283 -0
  381. praisonai/ui/database_config.py +56 -0
  382. praisonai/ui/db.py +294 -0
  383. praisonai/ui/realtime.py +488 -0
  384. praisonai/ui/realtimeclient/__init__.py +756 -0
  385. praisonai/ui/realtimeclient/tools.py +242 -0
  386. praisonai/ui/sql_alchemy.py +710 -0
  387. praisonai/upload_vision.py +140 -0
  388. praisonai/version.py +1 -0
  389. praisonai-3.0.0.dist-info/METADATA +3493 -0
  390. praisonai-3.0.0.dist-info/RECORD +393 -0
  391. praisonai-3.0.0.dist-info/WHEEL +5 -0
  392. praisonai-3.0.0.dist-info/entry_points.txt +4 -0
  393. praisonai-3.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,3493 @@
1
+ Metadata-Version: 2.4
2
+ Name: PraisonAI
3
+ Version: 3.0.0
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.6.0
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
+ Requires-Dist: typer>=0.9.0
20
+ Requires-Dist: textual>=0.47.0
21
+ Provides-Extra: ui
22
+ Requires-Dist: chainlit<2.9.0,>=2.8.5; extra == "ui"
23
+ Requires-Dist: sqlalchemy>=2.0.36; extra == "ui"
24
+ Requires-Dist: aiosqlite>=0.20.0; extra == "ui"
25
+ Requires-Dist: greenlet>=3.0.3; extra == "ui"
26
+ Requires-Dist: pydantic<=2.10.1; extra == "ui"
27
+ Provides-Extra: gradio
28
+ Requires-Dist: gradio>=4.26.0; extra == "gradio"
29
+ Provides-Extra: api
30
+ Requires-Dist: flask>=3.0.0; extra == "api"
31
+ Requires-Dist: fastapi>=0.115.0; extra == "api"
32
+ Requires-Dist: uvicorn>=0.34.0; extra == "api"
33
+ Requires-Dist: sse-starlette>=1.6.0; extra == "api"
34
+ Provides-Extra: agentops
35
+ Requires-Dist: agentops>=0.3.12; extra == "agentops"
36
+ Provides-Extra: google
37
+ Requires-Dist: langchain-google-genai>=2.1.0; extra == "google"
38
+ Provides-Extra: openai
39
+ Requires-Dist: langchain-openai<0.3.0,>=0.2.1; extra == "openai"
40
+ Provides-Extra: anthropic
41
+ Requires-Dist: langchain-anthropic>=0.3.0; extra == "anthropic"
42
+ Provides-Extra: cohere
43
+ Requires-Dist: langchain-cohere<0.4.0,>=0.3.0; extra == "cohere"
44
+ Provides-Extra: chat
45
+ Requires-Dist: chainlit<2.9.0,>=2.8.5; extra == "chat"
46
+ Requires-Dist: litellm>=1.72.6; extra == "chat"
47
+ Requires-Dist: aiosqlite>=0.20.0; extra == "chat"
48
+ Requires-Dist: greenlet>=3.0.3; extra == "chat"
49
+ Requires-Dist: tavily-python==0.5.0; extra == "chat"
50
+ Requires-Dist: crawl4ai>=0.7.0; extra == "chat"
51
+ Requires-Dist: sqlalchemy>=2.0.36; extra == "chat"
52
+ Requires-Dist: playwright>=1.47.0; extra == "chat"
53
+ Requires-Dist: rich; extra == "chat"
54
+ Requires-Dist: pydantic<=2.10.1; extra == "chat"
55
+ Provides-Extra: code
56
+ Requires-Dist: chainlit<2.9.0,>=2.8.5; extra == "code"
57
+ Requires-Dist: litellm>=1.72.6; extra == "code"
58
+ Requires-Dist: aiosqlite>=0.20.0; extra == "code"
59
+ Requires-Dist: greenlet>=3.0.3; extra == "code"
60
+ Requires-Dist: tavily-python==0.5.0; extra == "code"
61
+ Requires-Dist: crawl4ai>=0.7.0; extra == "code"
62
+ Requires-Dist: sqlalchemy>=2.0.36; extra == "code"
63
+ Requires-Dist: playwright>=1.47.0; extra == "code"
64
+ Requires-Dist: pydantic<=2.10.1; extra == "code"
65
+ Provides-Extra: realtime
66
+ Requires-Dist: chainlit<2.9.0,>=2.8.5; extra == "realtime"
67
+ Requires-Dist: litellm>=1.72.6; extra == "realtime"
68
+ Requires-Dist: aiosqlite>=0.20.0; extra == "realtime"
69
+ Requires-Dist: greenlet>=3.0.3; extra == "realtime"
70
+ Requires-Dist: tavily-python==0.5.0; extra == "realtime"
71
+ Requires-Dist: crawl4ai>=0.7.0; extra == "realtime"
72
+ Requires-Dist: websockets>=12.0; extra == "realtime"
73
+ Requires-Dist: plotly>=5.24.0; extra == "realtime"
74
+ Requires-Dist: yfinance>=0.2.44; extra == "realtime"
75
+ Requires-Dist: duckduckgo_search>=6.3.0; extra == "realtime"
76
+ Requires-Dist: sqlalchemy>=2.0.36; extra == "realtime"
77
+ Provides-Extra: call
78
+ Requires-Dist: twilio>=7.0.0; extra == "call"
79
+ Requires-Dist: fastapi>=0.95.0; extra == "call"
80
+ Requires-Dist: uvicorn>=0.20.0; extra == "call"
81
+ Requires-Dist: websockets>=12.0; extra == "call"
82
+ Requires-Dist: flaml[automl]>=2.3.1; extra == "call"
83
+ Requires-Dist: pyngrok>=1.4.0; extra == "call"
84
+ Requires-Dist: rich; extra == "call"
85
+ Requires-Dist: openai>=1.54.0; extra == "call"
86
+ Provides-Extra: train
87
+ Provides-Extra: crewai
88
+ Requires-Dist: crewai>=0.157.0; extra == "crewai"
89
+ Requires-Dist: praisonai-tools>=0.1.0; extra == "crewai"
90
+ Provides-Extra: autogen
91
+ Requires-Dist: pyautogen==0.2.29; extra == "autogen"
92
+ Requires-Dist: praisonai-tools>=0.1.0; extra == "autogen"
93
+ Requires-Dist: crewai; extra == "autogen"
94
+ Provides-Extra: autogen-v4
95
+ Requires-Dist: autogen-agentchat>=0.4.0; extra == "autogen-v4"
96
+ Requires-Dist: autogen-ext[openai]>=0.4.0; extra == "autogen-v4"
97
+ Requires-Dist: autogen-core>=0.4.0; extra == "autogen-v4"
98
+ Requires-Dist: praisonai-tools>=0.1.0; extra == "autogen-v4"
99
+ Requires-Dist: crewai; extra == "autogen-v4"
100
+ Provides-Extra: acp
101
+ Requires-Dist: agent-client-protocol>=0.7.0; extra == "acp"
102
+ Provides-Extra: lite
103
+ Provides-Extra: dev
104
+ Requires-Dist: textual-dev>=1.0.0; extra == "dev"
105
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
106
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
107
+
108
+ <p align="center">
109
+ <picture>
110
+ <source media="(prefers-color-scheme: dark)" srcset="docs/logo/dark.png" />
111
+ <source media="(prefers-color-scheme: light)" srcset="docs/logo/light.png" />
112
+ <img alt="PraisonAI Logo" src="docs/logo/light.png" />
113
+ </picture>
114
+ </p>
115
+
116
+ <!-- mcp-name: io.github.MervinPraison/praisonai -->
117
+
118
+ <p align="center">
119
+ <a href="https://github.com/MervinPraison/PraisonAI"><img src="https://static.pepy.tech/badge/PraisonAI" alt="Total Downloads" /></a>
120
+ <a href="https://github.com/MervinPraison/PraisonAI"><img src="https://img.shields.io/github/v/release/MervinPraison/PraisonAI" alt="Latest Stable Version" /></a>
121
+ <a href="https://github.com/MervinPraison/PraisonAI"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License" /></a>
122
+ <a href="https://registry.modelcontextprotocol.io/servers/io.github.MervinPraison/praisonai"><img src="https://img.shields.io/badge/MCP-Registry-blue" alt="MCP Registry" /></a>
123
+ </p>
124
+
125
+ <div align="center">
126
+
127
+ # Praison AI
128
+
129
+ <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>
130
+
131
+ </div>
132
+
133
+ 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.
134
+
135
+ <div align="center">
136
+ <a href="https://docs.praison.ai">
137
+ <p align="center">
138
+ <img src="https://img.shields.io/badge/📚_Documentation-Visit_docs.praison.ai-blue?style=for-the-badge&logo=bookstack&logoColor=white" alt="Documentation" />
139
+ </p>
140
+ </a>
141
+ </div>
142
+
143
+ ---
144
+
145
+ > **Quick Paths:**
146
+ > - 🚀 **New here?** → [Quick Start](#-quick-start)
147
+ > - 📦 **Installing?** → [Installation](#-installation)
148
+ > - 💻 **Python SDK?** → [Python Examples](#-using-python-code)
149
+ > - 🎯 **CLI user?** → [CLI Reference](#-cli--no-code-interface)
150
+ > - 🔧 **Need config?** → [Configuration](#-configuration--integration)
151
+ > - 🤝 **Contributing?** → [Development](#-development)
152
+
153
+ ---
154
+
155
+ ## 📑 Table of Contents
156
+
157
+ ### Getting Started
158
+ - [⚡ Performance](#-performance)
159
+ - [🚀 Quick Start](#-quick-start)
160
+ - [📦 Installation](#-installation)
161
+ - [Python SDK](#python-sdk)
162
+ - [JavaScript SDK](#javascript-sdk)
163
+ - [Environment Variables](#environment-variables)
164
+
165
+ ### Core Concepts
166
+ - [✨ Key Features](#-key-features)
167
+ - [🌐 Supported Providers](#-supported-providers)
168
+
169
+ ### Python SDK
170
+ - [📘 Python Examples](#-using-python-code)
171
+ - [1. Single Agent](#1-single-agent)
172
+ - [2. Multi Agents](#2-multi-agents)
173
+ - [3. Planning Mode](#3-agent-with-planning-mode)
174
+ - [4. Deep Research](#4-deep-research-agent)
175
+ - [5. Query Rewriter](#5-query-rewriter-agent)
176
+ - [6. Agent Memory](#6-agent-memory-zero-dependencies)
177
+ - [7. Rules & Instructions](#7-rules--instructions)
178
+ - [8. Auto-Generated Memories](#8-auto-generated-memories)
179
+ - [9. Agentic Workflows](#9-agentic-workflows)
180
+ - [10. Hooks](#10-hooks)
181
+ - [11. Shadow Git Checkpoints](#11-shadow-git-checkpoints)
182
+ - [12. Background Tasks](#12-background-tasks)
183
+ - [13. Policy Engine](#13-policy-engine)
184
+ - [14. Thinking Budgets](#14-thinking-budgets)
185
+ - [15. Output Styles](#15-output-styles)
186
+ - [16. Context Compaction](#16-context-compaction)
187
+ - [17. Field Names Reference](#17-field-names-reference-a-i-g-s)
188
+ - [18. Extended agents.yaml](#18-extended-agentsyaml-with-workflow-patterns)
189
+ - [19. MCP Protocol](#19-mcp-model-context-protocol)
190
+ - [20. A2A Protocol](#20-a2a-agent2agent-protocol)
191
+ - [🛠️ Custom Tools](#️-custom-tools)
192
+
193
+ ### JavaScript SDK
194
+ - [💻 JavaScript Examples](#-using-javascript-code)
195
+
196
+ ### CLI Reference
197
+ - [🎯 CLI Overview](#-cli--no-code-interface)
198
+ - [Auto Mode](#auto-mode)
199
+ - [Interactive Mode](#interactive-mode-cli)
200
+ - [Deep Research CLI](#deep-research-cli)
201
+ - [Planning Mode CLI](#planning-mode-cli)
202
+ - [Memory CLI](#memory-cli)
203
+ - [Workflow CLI](#workflow-cli)
204
+ - [Knowledge CLI](#knowledge-cli)
205
+ - [Session CLI](#session-cli)
206
+ - [Tools CLI](#tools-cli)
207
+ - [MCP Config CLI](#mcp-config-cli)
208
+ - [External Agents CLI](#external-agents-cli)
209
+ - [CLI Features Summary](#cli-features)
210
+
211
+ ### Configuration
212
+ - [🔧 Configuration & Integration](#-configuration--integration)
213
+ - [Ollama Integration](#ollama-integration)
214
+ - [Groq Integration](#groq-integration)
215
+ - [100+ Models Support](#100-models-support)
216
+ - [📋 Agents Playbook](#-agents-playbook)
217
+
218
+ ### Advanced Features
219
+ - [🔬 Advanced Features](#-advanced-features)
220
+ - [Research & Intelligence](#research--intelligence)
221
+ - [Memory & Caching](#memory--caching)
222
+ - [Planning & Workflows](#planning--workflows)
223
+ - [Specialised Agents](#specialised-agents)
224
+ - [MCP Protocol](#mcp-protocol)
225
+ - [A2A & A2UI Protocols](#a2a--a2ui-protocols)
226
+ - [Safety & Control](#safety--control)
227
+ - [Developer Tools](#developer-tools)
228
+
229
+ ### Architecture
230
+ - [📊 Process Types & Patterns](#-process-types--patterns)
231
+ - [Sequential Process](#sequential-process)
232
+ - [Hierarchical Process](#hierarchical-process)
233
+ - [Workflow Process](#workflow-process)
234
+ - [Agentic Patterns](#agentic-patterns)
235
+
236
+ ### Data & Persistence
237
+ - [💾 Persistence (Databases)](#-persistence-databases)
238
+ - [📚 Knowledge & Retrieval (RAG)](#-knowledge--retrieval-rag)
239
+ - [🔧 Tools Table](#-tools-table)
240
+
241
+ ### Learning & Community
242
+ - [🎓 Video Tutorials](#-video-tutorials)
243
+ - [⭐ Star History](#-star-history)
244
+ - [👥 Contributing](#-contributing)
245
+ - [🔧 Development](#-development)
246
+ - [❓ FAQ & Troubleshooting](#-faq--troubleshooting)
247
+
248
+ ---
249
+
250
+ ## ⚡ Performance
251
+
252
+ PraisonAI Agents is the **fastest AI agent framework** for agent instantiation.
253
+
254
+ | Framework | Avg Time (μs) | Relative |
255
+ |-----------|---------------|----------|
256
+ | **PraisonAI** | **3.77** | **1.00x (fastest)** |
257
+ | OpenAI Agents SDK | 5.26 | 1.39x |
258
+ | Agno | 5.64 | 1.49x |
259
+ | PraisonAI (LiteLLM) | 7.56 | 2.00x |
260
+ | PydanticAI | 226.94 | 60.16x |
261
+ | LangGraph | 4,558.71 | 1,209x |
262
+ | CrewAI | 15,607.92 | 4,138x |
263
+
264
+ <details>
265
+ <summary>Run benchmarks yourself</summary>
266
+
267
+ ```bash
268
+ cd praisonai-agents
269
+ python benchmarks/simple_benchmark.py
270
+ ```
271
+
272
+ </details>
273
+
274
+ ---
275
+
276
+ ## 🚀 Quick Start
277
+
278
+ Get started with PraisonAI in under 1 minute:
279
+
280
+ ```bash
281
+ # Install
282
+ pip install praisonaiagents
283
+
284
+ # Set API key
285
+ export OPENAI_API_KEY=your_key_here
286
+
287
+ # Create a simple agent
288
+ python -c "from praisonaiagents import Agent; Agent(instructions='You are a helpful AI assistant').start('Write a haiku about AI')"
289
+ ```
290
+
291
+ ---
292
+
293
+ ## 📦 Installation
294
+
295
+ ### Python SDK
296
+
297
+ Lightweight package dedicated for coding:
298
+
299
+ ```bash
300
+ pip install praisonaiagents
301
+ ```
302
+
303
+ For the full framework with CLI support:
304
+
305
+ ```bash
306
+ pip install praisonai
307
+ ```
308
+
309
+ ### JavaScript SDK
310
+
311
+ ```bash
312
+ npm install praisonai
313
+ ```
314
+
315
+ ### Environment Variables
316
+
317
+ | Variable | Required | Description |
318
+ |----------|----------|-------------|
319
+ | `OPENAI_API_KEY` | Yes* | OpenAI API key |
320
+ | `ANTHROPIC_API_KEY` | No | Anthropic Claude API key |
321
+ | `GOOGLE_API_KEY` | No | Google Gemini API key |
322
+ | `GROQ_API_KEY` | No | Groq API key |
323
+ | `OPENAI_BASE_URL` | No | Custom API endpoint (for Ollama, Groq, etc.) |
324
+
325
+ > *At least one LLM provider API key is required.
326
+
327
+ ```bash
328
+ # Set your API key
329
+ export OPENAI_API_KEY=your_key_here
330
+
331
+ # For Ollama (local models)
332
+ export OPENAI_BASE_URL=http://localhost:11434/v1
333
+
334
+ # For Groq
335
+ export OPENAI_API_KEY=your_groq_key
336
+ export OPENAI_BASE_URL=https://api.groq.com/openai/v1
337
+ ```
338
+
339
+ ---
340
+
341
+ ## 💻 Usage
342
+
343
+ ### Python Code Examples
344
+
345
+ - [📘 Complete Python Examples](#using-python-code)
346
+ - [🔧 Custom Tools](#️-custom-tools)
347
+ - [🧠 Memory Configuration](#-memory--context)
348
+
349
+ ### CLI / No-Code Interface
350
+
351
+ - [🎯 Auto Mode](#auto-mode)
352
+ - [🔬 Deep Research](#deep-research-cli)
353
+ - [📋 Planning Mode](#planning-mode-cli)
354
+ - [💾 Memory Management](#memory-cli)
355
+ - [🔄 Workflow Execution](#workflow-cli)
356
+
357
+ ### JavaScript Code Examples
358
+
359
+ - [💻 JavaScript Usage](#using-javascript-code)
360
+
361
+ ---
362
+
363
+ ## ✨ Key Features
364
+
365
+ <details open>
366
+ <summary><strong>🤖 Core Agents</strong></summary>
367
+
368
+ | Feature | Code | Docs |
369
+ |---------|:----:|:----:|
370
+ | Single Agent | [Example](examples/python/agents/single-agent.py) | [📖](https://docs.praison.ai/agents/single) |
371
+ | Multi Agents | [Example](examples/python/general/mini_agents_example.py) | [📖](https://docs.praison.ai/concepts/agents) |
372
+ | Auto Agents | [Example](examples/python/general/auto_agents_example.py) | [📖](https://docs.praison.ai/features/autoagents) |
373
+ | Self Reflection AI Agents | [Example](examples/python/concepts/self-reflection-details.py) | [📖](https://docs.praison.ai/features/selfreflection) |
374
+ | Reasoning AI Agents | [Example](examples/python/concepts/reasoning-extraction.py) | [📖](https://docs.praison.ai/features/reasoning) |
375
+ | Multi Modal AI Agents | [Example](examples/python/general/multimodal.py) | [📖](https://docs.praison.ai/features/multimodal) |
376
+
377
+ </details>
378
+
379
+ <details>
380
+ <summary><strong>🔄 Workflows</strong></summary>
381
+
382
+ | Feature | Code | Docs |
383
+ |---------|:----:|:----:|
384
+ | Simple Workflow | [Example](examples/python/workflows/simple_workflow.py) | [📖](https://docs.praison.ai/features/workflows) |
385
+ | Workflow with Agents | [Example](examples/python/workflows/workflow_with_agents.py) | [📖](https://docs.praison.ai/features/workflows) |
386
+ | Agentic Routing (`route()`) | [Example](examples/python/workflows/workflow_routing.py) | [📖](https://docs.praison.ai/features/routing) |
387
+ | Parallel Execution (`parallel()`) | [Example](examples/python/workflows/workflow_parallel.py) | [📖](https://docs.praison.ai/features/parallelisation) |
388
+ | Loop over List/CSV (`loop()`) | [Example](examples/python/workflows/workflow_loop_csv.py) | [📖](https://docs.praison.ai/features/repetitive) |
389
+ | Evaluator-Optimizer (`repeat()`) | [Example](examples/python/workflows/workflow_repeat.py) | [📖](https://docs.praison.ai/features/evaluator-optimiser) |
390
+ | Conditional Steps | [Example](examples/python/workflows/workflow_conditional.py) | [📖](https://docs.praison.ai/features/workflows) |
391
+ | Workflow Branching | [Example](examples/python/workflows/workflow_branching.py) | [📖](https://docs.praison.ai/features/workflows) |
392
+ | Workflow Early Stop | [Example](examples/python/workflows/workflow_early_stop.py) | [📖](https://docs.praison.ai/features/workflows) |
393
+ | Workflow Checkpoints | [Example](examples/python/workflows/workflow_checkpoints.py) | [📖](https://docs.praison.ai/features/workflows) |
394
+
395
+ </details>
396
+
397
+ <details>
398
+ <summary><strong>💻 Code & Development</strong></summary>
399
+
400
+ | Feature | Code | Docs |
401
+ |---------|:----:|:----:|
402
+ | Code Interpreter Agents | [Example](examples/python/agents/code-agent.py) | [📖](https://docs.praison.ai/features/codeagent) |
403
+ | AI Code Editing Tools | [Example](examples/python/code/code_editing_example.py) | [📖](https://docs.praison.ai/code/editing) |
404
+ | External Agents (All) | [Example](examples/python/code/external_agents_example.py) | [📖](https://docs.praison.ai/code/external-agents) |
405
+ | Claude Code CLI | [Example](examples/python/code/claude_code_example.py) | [📖](https://docs.praison.ai/code/claude-code) |
406
+ | Gemini CLI | [Example](examples/python/code/gemini_cli_example.py) | [📖](https://docs.praison.ai/code/gemini-cli) |
407
+ | Codex CLI | [Example](examples/python/code/codex_cli_example.py) | [📖](https://docs.praison.ai/code/codex-cli) |
408
+ | Cursor CLI | [Example](examples/python/code/cursor_cli_example.py) | [📖](https://docs.praison.ai/code/cursor-cli) |
409
+
410
+ </details>
411
+
412
+ <details>
413
+ <summary><strong>🧠 Memory & Knowledge</strong></summary>
414
+
415
+ | Feature | Code | Docs |
416
+ |---------|:----:|:----:|
417
+ | Memory (Short & Long Term) | [Example](examples/python/general/memory_example.py) | [📖](https://docs.praison.ai/concepts/memory) |
418
+ | File-Based Memory | [Example](examples/python/general/memory_example.py) | [📖](https://docs.praison.ai/concepts/memory) |
419
+ | Claude Memory Tool | [Example](#claude-memory-tool-cli) | [📖](https://docs.praison.ai/features/claude-memory-tool) |
420
+ | Add Custom Knowledge | [Example](examples/python/concepts/knowledge-agents.py) | [📖](https://docs.praison.ai/features/knowledge) |
421
+ | RAG Agents | [Example](examples/python/concepts/rag-agents.py) | [📖](https://docs.praison.ai/features/rag) |
422
+ | Chat with PDF Agents | [Example](examples/python/concepts/chat-with-pdf.py) | [📖](https://docs.praison.ai/features/chat-with-pdf) |
423
+ | Data Readers (PDF, DOCX, etc.) | [CLI](#knowledge-cli) | [📖](https://docs.praison.ai/api/praisonai/knowledge-readers-api) |
424
+ | Vector Store Selection | [CLI](#knowledge-cli) | [📖](https://docs.praison.ai/api/praisonai/knowledge-vector-store-api) |
425
+ | Retrieval Strategies | [CLI](#knowledge-cli) | [📖](https://docs.praison.ai/api/praisonai/knowledge-retrieval-api) |
426
+ | Rerankers | [CLI](#knowledge-cli) | [📖](https://docs.praison.ai/api/praisonai/knowledge-reranker-api) |
427
+ | Index Types (Vector/Keyword/Hybrid) | [CLI](#knowledge-cli) | [📖](https://docs.praison.ai/api/praisonai/knowledge-index-api) |
428
+ | Query Engines (Sub-Question, etc.) | [CLI](#knowledge-cli) | [📖](https://docs.praison.ai/api/praisonai/knowledge-query-engine-api) |
429
+
430
+ </details>
431
+
432
+ <details>
433
+ <summary><strong>🔬 Research & Intelligence</strong></summary>
434
+
435
+ | Feature | Code | Docs |
436
+ |---------|:----:|:----:|
437
+ | Deep Research Agents | [Example](examples/python/agents/research-agent.py) | [📖](https://docs.praison.ai/agents/deep-research) |
438
+ | Query Rewriter Agent | [Example](#5-query-rewriter-agent) | [📖](https://docs.praison.ai/agents/query-rewriter) |
439
+ | Native Web Search | [Example](examples/python/agents/websearch-agent.py) | [📖](https://docs.praison.ai/agents/websearch) |
440
+ | Built-in Search Tools | [Example](examples/python/agents/websearch-agent.py) | [📖](https://docs.praison.ai/tools/tavily) |
441
+ | Unified Web Search | [Example](src/praisonai-agents/examples/web_search_example.py) | [📖](https://docs.praison.ai/tools/web-search) |
442
+ | Web Fetch (Anthropic) | [Example](#web-search-web-fetch--prompt-caching) | [📖](https://docs.praison.ai/features/model-capabilities) |
443
+
444
+ </details>
445
+
446
+ <details>
447
+ <summary><strong>📋 Planning & Execution</strong></summary>
448
+
449
+ | Feature | Code | Docs |
450
+ |---------|:----:|:----:|
451
+ | Planning Mode | [Example](examples/python/agents/planning-agent.py) | [📖](https://docs.praison.ai/features/planning-mode) |
452
+ | Planning Tools | [Example](#3-agent-with-planning-mode) | [📖](https://docs.praison.ai/features/planning-mode) |
453
+ | Planning Reasoning | [Example](#3-agent-with-planning-mode) | [📖](https://docs.praison.ai/features/planning-mode) |
454
+ | Prompt Chaining | [Example](examples/python/general/prompt_chaining.py) | [📖](https://docs.praison.ai/features/promptchaining) |
455
+ | Evaluator Optimiser | [Example](examples/python/general/evaluator-optimiser.py) | [📖](https://docs.praison.ai/features/evaluator-optimiser) |
456
+ | Orchestrator Workers | [Example](examples/python/general/orchestrator-workers.py) | [📖](https://docs.praison.ai/features/orchestrator-worker) |
457
+
458
+ </details>
459
+
460
+ <details>
461
+ <summary><strong>👥 Specialized Agents</strong></summary>
462
+
463
+ | Feature | Code | Docs |
464
+ |---------|:----:|:----:|
465
+ | Data Analyst Agent | [Example](examples/python/agents/data-analyst-agent.py) | [📖](https://docs.praison.ai/agents/data-analyst) |
466
+ | Finance Agent | [Example](examples/python/agents/finance-agent.py) | [📖](https://docs.praison.ai/agents/finance) |
467
+ | Shopping Agent | [Example](examples/python/agents/shopping-agent.py) | [📖](https://docs.praison.ai/agents/shopping) |
468
+ | Recommendation Agent | [Example](examples/python/agents/recommendation-agent.py) | [📖](https://docs.praison.ai/agents/recommendation) |
469
+ | Wikipedia Agent | [Example](examples/python/agents/wikipedia-agent.py) | [📖](https://docs.praison.ai/agents/wikipedia) |
470
+ | Programming Agent | [Example](examples/python/agents/programming-agent.py) | [📖](https://docs.praison.ai/agents/programming) |
471
+ | Math Agents | [Example](examples/python/agents/math-agent.py) | [📖](https://docs.praison.ai/features/mathagent) |
472
+ | Markdown Agent | [Example](examples/python/agents/markdown-agent.py) | [📖](https://docs.praison.ai/agents/markdown) |
473
+ | Prompt Expander Agent | [Example](#prompt-expansion) | [📖](https://docs.praison.ai/agents/prompt-expander) |
474
+
475
+ </details>
476
+
477
+ <details>
478
+ <summary><strong>🎨 Media & Multimodal</strong></summary>
479
+
480
+ | Feature | Code | Docs |
481
+ |---------|:----:|:----:|
482
+ | Image Generation Agent | [Example](examples/python/image/image-agent.py) | [📖](https://docs.praison.ai/features/image-generation) |
483
+ | Image to Text Agent | [Example](examples/python/agents/image-to-text-agent.py) | [📖](https://docs.praison.ai/agents/image-to-text) |
484
+ | Video Agent | [Example](examples/python/agents/video-agent.py) | [📖](https://docs.praison.ai/agents/video) |
485
+ | Camera Integration | [Example](examples/python/camera/) | [📖](https://docs.praison.ai/features/camera-integration) |
486
+
487
+ </details>
488
+
489
+ <details>
490
+ <summary><strong>🔌 Protocols & Integration</strong></summary>
491
+
492
+ | Feature | Code | Docs |
493
+ |---------|:----:|:----:|
494
+ | MCP Transports | [Example](examples/python/mcp/mcp-transports-overview.py) | [📖](https://docs.praison.ai/mcp/transports) |
495
+ | WebSocket MCP | [Example](examples/python/mcp/websocket-mcp.py) | [📖](https://docs.praison.ai/mcp/sse-transport) |
496
+ | MCP Security | [Example](examples/python/mcp/mcp-security.py) | [📖](https://docs.praison.ai/mcp/transports) |
497
+ | MCP Resumability | [Example](examples/python/mcp/mcp-resumability.py) | [📖](https://docs.praison.ai/mcp/sse-transport) |
498
+ | MCP Config Management | [Example](#mcp-config-cli) | [📖](https://docs.praison.ai/docs/cli/mcp) |
499
+ | LangChain Integrated Agents | [Example](examples/python/general/langchain_example.py) | [📖](https://docs.praison.ai/features/langchain) |
500
+
501
+ </details>
502
+
503
+ <details>
504
+ <summary><strong>🛡️ Safety & Control</strong></summary>
505
+
506
+ | Feature | Code | Docs |
507
+ |---------|:----:|:----:|
508
+ | Guardrails | [Example](examples/python/guardrails/comprehensive-guardrails-example.py) | [📖](https://docs.praison.ai/features/guardrails) |
509
+ | Human Approval | [Example](examples/python/general/human_approval_example.py) | [📖](https://docs.praison.ai/features/approval) |
510
+ | Rules & Instructions | [Example](#7-rules--instructions) | [📖](https://docs.praison.ai/features/rules) |
511
+
512
+ </details>
513
+
514
+ <details>
515
+ <summary><strong>⚙️ Advanced Features</strong></summary>
516
+
517
+ | Feature | Code | Docs |
518
+ |---------|:----:|:----:|
519
+ | Async & Parallel Processing | [Example](examples/python/general/async_example.py) | [📖](https://docs.praison.ai/features/async) |
520
+ | Parallelisation | [Example](examples/python/general/parallelisation.py) | [📖](https://docs.praison.ai/features/parallelisation) |
521
+ | Repetitive Agents | [Example](examples/python/concepts/repetitive-agents.py) | [📖](https://docs.praison.ai/features/repetitive) |
522
+ | Agent Handoffs | [Example](examples/python/handoff/handoff_basic.py) | [📖](https://docs.praison.ai/features/handoffs) |
523
+ | Stateful Agents | [Example](examples/python/stateful/workflow-state-example.py) | [📖](https://docs.praison.ai/features/stateful-agents) |
524
+ | Autonomous Workflow | [Example](examples/python/general/autonomous-agent.py) | [📖](https://docs.praison.ai/features/autonomous-workflow) |
525
+ | Structured Output Agents | [Example](examples/python/general/structured_agents_example.py) | [📖](https://docs.praison.ai/features/structured) |
526
+ | Model Router | [Example](examples/python/agents/router-agent-cost-optimization.py) | [📖](https://docs.praison.ai/features/model-router) |
527
+ | Prompt Caching | [Example](#web-search-web-fetch--prompt-caching) | [📖](https://docs.praison.ai/features/model-capabilities) |
528
+ | Fast Context | [Example](examples/context/00_agent_fast_context_basic.py) | [📖](https://docs.praison.ai/features/fast-context) |
529
+
530
+ </details>
531
+
532
+ <details>
533
+ <summary><strong>🛠️ Tools & Configuration</strong></summary>
534
+
535
+ | Feature | Code | Docs |
536
+ |---------|:----:|:----:|
537
+ | 100+ Custom Tools | [Example](examples/python/general/tools_example.py) | [📖](https://docs.praison.ai/tools/tools) |
538
+ | YAML Configuration | [Example](examples/cookbooks/yaml/secondary_market_research_agents.yaml) | [📖](https://docs.praison.ai/developers/agents-playbook) |
539
+ | 100+ LLM Support | [Example](examples/python/providers/openai/openai_gpt4_example.py) | [📖](https://docs.praison.ai/models) |
540
+ | Callback Agents | [Example](examples/python/general/advanced-callback-systems.py) | [📖](https://docs.praison.ai/features/callbacks) |
541
+ | Hooks | [Example](#10-hooks) | [📖](https://docs.praison.ai/features/hooks) |
542
+ | Middleware System | [Example](examples/middleware/basic_middleware.py) | [📖](https://docs.praison.ai/features/middleware) |
543
+ | Configurable Model | [Example](examples/middleware/configurable_model.py) | [📖](https://docs.praison.ai/features/configurable-model) |
544
+ | Rate Limiter | [Example](examples/middleware/rate_limiter.py) | [📖](https://docs.praison.ai/features/rate-limiter) |
545
+ | Injected Tool State | [Example](examples/middleware/injected_state.py) | [📖](https://docs.praison.ai/features/injected-state) |
546
+ | Shadow Git Checkpoints | [Example](#11-shadow-git-checkpoints) | [📖](https://docs.praison.ai/features/checkpoints) |
547
+ | Background Tasks | [Example](examples/background/basic_background.py) | [📖](https://docs.praison.ai/features/background-tasks) |
548
+ | Policy Engine | [Example](examples/policy/basic_policy.py) | [📖](https://docs.praison.ai/features/policy-engine) |
549
+ | Thinking Budgets | [Example](examples/thinking/basic_thinking.py) | [📖](https://docs.praison.ai/features/thinking-budgets) |
550
+ | Output Styles | [Example](examples/output/basic_output.py) | [📖](https://docs.praison.ai/features/output-styles) |
551
+ | Context Compaction | [Example](examples/compaction/basic_compaction.py) | [📖](https://docs.praison.ai/features/context-compaction) |
552
+
553
+ </details>
554
+
555
+ <details>
556
+ <summary><strong>📊 Monitoring & Management</strong></summary>
557
+
558
+ | Feature | Code | Docs |
559
+ |---------|:----:|:----:|
560
+ | Sessions Management | [Example](examples/python/sessions/comprehensive-session-management.py) | [📖](https://docs.praison.ai/features/sessions) |
561
+ | Auto-Save Sessions | [Example](#session-management-python) | [📖](https://docs.praison.ai/docs/cli/session) |
562
+ | History in Context | [Example](#session-management-python) | [📖](https://docs.praison.ai/docs/cli/session) |
563
+ | Telemetry | [Example](examples/python/telemetry/production-telemetry-example.py) | [📖](https://docs.praison.ai/features/telemetry) |
564
+ | Project Docs (.praison/docs/) | [Example](#docs-cli) | [📖](https://docs.praison.ai/docs/cli/docs) |
565
+ | AI Commit Messages | [Example](#ai-commit-cli) | [📖](https://docs.praison.ai/docs/cli/commit) |
566
+ | @Mentions in Prompts | [Example](#mentions-in-prompts) | [📖](https://docs.praison.ai/docs/cli/mentions) |
567
+
568
+ </details>
569
+
570
+ <details>
571
+ <summary><strong>🖥️ CLI Features</strong></summary>
572
+
573
+ | Feature | Code | Docs |
574
+ |---------|:----:|:----:|
575
+ | Slash Commands | [Example](examples/python/cli/slash_commands_example.py) | [📖](https://docs.praison.ai/docs/cli/slash-commands) |
576
+ | Autonomy Modes | [Example](examples/python/cli/autonomy_modes_example.py) | [📖](https://docs.praison.ai/docs/cli/autonomy-modes) |
577
+ | Cost Tracking | [Example](examples/python/cli/cost_tracking_example.py) | [📖](https://docs.praison.ai/docs/cli/cost-tracking) |
578
+ | Repository Map | [Example](examples/python/cli/repo_map_example.py) | [📖](https://docs.praison.ai/docs/cli/repo-map) |
579
+ | Interactive TUI | [Example](examples/python/cli/interactive_tui_example.py) | [📖](https://docs.praison.ai/docs/cli/interactive-tui) |
580
+ | Git Integration | [Example](examples/python/cli/git_integration_example.py) | [📖](https://docs.praison.ai/docs/cli/git-integration) |
581
+ | Sandbox Execution | [Example](examples/python/cli/sandbox_execution_example.py) | [📖](https://docs.praison.ai/docs/cli/sandbox-execution) |
582
+ | CLI Compare | [Example](examples/compare/cli_compare_basic.py) | [📖](https://docs.praison.ai/docs/cli/compare) |
583
+ | Profile/Benchmark | [Example](#profile-benchmark) | [📖](https://docs.praison.ai/docs/cli/profile) |
584
+ | Auto Mode | [Example](#auto-mode) | [📖](https://docs.praison.ai/docs/cli/auto) |
585
+ | Init | [Example](#init) | [📖](https://docs.praison.ai/docs/cli/init) |
586
+ | File Input | [Example](#file-input) | [📖](https://docs.praison.ai/docs/cli/file-input) |
587
+ | Final Agent | [Example](#final-agent) | [📖](https://docs.praison.ai/docs/cli/final-agent) |
588
+ | Max Tokens | [Example](#max-tokens) | [📖](https://docs.praison.ai/docs/cli/max-tokens) |
589
+
590
+ </details>
591
+
592
+ <details>
593
+ <summary><strong>🧪 Evaluation</strong></summary>
594
+
595
+ | Feature | Code | Docs |
596
+ |---------|:----:|:----:|
597
+ | Accuracy Evaluation | [Example](examples/eval/accuracy_example.py) | [📖](https://docs.praison.ai/docs/cli/eval) |
598
+ | Performance Evaluation | [Example](examples/eval/performance_example.py) | [📖](https://docs.praison.ai/docs/cli/eval) |
599
+ | Reliability Evaluation | [Example](examples/eval/reliability_example.py) | [📖](https://docs.praison.ai/docs/cli/eval) |
600
+ | Criteria Evaluation | [Example](examples/eval/criteria_example.py) | [📖](https://docs.praison.ai/docs/cli/eval) |
601
+
602
+ </details>
603
+
604
+ <details>
605
+ <summary><strong>🎯 Agent Skills</strong></summary>
606
+
607
+ | Feature | Code | Docs |
608
+ |---------|:----:|:----:|
609
+ | Skills Management | [Example](examples/skills/basic_skill_usage.py) | [📖](https://docs.praison.ai/features/skills) |
610
+ | Custom Skills | [Example](examples/skills/custom_skill_example.py) | [📖](https://docs.praison.ai/features/skills) |
611
+
612
+ </details>
613
+
614
+ <details>
615
+ <summary><strong>⏰ 24/7 Scheduling</strong></summary>
616
+
617
+ | Feature | Code | Docs |
618
+ |---------|:----:|:----:|
619
+ | Agent Scheduler | [Example](examples/python/scheduled_agents/news_checker_live.py) | [📖](https://docs.praison.ai/docs/cli/scheduler) |
620
+
621
+ </details>
622
+
623
+ ---
624
+
625
+ ## 🌐 Supported Providers
626
+
627
+ PraisonAI supports 100+ LLM providers through seamless integration:
628
+
629
+ | Provider | Example |
630
+ |----------|:-------:|
631
+ | OpenAI | [Example](examples/python/providers/openai/openai_gpt4_example.py) |
632
+ | Anthropic | [Example](examples/python/providers/anthropic/anthropic_claude_example.py) |
633
+ | Google Gemini | [Example](examples/python/providers/google/google_gemini_example.py) |
634
+ | Ollama | [Example](examples/python/providers/ollama/ollama-agents.py) |
635
+ | Groq | [Example](examples/python/providers/groq/kimi_with_groq_example.py) |
636
+ | DeepSeek | [Example](examples/python/providers/deepseek/deepseek_example.py) |
637
+ | xAI Grok | [Example](examples/python/providers/xai/xai_grok_example.py) |
638
+ | Mistral | [Example](examples/python/providers/mistral/mistral_example.py) |
639
+ | Cohere | [Example](examples/python/providers/cohere/cohere_example.py) |
640
+ | Perplexity | [Example](examples/python/providers/perplexity/perplexity_example.py) |
641
+ | Fireworks | [Example](examples/python/providers/fireworks/fireworks_example.py) |
642
+ | Together AI | [Example](examples/python/providers/together/together_ai_example.py) |
643
+ | OpenRouter | [Example](examples/python/providers/openrouter/openrouter_example.py) |
644
+ | HuggingFace | [Example](examples/python/providers/huggingface/huggingface_example.py) |
645
+ | Azure OpenAI | [Example](examples/python/providers/azure/azure_openai_example.py) |
646
+ | AWS Bedrock | [Example](examples/python/providers/aws/aws_bedrock_example.py) |
647
+ | Google Vertex | [Example](examples/python/providers/vertex/vertex_example.py) |
648
+ | Databricks | [Example](examples/python/providers/databricks/databricks_example.py) |
649
+ | Cloudflare | [Example](examples/python/providers/cloudflare/cloudflare_example.py) |
650
+ | AI21 | [Example](examples/python/providers/ai21/ai21_example.py) |
651
+ | Replicate | [Example](examples/python/providers/replicate/replicate_example.py) |
652
+ | SageMaker | [Example](examples/python/providers/sagemaker/sagemaker_example.py) |
653
+ | Moonshot | [Example](examples/python/providers/moonshot/moonshot_example.py) |
654
+ | vLLM | [Example](examples/python/providers/vllm/vllm_example.py) |
655
+
656
+ ---
657
+
658
+ ## 📘 Using Python Code
659
+
660
+ Light weight package dedicated for coding:
661
+
662
+ ```bash
663
+ pip install praisonaiagents
664
+ export OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxx
665
+ ```
666
+
667
+ ### 1. Single Agent
668
+
669
+ Create app.py file and add the code below:
670
+ ```python
671
+ from praisonaiagents import Agent
672
+ agent = Agent(instructions="Your are a helpful AI assistant")
673
+ agent.start("Write a movie script about a robot in Mars")
674
+ ```
675
+
676
+ Run:
677
+ ```bash
678
+ python app.py
679
+ ```
680
+
681
+ ### 2. Multi Agents
682
+
683
+ Create app.py file and add the code below:
684
+ ```python
685
+ from praisonaiagents import Agent, PraisonAIAgents
686
+
687
+ research_agent = Agent(instructions="Research about AI")
688
+ summarise_agent = Agent(instructions="Summarise research agent's findings")
689
+ agents = PraisonAIAgents(agents=[research_agent, summarise_agent])
690
+ agents.start()
691
+ ```
692
+
693
+ Run:
694
+ ```bash
695
+ python app.py
696
+ ```
697
+
698
+ ### 3. Agent with Planning Mode
699
+
700
+ Enable planning for any agent - the agent creates a plan, then executes step by step:
701
+
702
+ ```python
703
+ from praisonaiagents import Agent
704
+
705
+ def search_web(query: str) -> str:
706
+ return f"Search results for: {query}"
707
+
708
+ agent = Agent(
709
+ name="AI Assistant",
710
+ instructions="Research and write about topics",
711
+ planning=True, # Enable planning mode
712
+ planning_tools=[search_web], # Tools for planning research
713
+ planning_reasoning=True # Chain-of-thought reasoning
714
+ )
715
+
716
+ result = agent.start("Research AI trends in 2025 and write a summary")
717
+ ```
718
+
719
+ **What happens:**
720
+ 1. 📋 Agent creates a multi-step plan
721
+ 2. 🚀 Executes each step sequentially
722
+ 3. 📊 Shows progress with context passing
723
+ 4. ✅ Returns final result
724
+
725
+ ### 4. Deep Research Agent
726
+
727
+ Automated research with real-time streaming, web search, and citations using OpenAI or Gemini Deep Research APIs.
728
+
729
+ ```python
730
+ from praisonaiagents import DeepResearchAgent
731
+
732
+ # OpenAI Deep Research
733
+ agent = DeepResearchAgent(
734
+ model="o4-mini-deep-research", # or "o3-deep-research"
735
+ verbose=True
736
+ )
737
+
738
+ result = agent.research("What are the latest AI trends in 2025?")
739
+ print(result.report)
740
+ print(f"Citations: {len(result.citations)}")
741
+ ```
742
+
743
+ ```python
744
+ # Gemini Deep Research
745
+ from praisonaiagents import DeepResearchAgent
746
+
747
+ agent = DeepResearchAgent(
748
+ model="deep-research-pro", # Auto-detected as Gemini
749
+ verbose=True
750
+ )
751
+
752
+ result = agent.research("Research quantum computing advances")
753
+ print(result.report)
754
+ ```
755
+
756
+ **Features:**
757
+ - 🔍 Multi-provider support (OpenAI, Gemini, LiteLLM)
758
+ - 📡 Real-time streaming with reasoning summaries
759
+ - 📚 Structured citations with URLs
760
+ - 🛠️ Built-in tools: web search, code interpreter, MCP, file search
761
+ - 🔄 Automatic provider detection from model name
762
+
763
+ ### 5. Query Rewriter Agent
764
+
765
+ Transform user queries to improve RAG retrieval quality using multiple strategies.
766
+
767
+ ```python
768
+ from praisonaiagents import QueryRewriterAgent, RewriteStrategy
769
+
770
+ agent = QueryRewriterAgent(model="gpt-4o-mini")
771
+
772
+ # Basic - expands abbreviations, adds context
773
+ result = agent.rewrite("AI trends")
774
+ print(result.primary_query) # "What are the current trends in Artificial Intelligence?"
775
+
776
+ # HyDE - generates hypothetical document for semantic matching
777
+ result = agent.rewrite("What is quantum computing?", strategy=RewriteStrategy.HYDE)
778
+
779
+ # Step-back - generates broader context question
780
+ result = agent.rewrite("GPT-4 vs Claude 3?", strategy=RewriteStrategy.STEP_BACK)
781
+
782
+ # Sub-queries - decomposes complex questions
783
+ result = agent.rewrite("RAG setup and best embedding models?", strategy=RewriteStrategy.SUB_QUERIES)
784
+
785
+ # Contextual - resolves references using chat history
786
+ result = agent.rewrite("What about cost?", chat_history=[...])
787
+ ```
788
+
789
+ **Strategies:**
790
+ - **BASIC**: Expand abbreviations, fix typos, add context
791
+ - **HYDE**: Generate hypothetical document for semantic matching
792
+ - **STEP_BACK**: Generate higher-level concept questions
793
+ - **SUB_QUERIES**: Decompose multi-part questions
794
+ - **MULTI_QUERY**: Generate multiple paraphrased versions
795
+ - **CONTEXTUAL**: Resolve references using conversation history
796
+ - **AUTO**: Automatically detect best strategy
797
+
798
+ ### 6. Agent Memory (Zero Dependencies)
799
+
800
+ Enable persistent memory for agents - works out of the box without any extra packages.
801
+
802
+ ```python
803
+ from praisonaiagents import Agent
804
+ from praisonaiagents.memory import FileMemory
805
+
806
+ # Enable memory with a single parameter
807
+ agent = Agent(
808
+ name="Personal Assistant",
809
+ instructions="You are a helpful assistant that remembers user preferences.",
810
+ memory=True, # Enables file-based memory (no extra deps!)
811
+ user_id="user123" # Isolate memory per user
812
+ )
813
+
814
+ # Memory is automatically injected into conversations
815
+ result = agent.start("My name is John and I prefer Python")
816
+ # Agent will remember this for future conversations
817
+ ```
818
+
819
+ **Memory Types:**
820
+ - **Short-term**: Rolling buffer of recent context (auto-expires)
821
+ - **Long-term**: Persistent important facts (sorted by importance)
822
+ - **Entity**: People, places, organizations with attributes
823
+ - **Episodic**: Date-based interaction history
824
+
825
+ **Advanced Features:**
826
+ ```python
827
+ from praisonaiagents.memory import FileMemory
828
+
829
+ memory = FileMemory(user_id="user123")
830
+
831
+ # Session Save/Resume
832
+ memory.save_session("project_session", conversation_history=[...])
833
+ memory.resume_session("project_session")
834
+
835
+ # Context Compression
836
+ memory.compress(llm_func=lambda p: agent.chat(p), max_items=10)
837
+
838
+ # Checkpointing
839
+ memory.create_checkpoint("before_refactor", include_files=["main.py"])
840
+ memory.restore_checkpoint("before_refactor", restore_files=True)
841
+
842
+ # Slash Commands
843
+ memory.handle_command("/memory show")
844
+ memory.handle_command("/memory save my_session")
845
+ ```
846
+
847
+ **Storage Options:**
848
+ | Option | Dependencies | Description |
849
+ |--------|-------------|-------------|
850
+ | `memory=True` | None | File-based JSON storage (default) |
851
+ | `memory="file"` | None | Explicit file-based storage |
852
+ | `memory="sqlite"` | Built-in | SQLite with indexing |
853
+ | `memory="chromadb"` | chromadb | Vector/semantic search |
854
+
855
+ ### 7. Rules & Instructions
856
+
857
+ PraisonAI auto-discovers instruction files from your project root and git root:
858
+
859
+ | File | Description | Priority |
860
+ |------|-------------|----------|
861
+ | `PRAISON.md` | PraisonAI native instructions | High |
862
+ | `PRAISON.local.md` | Local overrides (gitignored) | Higher |
863
+ | `CLAUDE.md` | Claude Code memory file | High |
864
+ | `CLAUDE.local.md` | Local overrides (gitignored) | Higher |
865
+ | `AGENTS.md` | OpenAI Codex CLI instructions | High |
866
+ | `GEMINI.md` | Gemini CLI memory file | High |
867
+ | `.cursorrules` | Cursor IDE rules | High |
868
+ | `.windsurfrules` | Windsurf IDE rules | High |
869
+ | `.claude/rules/*.md` | Claude Code modular rules | Medium |
870
+ | `.windsurf/rules/*.md` | Windsurf modular rules | Medium |
871
+ | `.cursor/rules/*.mdc` | Cursor modular rules | Medium |
872
+ | `.praison/rules/*.md` | Workspace rules | Medium |
873
+ | `~/.praison/rules/*.md` | Global rules | Low |
874
+
875
+ ```python
876
+ from praisonaiagents import Agent
877
+
878
+ # Agent auto-discovers CLAUDE.md, AGENTS.md, GEMINI.md, etc.
879
+ agent = Agent(name="Assistant", instructions="You are helpful.")
880
+ # Rules are injected into system prompt automatically
881
+ ```
882
+
883
+ **@Import Syntax:**
884
+ ```markdown
885
+ # CLAUDE.md
886
+ See @README for project overview
887
+ See @docs/architecture.md for system design
888
+ @~/.praison/my-preferences.md
889
+ ```
890
+
891
+ **Rule File Format (with YAML frontmatter):**
892
+ ```markdown
893
+ ---
894
+ description: Python coding guidelines
895
+ globs: ["**/*.py"]
896
+ activation: always # always, glob, manual, ai_decision
897
+ ---
898
+
899
+ # Guidelines
900
+ - Use type hints
901
+ - Follow PEP 8
902
+ ```
903
+
904
+ ### 8. Auto-Generated Memories
905
+
906
+ ```python
907
+ from praisonaiagents.memory import FileMemory, AutoMemory
908
+
909
+ memory = FileMemory(user_id="user123")
910
+ auto = AutoMemory(memory, enabled=True)
911
+
912
+ # Automatically extracts and stores memories from conversations
913
+ memories = auto.process_interaction(
914
+ "My name is John and I prefer Python for backend work"
915
+ )
916
+ # Extracts: name="John", preference="Python for backend"
917
+ ```
918
+
919
+ ### 9. Agentic Workflows
920
+
921
+ Create powerful multi-agent workflows with the `Workflow` class:
922
+
923
+ ```python
924
+ from praisonaiagents import Agent, Workflow
925
+
926
+ # Create agents
927
+ researcher = Agent(
928
+ name="Researcher",
929
+ role="Research Analyst",
930
+ goal="Research topics thoroughly",
931
+ instructions="Provide concise, factual information."
932
+ )
933
+
934
+ writer = Agent(
935
+ name="Writer",
936
+ role="Content Writer",
937
+ goal="Write engaging content",
938
+ instructions="Write clear, engaging content based on research."
939
+ )
940
+
941
+ # Create workflow with agents as steps
942
+ workflow = Workflow(steps=[researcher, writer])
943
+
944
+ # Run workflow - agents process sequentially
945
+ result = workflow.start("What are the benefits of AI agents?")
946
+ print(result["output"])
947
+ ```
948
+
949
+ **Key Features:**
950
+ - **Agent-first** - Pass `Agent` objects directly as workflow steps
951
+ - **Pattern helpers** - Use `route()`, `parallel()`, `loop()`, `repeat()`
952
+ - **Planning mode** - Enable with `planning=True`
953
+ - **Callbacks** - Monitor with `on_step_complete`, `on_workflow_complete`
954
+ - **Async execution** - Use `workflow.astart()` for async
955
+
956
+ ### Workflow Patterns (route, parallel, loop, repeat)
957
+
958
+ ```python
959
+ from praisonaiagents import Agent, Workflow
960
+ from praisonaiagents.workflows import route, parallel, loop, repeat
961
+
962
+ # 1. ROUTING - Classifier agent routes to specialized agents
963
+ classifier = Agent(name="Classifier", instructions="Respond with 'technical' or 'creative'")
964
+ tech_agent = Agent(name="TechExpert", role="Technical Expert")
965
+ creative_agent = Agent(name="Creative", role="Creative Writer")
966
+
967
+ workflow = Workflow(steps=[
968
+ classifier,
969
+ route({
970
+ "technical": [tech_agent],
971
+ "creative": [creative_agent]
972
+ })
973
+ ])
974
+
975
+ # 2. PARALLEL - Multiple agents work concurrently
976
+ market_agent = Agent(name="Market", role="Market Researcher")
977
+ competitor_agent = Agent(name="Competitor", role="Competitor Analyst")
978
+ aggregator = Agent(name="Aggregator", role="Synthesizer")
979
+
980
+ workflow = Workflow(steps=[
981
+ parallel([market_agent, competitor_agent]),
982
+ aggregator
983
+ ])
984
+
985
+ # 3. LOOP - Agent processes each item
986
+ processor = Agent(name="Processor", role="Item Processor")
987
+ summarizer = Agent(name="Summarizer", role="Summarizer")
988
+
989
+ workflow = Workflow(
990
+ steps=[loop(processor, over="items"), summarizer],
991
+ variables={"items": ["AI", "ML", "NLP"]}
992
+ )
993
+
994
+ # 4. REPEAT - Evaluator-Optimizer pattern
995
+ generator = Agent(name="Generator", role="Content Generator")
996
+ evaluator = Agent(name="Evaluator", instructions="Say 'APPROVED' if good")
997
+
998
+ workflow = Workflow(steps=[
999
+ generator,
1000
+ repeat(evaluator, until=lambda ctx: "approved" in ctx.previous_result.lower(), max_iterations=3)
1001
+ ])
1002
+
1003
+ # 5. CALLBACKS
1004
+ workflow = Workflow(
1005
+ steps=[researcher, writer],
1006
+ on_step_complete=lambda name, r: print(f"✅ {name} done")
1007
+ )
1008
+
1009
+ # 6. WITH PLANNING & REASONING
1010
+ workflow = Workflow(
1011
+ steps=[researcher, writer],
1012
+ planning=True,
1013
+ reasoning=True
1014
+ )
1015
+
1016
+ # 7. ASYNC EXECUTION
1017
+ result = asyncio.run(workflow.astart("input"))
1018
+
1019
+ # 8. STATUS TRACKING
1020
+ workflow.status # "not_started" | "running" | "completed"
1021
+ workflow.step_statuses # {"step1": "completed", "step2": "skipped"}
1022
+ ```
1023
+
1024
+ ### YAML Workflow Template
1025
+
1026
+ ```yaml
1027
+ # .praison/workflows/research.yaml
1028
+ name: Research Workflow
1029
+ description: Research and write content with all patterns
1030
+
1031
+ agents:
1032
+ researcher:
1033
+ role: Research Expert
1034
+ goal: Find accurate information
1035
+ tools: [tavily_search, web_scraper]
1036
+ writer:
1037
+ role: Content Writer
1038
+ goal: Write engaging content
1039
+ editor:
1040
+ role: Editor
1041
+ goal: Polish content
1042
+
1043
+ steps:
1044
+ # Sequential
1045
+ - agent: researcher
1046
+ action: Research {{topic}}
1047
+ output_variable: research_data
1048
+
1049
+ # Routing
1050
+ - name: classifier
1051
+ action: Classify content type
1052
+ route:
1053
+ technical: [tech_handler]
1054
+ creative: [creative_handler]
1055
+ default: [general_handler]
1056
+
1057
+ # Parallel
1058
+ - name: parallel_research
1059
+ parallel:
1060
+ - agent: researcher
1061
+ action: Research market
1062
+ - agent: researcher
1063
+ action: Research competitors
1064
+
1065
+ # Loop
1066
+ - agent: writer
1067
+ action: Write about {{item}}
1068
+ loop_over: topics
1069
+ loop_var: item
1070
+
1071
+ # Repeat (evaluator-optimizer)
1072
+ - agent: editor
1073
+ action: Review and improve
1074
+ repeat:
1075
+ until: "quality > 8"
1076
+ max_iterations: 3
1077
+
1078
+ # Output to file
1079
+ - agent: writer
1080
+ action: Write final report
1081
+ output_file: output/{{topic}}_report.md
1082
+
1083
+ variables:
1084
+ topic: AI trends
1085
+ topics: [ML, NLP, Vision]
1086
+
1087
+ workflow:
1088
+ planning: true
1089
+ planning_llm: gpt-4o
1090
+ memory_config:
1091
+ provider: chroma
1092
+ persist: true
1093
+ ```
1094
+
1095
+ ### Loading YAML Workflows
1096
+
1097
+ ```python
1098
+ from praisonaiagents.workflows import YAMLWorkflowParser, WorkflowManager
1099
+
1100
+ # Option 1: Parse YAML string
1101
+ parser = YAMLWorkflowParser()
1102
+ workflow = parser.parse_string(yaml_content)
1103
+ result = workflow.start("Research AI trends")
1104
+
1105
+ # Option 2: Load from file with WorkflowManager
1106
+ manager = WorkflowManager()
1107
+ workflow = manager.load_yaml("research_workflow.yaml")
1108
+ result = workflow.start("Research AI trends")
1109
+
1110
+ # Option 3: Execute YAML directly
1111
+ result = manager.execute_yaml(
1112
+ "research_workflow.yaml",
1113
+ input_data="Research AI trends",
1114
+ variables={"topic": "Machine Learning"}
1115
+ )
1116
+ ```
1117
+
1118
+ ### Complete workflow.yaml Reference
1119
+
1120
+ ```yaml
1121
+ # workflow.yaml - Full feature reference
1122
+ name: Complete Workflow
1123
+ description: Demonstrates all workflow.yaml features
1124
+ framework: praisonai # praisonai, crewai, autogen
1125
+ process: workflow # sequential, hierarchical, workflow
1126
+
1127
+ workflow:
1128
+ planning: true
1129
+ planning_llm: gpt-4o
1130
+ reasoning: true
1131
+ verbose: true
1132
+ memory_config:
1133
+ provider: chroma
1134
+ persist: true
1135
+
1136
+ variables:
1137
+ topic: AI trends
1138
+ items: [ML, NLP, Vision]
1139
+
1140
+ agents:
1141
+ researcher:
1142
+ name: Researcher
1143
+ role: Research Analyst
1144
+ goal: Research topics thoroughly
1145
+ instructions: "Provide detailed research findings"
1146
+ backstory: "Expert researcher with 10 years experience" # alias for instructions
1147
+ llm: gpt-4o-mini
1148
+ function_calling_llm: gpt-4o # For tool calls
1149
+ max_rpm: 10 # Rate limiting
1150
+ max_execution_time: 300 # Timeout in seconds
1151
+ reflect_llm: gpt-4o # For self-reflection
1152
+ min_reflect: 1
1153
+ max_reflect: 3
1154
+ system_template: "You are a helpful assistant"
1155
+ tools:
1156
+ - tavily_search
1157
+
1158
+ writer:
1159
+ name: Writer
1160
+ role: Content Writer
1161
+ goal: Write clear content
1162
+ instructions: "Write engaging content"
1163
+
1164
+ steps:
1165
+ - name: research_step
1166
+ agent: researcher
1167
+ action: "Research {{topic}}"
1168
+ expected_output: "Comprehensive research report"
1169
+ output_file: "output/research.md"
1170
+ create_directory: true
1171
+
1172
+ - name: writing_step
1173
+ agent: writer
1174
+ action: "Write article based on research"
1175
+ context: # Task dependencies
1176
+ - research_step
1177
+ output_json: # Structured output
1178
+ type: object
1179
+ properties:
1180
+ title: { type: string }
1181
+ content: { type: string }
1182
+
1183
+ callbacks:
1184
+ on_workflow_start: log_start
1185
+ on_step_complete: log_step
1186
+ on_workflow_complete: log_complete
1187
+ ```
1188
+
1189
+ ### 10. Hooks
1190
+
1191
+ Intercept and modify agent behavior at various lifecycle points:
1192
+
1193
+ ```python
1194
+ from praisonaiagents.hooks import (
1195
+ HookRegistry, HookRunner, HookEvent, HookResult,
1196
+ BeforeToolInput
1197
+ )
1198
+
1199
+ # Create a hook registry
1200
+ registry = HookRegistry()
1201
+
1202
+ # Log all tool calls
1203
+ @registry.on(HookEvent.BEFORE_TOOL)
1204
+ def log_tools(event_data: BeforeToolInput) -> HookResult:
1205
+ print(f"Tool: {event_data.tool_name}")
1206
+ return HookResult.allow()
1207
+
1208
+ # Block dangerous operations
1209
+ @registry.on(HookEvent.BEFORE_TOOL)
1210
+ def security_check(event_data: BeforeToolInput) -> HookResult:
1211
+ if "delete" in event_data.tool_name.lower():
1212
+ return HookResult.deny("Delete operations blocked")
1213
+ return HookResult.allow()
1214
+
1215
+ # Execute hooks
1216
+ runner = HookRunner(registry)
1217
+ ```
1218
+
1219
+ **CLI Commands:**
1220
+ ```bash
1221
+ praisonai hooks list # List registered hooks
1222
+ praisonai hooks test before_tool # Test hooks for an event
1223
+ praisonai hooks run "echo test" # Run a command hook
1224
+ praisonai hooks validate hooks.json # Validate configuration
1225
+ ```
1226
+
1227
+
1228
+ ### 11. Shadow Git Checkpoints
1229
+
1230
+ File-level undo/restore using shadow git:
1231
+
1232
+ ```python
1233
+ from praisonaiagents.checkpoints import CheckpointService
1234
+
1235
+ service = CheckpointService(workspace_dir="./my_project")
1236
+ await service.initialize()
1237
+
1238
+ # Save checkpoint before changes
1239
+ result = await service.save("Before refactoring")
1240
+
1241
+ # Make changes...
1242
+
1243
+ # Restore if needed
1244
+ await service.restore(result.checkpoint.id)
1245
+
1246
+ # View diff
1247
+ diff = await service.diff()
1248
+ ```
1249
+
1250
+ **CLI Commands:**
1251
+ ```bash
1252
+ praisonai checkpoint save "Before changes" # Save checkpoint
1253
+ praisonai checkpoint list # List checkpoints
1254
+ praisonai checkpoint diff # Show changes
1255
+ praisonai checkpoint restore abc123 # Restore to checkpoint
1256
+ ```
1257
+
1258
+ **Links:**
1259
+ - [📖 Coding Docs](https://docs.praison.ai/features/checkpoints)
1260
+ - [📖 CLI Docs](https://docs.praison.ai/docs/cli/checkpoint)
1261
+ - [💻 Example](examples/checkpoints/basic_checkpoints.py)
1262
+
1263
+ ---
1264
+
1265
+ ### 12. Background Tasks
1266
+
1267
+ Run agent tasks asynchronously without blocking:
1268
+
1269
+ ```python
1270
+ import asyncio
1271
+ from praisonaiagents.background import BackgroundRunner, BackgroundConfig
1272
+
1273
+ async def main():
1274
+ config = BackgroundConfig(max_concurrent_tasks=3)
1275
+ runner = BackgroundRunner(config=config)
1276
+
1277
+ async def my_task(name: str) -> str:
1278
+ await asyncio.sleep(2)
1279
+ return f"Task {name} completed"
1280
+
1281
+ task = await runner.submit(my_task, args=("example",), name="my_task")
1282
+ await task.wait(timeout=10.0)
1283
+ print(task.result)
1284
+
1285
+ asyncio.run(main())
1286
+ ```
1287
+
1288
+ **CLI Commands:**
1289
+ ```bash
1290
+ praisonai background list # List running tasks
1291
+ praisonai background status <id> # Check task status
1292
+ praisonai background cancel <id> # Cancel a task
1293
+ praisonai background clear # Clear completed tasks
1294
+ ```
1295
+
1296
+ **Links:**
1297
+ - [📖 Coding Docs](https://docs.praison.ai/features/background-tasks)
1298
+ - [📖 CLI Docs](https://docs.praison.ai/docs/cli/background)
1299
+ - [💻 Example](examples/background/basic_background.py)
1300
+
1301
+ ---
1302
+
1303
+ ### 13. Policy Engine
1304
+
1305
+ Control what agents can and cannot do with policy-based execution:
1306
+
1307
+ ```python
1308
+ from praisonaiagents.policy import (
1309
+ PolicyEngine, Policy, PolicyRule, PolicyAction
1310
+ )
1311
+
1312
+ engine = PolicyEngine()
1313
+
1314
+ policy = Policy(
1315
+ name="no_delete",
1316
+ rules=[
1317
+ PolicyRule(
1318
+ action=PolicyAction.DENY,
1319
+ resource="tool:delete_*",
1320
+ reason="Delete operations blocked"
1321
+ )
1322
+ ]
1323
+ )
1324
+ engine.add_policy(policy)
1325
+
1326
+ result = engine.check("tool:delete_file", {})
1327
+ print(f"Allowed: {result.allowed}")
1328
+ ```
1329
+
1330
+ **CLI Commands:**
1331
+ ```bash
1332
+ praisonai policy list # List policies
1333
+ praisonai policy check "tool:name" # Check if allowed
1334
+ praisonai policy init # Create template
1335
+ ```
1336
+
1337
+ **Links:**
1338
+ - [📖 Coding Docs](https://docs.praison.ai/features/policy-engine)
1339
+ - [📖 CLI Docs](https://docs.praison.ai/docs/cli/policy)
1340
+ - [💻 Example](examples/policy/basic_policy.py)
1341
+
1342
+ ---
1343
+
1344
+ ### 14. Thinking Budgets
1345
+
1346
+ Configure token budgets for extended thinking:
1347
+
1348
+ ```python
1349
+ from praisonaiagents.thinking import ThinkingBudget, ThinkingTracker
1350
+
1351
+ # Use predefined levels
1352
+ budget = ThinkingBudget.high() # 16,000 tokens
1353
+
1354
+ # Track usage
1355
+ tracker = ThinkingTracker()
1356
+ session = tracker.start_session(budget_tokens=16000)
1357
+ tracker.end_session(session, tokens_used=12000)
1358
+
1359
+ summary = tracker.get_summary()
1360
+ print(f"Utilization: {summary['average_utilization']:.1%}")
1361
+ ```
1362
+
1363
+ **CLI Commands:**
1364
+ ```bash
1365
+ praisonai thinking status # Show current budget
1366
+ praisonai thinking set high # Set budget level
1367
+ praisonai thinking stats # Show usage statistics
1368
+ ```
1369
+
1370
+ **Links:**
1371
+ - [📖 Coding Docs](https://docs.praison.ai/features/thinking-budgets)
1372
+ - [📖 CLI Docs](https://docs.praison.ai/docs/cli/thinking)
1373
+ - [💻 Example](examples/thinking/basic_thinking.py)
1374
+
1375
+ ---
1376
+
1377
+ ### 15. Output Styles
1378
+
1379
+ Configure how agents format their responses:
1380
+
1381
+ ```python
1382
+ from praisonaiagents.output import OutputStyle, OutputFormatter
1383
+
1384
+ # Use preset styles
1385
+ style = OutputStyle.concise()
1386
+ formatter = OutputFormatter(style)
1387
+
1388
+ # Format output
1389
+ text = "# Hello\n\nThis is **bold** text."
1390
+ plain = formatter.format(text)
1391
+ print(plain)
1392
+ ```
1393
+
1394
+ **CLI Commands:**
1395
+ ```bash
1396
+ praisonai output status # Show current style
1397
+ praisonai output set concise # Set output style
1398
+ ```
1399
+
1400
+ **Links:**
1401
+ - [📖 Coding Docs](https://docs.praison.ai/features/output-styles)
1402
+ - [📖 CLI Docs](https://docs.praison.ai/docs/cli/output-style)
1403
+ - [💻 Example](examples/output/basic_output.py)
1404
+
1405
+ ---
1406
+
1407
+ ### 16. Context Compaction
1408
+
1409
+ Automatically manage context window size:
1410
+
1411
+ ```python
1412
+ from praisonaiagents.compaction import (
1413
+ ContextCompactor, CompactionStrategy
1414
+ )
1415
+
1416
+ compactor = ContextCompactor(
1417
+ max_tokens=4000,
1418
+ strategy=CompactionStrategy.SLIDING,
1419
+ preserve_recent=3
1420
+ )
1421
+
1422
+ messages = [...] # Your conversation history
1423
+ compacted, result = compactor.compact(messages)
1424
+
1425
+ print(f"Compression: {result.compression_ratio:.1%}")
1426
+ ```
1427
+
1428
+ **CLI Commands:**
1429
+ ```bash
1430
+ praisonai compaction status # Show settings
1431
+ praisonai compaction set sliding # Set strategy
1432
+ praisonai compaction stats # Show statistics
1433
+ ```
1434
+
1435
+ **Links:**
1436
+ - [📖 Coding Docs](https://docs.praison.ai/features/context-compaction)
1437
+ - [📖 CLI Docs](https://docs.praison.ai/docs/cli/compaction)
1438
+ - [💻 Example](examples/compaction/basic_compaction.py)
1439
+
1440
+ ---
1441
+
1442
+ ### 17. Field Names Reference (A-I-G-S)
1443
+
1444
+ PraisonAI accepts both old (agents.yaml) and new (workflow.yaml) field names. Use the **canonical names** for new projects:
1445
+
1446
+ | Canonical (Recommended) | Alias (Also Works) | Purpose |
1447
+ |-------------------------|-------------------|---------|
1448
+ | `agents` | `roles` | Define agent personas |
1449
+ | `instructions` | `backstory` | Agent behavior/persona |
1450
+ | `action` | `description` | What the step does |
1451
+ | `steps` | `tasks` (nested) | Define work items |
1452
+ | `name` | `topic` | Workflow identifier |
1453
+
1454
+ **A-I-G-S Mnemonic** - Easy to remember:
1455
+ - **A**gents - Who does the work
1456
+ - **I**nstructions - How they behave
1457
+ - **G**oal - What they achieve
1458
+ - **S**teps - What they do
1459
+
1460
+ ```yaml
1461
+ # Quick Reference - Canonical Format
1462
+ name: My Workflow # Workflow name (not 'topic')
1463
+ agents: # Define agents (not 'roles')
1464
+ my_agent:
1465
+ role: Job Title # Agent's role
1466
+ goal: What to achieve # Agent's goal
1467
+ instructions: How to act # Agent's behavior (not 'backstory')
1468
+
1469
+ steps: # Define steps (not 'tasks')
1470
+ - agent: my_agent
1471
+ action: What to do # Step action (not 'description')
1472
+ ```
1473
+
1474
+ > **Note:** The parser accepts both old and new names. Run `praisonai workflow validate <file.yaml>` to see suggestions for canonical names.
1475
+
1476
+ ### 18. Extended agents.yaml with Workflow Patterns
1477
+
1478
+ **Feature Parity:** Both `agents.yaml` and `workflow.yaml` now support the same features:
1479
+ - All workflow patterns (route, parallel, loop, repeat)
1480
+ - All agent fields (function_calling_llm, max_rpm, max_execution_time, reflect_llm, templates)
1481
+ - All step fields (expected_output, context, output_json, create_directory, callback)
1482
+ - Framework support (praisonai, crewai, autogen)
1483
+ - Process types (sequential, hierarchical, workflow)
1484
+
1485
+ You can use advanced workflow patterns directly in agents.yaml by setting `process: workflow`:
1486
+
1487
+ ```yaml
1488
+ # agents.yaml with workflow patterns
1489
+ framework: praisonai
1490
+ process: workflow # Enables workflow mode
1491
+ topic: "Research AI trends"
1492
+
1493
+ workflow:
1494
+ planning: true
1495
+ reasoning: true
1496
+ verbose: true
1497
+
1498
+ variables:
1499
+ topic: AI trends
1500
+
1501
+ agents: # Canonical: use 'agents' instead of 'roles'
1502
+ classifier:
1503
+ role: Request Classifier
1504
+ instructions: "Classify requests into categories" # Canonical: use 'instructions' instead of 'backstory'
1505
+ goal: Classify requests
1506
+
1507
+ researcher:
1508
+ role: Research Analyst
1509
+ instructions: "Expert researcher" # Canonical: use 'instructions' instead of 'backstory'
1510
+ goal: Research topics
1511
+ tools:
1512
+ - tavily_search
1513
+
1514
+ steps:
1515
+ # Sequential step
1516
+ - agent: classifier
1517
+ action: "Classify: {{topic}}"
1518
+
1519
+ # Route pattern - decision-based branching
1520
+ - name: routing
1521
+ route:
1522
+ technical: [tech_expert]
1523
+ default: [researcher]
1524
+
1525
+ # Parallel pattern - concurrent execution
1526
+ - name: parallel_research
1527
+ parallel:
1528
+ - agent: researcher
1529
+ action: "Research market trends"
1530
+ - agent: researcher
1531
+ action: "Research competitors"
1532
+
1533
+ # Loop pattern - iterate over items
1534
+ - agent: researcher
1535
+ action: "Analyze {{item}}"
1536
+ loop:
1537
+ over: topics
1538
+
1539
+ # Repeat pattern - evaluator-optimizer
1540
+ - agent: aggregator
1541
+ action: "Synthesize findings"
1542
+ repeat:
1543
+ until: "comprehensive"
1544
+ max_iterations: 3
1545
+ ```
1546
+
1547
+ Run with the same simple command:
1548
+ ```bash
1549
+ praisonai agents.yaml
1550
+ ```
1551
+
1552
+ ### 19. MCP (Model Context Protocol)
1553
+
1554
+ PraisonAI supports MCP Protocol Revision 2025-11-25 with multiple transports.
1555
+
1556
+ #### MCP Client (Consume MCP Servers)
1557
+ ```python
1558
+ from praisonaiagents import Agent, MCP
1559
+
1560
+ # stdio - Local NPX/Python servers
1561
+ agent = Agent(tools=MCP("npx @modelcontextprotocol/server-memory"))
1562
+
1563
+ # Streamable HTTP - Production servers
1564
+ agent = Agent(tools=MCP("https://api.example.com/mcp"))
1565
+
1566
+ # WebSocket - Real-time bidirectional
1567
+ agent = Agent(tools=MCP("wss://api.example.com/mcp", auth_token="token"))
1568
+
1569
+ # SSE (Legacy) - Backward compatibility
1570
+ agent = Agent(tools=MCP("http://localhost:8080/sse"))
1571
+
1572
+ # With environment variables
1573
+ agent = Agent(
1574
+ tools=MCP(
1575
+ command="npx",
1576
+ args=["-y", "@modelcontextprotocol/server-brave-search"],
1577
+ env={"BRAVE_API_KEY": "your-key"}
1578
+ )
1579
+ )
1580
+
1581
+ # Multiple MCP servers + regular functions
1582
+ def my_custom_tool(query: str) -> str:
1583
+ """Custom tool function."""
1584
+ return f"Result: {query}"
1585
+
1586
+ agent = Agent(
1587
+ name="MultiToolAgent",
1588
+ instructions="Agent with multiple MCP servers",
1589
+ tools=[
1590
+ MCP("uvx mcp-server-time"), # Time tools
1591
+ MCP("npx @modelcontextprotocol/server-memory"), # Memory tools
1592
+ my_custom_tool # Regular function
1593
+ ]
1594
+ )
1595
+ ```
1596
+
1597
+ #### MCP Server (Expose Tools as MCP Server)
1598
+
1599
+ Expose your Python functions as MCP tools for Claude Desktop, Cursor, and other MCP clients:
1600
+
1601
+ ```python
1602
+ from praisonaiagents.mcp import ToolsMCPServer
1603
+
1604
+ def search_web(query: str, max_results: int = 5) -> dict:
1605
+ """Search the web for information."""
1606
+ return {"results": [f"Result for {query}"]}
1607
+
1608
+ def calculate(expression: str) -> dict:
1609
+ """Evaluate a mathematical expression."""
1610
+ return {"result": eval(expression)}
1611
+
1612
+ # Create and run MCP server
1613
+ server = ToolsMCPServer(name="my-tools")
1614
+ server.register_tools([search_web, calculate])
1615
+ server.run() # stdio for Claude Desktop
1616
+ # server.run_sse(host="0.0.0.0", port=8080) # SSE for web clients
1617
+ ```
1618
+
1619
+ #### MCP Features
1620
+ | Feature | Description |
1621
+ |---------|-------------|
1622
+ | Session Management | Automatic Mcp-Session-Id handling |
1623
+ | Protocol Versioning | Mcp-Protocol-Version header |
1624
+ | Resumability | SSE stream recovery via Last-Event-ID |
1625
+ | Security | Origin validation, DNS rebinding prevention |
1626
+ | WebSocket | Auto-reconnect with exponential backoff |
1627
+
1628
+ ### 20. A2A (Agent2Agent Protocol)
1629
+
1630
+ PraisonAI supports the [A2A Protocol](https://a2a-protocol.org) for agent-to-agent communication, enabling your agents to be discovered and collaborate with other AI agents.
1631
+
1632
+ #### A2A Server (Expose Agent as A2A Server)
1633
+ ```python
1634
+ from praisonaiagents import Agent, A2A
1635
+ from fastapi import FastAPI
1636
+
1637
+ # Create an agent with tools
1638
+ def search_web(query: str) -> str:
1639
+ """Search the web for information."""
1640
+ return f"Results for: {query}"
1641
+
1642
+ agent = Agent(
1643
+ name="Research Assistant",
1644
+ role="Research Analyst",
1645
+ goal="Help users research topics",
1646
+ tools=[search_web]
1647
+ )
1648
+
1649
+ # Expose as A2A Server
1650
+ a2a = A2A(agent=agent, url="http://localhost:8000/a2a")
1651
+
1652
+ app = FastAPI()
1653
+ app.include_router(a2a.get_router())
1654
+
1655
+ # Run: uvicorn app:app --reload
1656
+ # Agent Card: GET /.well-known/agent.json
1657
+ # Status: GET /status
1658
+ ```
1659
+
1660
+ #### A2A Features
1661
+ | Feature | Description |
1662
+ |---------|-------------|
1663
+ | Agent Card | JSON metadata for agent discovery |
1664
+ | Skills Extraction | Auto-generate skills from tools |
1665
+ | Task Management | Stateful task lifecycle |
1666
+ | Streaming | SSE streaming for real-time updates |
1667
+
1668
+ > **Documentation**: [docs.praison.ai/a2a](https://docs.praison.ai/a2a) | **Examples**: [examples/python/a2a](https://github.com/MervinPraison/PraisonAI/tree/main/examples/python/a2a)
1669
+
1670
+ ---
1671
+
1672
+ ## 🎯 CLI / No-Code Interface
1673
+
1674
+ PraisonAI provides a powerful CLI for no-code automation and quick prototyping.
1675
+
1676
+ ### CLI Quick Reference
1677
+
1678
+ | Category | Commands |
1679
+ |----------|----------|
1680
+ | **Execution** | `praisonai`, `--auto`, `--interactive`, `--chat` |
1681
+ | **Research** | `research`, `--query-rewrite`, `--deep-research` |
1682
+ | **Planning** | `--planning`, `--planning-tools`, `--planning-reasoning` |
1683
+ | **Workflows** | `workflow run`, `workflow list`, `workflow auto` |
1684
+ | **Memory** | `memory show`, `memory add`, `memory search`, `memory clear` |
1685
+ | **Knowledge** | `knowledge add`, `knowledge query`, `knowledge list` |
1686
+ | **Sessions** | `session list`, `session resume`, `session delete` |
1687
+ | **Tools** | `tools list`, `tools info`, `tools search` |
1688
+ | **MCP** | `mcp list`, `mcp create`, `mcp enable` |
1689
+ | **Development** | `commit`, `docs`, `checkpoint`, `hooks` |
1690
+ | **Scheduling** | `schedule start`, `schedule list`, `schedule stop` |
1691
+
1692
+ ### Auto Mode
1693
+ ```bash
1694
+ pip install praisonai
1695
+ export OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxx
1696
+ praisonai --auto create a movie script about Robots in Mars
1697
+ ```
1698
+
1699
+ ### Interactive Mode CLI:
1700
+ ```bash
1701
+ # Start interactive terminal mode (inspired by Gemini CLI, Codex CLI, Claude Code)
1702
+ praisonai --interactive
1703
+ praisonai -i
1704
+
1705
+ # Features:
1706
+ # - Streaming responses (no boxes)
1707
+ # - Built-in tools: read_file, write_file, list_files, execute_command, internet_search
1708
+ # - Slash commands: /help, /exit, /tools, /clear
1709
+
1710
+ # Chat mode - single prompt with interactive style (for testing/scripting)
1711
+ # Use --chat (or --chat-mode for backward compatibility)
1712
+ praisonai "list files in current folder" --chat
1713
+ praisonai "search the web for AI news" --chat
1714
+ praisonai "read README.md" --chat
1715
+ ```
1716
+
1717
+ ### Chat UI (Web Interface):
1718
+ ```bash
1719
+ # Start web-based Chainlit chat interface (requires praisonai[chat])
1720
+ pip install "praisonai[chat]"
1721
+ praisonai chat
1722
+ # Opens browser at http://localhost:8084
1723
+ ```
1724
+
1725
+ ### Query Rewriting (works with any command):
1726
+ ```bash
1727
+ # Rewrite query for better results (uses QueryRewriterAgent)
1728
+ praisonai "AI trends" --query-rewrite
1729
+
1730
+ # Rewrite with search tools (agent decides when to search)
1731
+ praisonai "latest developments" --query-rewrite --rewrite-tools "internet_search"
1732
+
1733
+ # Works with any prompt
1734
+ praisonai "explain quantum computing" --query-rewrite -v
1735
+ ```
1736
+
1737
+ ### Deep Research CLI:
1738
+ ```bash
1739
+ # Default: OpenAI (o4-mini-deep-research)
1740
+ praisonai research "What are the latest AI trends in 2025?"
1741
+
1742
+ # Use Gemini
1743
+ praisonai research --model deep-research-pro "Your research query"
1744
+
1745
+ # Rewrite query before research
1746
+ praisonai research --query-rewrite "AI trends"
1747
+
1748
+ # Rewrite with search tools
1749
+ praisonai research --query-rewrite --rewrite-tools "internet_search" "AI trends"
1750
+
1751
+ # Use custom tools from file (gathers context before deep research)
1752
+ praisonai research --tools tools.py "Your research query"
1753
+ praisonai research -t my_tools.py "Your research query"
1754
+
1755
+ # Use built-in tools by name (comma-separated)
1756
+ praisonai research --tools "internet_search,wiki_search" "Your query"
1757
+ praisonai research -t "yfinance,calculator_tools" "Stock analysis query"
1758
+
1759
+ # Save output to file (output/research/{query}.md)
1760
+ praisonai research --save "Your research query"
1761
+ praisonai research -s "Your research query"
1762
+
1763
+ # Combine options
1764
+ praisonai research --query-rewrite --tools tools.py --save "Your research query"
1765
+
1766
+ # Verbose mode (show debug logs)
1767
+ praisonai research -v "Your research query"
1768
+ ```
1769
+
1770
+ ### Planning Mode CLI:
1771
+ ```bash
1772
+ # Enable planning mode - agent creates a plan before execution
1773
+ praisonai "Research AI trends and write a summary" --planning
1774
+
1775
+ # Planning with tools for research
1776
+ praisonai "Analyze market trends" --planning --planning-tools tools.py
1777
+
1778
+ # Planning with chain-of-thought reasoning
1779
+ praisonai "Complex analysis task" --planning --planning-reasoning
1780
+
1781
+ # Auto-approve plans without confirmation
1782
+ praisonai "Task" --planning --auto-approve-plan
1783
+ ```
1784
+
1785
+ ### Tool Approval CLI:
1786
+ ```bash
1787
+ # Auto-approve ALL tool executions (use with caution!)
1788
+ praisonai "run ls command" --trust
1789
+
1790
+ # Auto-approve tools up to a risk level (prompt for higher)
1791
+ # Levels: low, medium, high, critical
1792
+ praisonai "write to file" --approve-level high # Prompts for critical tools only
1793
+ praisonai "task" --approve-level medium # Prompts for high and critical
1794
+
1795
+ # Default behavior (no flags): prompts for all dangerous tools
1796
+ praisonai "run shell command" # Will prompt for approval
1797
+ ```
1798
+
1799
+ ### Memory CLI:
1800
+ ```bash
1801
+ # Enable memory for agent (persists across sessions)
1802
+ praisonai "My name is John" --memory
1803
+
1804
+ # Memory with user isolation
1805
+ praisonai "Remember my preferences" --memory --user-id user123
1806
+
1807
+ # Memory management commands
1808
+ praisonai memory show # Show memory statistics
1809
+ praisonai memory add "User prefers Python" # Add to long-term memory
1810
+ praisonai memory search "Python" # Search memories
1811
+ praisonai memory clear # Clear short-term memory
1812
+ praisonai memory clear all # Clear all memory
1813
+ praisonai memory save my_session # Save session
1814
+ praisonai memory resume my_session # Resume session
1815
+ praisonai memory sessions # List saved sessions
1816
+ praisonai memory checkpoint # Create checkpoint
1817
+ praisonai memory restore <checkpoint_id> # Restore checkpoint
1818
+ praisonai memory checkpoints # List checkpoints
1819
+ praisonai memory help # Show all commands
1820
+ ```
1821
+
1822
+ ### Rules CLI:
1823
+ ```bash
1824
+ # List all loaded rules (from PRAISON.md, CLAUDE.md, etc.)
1825
+ praisonai rules list
1826
+
1827
+ # Show specific rule details
1828
+ praisonai rules show <rule_name>
1829
+
1830
+ # Create a new rule
1831
+ praisonai rules create my_rule "Always use type hints"
1832
+
1833
+ # Delete a rule
1834
+ praisonai rules delete my_rule
1835
+
1836
+ # Show rules statistics
1837
+ praisonai rules stats
1838
+
1839
+ # Include manual rules with prompts
1840
+ praisonai "Task" --include-rules security,testing
1841
+ ```
1842
+
1843
+ ### Workflow CLI:
1844
+ ```bash
1845
+ # List available workflows
1846
+ praisonai workflow list
1847
+
1848
+ # Execute a workflow with tools and save output
1849
+ praisonai workflow run "Research Blog" --tools tavily --save
1850
+
1851
+ # Execute with variables
1852
+ praisonai workflow run deploy --workflow-var environment=staging --workflow-var branch=main
1853
+
1854
+ # Execute with planning mode (AI creates sub-steps for each workflow step)
1855
+ praisonai workflow run "Research Blog" --planning --verbose
1856
+
1857
+ # Execute with reasoning mode (chain-of-thought)
1858
+ praisonai workflow run "Analysis" --reasoning --verbose
1859
+
1860
+ # Execute with memory enabled
1861
+ praisonai workflow run "Research" --memory
1862
+
1863
+ # Show workflow details
1864
+ praisonai workflow show deploy
1865
+
1866
+ # Create a new workflow template
1867
+ praisonai workflow create my_workflow
1868
+
1869
+ # Inline workflow (no template file needed)
1870
+ praisonai "What is AI?" --workflow "Research,Summarize" --save
1871
+
1872
+ # Inline workflow with step actions
1873
+ praisonai "GPT-5" --workflow "Research:Search for info,Write:Write blog" --tools tavily
1874
+
1875
+ # Workflow CLI help
1876
+ praisonai workflow help
1877
+ ```
1878
+
1879
+ #### YAML Workflow Files:
1880
+ ```bash
1881
+ # Run a YAML workflow file
1882
+ praisonai workflow run research.yaml
1883
+
1884
+ # Run with variables
1885
+ praisonai workflow run research.yaml --var topic="AI trends"
1886
+
1887
+ # Validate a YAML workflow
1888
+ praisonai workflow validate research.yaml
1889
+
1890
+ # Create from template (simple, routing, parallel, loop, evaluator-optimizer)
1891
+ praisonai workflow template routing --output my_workflow.yaml
1892
+ ```
1893
+
1894
+ #### Auto-Generate Workflows:
1895
+ ```bash
1896
+ # Auto-generate a sequential workflow from topic
1897
+ praisonai workflow auto "Research AI trends"
1898
+
1899
+ # Generate parallel workflow (multiple agents work concurrently)
1900
+ praisonai workflow auto "Research AI trends" --pattern parallel
1901
+
1902
+ # Generate routing workflow (classifier routes to specialists)
1903
+ praisonai workflow auto "Build a chatbot" --pattern routing
1904
+
1905
+ # Generate orchestrator-workers workflow (central orchestrator delegates)
1906
+ praisonai workflow auto "Comprehensive market analysis" --pattern orchestrator-workers
1907
+
1908
+ # Generate evaluator-optimizer workflow (iterative refinement)
1909
+ praisonai workflow auto "Write and refine article" --pattern evaluator-optimizer
1910
+
1911
+ # Specify output file
1912
+ praisonai workflow auto "Build a chatbot" --pattern routing
1913
+
1914
+ # Specify output file
1915
+ praisonai workflow auto "Research AI" --pattern sequential --output my_workflow.yaml
1916
+ ```
1917
+
1918
+ **Workflow CLI Options:**
1919
+ | Flag | Description |
1920
+ |------|-------------|
1921
+ | `--workflow-var key=value` | Set workflow variable (can be repeated) |
1922
+ | `--var key=value` | Set variable for YAML workflows |
1923
+ | `--pattern <pattern>` | Pattern for auto-generation (sequential, parallel, routing, loop, orchestrator-workers, evaluator-optimizer) |
1924
+ | `--output <file>` | Output file for auto-generation |
1925
+ | `--llm <model>` | LLM model (e.g., openai/gpt-4o-mini) |
1926
+ | `--tools <tools>` | Tools (comma-separated, e.g., tavily) |
1927
+ | `--planning` | Enable planning mode |
1928
+ | `--reasoning` | Enable reasoning mode |
1929
+ | `--memory` | Enable memory |
1930
+ | `--verbose` | Enable verbose output |
1931
+ | `--save` | Save output to file |
1932
+
1933
+ ### Hooks CLI:
1934
+ ```bash
1935
+ # List configured hooks
1936
+ praisonai hooks list
1937
+
1938
+ # Show hooks statistics
1939
+ praisonai hooks stats
1940
+
1941
+ # Create hooks.json template
1942
+ praisonai hooks init
1943
+ ```
1944
+
1945
+ ### Claude Memory Tool CLI:
1946
+ ```bash
1947
+ # Enable Claude Memory Tool (Anthropic models only)
1948
+ praisonai "Research and remember findings" --claude-memory --llm anthropic/claude-sonnet-4-20250514
1949
+ ```
1950
+
1951
+ ### Guardrail CLI:
1952
+ ```bash
1953
+ # Validate output with LLM guardrail
1954
+ praisonai "Write code" --guardrail "Ensure code is secure and follows best practices"
1955
+
1956
+ # Combine with other flags
1957
+ praisonai "Generate SQL query" --guardrail "No DROP or DELETE statements" --save
1958
+ ```
1959
+
1960
+ ### Metrics CLI:
1961
+ ```bash
1962
+ # Display token usage and cost metrics
1963
+ praisonai "Analyze this data" --metrics
1964
+
1965
+ # Combine with other features
1966
+ praisonai "Complex task" --metrics --planning
1967
+ ```
1968
+
1969
+ ### Scheduler CLI:
1970
+
1971
+ ```bash
1972
+ praisonai schedule start <name> "task" --interval hourly
1973
+ praisonai schedule list
1974
+ praisonai schedule logs <name> [--follow]
1975
+ praisonai schedule stop <name>
1976
+ praisonai schedule restart <name>
1977
+ praisonai schedule delete <name>
1978
+ praisonai schedule describe <name>
1979
+ praisonai schedule save <name> [file.yaml]
1980
+ praisonai schedule "task" --interval hourly # foreground mode
1981
+ praisonai schedule agents.yaml # foreground mode
1982
+ ```
1983
+
1984
+ ### Image Processing CLI:
1985
+ ```bash
1986
+ # Process images with vision-based tasks
1987
+ praisonai "Describe this image" --image path/to/image.png
1988
+
1989
+ # Analyze image content
1990
+ praisonai "What objects are in this photo?" --image photo.jpg --llm openai/gpt-4o
1991
+ ```
1992
+
1993
+ ### Telemetry CLI:
1994
+ ```bash
1995
+ # Enable usage monitoring and analytics
1996
+ praisonai "Task" --telemetry
1997
+
1998
+ # Combine with metrics for full observability
1999
+ praisonai "Complex analysis" --telemetry --metrics
2000
+ ```
2001
+
2002
+ ### MCP (Model Context Protocol) CLI:
2003
+ ```bash
2004
+ # Use MCP server tools
2005
+ praisonai "Search files" --mcp "npx -y @modelcontextprotocol/server-filesystem ."
2006
+
2007
+ # MCP with environment variables
2008
+ praisonai "Search web" --mcp "npx -y @modelcontextprotocol/server-brave-search" --mcp-env "BRAVE_API_KEY=your_key"
2009
+
2010
+ # Multiple MCP options
2011
+ praisonai "Task" --mcp "npx server" --mcp-env "KEY1=value1,KEY2=value2"
2012
+ ```
2013
+
2014
+ ### Fast Context CLI:
2015
+ ```bash
2016
+ # Search codebase for relevant context
2017
+ praisonai "Find authentication code" --fast-context ./src
2018
+
2019
+ # Add code context to any task
2020
+ praisonai "Explain this function" --fast-context /path/to/project
2021
+ ```
2022
+
2023
+ ### Knowledge CLI:
2024
+ ```bash
2025
+ # Add documents to knowledge base
2026
+ praisonai knowledge add document.pdf
2027
+ praisonai knowledge add ./docs/
2028
+
2029
+ # Search knowledge base
2030
+ praisonai knowledge search "API authentication"
2031
+
2032
+ # List indexed documents
2033
+ praisonai knowledge list
2034
+
2035
+ # Clear knowledge base
2036
+ praisonai knowledge clear
2037
+
2038
+ # Show knowledge base info
2039
+ praisonai knowledge info
2040
+
2041
+ # Show all commands
2042
+ praisonai knowledge help
2043
+ ```
2044
+
2045
+ ### Session CLI:
2046
+ ```bash
2047
+ # List all saved sessions
2048
+ praisonai session list
2049
+
2050
+ # Show session details
2051
+ praisonai session show my-project
2052
+
2053
+ # Resume a session (load into memory)
2054
+ praisonai session resume my-project
2055
+
2056
+ # Delete a session
2057
+ praisonai session delete my-project
2058
+
2059
+ # Auto-save session after each run
2060
+ praisonai "Analyze this code" --auto-save my-project
2061
+
2062
+ # Load history from last N sessions into context
2063
+ praisonai "Continue our discussion" --history 5
2064
+ ```
2065
+
2066
+ ### Session Management (Python):
2067
+ ```python
2068
+ from praisonaiagents import Agent
2069
+
2070
+ # Auto-save session after each run
2071
+ agent = Agent(
2072
+ name="Assistant",
2073
+ memory=True,
2074
+ auto_save="my-project"
2075
+ )
2076
+
2077
+ # Load history from last 5 sessions
2078
+ agent = Agent(
2079
+ name="Assistant",
2080
+ memory=True,
2081
+ history_in_context=5
2082
+ )
2083
+ ```
2084
+
2085
+ ### Workflow Checkpoints:
2086
+ ```python
2087
+ from praisonaiagents.memory.workflows import WorkflowManager
2088
+
2089
+ manager = WorkflowManager()
2090
+
2091
+ # Save checkpoint after each step
2092
+ result = manager.execute("deploy", checkpoint="deploy-v1")
2093
+
2094
+ # Resume from checkpoint
2095
+ result = manager.execute("deploy", resume="deploy-v1")
2096
+
2097
+ # List/delete checkpoints
2098
+ manager.list_checkpoints()
2099
+ manager.delete_checkpoint("deploy-v1")
2100
+ ```
2101
+
2102
+ ### Tools CLI:
2103
+ ```bash
2104
+ praisonai tools list
2105
+ praisonai tools info internet_search
2106
+ praisonai tools search "web"
2107
+ praisonai tools doctor
2108
+ praisonai tools resolve shell_tool
2109
+ praisonai tools discover
2110
+ praisonai tools show-sources
2111
+ praisonai tools show-sources --template ai-video-editor
2112
+ ```
2113
+
2114
+ | Command | Example | Docs |
2115
+ |---------|---------|------|
2116
+ | `tools list` | [example](examples/tools/) | [docs](https://docs.praison.ai/docs/cli/tools) |
2117
+ | `tools resolve` | [example](examples/tools/example_tools_resolve.py) | [docs](https://docs.praison.ai/docs/cli/tools-resolve) |
2118
+ | `tools discover` | [example](examples/tools/example_tools_discover.py) | [docs](https://docs.praison.ai/docs/cli/tools-discover) |
2119
+ | `tools show-sources` | [example](examples/tools/example_tools_sources.py) | [docs](https://docs.praison.ai/docs/cli/tools-show-sources) |
2120
+
2121
+ ### Handoff CLI:
2122
+ ```bash
2123
+ # Enable agent-to-agent task delegation
2124
+ praisonai "Research and write article" --handoff "researcher,writer,editor"
2125
+
2126
+ # Complex multi-agent workflow
2127
+ praisonai "Analyze data and create report" --handoff "analyst,visualizer,writer"
2128
+ ```
2129
+
2130
+ ### Auto Memory CLI:
2131
+ ```bash
2132
+ # Enable automatic memory extraction
2133
+ praisonai "Learn about user preferences" --auto-memory
2134
+
2135
+ # Combine with user isolation
2136
+ praisonai "Remember my settings" --auto-memory --user-id user123
2137
+ ```
2138
+
2139
+ ### Todo CLI:
2140
+ ```bash
2141
+ # Generate todo list from task
2142
+ praisonai "Plan the project" --todo
2143
+
2144
+ # Add a todo item
2145
+ praisonai todo add "Implement feature X"
2146
+
2147
+ # List all todos
2148
+ praisonai todo list
2149
+
2150
+ # Complete a todo
2151
+ praisonai todo complete 1
2152
+
2153
+ # Delete a todo
2154
+ praisonai todo delete 1
2155
+
2156
+ # Clear all todos
2157
+ praisonai todo clear
2158
+
2159
+ # Show all commands
2160
+ praisonai todo help
2161
+ ```
2162
+
2163
+ ### Router CLI:
2164
+ ```bash
2165
+ # Auto-select best model based on task complexity
2166
+ praisonai "Simple question" --router
2167
+
2168
+ # Specify preferred provider
2169
+ praisonai "Complex analysis" --router --router-provider anthropic
2170
+
2171
+ # Router automatically selects:
2172
+ # - Simple tasks → gpt-4o-mini, claude-3-haiku
2173
+ # - Complex tasks → gpt-4-turbo, claude-3-opus
2174
+
2175
+ # Create workflow with model routing template
2176
+ praisonai workflow create --template model-routing --output my_workflow.yaml
2177
+ ```
2178
+
2179
+ Custom models can be configured in `agents.yaml`. See [Model Router Docs](https://docs.praison.ai/features/model-router) for details.
2180
+
2181
+ ### Flow Display CLI:
2182
+ ```bash
2183
+ # Enable visual workflow tracking
2184
+ praisonai agents.yaml --flow-display
2185
+
2186
+ # Combine with other features
2187
+ praisonai "Multi-step task" --planning --flow-display
2188
+ ```
2189
+
2190
+ ### Docs CLI:
2191
+ ```bash
2192
+ # List all project docs
2193
+ praisonai docs list
2194
+
2195
+ # Create a new doc
2196
+ praisonai docs create project-overview "This project is a Python web app..."
2197
+
2198
+ # Show a specific doc
2199
+ praisonai docs show project-overview
2200
+
2201
+ # Delete a doc
2202
+ praisonai docs delete old-doc
2203
+
2204
+ # Show all commands
2205
+ praisonai docs help
2206
+ ```
2207
+
2208
+ ### MCP Config CLI:
2209
+ ```bash
2210
+ # List all MCP configurations
2211
+ praisonai mcp list
2212
+
2213
+ # Create a new MCP config
2214
+ praisonai mcp create filesystem npx -y @modelcontextprotocol/server-filesystem .
2215
+
2216
+ # Show a specific config
2217
+ praisonai mcp show filesystem
2218
+
2219
+ # Enable/disable a config
2220
+ praisonai mcp enable filesystem
2221
+ praisonai mcp disable filesystem
2222
+
2223
+ # Delete a config
2224
+ praisonai mcp delete filesystem
2225
+
2226
+ # Show all commands
2227
+ praisonai mcp help
2228
+ ```
2229
+
2230
+ ### AI Commit CLI:
2231
+ ```bash
2232
+ # Full auto mode: stage all, security check, commit, and push
2233
+ praisonai commit -a
2234
+
2235
+ # Interactive mode (requires git add first)
2236
+ praisonai commit
2237
+
2238
+ # Interactive with auto-push
2239
+ praisonai commit --push
2240
+
2241
+ # Skip security check (not recommended)
2242
+ praisonai commit -a --no-verify
2243
+ ```
2244
+
2245
+ **Features:**
2246
+ - 🤖 AI-generated conventional commit messages
2247
+ - 🔒 Built-in security scanning (API keys, passwords, secrets, sensitive files)
2248
+ - 📦 Auto-staging with `-a` flag
2249
+ - 🚀 Auto-push in full auto mode
2250
+ - ✏️ Edit message before commit in interactive mode
2251
+
2252
+ **Security Detection:**
2253
+ - API keys, secrets, tokens (AWS, GitHub, GitLab, Slack)
2254
+ - Passwords and private keys
2255
+ - Sensitive files (`.env`, `id_rsa`, `.pem`, `.key`, etc.)
2256
+
2257
+ ### Serve CLI (API Server):
2258
+ ```bash
2259
+ # Start API server for agents defined in YAML
2260
+ praisonai serve agents.yaml
2261
+
2262
+ # With custom port and host
2263
+ praisonai serve agents.yaml --port 8005 --host 0.0.0.0
2264
+
2265
+ # Alternative flag style
2266
+ praisonai agents.yaml --serve
2267
+
2268
+ # The server provides:
2269
+ # POST /agents - Run all agents sequentially
2270
+ # POST /agents/{name} - Run specific agent (e.g., /agents/researcher)
2271
+ # GET /agents/list - List available agents
2272
+ ```
2273
+
2274
+ ### n8n Integration CLI:
2275
+ ```bash
2276
+ # Export workflow to n8n and open in browser
2277
+ praisonai agents.yaml --n8n
2278
+
2279
+ # With custom n8n URL
2280
+ praisonai agents.yaml --n8n --n8n-url http://localhost:5678
2281
+
2282
+ # Set N8N_API_KEY for auto-import
2283
+ export N8N_API_KEY="your-api-key"
2284
+ praisonai agents.yaml --n8n
2285
+ ```
2286
+
2287
+ ### External Agents CLI:
2288
+
2289
+ Use external AI coding CLI tools (Claude Code, Gemini CLI, Codex CLI, Cursor CLI) as agent tools:
2290
+
2291
+ ```bash
2292
+ # Use Claude Code for coding tasks
2293
+ praisonai "Refactor the auth module" --external-agent claude
2294
+
2295
+ # Use Gemini CLI for code analysis
2296
+ praisonai "Analyze codebase architecture" --external-agent gemini
2297
+
2298
+ # Use OpenAI Codex CLI
2299
+ praisonai "Fix all bugs in src/" --external-agent codex
2300
+
2301
+ # Use Cursor CLI
2302
+ praisonai "Add comprehensive tests" --external-agent cursor
2303
+ ```
2304
+
2305
+ **Python API:**
2306
+ ```python
2307
+ from praisonai.integrations import (
2308
+ ClaudeCodeIntegration,
2309
+ GeminiCLIIntegration,
2310
+ CodexCLIIntegration,
2311
+ CursorCLIIntegration
2312
+ )
2313
+
2314
+ # Create integration
2315
+ claude = ClaudeCodeIntegration(workspace="/project")
2316
+
2317
+ # Execute a coding task
2318
+ result = await claude.execute("Refactor the auth module")
2319
+
2320
+ # Use as agent tool
2321
+ from praisonai import Agent
2322
+ tool = claude.as_tool()
2323
+ agent = Agent(tools=[tool])
2324
+ ```
2325
+
2326
+ **Environment Variables:**
2327
+ ```bash
2328
+ export ANTHROPIC_API_KEY=your-key # Claude Code
2329
+ export GEMINI_API_KEY=your-key # Gemini CLI
2330
+ export OPENAI_API_KEY=your-key # Codex CLI
2331
+ export CURSOR_API_KEY=your-key # Cursor CLI
2332
+ ```
2333
+
2334
+ See [External Agents Documentation](https://docs.praison.ai/code/external-agents) for more details.
2335
+
2336
+ ### @Mentions in Prompts:
2337
+ ```bash
2338
+ # Include file content in prompt
2339
+ praisonai "@file:src/main.py explain this code"
2340
+
2341
+ # Include project doc
2342
+ praisonai "@doc:project-overview help me add a feature"
2343
+
2344
+ # Search the web
2345
+ praisonai "@web:python best practices give me tips"
2346
+
2347
+ # Fetch URL content
2348
+ praisonai "@url:https://docs.python.org summarize this"
2349
+
2350
+ # Combine multiple mentions
2351
+ praisonai "@file:main.py @doc:coding-standards review this code"
2352
+ ```
2353
+
2354
+ ## Prompt Expansion
2355
+
2356
+ Expand short prompts into detailed, actionable prompts:
2357
+
2358
+ ### CLI Usage
2359
+ ```bash
2360
+ # Expand a short prompt into detailed prompt
2361
+ praisonai "write a movie script in 3 lines" --expand-prompt
2362
+
2363
+ # With verbose output
2364
+ praisonai "blog about AI" --expand-prompt -v
2365
+
2366
+ # With tools for context gathering
2367
+ praisonai "latest AI trends" --expand-prompt --expand-tools tools.py
2368
+
2369
+ # Combine with query rewrite
2370
+ praisonai "AI news" --query-rewrite --expand-prompt
2371
+ ```
2372
+
2373
+ ### Programmatic Usage
2374
+ ```python
2375
+ from praisonaiagents import PromptExpanderAgent, ExpandStrategy
2376
+
2377
+ # Basic usage
2378
+ agent = PromptExpanderAgent()
2379
+ result = agent.expand("write a movie script in 3 lines")
2380
+ print(result.expanded_prompt)
2381
+
2382
+ # With specific strategy
2383
+ result = agent.expand("blog about AI", strategy=ExpandStrategy.DETAILED)
2384
+
2385
+ # Available strategies: BASIC, DETAILED, STRUCTURED, CREATIVE, AUTO
2386
+ ```
2387
+
2388
+ **Key Difference:**
2389
+ - `--query-rewrite`: Optimizes queries for search/retrieval (RAG)
2390
+ - `--expand-prompt`: Expands prompts for detailed task execution
2391
+
2392
+ ## Web Search, Web Fetch & Prompt Caching
2393
+
2394
+ ### CLI Usage
2395
+ ```bash
2396
+ # Web Search - Get real-time information
2397
+ praisonai "What are the latest AI news today?" --web-search --llm openai/gpt-4o-search-preview
2398
+
2399
+ # Web Fetch - Retrieve and analyze URL content (Anthropic only)
2400
+ praisonai "Summarize https://docs.praison.ai" --web-fetch --llm anthropic/claude-sonnet-4-20250514
2401
+
2402
+ # Prompt Caching - Reduce costs for repeated prompts
2403
+ praisonai "Analyze this document..." --prompt-caching --llm anthropic/claude-sonnet-4-20250514
2404
+ ```
2405
+
2406
+ ### Programmatic Usage
2407
+ ```python
2408
+ from praisonaiagents import Agent
2409
+
2410
+ # Web Search
2411
+ agent = Agent(
2412
+ instructions="You are a research assistant",
2413
+ llm="openai/gpt-4o-search-preview",
2414
+ web_search=True
2415
+ )
2416
+
2417
+ # Web Fetch (Anthropic only)
2418
+ agent = Agent(
2419
+ instructions="You are a content analyzer",
2420
+ llm="anthropic/claude-sonnet-4-20250514",
2421
+ web_fetch=True
2422
+ )
2423
+
2424
+ # Prompt Caching
2425
+ agent = Agent(
2426
+ instructions="You are an AI assistant..." * 50, # Long system prompt
2427
+ llm="anthropic/claude-sonnet-4-20250514",
2428
+ prompt_caching=True
2429
+ )
2430
+ ```
2431
+
2432
+ **Supported Providers:**
2433
+ | Feature | Providers |
2434
+ |---------|----------|
2435
+ | Web Search | OpenAI, Gemini, Anthropic, xAI, Perplexity |
2436
+ | Web Fetch | Anthropic |
2437
+ | Prompt Caching | OpenAI (auto), Anthropic, Bedrock, Deepseek |
2438
+
2439
+ ## CLI Features
2440
+
2441
+ | Feature | Docs |
2442
+ |---------|:----:|
2443
+ | 🔄 Query Rewrite - RAG optimization | [📖](https://docs.praison.ai/docs/cli/query-rewrite) |
2444
+ | 🔬 Deep Research - Automated research | [📖](https://docs.praison.ai/docs/cli/deep-research) |
2445
+ | 📋 Planning - Step-by-step execution | [📖](https://docs.praison.ai/docs/cli/planning) |
2446
+ | 💾 Memory - Persistent agent memory | [📖](https://docs.praison.ai/docs/cli/memory) |
2447
+ | 📜 Rules - Auto-discovered instructions | [📖](https://docs.praison.ai/docs/cli/rules) |
2448
+ | 🔄 Workflow - Multi-step workflows | [📖](https://docs.praison.ai/docs/cli/workflow) |
2449
+ | 🪝 Hooks - Event-driven actions | [📖](https://docs.praison.ai/docs/cli/hooks) |
2450
+ | 🧠 Claude Memory - Anthropic memory tool | [📖](https://docs.praison.ai/docs/cli/claude-memory) |
2451
+ | 🛡️ Guardrail - Output validation | [📖](https://docs.praison.ai/docs/cli/guardrail) |
2452
+ | 📊 Metrics - Token usage tracking | [📖](https://docs.praison.ai/docs/cli/metrics) |
2453
+ | 🖼️ Image - Vision processing | [📖](https://docs.praison.ai/docs/cli/image) |
2454
+ | 📡 Telemetry - Usage monitoring | [📖](https://docs.praison.ai/docs/cli/telemetry) |
2455
+ | 🔌 MCP - Model Context Protocol | [📖](https://docs.praison.ai/docs/cli/mcp) |
2456
+ | ⚡ Fast Context - Codebase search | [📖](https://docs.praison.ai/docs/cli/fast-context) |
2457
+ | 📚 Knowledge - RAG management | [📖](https://docs.praison.ai/docs/cli/knowledge) |
2458
+ | 💬 Session - Conversation management | [📖](https://docs.praison.ai/docs/cli/session) |
2459
+ | 🔧 Tools - Tool discovery | [📖](https://docs.praison.ai/docs/cli/tools) |
2460
+ | 🤝 Handoff - Agent delegation | [📖](https://docs.praison.ai/docs/cli/handoff) |
2461
+ | 🧠 Auto Memory - Memory extraction | [📖](https://docs.praison.ai/docs/cli/auto-memory) |
2462
+ | 📋 Todo - Task management | [📖](https://docs.praison.ai/docs/cli/todo) |
2463
+ | 🎯 Router - Smart model selection | [📖](https://docs.praison.ai/docs/cli/router) |
2464
+ | 📈 Flow Display - Visual workflow | [📖](https://docs.praison.ai/docs/cli/flow-display) |
2465
+ | ✨ Prompt Expansion - Detailed prompts | [📖](https://docs.praison.ai/docs/cli/prompt-expansion) |
2466
+ | 🌐 Web Search - Real-time search | [📖](https://docs.praison.ai/docs/cli/web-search) |
2467
+ | 📥 Web Fetch - URL content retrieval | [📖](https://docs.praison.ai/docs/cli/web-fetch) |
2468
+ | 💾 Prompt Caching - Cost reduction | [📖](https://docs.praison.ai/docs/cli/prompt-caching) |
2469
+ | 📦 Template Catalog - Browse & discover templates | [📖](https://docs.praison.ai/docs/cli/template-catalog) |
2470
+
2471
+ ### Template Catalog CLI
2472
+
2473
+ | Command | Description |
2474
+ |---------|-------------|
2475
+ | `praisonai templates browse` | Open template catalog in browser |
2476
+ | `praisonai templates browse --print` | Print catalog URL only |
2477
+ | `praisonai templates validate` | Validate template YAML files |
2478
+ | `praisonai templates validate --source <dir>` | Validate specific directory |
2479
+ | `praisonai templates validate --strict` | Strict validation mode |
2480
+ | `praisonai templates validate --json` | JSON output format |
2481
+ | `praisonai templates catalog build` | Build catalog locally |
2482
+ | `praisonai templates catalog build --out <dir>` | Build to specific directory |
2483
+ | `praisonai templates catalog sync` | Sync template sources |
2484
+ | `praisonai templates catalog sync --source <name>` | Sync specific source |
2485
+
2486
+ **Examples:** [examples/catalog/](examples/catalog/) | **Docs:** [Code](https://docs.praison.ai/docs/cli/template-catalog-code) | [CLI](https://docs.praison.ai/docs/cli/template-catalog)
2487
+
2488
+ ---
2489
+
2490
+ ## 💻 Using JavaScript Code
2491
+
2492
+ ```bash
2493
+ npm install praisonai
2494
+ export OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxx
2495
+ ```
2496
+
2497
+ ```javascript
2498
+ const { Agent } = require('praisonai');
2499
+ const agent = new Agent({ instructions: 'You are a helpful AI assistant' });
2500
+ agent.start('Write a movie script about a robot in Mars');
2501
+ ```
2502
+
2503
+ ![PraisonAI CLI Demo](docs/demo/praisonai-cli-demo.gif)
2504
+
2505
+ ---
2506
+
2507
+ ## ⭐ Star History
2508
+
2509
+ [![Star History Chart](https://api.star-history.com/svg?repos=MervinPraison/PraisonAI&type=Date)](https://docs.praison.ai)
2510
+
2511
+ ---
2512
+
2513
+ ## 📊 Process Types & Patterns
2514
+
2515
+ ### AI Agents Flow
2516
+
2517
+ ```mermaid
2518
+ graph LR
2519
+ %% Define the main flow
2520
+ Start([▶ Start]) --> Agent1
2521
+ Agent1 --> Process[⚙ Process]
2522
+ Process --> Agent2
2523
+ Agent2 --> Output([✓ Output])
2524
+ Process -.-> Agent1
2525
+
2526
+ %% Define subgraphs for agents and their tasks
2527
+ subgraph Agent1[ ]
2528
+ Task1[📋 Task]
2529
+ AgentIcon1[🤖 AI Agent]
2530
+ Tools1[🔧 Tools]
2531
+
2532
+ Task1 --- AgentIcon1
2533
+ AgentIcon1 --- Tools1
2534
+ end
2535
+
2536
+ subgraph Agent2[ ]
2537
+ Task2[📋 Task]
2538
+ AgentIcon2[🤖 AI Agent]
2539
+ Tools2[🔧 Tools]
2540
+
2541
+ Task2 --- AgentIcon2
2542
+ AgentIcon2 --- Tools2
2543
+ end
2544
+
2545
+ classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
2546
+ classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
2547
+ classDef tools fill:#2E8B57,stroke:#7C90A0,color:#fff
2548
+ classDef transparent fill:none,stroke:none
2549
+
2550
+ class Start,Output,Task1,Task2 input
2551
+ class Process,AgentIcon1,AgentIcon2 process
2552
+ class Tools1,Tools2 tools
2553
+ class Agent1,Agent2 transparent
2554
+ ```
2555
+
2556
+ ## AI Agents with Tools
2557
+
2558
+ Create AI agents that can use tools to interact with external systems and perform actions.
2559
+
2560
+ ```mermaid
2561
+ flowchart TB
2562
+ subgraph Tools
2563
+ direction TB
2564
+ T3[Internet Search]
2565
+ T1[Code Execution]
2566
+ T2[Formatting]
2567
+ end
2568
+
2569
+ Input[Input] ---> Agents
2570
+ subgraph Agents
2571
+ direction LR
2572
+ A1[Agent 1]
2573
+ A2[Agent 2]
2574
+ A3[Agent 3]
2575
+ end
2576
+ Agents ---> Output[Output]
2577
+
2578
+ T3 --> A1
2579
+ T1 --> A2
2580
+ T2 --> A3
2581
+
2582
+ style Tools fill:#189AB4,color:#fff
2583
+ style Agents fill:#8B0000,color:#fff
2584
+ style Input fill:#8B0000,color:#fff
2585
+ style Output fill:#8B0000,color:#fff
2586
+ ```
2587
+
2588
+ ## AI Agents with Memory
2589
+
2590
+ Create AI agents with memory capabilities for maintaining context and information across tasks.
2591
+
2592
+ ```mermaid
2593
+ flowchart TB
2594
+ subgraph Memory
2595
+ direction TB
2596
+ STM[Short Term]
2597
+ LTM[Long Term]
2598
+ end
2599
+
2600
+ subgraph Store
2601
+ direction TB
2602
+ DB[(Vector DB)]
2603
+ end
2604
+
2605
+ Input[Input] ---> Agents
2606
+ subgraph Agents
2607
+ direction LR
2608
+ A1[Agent 1]
2609
+ A2[Agent 2]
2610
+ A3[Agent 3]
2611
+ end
2612
+ Agents ---> Output[Output]
2613
+
2614
+ Memory <--> Store
2615
+ Store <--> A1
2616
+ Store <--> A2
2617
+ Store <--> A3
2618
+
2619
+ style Memory fill:#189AB4,color:#fff
2620
+ style Store fill:#2E8B57,color:#fff
2621
+ style Agents fill:#8B0000,color:#fff
2622
+ style Input fill:#8B0000,color:#fff
2623
+ style Output fill:#8B0000,color:#fff
2624
+ ```
2625
+
2626
+ ## AI Agents with Different Processes
2627
+
2628
+ ### Sequential Process
2629
+
2630
+ The simplest form of task execution where tasks are performed one after another.
2631
+
2632
+ ```mermaid
2633
+ graph LR
2634
+ Input[Input] --> A1
2635
+ subgraph Agents
2636
+ direction LR
2637
+ A1[Agent 1] --> A2[Agent 2] --> A3[Agent 3]
2638
+ end
2639
+ A3 --> Output[Output]
2640
+
2641
+ classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
2642
+ classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
2643
+ classDef transparent fill:none,stroke:none
2644
+
2645
+ class Input,Output input
2646
+ class A1,A2,A3 process
2647
+ class Agents transparent
2648
+ ```
2649
+
2650
+ ### Hierarchical Process
2651
+
2652
+ Uses a manager agent to coordinate task execution and agent assignments.
2653
+
2654
+ ```mermaid
2655
+ graph TB
2656
+ Input[Input] --> Manager
2657
+
2658
+ subgraph Agents
2659
+ Manager[Manager Agent]
2660
+
2661
+ subgraph Workers
2662
+ direction LR
2663
+ W1[Worker 1]
2664
+ W2[Worker 2]
2665
+ W3[Worker 3]
2666
+ end
2667
+
2668
+ Manager --> W1
2669
+ Manager --> W2
2670
+ Manager --> W3
2671
+ end
2672
+
2673
+ W1 --> Manager
2674
+ W2 --> Manager
2675
+ W3 --> Manager
2676
+ Manager --> Output[Output]
2677
+
2678
+ classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
2679
+ classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
2680
+ classDef transparent fill:none,stroke:none
2681
+
2682
+ class Input,Output input
2683
+ class Manager,W1,W2,W3 process
2684
+ class Agents,Workers transparent
2685
+ ```
2686
+
2687
+ ### Workflow Process
2688
+
2689
+ Advanced process type supporting complex task relationships and conditional execution.
2690
+
2691
+ ```mermaid
2692
+ graph LR
2693
+ Input[Input] --> Start
2694
+
2695
+ subgraph Workflow
2696
+ direction LR
2697
+ Start[Start] --> C1{Condition}
2698
+ C1 --> |Yes| A1[Agent 1]
2699
+ C1 --> |No| A2[Agent 2]
2700
+ A1 --> Join
2701
+ A2 --> Join
2702
+ Join --> A3[Agent 3]
2703
+ end
2704
+
2705
+ A3 --> Output[Output]
2706
+
2707
+ classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
2708
+ classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
2709
+ classDef decision fill:#2E8B57,stroke:#7C90A0,color:#fff
2710
+ classDef transparent fill:none,stroke:none
2711
+
2712
+ class Input,Output input
2713
+ class Start,A1,A2,A3,Join process
2714
+ class C1 decision
2715
+ class Workflow transparent
2716
+ ```
2717
+
2718
+ #### Agentic Routing Workflow
2719
+
2720
+ Create AI agents that can dynamically route tasks to specialized LLM instances.
2721
+
2722
+ ```mermaid
2723
+ flowchart LR
2724
+ In[In] --> Router[LLM Call Router]
2725
+ Router --> LLM1[LLM Call 1]
2726
+ Router --> LLM2[LLM Call 2]
2727
+ Router --> LLM3[LLM Call 3]
2728
+ LLM1 --> Out[Out]
2729
+ LLM2 --> Out
2730
+ LLM3 --> Out
2731
+
2732
+ style In fill:#8B0000,color:#fff
2733
+ style Router fill:#2E8B57,color:#fff
2734
+ style LLM1 fill:#2E8B57,color:#fff
2735
+ style LLM2 fill:#2E8B57,color:#fff
2736
+ style LLM3 fill:#2E8B57,color:#fff
2737
+ style Out fill:#8B0000,color:#fff
2738
+ ```
2739
+
2740
+ #### Agentic Orchestrator Worker
2741
+
2742
+ Create AI agents that orchestrate and distribute tasks among specialized workers.
2743
+
2744
+ ```mermaid
2745
+ flowchart LR
2746
+ In[In] --> Router[LLM Call Router]
2747
+ Router --> LLM1[LLM Call 1]
2748
+ Router --> LLM2[LLM Call 2]
2749
+ Router --> LLM3[LLM Call 3]
2750
+ LLM1 --> Synthesizer[Synthesizer]
2751
+ LLM2 --> Synthesizer
2752
+ LLM3 --> Synthesizer
2753
+ Synthesizer --> Out[Out]
2754
+
2755
+ style In fill:#8B0000,color:#fff
2756
+ style Router fill:#2E8B57,color:#fff
2757
+ style LLM1 fill:#2E8B57,color:#fff
2758
+ style LLM2 fill:#2E8B57,color:#fff
2759
+ style LLM3 fill:#2E8B57,color:#fff
2760
+ style Synthesizer fill:#2E8B57,color:#fff
2761
+ style Out fill:#8B0000,color:#fff
2762
+ ```
2763
+
2764
+ #### Agentic Autonomous Workflow
2765
+
2766
+ Create AI agents that can autonomously monitor, act, and adapt based on environment feedback.
2767
+
2768
+ ```mermaid
2769
+ flowchart LR
2770
+ Human[Human] <--> LLM[LLM Call]
2771
+ LLM -->|ACTION| Environment[Environment]
2772
+ Environment -->|FEEDBACK| LLM
2773
+ LLM --> Stop[Stop]
2774
+
2775
+ style Human fill:#8B0000,color:#fff
2776
+ style LLM fill:#2E8B57,color:#fff
2777
+ style Environment fill:#8B0000,color:#fff
2778
+ style Stop fill:#333,color:#fff
2779
+ ```
2780
+
2781
+ #### Agentic Parallelization
2782
+
2783
+ Create AI agents that can execute tasks in parallel for improved performance.
2784
+
2785
+ ```mermaid
2786
+ flowchart LR
2787
+ In[In] --> LLM2[LLM Call 2]
2788
+ In --> LLM1[LLM Call 1]
2789
+ In --> LLM3[LLM Call 3]
2790
+ LLM1 --> Aggregator[Aggregator]
2791
+ LLM2 --> Aggregator
2792
+ LLM3 --> Aggregator
2793
+ Aggregator --> Out[Out]
2794
+
2795
+ style In fill:#8B0000,color:#fff
2796
+ style LLM1 fill:#2E8B57,color:#fff
2797
+ style LLM2 fill:#2E8B57,color:#fff
2798
+ style LLM3 fill:#2E8B57,color:#fff
2799
+ style Aggregator fill:#fff,color:#000
2800
+ style Out fill:#8B0000,color:#fff
2801
+ ```
2802
+
2803
+ #### Agentic Prompt Chaining
2804
+
2805
+ Create AI agents with sequential prompt chaining for complex workflows.
2806
+
2807
+ ```mermaid
2808
+ flowchart LR
2809
+ In[In] --> LLM1[LLM Call 1] --> Gate{Gate}
2810
+ Gate -->|Pass| LLM2[LLM Call 2] -->|Output 2| LLM3[LLM Call 3] --> Out[Out]
2811
+ Gate -->|Fail| Exit[Exit]
2812
+
2813
+ style In fill:#8B0000,color:#fff
2814
+ style LLM1 fill:#2E8B57,color:#fff
2815
+ style LLM2 fill:#2E8B57,color:#fff
2816
+ style LLM3 fill:#2E8B57,color:#fff
2817
+ style Out fill:#8B0000,color:#fff
2818
+ style Exit fill:#8B0000,color:#fff
2819
+ ```
2820
+
2821
+ #### Agentic Evaluator Optimizer
2822
+
2823
+ Create AI agents that can generate and optimize solutions through iterative feedback.
2824
+
2825
+ ```mermaid
2826
+ flowchart LR
2827
+ In[In] --> Generator[LLM Call Generator]
2828
+ Generator -->|SOLUTION| Evaluator[LLM Call Evaluator] -->|ACCEPTED| Out[Out]
2829
+ Evaluator -->|REJECTED + FEEDBACK| Generator
2830
+
2831
+ style In fill:#8B0000,color:#fff
2832
+ style Generator fill:#2E8B57,color:#fff
2833
+ style Evaluator fill:#2E8B57,color:#fff
2834
+ style Out fill:#8B0000,color:#fff
2835
+ ```
2836
+
2837
+ #### Repetitive Agents
2838
+
2839
+ Create AI agents that can efficiently handle repetitive tasks through automated loops.
2840
+
2841
+ ```mermaid
2842
+ flowchart LR
2843
+ In[Input] --> LoopAgent[("Looping Agent")]
2844
+ LoopAgent --> Task[Task]
2845
+ Task --> |Next iteration| LoopAgent
2846
+ Task --> |Done| Out[Output]
2847
+
2848
+ style In fill:#8B0000,color:#fff
2849
+ style LoopAgent fill:#2E8B57,color:#fff,shape:circle
2850
+ style Task fill:#2E8B57,color:#fff
2851
+ style Out fill:#8B0000,color:#fff
2852
+ ```
2853
+
2854
+ ---
2855
+
2856
+ ## 🔧 Configuration & Integration
2857
+
2858
+ ### Ollama Integration
2859
+
2860
+ ```bash
2861
+ export OPENAI_BASE_URL=http://localhost:11434/v1
2862
+ ```
2863
+
2864
+ ### Groq Integration
2865
+
2866
+ Replace xxxx with Groq API KEY:
2867
+
2868
+ ```bash
2869
+ export OPENAI_API_KEY=xxxxxxxxxxx
2870
+ export OPENAI_BASE_URL=https://api.groq.com/openai/v1
2871
+ ```
2872
+
2873
+ ### 100+ Models Support
2874
+
2875
+ PraisonAI supports 100+ LLM models from various providers. Visit our [models documentation](https://docs.praison.ai/models/) for the complete list.
2876
+
2877
+ <div align="center">
2878
+ <a href="https://docs.praison.ai/models">
2879
+ <p align="center">
2880
+ <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" />
2881
+ </p>
2882
+ </a>
2883
+ </div>
2884
+
2885
+ ---
2886
+
2887
+ ## 📋 Agents Playbook
2888
+
2889
+ ### Simple Playbook Example
2890
+
2891
+ Create `agents.yaml` file and add the code below:
2892
+
2893
+ ```yaml
2894
+ framework: praisonai
2895
+ topic: Artificial Intelligence
2896
+ agents: # Canonical: use 'agents' instead of 'roles'
2897
+ screenwriter:
2898
+ instructions: "Skilled in crafting scripts with engaging dialogue about {topic}." # Canonical: use 'instructions' instead of 'backstory'
2899
+ goal: Create scripts from concepts.
2900
+ role: Screenwriter
2901
+ tasks:
2902
+ scriptwriting_task:
2903
+ description: "Develop scripts with compelling characters and dialogue about {topic}."
2904
+ expected_output: "Complete script ready for production."
2905
+ ```
2906
+
2907
+ *To run the playbook:*
2908
+ ```bash
2909
+ praisonai agents.yaml
2910
+ ```
2911
+
2912
+ ---
2913
+
2914
+ ## 🛠️ Custom Tools / Create Plugins
2915
+
2916
+ PraisonAI supports multiple ways to create and integrate custom tools (plugins) into your agents.
2917
+
2918
+ ### Using `@tool` Decorator
2919
+
2920
+ ```python
2921
+ from praisonaiagents import Agent, tool
2922
+
2923
+ @tool
2924
+ def search(query: str) -> str:
2925
+ """Search the web for information."""
2926
+ return f"Results for: {query}"
2927
+
2928
+ @tool
2929
+ def calculate(expression: str) -> float:
2930
+ """Evaluate a math expression."""
2931
+ return eval(expression)
2932
+
2933
+ agent = Agent(
2934
+ instructions="You are a helpful assistant",
2935
+ tools=[search, calculate]
2936
+ )
2937
+ agent.start("Search for AI news and calculate 15*4")
2938
+ ```
2939
+
2940
+ ### Using `BaseTool` Class
2941
+
2942
+ ```python
2943
+ from praisonaiagents import Agent, BaseTool
2944
+
2945
+ class WeatherTool(BaseTool):
2946
+ name = "weather"
2947
+ description = "Get current weather for a location"
2948
+
2949
+ def run(self, location: str) -> str:
2950
+ return f"Weather in {location}: 72°F, Sunny"
2951
+
2952
+ agent = Agent(
2953
+ instructions="You are a weather assistant",
2954
+ tools=[WeatherTool()]
2955
+ )
2956
+ agent.start("What's the weather in Paris?")
2957
+ ```
2958
+
2959
+ ### Creating a Tool Package (pip installable)
2960
+
2961
+ ```toml
2962
+ # pyproject.toml
2963
+ [project]
2964
+ name = "my-praisonai-tools"
2965
+ version = "1.0.0"
2966
+ dependencies = ["praisonaiagents"]
2967
+
2968
+ [project.entry-points."praisonaiagents.tools"]
2969
+ my_tool = "my_package:MyTool"
2970
+ ```
2971
+
2972
+ ```python
2973
+ # my_package/__init__.py
2974
+ from praisonaiagents import BaseTool
2975
+
2976
+ class MyTool(BaseTool):
2977
+ name = "my_tool"
2978
+ description = "My custom tool"
2979
+
2980
+ def run(self, param: str) -> str:
2981
+ return f"Result: {param}"
2982
+ ```
2983
+
2984
+ After `pip install`, tools are auto-discovered:
2985
+ ```python
2986
+ agent = Agent(tools=["my_tool"]) # Works automatically!
2987
+ ```
2988
+
2989
+ ---
2990
+
2991
+ ## 🧠 Memory & Context
2992
+
2993
+ 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.
2994
+
2995
+ ---
2996
+
2997
+ ## 📚 Knowledge & Retrieval (RAG)
2998
+
2999
+ PraisonAI provides a complete knowledge stack for building RAG applications with multiple vector stores, retrieval strategies, rerankers, and query modes.
3000
+
3001
+ ### Knowledge CLI Commands
3002
+
3003
+ | Command | Description |
3004
+ |---------|-------------|
3005
+ | `praisonai knowledge add <file\|dir\|url>` | Add documents to knowledge base |
3006
+ | `praisonai knowledge query <question>` | Query knowledge base with RAG |
3007
+ | `praisonai knowledge list` | List indexed documents |
3008
+ | `praisonai knowledge clear` | Clear knowledge base |
3009
+ | `praisonai knowledge stats` | Show knowledge base statistics |
3010
+
3011
+ ### Knowledge CLI Options
3012
+
3013
+ | Option | Values | Description |
3014
+ |--------|--------|-------------|
3015
+ | `--vector-store` | `memory`, `chroma`, `pinecone`, `qdrant`, `weaviate` | Vector store backend |
3016
+ | `--retrieval` | `basic`, `fusion`, `recursive`, `auto_merge` | Retrieval strategy |
3017
+ | `--reranker` | `simple`, `llm`, `cross_encoder`, `cohere` | Reranking method |
3018
+ | `--index-type` | `vector`, `keyword`, `hybrid` | Index type |
3019
+ | `--query-mode` | `default`, `sub_question`, `summarize` | Query mode |
3020
+
3021
+ ### Knowledge CLI Examples
3022
+
3023
+ ```bash
3024
+ # Add documents
3025
+ praisonai knowledge add ./docs/
3026
+ praisonai knowledge add https://example.com/page.html
3027
+ praisonai knowledge add "*.pdf"
3028
+
3029
+ # Query with advanced options
3030
+ praisonai knowledge query "How to authenticate?" --retrieval fusion --reranker llm
3031
+
3032
+ # Full advanced query
3033
+ praisonai knowledge query "authentication flow" \
3034
+ --vector-store chroma \
3035
+ --retrieval fusion \
3036
+ --reranker llm \
3037
+ --index-type hybrid \
3038
+ --query-mode sub_question
3039
+ ```
3040
+
3041
+ ### Knowledge SDK Usage
3042
+
3043
+ ```python
3044
+ from praisonaiagents import Agent, Knowledge
3045
+
3046
+ # Simple usage with Agent
3047
+ agent = Agent(
3048
+ name="Research Assistant",
3049
+ knowledge=["docs/manual.pdf", "data/faq.txt"],
3050
+ knowledge_config={
3051
+ "vector_store": {"provider": "chroma"}
3052
+ }
3053
+ )
3054
+ response = agent.chat("How do I authenticate?")
3055
+
3056
+ # Direct Knowledge usage
3057
+ knowledge = Knowledge()
3058
+ knowledge.add("document.pdf")
3059
+ results = knowledge.search("authentication", limit=5)
3060
+ ```
3061
+
3062
+ ### Knowledge Stack Features Table
3063
+
3064
+ | Feature | Description | SDK Docs | CLI Docs |
3065
+ |---------|-------------|----------|----------|
3066
+ | **Data Readers** | Load PDF, Markdown, Text, HTML, URLs | [SDK](/docs/sdk/praisonaiagents/knowledge/protocols) | [CLI](/docs/cli/knowledge) |
3067
+ | **Vector Stores** | ChromaDB, Pinecone, Qdrant, Weaviate, In-Memory | [SDK](/docs/sdk/praisonaiagents/knowledge/protocols) | [CLI](/docs/cli/knowledge) |
3068
+ | **Retrieval Strategies** | Basic, Fusion (RRF), Recursive, Auto-Merge | [SDK](/docs/sdk/praisonaiagents/knowledge/protocols) | [CLI](/docs/cli/knowledge) |
3069
+ | **Rerankers** | Simple, LLM, Cross-Encoder, Cohere | [SDK](/docs/sdk/praisonaiagents/knowledge/protocols) | [CLI](/docs/cli/knowledge) |
3070
+ | **Index Types** | Vector, Keyword (BM25), Hybrid | [SDK](/docs/sdk/praisonaiagents/knowledge/protocols) | [CLI](/docs/cli/knowledge) |
3071
+ | **Query Engines** | Default, Sub-Question, Summarize | [SDK](/docs/sdk/praisonaiagents/knowledge/protocols) | [CLI](/docs/cli/knowledge) |
3072
+
3073
+ ---
3074
+
3075
+ ## 🔬 Advanced Features
3076
+
3077
+ ### Research & Intelligence
3078
+
3079
+ - 🔬 **Deep Research Agents** - OpenAI & Gemini support for automated research
3080
+ - 🔄 **Query Rewriter Agent** - HyDE, Step-back, Multi-query strategies for RAG optimization
3081
+ - 🌐 **Native Web Search** - Real-time search via OpenAI, Gemini, Anthropic, xAI, Perplexity
3082
+ - 📥 **Web Fetch** - Retrieve full content from URLs (Anthropic)
3083
+ - 📝 **Prompt Expander Agent** - Expand short prompts into detailed instructions
3084
+
3085
+ ### Memory & Caching
3086
+
3087
+ - 💾 **Prompt Caching** - Reduce costs & latency (OpenAI, Anthropic, Bedrock, Deepseek)
3088
+ - 🧠 **Claude Memory Tool** - Persistent cross-conversation memory (Anthropic Beta)
3089
+ - 💾 **File-Based Memory** - Zero-dependency persistent memory for all agents
3090
+ - 🔍 **Built-in Search Tools** - Tavily, You.com, Exa for web search, news, content extraction
3091
+
3092
+ ### Planning & Workflows
3093
+
3094
+ - 📋 **Planning Mode** - Plan before execution for agents & multi-agent systems
3095
+ - 🔧 **Planning Tools** - Research with tools during planning phase
3096
+ - 🧠 **Planning Reasoning** - Chain-of-thought planning for complex tasks
3097
+ - ⛓️ **Prompt Chaining** - Sequential prompt workflows with conditional gates
3098
+ - 🔍 **Evaluator Optimiser** - Generate and optimize through iterative feedback
3099
+ - 👷 **Orchestrator Workers** - Distribute tasks among specialised workers
3100
+ - ⚡ **Parallelisation** - Execute tasks in parallel for improved performance
3101
+ - 🔁 **Repetitive Agents** - Handle repetitive tasks through automated loops
3102
+ - 🤖 **Autonomous Workflow** - Monitor, act, adapt based on environment feedback
3103
+
3104
+ ### Specialised Agents
3105
+
3106
+ - 🖼️ **Image Generation Agent** - Create images from text descriptions
3107
+ - 📷 **Image to Text Agent** - Extract text and descriptions from images
3108
+ - 🎬 **Video Agent** - Analyse and process video content
3109
+ - 📊 **Data Analyst Agent** - Analyse data and generate insights
3110
+ - 💰 **Finance Agent** - Financial analysis and recommendations
3111
+ - 🛒 **Shopping Agent** - Price comparison and shopping assistance
3112
+ - ⭐ **Recommendation Agent** - Personalised recommendations
3113
+ - 📖 **Wikipedia Agent** - Search and extract Wikipedia information
3114
+ - 💻 **Programming Agent** - Code development and analysis
3115
+ - 📝 **Markdown Agent** - Generate and format Markdown content
3116
+ - 🔀 **Model Router** - Smart model selection based on task complexity
3117
+
3118
+ ### MCP Protocol
3119
+
3120
+ - 🔌 **MCP Transports** - stdio, Streamable HTTP, WebSocket, SSE (Protocol 2025-11-25)
3121
+ - 🌐 **WebSocket MCP** - Real-time bidirectional connections with auto-reconnect
3122
+ - 🔐 **MCP Security** - Origin validation, DNS rebinding prevention, secure sessions
3123
+ - 🔄 **MCP Resumability** - SSE stream recovery via Last-Event-ID
3124
+
3125
+ ### A2A & A2UI Protocols
3126
+
3127
+ - 🔗 **A2A Protocol** - Agent-to-Agent communication for inter-agent collaboration
3128
+ - 🖼️ **A2UI Protocol** - Agent-to-User Interface for generating rich UIs from agents
3129
+ - 📋 **UI Templates** - ChatTemplate, ListTemplate, FormTemplate, DashboardTemplate
3130
+ - 🔧 **Surface Builder** - Fluent API for building declarative UIs
3131
+
3132
+ ### Safety & Control
3133
+
3134
+ - 🤝 **Agent Handoffs** - Transfer context between specialised agents
3135
+ - 🛡️ **Guardrails** - Input/output validation and safety checks
3136
+ - ✅ **Human Approval** - Require human confirmation for critical actions
3137
+ - 🔐 **Tool Approval CLI** - `--trust` (auto-approve all) and `--approve-level` (risk-based approval)
3138
+ - 💬 **Sessions Management** - Isolated conversation contexts
3139
+ - 🔄 **Stateful Agents** - Maintain state across interactions
3140
+
3141
+ ### Developer Tools
3142
+
3143
+ - ⚡ **Fast Context** - Rapid parallel code search (10-20x faster)
3144
+ - 📜 **Rules & Instructions** - Auto-discover CLAUDE.md, AGENTS.md, GEMINI.md
3145
+ - 🪝 **Hooks** - Pre/post operation hooks for custom logic
3146
+ - 📈 **Telemetry** - Track agent performance and usage
3147
+ - 📹 **Camera Integration** - Capture and analyse camera input
3148
+
3149
+ ### Other Features
3150
+
3151
+ - 🔄 **CrewAI & AG2 Integration** - Use CrewAI or AG2 (Formerly AutoGen) Framework
3152
+ - 💻 **Codebase Chat** - Chat with entire codebase
3153
+ - 🎨 **Interactive UIs** - Multiple interactive interfaces
3154
+ - 📄 **YAML Configuration** - YAML-based agent and workflow configuration
3155
+ - 🛠️ **Custom Tools** - Easy custom tool integration
3156
+ - 🔍 **Internet Search** - Multiple providers (Tavily, You.com, Exa, DuckDuckGo, Crawl4AI)
3157
+ - 🖼️ **VLM Support** - Vision Language Model support
3158
+ - 🎙️ **Voice Interaction** - Real-time voice interaction
3159
+
3160
+ ---
3161
+
3162
+ ## 💾 Persistence (Databases)
3163
+
3164
+ Enable automatic conversation persistence with 2 lines of code:
3165
+
3166
+ ```python
3167
+ from praisonaiagents import Agent, db
3168
+
3169
+ agent = Agent(
3170
+ name="Assistant",
3171
+ db=db(database_url="postgresql://localhost/mydb"), # db(...) shortcut
3172
+ session_id="my-session" # Optional: defaults to per-hour ID (YYYYMMDDHH)
3173
+ )
3174
+ agent.chat("Hello!") # Auto-persists messages, runs, traces
3175
+ ```
3176
+
3177
+ ### Persistence CLI Commands
3178
+
3179
+ | Command | Description |
3180
+ |---------|-------------|
3181
+ | `praisonai persistence doctor` | Validate DB connectivity |
3182
+ | `praisonai persistence run` | Run agent with persistence |
3183
+ | `praisonai persistence resume` | Resume existing session |
3184
+ | `praisonai persistence export` | Export session to JSONL |
3185
+ | `praisonai persistence import` | Import session from JSONL |
3186
+ | `praisonai persistence migrate` | Apply schema migrations |
3187
+ | `praisonai persistence status` | Show schema status |
3188
+
3189
+ ### Knowledge CLI Commands {#knowledge-cli}
3190
+
3191
+ | Command | Description |
3192
+ |---------|-------------|
3193
+ | `praisonai knowledge add <source>` | Add file, directory, URL, or glob pattern |
3194
+ | `praisonai knowledge query "<question>"` | Query knowledge base with RAG |
3195
+ | `praisonai knowledge list` | List indexed documents |
3196
+ | `praisonai knowledge clear` | Clear knowledge base |
3197
+ | `praisonai knowledge stats` | Show knowledge base statistics |
3198
+
3199
+ **Knowledge Query Flags:**
3200
+
3201
+ | Flag | Values | Default |
3202
+ |------|--------|---------|
3203
+ | `--vector-store` | `memory`, `chroma`, `pinecone`, `qdrant`, `weaviate` | `chroma` |
3204
+ | `--retrieval-strategy` | `basic`, `fusion`, `recursive`, `auto_merge` | `basic` |
3205
+ | `--reranker` | `none`, `simple`, `llm`, `cross_encoder`, `cohere` | `none` |
3206
+ | `--index-type` | `vector`, `keyword`, `hybrid` | `vector` |
3207
+ | `--query-mode` | `default`, `sub_question`, `summarize` | `default` |
3208
+ | `--workspace` | Path to workspace directory | Current dir |
3209
+ | `--session` | Session ID for persistence | - |
3210
+
3211
+ **Examples:**
3212
+
3213
+ ```bash
3214
+ # Add documents
3215
+ praisonai knowledge add document.pdf
3216
+ praisonai knowledge add ./docs/
3217
+ praisonai knowledge add "*.md"
3218
+
3219
+ # Query with options
3220
+ praisonai knowledge query "How to authenticate?" \
3221
+ --vector-store chroma \
3222
+ --retrieval-strategy fusion \
3223
+ --reranker simple \
3224
+ --query-mode sub_question
3225
+ ```
3226
+
3227
+ ### Databases Table
3228
+
3229
+ | Database | Store Type | Install | Example | Docs |
3230
+ |----------|------------|---------|---------|------|
3231
+ | PostgreSQL | Conversation | `pip install "praisonai[tools]"` | [simple_db_agent.py](examples/persistence/simple_db_agent.py) | [docs](https://docs.praison.ai/docs/databases/postgres) |
3232
+ | MySQL | Conversation | `pip install "praisonai[tools]"` | - | [docs](https://docs.praison.ai/docs/databases/overview) |
3233
+ | SQLite | Conversation | `pip install "praisonai[tools]"` | - | [docs](https://docs.praison.ai/docs/databases/overview) |
3234
+ | SingleStore | Conversation | `pip install "praisonai[tools]"` | - | [docs](https://docs.praison.ai/docs/databases/overview) |
3235
+ | Supabase | Conversation | `pip install "praisonai[tools]"` | - | [docs](https://docs.praison.ai/docs/databases/overview) |
3236
+ | SurrealDB | Conversation | `pip install "praisonai[tools]"` | - | [docs](https://docs.praison.ai/docs/databases/overview) |
3237
+ | Qdrant | Knowledge | `pip install "praisonai[tools]"` | [knowledge_qdrant.py](examples/persistence/knowledge_qdrant.py) | [docs](https://docs.praison.ai/docs/databases/qdrant) |
3238
+ | ChromaDB | Knowledge | `pip install "praisonai[tools]"` | - | [docs](https://docs.praison.ai/docs/databases/overview) |
3239
+ | Pinecone | Knowledge | `pip install pinecone` | [pinecone_wow.py](examples/vector/pinecone_wow.py) | [docs](https://docs.praison.ai/docs/databases/pinecone) |
3240
+ | Weaviate | Knowledge | `pip install weaviate-client` | [weaviate_wow.py](examples/vector/weaviate_wow.py) | [docs](https://docs.praison.ai/docs/databases/weaviate) |
3241
+ | LanceDB | Knowledge | `pip install lancedb` | [lancedb_real_wow.py](examples/vector/lancedb_real_wow.py) | [docs](https://docs.praison.ai/docs/databases/lancedb) |
3242
+ | Milvus | Knowledge | `pip install "praisonai[tools]"` | - | [docs](https://docs.praison.ai/docs/databases/overview) |
3243
+ | PGVector | Knowledge | `pip install psycopg2-binary` | [pgvector_real_wow.py](examples/vector/pgvector_real_wow.py) | [docs](https://docs.praison.ai/docs/databases/pgvector) |
3244
+ | Redis Vector | Knowledge | `pip install "praisonai[tools]"` | - | [docs](https://docs.praison.ai/docs/databases/overview) |
3245
+ | Cassandra | Knowledge | `pip install "praisonai[tools]"` | - | [docs](https://docs.praison.ai/docs/databases/overview) |
3246
+ | ClickHouse | Knowledge | `pip install "praisonai[tools]"` | - | [docs](https://docs.praison.ai/docs/databases/overview) |
3247
+ | Redis | State | `pip install "praisonai[tools]"` | [state_redis.py](examples/persistence/state_redis.py) | [docs](https://docs.praison.ai/docs/databases/redis) |
3248
+ | MongoDB | State | `pip install "praisonai[tools]"` | - | [docs](https://docs.praison.ai/docs/databases/overview) |
3249
+ | DynamoDB | State | `pip install "praisonai[tools]"` | - | [docs](https://docs.praison.ai/docs/databases/overview) |
3250
+ | Firestore | State | `pip install "praisonai[tools]"` | - | [docs](https://docs.praison.ai/docs/databases/overview) |
3251
+ | Upstash | State | `pip install "praisonai[tools]"` | - | [docs](https://docs.praison.ai/docs/databases/overview) |
3252
+ | Memory | State | `pip install "praisonai[tools]"` | - | [docs](https://docs.praison.ai/docs/databases/overview) |
3253
+
3254
+ ---
3255
+
3256
+ ## 🔧 Tools Table
3257
+
3258
+ Install all tools with: `pip install "praisonai[tools]"`
3259
+
3260
+ | Tool | Category | Import | Docs |
3261
+ |------|----------|--------|------|
3262
+ | Tavily | Web Search | `from praisonai_tools import TavilyTool` | [docs](https://docs.praison.ai/docs/tools/external/tavily) |
3263
+ | DuckDuckGo | Web Search | `from praisonai_tools import DuckDuckGoTool` | [docs](https://docs.praison.ai/docs/tools/external/duckduckgo) |
3264
+ | Exa | Web Search | `from praisonai_tools import ExaTool` | [docs](https://docs.praison.ai/docs/tools/external/exa) |
3265
+ | Serper | Web Search | `from praisonai_tools import SerperTool` | [docs](https://docs.praison.ai/docs/tools/external/serper) |
3266
+ | Jina | Web Reader | `from praisonai_tools import JinaTool` | [docs](https://docs.praison.ai/docs/tools/external/jina) |
3267
+ | Firecrawl | Web Scraping | `from praisonai_tools import FirecrawlTool` | [docs](https://docs.praison.ai/docs/tools/external/firecrawl) |
3268
+ | Crawl4AI | Web Scraping | `from praisonai_tools import Crawl4AITool` | [docs](https://docs.praison.ai/docs/tools/external/crawl4ai) |
3269
+ | Wikipedia | Knowledge | `from praisonai_tools import WikipediaTool` | [docs](https://docs.praison.ai/docs/tools/external/wikipedia) |
3270
+ | ArXiv | Research | `from praisonai_tools import ArxivTool` | [docs](https://docs.praison.ai/docs/tools/external/arxiv) |
3271
+ | HackerNews | News | `from praisonai_tools import HackerNewsTool` | [docs](https://docs.praison.ai/docs/tools/external/hackernews) |
3272
+ | YouTube | Media | `from praisonai_tools import YouTubeTool` | [docs](https://docs.praison.ai/docs/tools/external/youtube) |
3273
+ | Weather | Data | `from praisonai_tools import WeatherTool` | [docs](https://docs.praison.ai/docs/tools/external/weather) |
3274
+ | PostgreSQL | Database | `from praisonai_tools import PostgresTool` | [docs](https://docs.praison.ai/docs/tools/external/postgres) |
3275
+ | MySQL | Database | `from praisonai_tools import MySQLTool` | [docs](https://docs.praison.ai/docs/tools/external/mysql) |
3276
+ | SQLite | Database | `from praisonai_tools import SQLiteTool` | [docs](https://docs.praison.ai/docs/tools/external/sqlite) |
3277
+ | MongoDB | Database | `from praisonai_tools import MongoDBTool` | [docs](https://docs.praison.ai/docs/tools/external/mongodb) |
3278
+ | Redis | Database | `from praisonai_tools import RedisTool` | [docs](https://docs.praison.ai/docs/tools/external/redis) |
3279
+ | Qdrant | Vector DB | `from praisonai_tools import QdrantTool` | [docs](https://docs.praison.ai/docs/tools/external/qdrant) |
3280
+ | GitHub | DevOps | `from praisonai_tools import GitHubTool` | [docs](https://docs.praison.ai/docs/tools/external/github) |
3281
+ | Slack | Communication | `from praisonai_tools import SlackTool` | [docs](https://docs.praison.ai/docs/tools/external/slack) |
3282
+ | Discord | Communication | `from praisonai_tools import DiscordTool` | [docs](https://docs.praison.ai/docs/tools/external/discord) |
3283
+ | Telegram | Communication | `from praisonai_tools import TelegramTool` | [docs](https://docs.praison.ai/docs/tools/external/telegram) |
3284
+ | Email | Communication | `from praisonai_tools import EmailTool` | [docs](https://docs.praison.ai/docs/tools/external/email) |
3285
+ | Notion | Productivity | `from praisonai_tools import NotionTool` | [docs](https://docs.praison.ai/docs/tools/external/notion) |
3286
+ | File | File System | `from praisonai_tools import FileTool` | [docs](https://docs.praison.ai/docs/tools/external/file) |
3287
+ | Shell | System | `from praisonai_tools import ShellTool` | [docs](https://docs.praison.ai/docs/tools/external/shell) |
3288
+ | Python | Code | `from praisonai_tools import PythonTool` | [docs](https://docs.praison.ai/docs/tools/external/python) |
3289
+ | JSON | Data | `from praisonai_tools import JSONTool` | [docs](https://docs.praison.ai/docs/tools/external/json) |
3290
+ | CSV | Data | `from praisonai_tools import CSVTool` | [docs](https://docs.praison.ai/docs/tools/external/csv) |
3291
+ | Calculator | Math | `from praisonai_tools import CalculatorTool` | [docs](https://docs.praison.ai/docs/tools/external/calculator) |
3292
+
3293
+ > See [full tools documentation](https://docs.praison.ai/docs/tools/tools) for all 100+ available tools.
3294
+
3295
+ ---
3296
+
3297
+ ## 🎓 Video Tutorials
3298
+
3299
+ Learn PraisonAI through our comprehensive video series:
3300
+
3301
+ | Topic | Video |
3302
+ |-------|--------|
3303
+ | AI Agents with Self Reflection | [![Self Reflection](https://img.youtube.com/vi/vLXobEN2Vc8/0.jpg)](https://www.youtube.com/watch?v=vLXobEN2Vc8) |
3304
+ | Reasoning Data Generating Agent | [![Reasoning Data](https://img.youtube.com/vi/fUT332Y2zA8/0.jpg)](https://www.youtube.com/watch?v=fUT332Y2zA8) |
3305
+ | AI Agents with Reasoning | [![Reasoning](https://img.youtube.com/vi/KNDVWGN3TpM/0.jpg)](https://www.youtube.com/watch?v=KNDVWGN3TpM) |
3306
+ | Multimodal AI Agents | [![Multimodal](https://img.youtube.com/vi/hjAWmUT1qqY/0.jpg)](https://www.youtube.com/watch?v=hjAWmUT1qqY) |
3307
+ | AI Agents Workflow | [![Workflow](https://img.youtube.com/vi/yWTH44QPl2A/0.jpg)](https://www.youtube.com/watch?v=yWTH44QPl2A) |
3308
+ | Async AI Agents | [![Async](https://img.youtube.com/vi/VhVQfgo00LE/0.jpg)](https://www.youtube.com/watch?v=VhVQfgo00LE) |
3309
+ | Mini AI Agents | [![Mini](https://img.youtube.com/vi/OkvYp5aAGSg/0.jpg)](https://www.youtube.com/watch?v=OkvYp5aAGSg) |
3310
+ | AI Agents with Memory | [![Memory](https://img.youtube.com/vi/1hVfVxvPnnQ/0.jpg)](https://www.youtube.com/watch?v=1hVfVxvPnnQ) |
3311
+ | Repetitive Agents | [![Repetitive](https://img.youtube.com/vi/dAYGxsjDOPg/0.jpg)](https://www.youtube.com/watch?v=dAYGxsjDOPg) |
3312
+ | Introduction | [![Introduction](https://img.youtube.com/vi/Fn1lQjC0GO0/0.jpg)](https://www.youtube.com/watch?v=Fn1lQjC0GO0) |
3313
+ | Tools Overview | [![Tools Overview](https://img.youtube.com/vi/XaQRgRpV7jo/0.jpg)](https://www.youtube.com/watch?v=XaQRgRpV7jo) |
3314
+ | Custom Tools | [![Custom Tools](https://img.youtube.com/vi/JSU2Rndh06c/0.jpg)](https://www.youtube.com/watch?v=JSU2Rndh06c) |
3315
+ | Firecrawl Integration | [![Firecrawl](https://img.youtube.com/vi/UoqUDcLcOYo/0.jpg)](https://www.youtube.com/watch?v=UoqUDcLcOYo) |
3316
+ | User Interface | [![UI](https://img.youtube.com/vi/tg-ZjNl3OCg/0.jpg)](https://www.youtube.com/watch?v=tg-ZjNl3OCg) |
3317
+ | Crawl4AI Integration | [![Crawl4AI](https://img.youtube.com/vi/KAvuVUh0XU8/0.jpg)](https://www.youtube.com/watch?v=KAvuVUh0XU8) |
3318
+ | Chat Interface | [![Chat](https://img.youtube.com/vi/sw3uDqn2h1Y/0.jpg)](https://www.youtube.com/watch?v=sw3uDqn2h1Y) |
3319
+ | Code Interface | [![Code](https://img.youtube.com/vi/_5jQayO-MQY/0.jpg)](https://www.youtube.com/watch?v=_5jQayO-MQY) |
3320
+ | Mem0 Integration | [![Mem0](https://img.youtube.com/vi/KIGSgRxf1cY/0.jpg)](https://www.youtube.com/watch?v=KIGSgRxf1cY) |
3321
+ | Training | [![Training](https://img.youtube.com/vi/aLawE8kwCrI/0.jpg)](https://www.youtube.com/watch?v=aLawE8kwCrI) |
3322
+ | Realtime Voice Interface | [![Realtime](https://img.youtube.com/vi/frRHfevTCSw/0.jpg)](https://www.youtube.com/watch?v=frRHfevTCSw) |
3323
+ | Call Interface | [![Call](https://img.youtube.com/vi/m1cwrUG2iAk/0.jpg)](https://www.youtube.com/watch?v=m1cwrUG2iAk) |
3324
+ | Reasoning Extract Agents | [![Reasoning Extract](https://img.youtube.com/vi/2PPamsADjJA/0.jpg)](https://www.youtube.com/watch?v=2PPamsADjJA) |
3325
+
3326
+ ---
3327
+
3328
+ ## 👥 Contributing
3329
+
3330
+ We welcome contributions from the community! Here's how you can contribute:
3331
+
3332
+ 1. **Fork on GitHub** - Use the "Fork" button on the [repository page](https://github.com/MervinPraison/PraisonAI)
3333
+ 2. **Clone your fork** - `git clone https://github.com/yourusername/praisonAI.git`
3334
+ 3. **Create a branch** - `git checkout -b new-feature`
3335
+ 4. **Make changes and commit** - `git commit -am "Add some feature"`
3336
+ 5. **Push to your fork** - `git push origin new-feature`
3337
+ 6. **Submit a pull request** - Via GitHub's web interface
3338
+ 7. **Await feedback** - From project maintainers
3339
+
3340
+ ---
3341
+
3342
+ ## 🔧 Development
3343
+
3344
+ ### Using uv
3345
+
3346
+ ```bash
3347
+ # Install uv if you haven't already
3348
+ pip install uv
3349
+
3350
+ # Install from requirements
3351
+ uv pip install -r pyproject.toml
3352
+
3353
+ # Install with extras
3354
+ uv pip install -r pyproject.toml --extra code
3355
+ uv pip install -r pyproject.toml --extra "crewai,autogen"
3356
+ ```
3357
+
3358
+ ### Bump and Release
3359
+
3360
+ ```bash
3361
+ # From project root - bumps version and releases in one command
3362
+ python src/praisonai/scripts/bump_and_release.py 2.2.99
3363
+
3364
+ # With praisonaiagents dependency
3365
+ python src/praisonai/scripts/bump_and_release.py 2.2.99 --agents 0.0.169
3366
+
3367
+ # Then publish
3368
+ cd src/praisonai && uv publish
3369
+ ```
3370
+
3371
+ ---
3372
+
3373
+ ## ❓ FAQ & Troubleshooting
3374
+
3375
+ <details>
3376
+ <summary><strong>ModuleNotFoundError: No module named 'praisonaiagents'</strong></summary>
3377
+
3378
+ Install the package:
3379
+ ```bash
3380
+ pip install praisonaiagents
3381
+ ```
3382
+
3383
+ </details>
3384
+
3385
+ <details>
3386
+ <summary><strong>API key not found / Authentication error</strong></summary>
3387
+
3388
+ Ensure your API key is set:
3389
+ ```bash
3390
+ export OPENAI_API_KEY=your_key_here
3391
+ ```
3392
+
3393
+ For other providers, see [Environment Variables](#environment-variables).
3394
+
3395
+ </details>
3396
+
3397
+ <details>
3398
+ <summary><strong>How do I use a local model (Ollama)?</strong></summary>
3399
+
3400
+ ```bash
3401
+ # Start Ollama server first
3402
+ ollama serve
3403
+
3404
+ # Set environment variable
3405
+ export OPENAI_BASE_URL=http://localhost:11434/v1
3406
+ ```
3407
+
3408
+ See [Ollama Integration](#ollama-integration) for more details.
3409
+
3410
+ </details>
3411
+
3412
+ <details>
3413
+ <summary><strong>How do I persist conversations to a database?</strong></summary>
3414
+
3415
+ Use the `db` parameter:
3416
+ ```python
3417
+ from praisonaiagents import Agent, db
3418
+
3419
+ agent = Agent(
3420
+ name="Assistant",
3421
+ db=db(database_url="postgresql://localhost/mydb"),
3422
+ session_id="my-session"
3423
+ )
3424
+ ```
3425
+
3426
+ See [Persistence (Databases)](#-persistence-databases) for supported databases.
3427
+
3428
+ </details>
3429
+
3430
+ <details>
3431
+ <summary><strong>How do I enable agent memory?</strong></summary>
3432
+
3433
+ ```python
3434
+ from praisonaiagents import Agent
3435
+
3436
+ agent = Agent(
3437
+ name="Assistant",
3438
+ memory=True, # Enables file-based memory (no extra deps!)
3439
+ user_id="user123"
3440
+ )
3441
+ ```
3442
+
3443
+ See [Agent Memory](#6-agent-memory-zero-dependencies) for more options.
3444
+
3445
+ </details>
3446
+
3447
+ <details>
3448
+ <summary><strong>How do I run multiple agents together?</strong></summary>
3449
+
3450
+ ```python
3451
+ from praisonaiagents import Agent, PraisonAIAgents
3452
+
3453
+ agent1 = Agent(instructions="Research topics")
3454
+ agent2 = Agent(instructions="Summarize findings")
3455
+ agents = PraisonAIAgents(agents=[agent1, agent2])
3456
+ agents.start()
3457
+ ```
3458
+
3459
+ See [Multi Agents](#2-multi-agents) for more examples.
3460
+
3461
+ </details>
3462
+
3463
+ <details>
3464
+ <summary><strong>How do I use MCP tools?</strong></summary>
3465
+
3466
+ ```python
3467
+ from praisonaiagents import Agent, MCP
3468
+
3469
+ agent = Agent(
3470
+ tools=MCP("npx @modelcontextprotocol/server-memory")
3471
+ )
3472
+ ```
3473
+
3474
+ See [MCP Protocol](#19-mcp-model-context-protocol) for all transport options.
3475
+
3476
+ </details>
3477
+
3478
+ ### Getting Help
3479
+
3480
+ - 📚 [Full Documentation](https://docs.praison.ai)
3481
+ - 🐛 [Report Issues](https://github.com/MervinPraison/PraisonAI/issues)
3482
+ - 💬 [Discussions](https://github.com/MervinPraison/PraisonAI/discussions)
3483
+
3484
+ ---
3485
+
3486
+ <div align="center">
3487
+ <p><strong>Made with ❤️ by the PraisonAI Team</strong></p>
3488
+ <p>
3489
+ <a href="https://docs.praison.ai">Documentation</a> •
3490
+ <a href="https://github.com/MervinPraison/PraisonAI">GitHub</a> •
3491
+ <a href="https://github.com/MervinPraison/PraisonAI/issues">Issues</a>
3492
+ </p>
3493
+ </div>