PraisonAI 2.2.70__tar.gz → 2.3.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. praisonai-2.3.4/PKG-INFO +1145 -0
  2. praisonai-2.3.4/PraisonAI.egg-info/PKG-INFO +1145 -0
  3. praisonai-2.3.4/PraisonAI.egg-info/SOURCES.txt +53 -0
  4. praisonai-2.3.4/PraisonAI.egg-info/dependency_links.txt +1 -0
  5. praisonai-2.3.4/PraisonAI.egg-info/entry_points.txt +4 -0
  6. praisonai-2.3.4/PraisonAI.egg-info/requires.txt +102 -0
  7. praisonai-2.3.4/PraisonAI.egg-info/top_level.txt +1 -0
  8. praisonai-2.3.4/README.md +1048 -0
  9. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/agents_generator.py +7 -7
  10. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/auto.py +1 -1
  11. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/chainlit_ui.py +1 -1
  12. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/cli.py +529 -12
  13. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/deploy.py +4 -4
  14. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/inc/models.py +10 -6
  15. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/test.py +1 -1
  16. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/ui/agents.py +4 -4
  17. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/ui/chat.py +5 -5
  18. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/ui/code.py +5 -5
  19. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/ui/colab.py +2 -2
  20. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/ui/realtime.py +5 -5
  21. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/ui/realtimeclient/__init__.py +3 -3
  22. praisonai-2.3.4/praisonai/version.py +1 -0
  23. praisonai-2.3.4/pyproject.toml +116 -0
  24. praisonai-2.3.4/setup.cfg +4 -0
  25. praisonai-2.3.4/tests/test.py +108 -0
  26. praisonai-2.3.4/tests/test_agents_playbook.py +36 -0
  27. praisonai-2.3.4/tests/test_basic.py +32 -0
  28. praisonai-2.3.4/tests/test_custom_tools_fix.py +83 -0
  29. praisonai-2.3.4/tests/test_double_api_fix.py +187 -0
  30. praisonai-2.3.4/tests/test_phase2_refactor.py +152 -0
  31. praisonai-2.3.4/tests/test_runner.py +355 -0
  32. praisonai-2.2.70/PKG-INFO +0 -110
  33. praisonai-2.2.70/README.md +0 -9
  34. praisonai-2.2.70/praisonai/README.md +0 -5
  35. praisonai-2.2.70/praisonai/public/android-chrome-192x192.png +0 -0
  36. praisonai-2.2.70/praisonai/public/android-chrome-512x512.png +0 -0
  37. praisonai-2.2.70/praisonai/public/apple-touch-icon.png +0 -0
  38. praisonai-2.2.70/praisonai/public/fantasy.svg +0 -3
  39. praisonai-2.2.70/praisonai/public/favicon-16x16.png +0 -0
  40. praisonai-2.2.70/praisonai/public/favicon-32x32.png +0 -0
  41. praisonai-2.2.70/praisonai/public/favicon.ico +0 -0
  42. praisonai-2.2.70/praisonai/public/game.svg +0 -3
  43. praisonai-2.2.70/praisonai/public/logo_dark.png +0 -0
  44. praisonai-2.2.70/praisonai/public/logo_light.png +0 -0
  45. praisonai-2.2.70/praisonai/public/movie.svg +0 -3
  46. praisonai-2.2.70/praisonai/public/praison-ai-agents-architecture-dark.png +0 -0
  47. praisonai-2.2.70/praisonai/public/praison-ai-agents-architecture.png +0 -0
  48. praisonai-2.2.70/praisonai/public/thriller.svg +0 -3
  49. praisonai-2.2.70/praisonai/setup/config.yaml +0 -60
  50. praisonai-2.2.70/praisonai/setup/setup_conda_env.sh +0 -105
  51. praisonai-2.2.70/praisonai/ui/README.md +0 -21
  52. praisonai-2.2.70/praisonai/ui/config/chainlit.md +0 -1
  53. praisonai-2.2.70/praisonai/ui/config/translations/bn.json +0 -231
  54. praisonai-2.2.70/praisonai/ui/config/translations/en-US.json +0 -229
  55. praisonai-2.2.70/praisonai/ui/config/translations/gu.json +0 -231
  56. praisonai-2.2.70/praisonai/ui/config/translations/he-IL.json +0 -231
  57. praisonai-2.2.70/praisonai/ui/config/translations/hi.json +0 -231
  58. praisonai-2.2.70/praisonai/ui/config/translations/kn.json +0 -231
  59. praisonai-2.2.70/praisonai/ui/config/translations/ml.json +0 -231
  60. praisonai-2.2.70/praisonai/ui/config/translations/mr.json +0 -231
  61. praisonai-2.2.70/praisonai/ui/config/translations/ta.json +0 -231
  62. praisonai-2.2.70/praisonai/ui/config/translations/te.json +0 -231
  63. praisonai-2.2.70/praisonai/ui/config/translations/zh-CN.json +0 -229
  64. praisonai-2.2.70/praisonai/ui/public/fantasy.svg +0 -3
  65. praisonai-2.2.70/praisonai/ui/public/game.svg +0 -3
  66. praisonai-2.2.70/praisonai/ui/public/logo_dark.png +0 -0
  67. praisonai-2.2.70/praisonai/ui/public/logo_light.png +0 -0
  68. praisonai-2.2.70/praisonai/ui/public/movie.svg +0 -3
  69. praisonai-2.2.70/praisonai/ui/public/praison.css +0 -3
  70. praisonai-2.2.70/praisonai/ui/public/thriller.svg +0 -3
  71. praisonai-2.2.70/praisonai/ui/tools.md +0 -133
  72. praisonai-2.2.70/praisonai/version.py +0 -1
  73. praisonai-2.2.70/pyproject.toml +0 -299
  74. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/__init__.py +0 -0
  75. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/__main__.py +0 -0
  76. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/api/call.py +0 -0
  77. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/inbuilt_tools/__init__.py +0 -0
  78. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/inbuilt_tools/autogen_tools.py +0 -0
  79. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/inc/__init__.py +0 -0
  80. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/inc/config.py +0 -0
  81. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/scheduler.py +0 -0
  82. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/setup/__init__.py +0 -0
  83. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/setup/build.py +0 -0
  84. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/setup/post_install.py +0 -0
  85. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/setup/setup_conda_env.py +0 -0
  86. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/setup.py +0 -0
  87. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/train.py +0 -0
  88. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/train_vision.py +0 -0
  89. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/ui/callbacks.py +0 -0
  90. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/ui/colab_chainlit.py +0 -0
  91. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/ui/components/aicoder.py +0 -0
  92. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/ui/context.py +0 -0
  93. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/ui/database_config.py +0 -0
  94. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/ui/db.py +0 -0
  95. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/ui/realtimeclient/tools.py +0 -0
  96. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/ui/sql_alchemy.py +0 -0
  97. {praisonai-2.2.70 → praisonai-2.3.4}/praisonai/upload_vision.py +0 -0
@@ -0,0 +1,1145 @@
1
+ Metadata-Version: 2.4
2
+ Name: PraisonAI
3
+ Version: 2.3.4
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.0.180
15
+ Requires-Dist: python-dotenv>=0.19.0
16
+ Requires-Dist: instructor>=1.3.3
17
+ Requires-Dist: PyYAML>=6.0
18
+ Requires-Dist: mcp>=1.6.0
19
+ Provides-Extra: ui
20
+ Requires-Dist: chainlit==2.5.5; extra == "ui"
21
+ Requires-Dist: sqlalchemy>=2.0.36; extra == "ui"
22
+ Requires-Dist: aiosqlite>=0.20.0; extra == "ui"
23
+ Requires-Dist: greenlet>=3.0.3; extra == "ui"
24
+ Requires-Dist: pydantic<=2.10.1; extra == "ui"
25
+ Provides-Extra: gradio
26
+ Requires-Dist: gradio>=4.26.0; extra == "gradio"
27
+ Provides-Extra: api
28
+ Requires-Dist: flask>=3.0.0; extra == "api"
29
+ Requires-Dist: fastapi>=0.115.0; extra == "api"
30
+ Requires-Dist: uvicorn>=0.34.0; extra == "api"
31
+ Provides-Extra: agentops
32
+ Requires-Dist: agentops>=0.3.12; extra == "agentops"
33
+ Provides-Extra: google
34
+ Requires-Dist: langchain-google-genai>=2.1.0; extra == "google"
35
+ Provides-Extra: openai
36
+ Requires-Dist: langchain-openai<0.3.0,>=0.2.1; extra == "openai"
37
+ Provides-Extra: anthropic
38
+ Requires-Dist: langchain-anthropic>=0.3.0; extra == "anthropic"
39
+ Provides-Extra: cohere
40
+ Requires-Dist: langchain-cohere<0.4.0,>=0.3.0; extra == "cohere"
41
+ Provides-Extra: chat
42
+ Requires-Dist: chainlit==2.5.5; extra == "chat"
43
+ Requires-Dist: litellm>=1.72.6; extra == "chat"
44
+ Requires-Dist: aiosqlite>=0.20.0; extra == "chat"
45
+ Requires-Dist: greenlet>=3.0.3; extra == "chat"
46
+ Requires-Dist: tavily-python==0.5.0; extra == "chat"
47
+ Requires-Dist: crawl4ai>=0.7.0; extra == "chat"
48
+ Requires-Dist: sqlalchemy>=2.0.36; extra == "chat"
49
+ Requires-Dist: playwright>=1.47.0; extra == "chat"
50
+ Requires-Dist: rich; extra == "chat"
51
+ Requires-Dist: pydantic<=2.10.1; extra == "chat"
52
+ Provides-Extra: code
53
+ Requires-Dist: chainlit==2.5.5; extra == "code"
54
+ Requires-Dist: litellm>=1.72.6; extra == "code"
55
+ Requires-Dist: aiosqlite>=0.20.0; extra == "code"
56
+ Requires-Dist: greenlet>=3.0.3; extra == "code"
57
+ Requires-Dist: tavily-python==0.5.0; extra == "code"
58
+ Requires-Dist: crawl4ai>=0.7.0; extra == "code"
59
+ Requires-Dist: sqlalchemy>=2.0.36; extra == "code"
60
+ Requires-Dist: playwright>=1.47.0; extra == "code"
61
+ Requires-Dist: pydantic<=2.10.1; extra == "code"
62
+ Provides-Extra: realtime
63
+ Requires-Dist: chainlit==2.5.5; extra == "realtime"
64
+ Requires-Dist: litellm>=1.72.6; extra == "realtime"
65
+ Requires-Dist: aiosqlite>=0.20.0; extra == "realtime"
66
+ Requires-Dist: greenlet>=3.0.3; extra == "realtime"
67
+ Requires-Dist: tavily-python==0.5.0; extra == "realtime"
68
+ Requires-Dist: crawl4ai>=0.7.0; extra == "realtime"
69
+ Requires-Dist: websockets>=12.0; extra == "realtime"
70
+ Requires-Dist: plotly>=5.24.0; extra == "realtime"
71
+ Requires-Dist: yfinance>=0.2.44; extra == "realtime"
72
+ Requires-Dist: duckduckgo_search>=6.3.0; extra == "realtime"
73
+ Requires-Dist: sqlalchemy>=2.0.36; extra == "realtime"
74
+ Provides-Extra: call
75
+ Requires-Dist: twilio>=7.0.0; extra == "call"
76
+ Requires-Dist: fastapi>=0.95.0; extra == "call"
77
+ Requires-Dist: uvicorn>=0.20.0; extra == "call"
78
+ Requires-Dist: websockets>=12.0; extra == "call"
79
+ Requires-Dist: flaml[automl]>=2.3.1; extra == "call"
80
+ Requires-Dist: pyngrok>=1.4.0; extra == "call"
81
+ Requires-Dist: rich; extra == "call"
82
+ Requires-Dist: openai>=1.54.0; extra == "call"
83
+ Provides-Extra: train
84
+ Provides-Extra: crewai
85
+ Requires-Dist: crewai>=0.157.0; extra == "crewai"
86
+ Requires-Dist: praisonai-tools>=0.0.22; extra == "crewai"
87
+ Provides-Extra: autogen
88
+ Requires-Dist: pyautogen==0.2.29; extra == "autogen"
89
+ Requires-Dist: praisonai-tools>=0.0.22; extra == "autogen"
90
+ Requires-Dist: crewai; extra == "autogen"
91
+ Provides-Extra: autogen-v4
92
+ Requires-Dist: autogen-agentchat>=0.4.0; extra == "autogen-v4"
93
+ Requires-Dist: autogen-ext[openai]>=0.4.0; extra == "autogen-v4"
94
+ Requires-Dist: autogen-core>=0.4.0; extra == "autogen-v4"
95
+ Requires-Dist: praisonai-tools>=0.0.22; extra == "autogen-v4"
96
+ Requires-Dist: crewai; extra == "autogen-v4"
97
+
98
+ <p align="center">
99
+ <picture>
100
+ <source media="(prefers-color-scheme: dark)" srcset="docs/logo/dark.png" />
101
+ <source media="(prefers-color-scheme: light)" srcset="docs/logo/light.png" />
102
+ <img alt="PraisonAI Logo" src="docs/logo/light.png" />
103
+ </picture>
104
+ </p>
105
+
106
+ <p align="center">
107
+ <a href="https://github.com/MervinPraison/PraisonAI"><img src="https://static.pepy.tech/badge/PraisonAI" alt="Total Downloads" /></a>
108
+ <a href="https://github.com/MervinPraison/PraisonAI"><img src="https://img.shields.io/github/v/release/MervinPraison/PraisonAI" alt="Latest Stable Version" /></a>
109
+ <a href="https://github.com/MervinPraison/PraisonAI"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License" /></a>
110
+ </p>
111
+
112
+ <div align="center">
113
+
114
+ # Praison AI
115
+
116
+ <a href="https://trendshift.io/repositories/9130" target="_blank"><img src="https://trendshift.io/api/badge/repositories/9130" alt="MervinPraison%2FPraisonAI | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
117
+
118
+ </div>
119
+
120
+ PraisonAI is a production-ready Multi-AI Agents framework with self-reflection, designed to create AI Agents to automate and solve problems ranging from simple tasks to complex challenges. By integrating PraisonAI Agents, AG2 (Formerly AutoGen), and CrewAI into a low-code solution, it streamlines the building and management of multi-agent LLM systems, emphasising simplicity, customisation, and effective human-agent collaboration.
121
+
122
+ <div align="center">
123
+ <a href="https://docs.praison.ai">
124
+ <p align="center">
125
+ <img src="https://img.shields.io/badge/📚_Documentation-Visit_docs.praison.ai-blue?style=for-the-badge&logo=bookstack&logoColor=white" alt="Documentation" />
126
+ </p>
127
+ </a>
128
+ </div>
129
+
130
+ ## Key Features
131
+
132
+ - 🤖 Automated AI Agents Creation
133
+ - 🔄 Self Reflection AI Agents
134
+ - 🧠 Reasoning AI Agents
135
+ - 👁️ Multi Modal AI Agents
136
+ - 🤝 Multi Agent Collaboration
137
+ - 🎭 AI Agent Workflow
138
+ - 📚 Add Custom Knowledge
139
+ - 🧠 Agents with Short and Long Term Memory
140
+ - 📄 Chat with PDF Agents
141
+ - 💻 Code Interpreter Agents
142
+ - 📚 RAG Agents
143
+ - 🤔 Async & Parallel Processing
144
+ - 🔄 Auto Agents
145
+ - 🔢 Math Agents
146
+ - 🎯 Structured Output Agents
147
+ - 🔗 LangChain Integrated Agents
148
+ - 📞 Callback Agents
149
+ - 🤏 Mini AI Agents
150
+ - 🛠️ 100+ Custom Tools
151
+ - 📄 YAML Configuration
152
+ - 💯 100+ LLM Support
153
+ - 🔬 **Deep Research Agents** (OpenAI & Gemini)
154
+ - 🔄 **Query Rewriter Agent** (HyDE, Step-back, Multi-query)
155
+ - 🌐 **Native Web Search** (OpenAI, Gemini, Anthropic, xAI, Perplexity)
156
+ - 📥 **Web Fetch** (Retrieve full content from URLs - Anthropic)
157
+ - 💾 **Prompt Caching** (Reduce costs & latency - OpenAI, Anthropic, Bedrock, Deepseek)
158
+ - 🧠 **Claude Memory Tool** (Persistent cross-conversation memory - Anthropic Beta)
159
+ - 💾 **File-Based Memory** (Zero-dependency persistent memory for all agents)
160
+
161
+ ## Using Python Code
162
+
163
+ Light weight package dedicated for coding:
164
+ ```bash
165
+ pip install praisonaiagents
166
+ ```
167
+
168
+ ```bash
169
+ export OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxx
170
+ ```
171
+
172
+ ### 1. Single Agent
173
+
174
+ Create app.py file and add the code below:
175
+ ```python
176
+ from praisonaiagents import Agent
177
+ agent = Agent(instructions="Your are a helpful AI assistant")
178
+ agent.start("Write a movie script about a robot in Mars")
179
+ ```
180
+
181
+ Run:
182
+ ```bash
183
+ python app.py
184
+ ```
185
+
186
+ ### 2. Multi Agents
187
+
188
+ Create app.py file and add the code below:
189
+ ```python
190
+ from praisonaiagents import Agent, PraisonAIAgents
191
+
192
+ research_agent = Agent(instructions="Research about AI")
193
+ summarise_agent = Agent(instructions="Summarise research agent's findings")
194
+ agents = PraisonAIAgents(agents=[research_agent, summarise_agent])
195
+ agents.start()
196
+ ```
197
+
198
+ Run:
199
+ ```bash
200
+ python app.py
201
+ ```
202
+
203
+ ### 3. Deep Research Agent
204
+
205
+ Automated research with real-time streaming, web search, and citations using OpenAI or Gemini Deep Research APIs.
206
+
207
+ ```python
208
+ from praisonaiagents import DeepResearchAgent
209
+
210
+ # OpenAI Deep Research
211
+ agent = DeepResearchAgent(
212
+ model="o4-mini-deep-research", # or "o3-deep-research"
213
+ verbose=True
214
+ )
215
+
216
+ result = agent.research("What are the latest AI trends in 2025?")
217
+ print(result.report)
218
+ print(f"Citations: {len(result.citations)}")
219
+ ```
220
+
221
+ ```python
222
+ # Gemini Deep Research
223
+ from praisonaiagents import DeepResearchAgent
224
+
225
+ agent = DeepResearchAgent(
226
+ model="deep-research-pro", # Auto-detected as Gemini
227
+ verbose=True
228
+ )
229
+
230
+ result = agent.research("Research quantum computing advances")
231
+ print(result.report)
232
+ ```
233
+
234
+ **Features:**
235
+ - 🔍 Multi-provider support (OpenAI, Gemini, LiteLLM)
236
+ - 📡 Real-time streaming with reasoning summaries
237
+ - 📚 Structured citations with URLs
238
+ - 🛠️ Built-in tools: web search, code interpreter, MCP, file search
239
+ - 🔄 Automatic provider detection from model name
240
+
241
+ ### 4. Query Rewriter Agent
242
+
243
+ Transform user queries to improve RAG retrieval quality using multiple strategies.
244
+
245
+ ```python
246
+ from praisonaiagents import QueryRewriterAgent, RewriteStrategy
247
+
248
+ agent = QueryRewriterAgent(model="gpt-4o-mini")
249
+
250
+ # Basic - expands abbreviations, adds context
251
+ result = agent.rewrite("AI trends")
252
+ print(result.primary_query) # "What are the current trends in Artificial Intelligence?"
253
+
254
+ # HyDE - generates hypothetical document for semantic matching
255
+ result = agent.rewrite("What is quantum computing?", strategy=RewriteStrategy.HYDE)
256
+
257
+ # Step-back - generates broader context question
258
+ result = agent.rewrite("GPT-4 vs Claude 3?", strategy=RewriteStrategy.STEP_BACK)
259
+
260
+ # Sub-queries - decomposes complex questions
261
+ result = agent.rewrite("RAG setup and best embedding models?", strategy=RewriteStrategy.SUB_QUERIES)
262
+
263
+ # Contextual - resolves references using chat history
264
+ result = agent.rewrite("What about cost?", chat_history=[...])
265
+ ```
266
+
267
+ **Strategies:**
268
+ - **BASIC**: Expand abbreviations, fix typos, add context
269
+ - **HYDE**: Generate hypothetical document for semantic matching
270
+ - **STEP_BACK**: Generate higher-level concept questions
271
+ - **SUB_QUERIES**: Decompose multi-part questions
272
+ - **MULTI_QUERY**: Generate multiple paraphrased versions
273
+ - **CONTEXTUAL**: Resolve references using conversation history
274
+ - **AUTO**: Automatically detect best strategy
275
+
276
+ ### 5. Agent Memory (Zero Dependencies)
277
+
278
+ Enable persistent memory for agents - works out of the box without any extra packages. Features inspired by Claude, Gemini CLI, Codex CLI, Cursor, and Windsurf.
279
+
280
+ ```python
281
+ from praisonaiagents import Agent
282
+ from praisonaiagents.memory import FileMemory
283
+
284
+ # Enable memory with a single parameter
285
+ agent = Agent(
286
+ name="Personal Assistant",
287
+ instructions="You are a helpful assistant that remembers user preferences.",
288
+ memory=True, # Enables file-based memory (no extra deps!)
289
+ user_id="user123" # Isolate memory per user
290
+ )
291
+
292
+ # Memory is automatically injected into conversations
293
+ result = agent.start("My name is John and I prefer Python")
294
+ # Agent will remember this for future conversations
295
+ ```
296
+
297
+ **Memory Types:**
298
+ - **Short-term**: Rolling buffer of recent context (auto-expires)
299
+ - **Long-term**: Persistent important facts (sorted by importance)
300
+ - **Entity**: People, places, organizations with attributes
301
+ - **Episodic**: Date-based interaction history
302
+
303
+ **Advanced Features (like Gemini CLI):**
304
+ ```python
305
+ from praisonaiagents.memory import FileMemory
306
+
307
+ memory = FileMemory(user_id="user123")
308
+
309
+ # Session Save/Resume
310
+ memory.save_session("project_session", conversation_history=[...])
311
+ memory.resume_session("project_session")
312
+
313
+ # Context Compression
314
+ memory.compress(llm_func=lambda p: agent.chat(p), max_items=10)
315
+
316
+ # Checkpointing
317
+ memory.create_checkpoint("before_refactor", include_files=["main.py"])
318
+ memory.restore_checkpoint("before_refactor", restore_files=True)
319
+
320
+ # Slash Commands
321
+ memory.handle_command("/memory show")
322
+ memory.handle_command("/memory save my_session")
323
+ ```
324
+
325
+ **Storage Options:**
326
+ | Option | Dependencies | Description |
327
+ |--------|-------------|-------------|
328
+ | `memory=True` | None | File-based JSON storage (default) |
329
+ | `memory="file"` | None | Explicit file-based storage |
330
+ | `memory="sqlite"` | Built-in | SQLite with indexing |
331
+ | `memory="chromadb"` | chromadb | Vector/semantic search |
332
+
333
+ ### 6. Rules & Instructions (like Cursor/Windsurf)
334
+
335
+ PraisonAI auto-discovers instruction files from your project root and git root:
336
+
337
+ | File | Description | Priority |
338
+ |------|-------------|----------|
339
+ | `PRAISON.md` | PraisonAI native instructions | High |
340
+ | `PRAISON.local.md` | Local overrides (gitignored) | Higher |
341
+ | `CLAUDE.md` | Claude Code memory file | High |
342
+ | `CLAUDE.local.md` | Local overrides (gitignored) | Higher |
343
+ | `AGENTS.md` | OpenAI Codex CLI instructions | High |
344
+ | `GEMINI.md` | Gemini CLI memory file | High |
345
+ | `.cursorrules` | Cursor IDE rules | High |
346
+ | `.windsurfrules` | Windsurf IDE rules | High |
347
+ | `.claude/rules/*.md` | Claude Code modular rules | Medium |
348
+ | `.windsurf/rules/*.md` | Windsurf modular rules | Medium |
349
+ | `.cursor/rules/*.mdc` | Cursor modular rules | Medium |
350
+ | `.praison/rules/*.md` | Workspace rules | Medium |
351
+ | `~/.praison/rules/*.md` | Global rules | Low |
352
+
353
+ ```python
354
+ from praisonaiagents import Agent
355
+
356
+ # Agent auto-discovers CLAUDE.md, AGENTS.md, GEMINI.md, etc.
357
+ agent = Agent(name="Assistant", instructions="You are helpful.")
358
+ # Rules are injected into system prompt automatically
359
+ ```
360
+
361
+ **@Import Syntax (like Claude Code):**
362
+ ```markdown
363
+ # CLAUDE.md
364
+ See @README for project overview
365
+ See @docs/architecture.md for system design
366
+ @~/.praison/my-preferences.md
367
+ ```
368
+
369
+ **Rule File Format (with YAML frontmatter):**
370
+ ```markdown
371
+ ---
372
+ description: Python coding guidelines
373
+ globs: ["**/*.py"]
374
+ activation: always # always, glob, manual, ai_decision
375
+ ---
376
+
377
+ # Guidelines
378
+ - Use type hints
379
+ - Follow PEP 8
380
+ ```
381
+
382
+ ### 7. Auto-Generated Memories (like Windsurf Cascade)
383
+
384
+ ```python
385
+ from praisonaiagents.memory import FileMemory, AutoMemory
386
+
387
+ memory = FileMemory(user_id="user123")
388
+ auto = AutoMemory(memory, enabled=True)
389
+
390
+ # Automatically extracts and stores memories from conversations
391
+ memories = auto.process_interaction(
392
+ "My name is John and I prefer Python for backend work"
393
+ )
394
+ # Extracts: name="John", preference="Python for backend"
395
+ ```
396
+
397
+ ### 8. Workflows (like Windsurf)
398
+
399
+ Create reusable multi-step workflows in `.praison/workflows/`:
400
+
401
+ ```python
402
+ from praisonaiagents.memory import WorkflowManager
403
+
404
+ manager = WorkflowManager()
405
+
406
+ # Execute a workflow
407
+ result = manager.execute(
408
+ "deploy",
409
+ executor=lambda prompt: agent.chat(prompt),
410
+ variables={"environment": "production"}
411
+ )
412
+ ```
413
+
414
+ ### 9. Hooks (like Windsurf Cascade Hooks)
415
+
416
+ Configure in `.praison/hooks.json`:
417
+
418
+ ```python
419
+ from praisonaiagents.memory import HooksManager
420
+
421
+ hooks = HooksManager()
422
+
423
+ # Register Python hooks
424
+ hooks.register("pre_write_code", lambda ctx: print(f"Writing {ctx['file']}"))
425
+
426
+ # Execute hooks
427
+ result = hooks.execute("pre_write_code", {"file": "main.py"})
428
+ ```
429
+
430
+ ## Using No Code
431
+
432
+ ### Auto Mode:
433
+ ```bash
434
+ pip install praisonai
435
+ export OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxx
436
+ praisonai --auto create a movie script about Robots in Mars
437
+ ```
438
+
439
+ ### Query Rewriting (works with any command):
440
+ ```bash
441
+ # Rewrite query for better results (uses QueryRewriterAgent)
442
+ praisonai "AI trends" --query-rewrite
443
+
444
+ # Rewrite with search tools (agent decides when to search)
445
+ praisonai "latest developments" --query-rewrite --rewrite-tools "internet_search"
446
+
447
+ # Works with any prompt
448
+ praisonai "explain quantum computing" --query-rewrite -v
449
+ ```
450
+
451
+ ### Deep Research CLI:
452
+ ```bash
453
+ # Default: OpenAI (o4-mini-deep-research)
454
+ praisonai research "What are the latest AI trends in 2025?"
455
+
456
+ # Use Gemini
457
+ praisonai research --model deep-research-pro "Your research query"
458
+
459
+ # Rewrite query before research
460
+ praisonai research --query-rewrite "AI trends"
461
+
462
+ # Rewrite with search tools
463
+ praisonai research --query-rewrite --rewrite-tools "internet_search" "AI trends"
464
+
465
+ # Use custom tools from file (gathers context before deep research)
466
+ praisonai research --tools tools.py "Your research query"
467
+ praisonai research -t my_tools.py "Your research query"
468
+
469
+ # Use built-in tools by name (comma-separated)
470
+ praisonai research --tools "internet_search,wiki_search" "Your query"
471
+ praisonai research -t "yfinance,calculator_tools" "Stock analysis query"
472
+
473
+ # Save output to file (output/research/{query}.md)
474
+ praisonai research --save "Your research query"
475
+ praisonai research -s "Your research query"
476
+
477
+ # Combine options
478
+ praisonai research --query-rewrite --tools tools.py --save "Your research query"
479
+
480
+ # Verbose mode (show debug logs)
481
+ praisonai research -v "Your research query"
482
+ ```
483
+
484
+ ## Using JavaScript Code
485
+
486
+ ```bash
487
+ npm install praisonai
488
+ export OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxx
489
+ ```
490
+
491
+ ```javascript
492
+ const { Agent } = require('praisonai');
493
+ const agent = new Agent({ instructions: 'You are a helpful AI assistant' });
494
+ agent.start('Write a movie script about a robot in Mars');
495
+ ```
496
+
497
+ ![PraisonAI CLI Demo](docs/demo/praisonai-cli-demo.gif)
498
+
499
+ ## Star History
500
+
501
+ [![Star History Chart](https://api.star-history.com/svg?repos=MervinPraison/PraisonAI&type=Date)](https://docs.praison.ai)
502
+
503
+ ## AI Agents Flow
504
+
505
+ ```mermaid
506
+ graph LR
507
+ %% Define the main flow
508
+ Start([▶ Start]) --> Agent1
509
+ Agent1 --> Process[⚙ Process]
510
+ Process --> Agent2
511
+ Agent2 --> Output([✓ Output])
512
+ Process -.-> Agent1
513
+
514
+ %% Define subgraphs for agents and their tasks
515
+ subgraph Agent1[ ]
516
+ Task1[📋 Task]
517
+ AgentIcon1[🤖 AI Agent]
518
+ Tools1[🔧 Tools]
519
+
520
+ Task1 --- AgentIcon1
521
+ AgentIcon1 --- Tools1
522
+ end
523
+
524
+ subgraph Agent2[ ]
525
+ Task2[📋 Task]
526
+ AgentIcon2[🤖 AI Agent]
527
+ Tools2[🔧 Tools]
528
+
529
+ Task2 --- AgentIcon2
530
+ AgentIcon2 --- Tools2
531
+ end
532
+
533
+ classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
534
+ classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
535
+ classDef tools fill:#2E8B57,stroke:#7C90A0,color:#fff
536
+ classDef transparent fill:none,stroke:none
537
+
538
+ class Start,Output,Task1,Task2 input
539
+ class Process,AgentIcon1,AgentIcon2 process
540
+ class Tools1,Tools2 tools
541
+ class Agent1,Agent2 transparent
542
+ ```
543
+
544
+ ## AI Agents with Tools
545
+
546
+ Create AI agents that can use tools to interact with external systems and perform actions.
547
+
548
+ ```mermaid
549
+ flowchart TB
550
+ subgraph Tools
551
+ direction TB
552
+ T3[Internet Search]
553
+ T1[Code Execution]
554
+ T2[Formatting]
555
+ end
556
+
557
+ Input[Input] ---> Agents
558
+ subgraph Agents
559
+ direction LR
560
+ A1[Agent 1]
561
+ A2[Agent 2]
562
+ A3[Agent 3]
563
+ end
564
+ Agents ---> Output[Output]
565
+
566
+ T3 --> A1
567
+ T1 --> A2
568
+ T2 --> A3
569
+
570
+ style Tools fill:#189AB4,color:#fff
571
+ style Agents fill:#8B0000,color:#fff
572
+ style Input fill:#8B0000,color:#fff
573
+ style Output fill:#8B0000,color:#fff
574
+ ```
575
+
576
+ ## AI Agents with Memory
577
+
578
+ Create AI agents with memory capabilities for maintaining context and information across tasks.
579
+
580
+ ```mermaid
581
+ flowchart TB
582
+ subgraph Memory
583
+ direction TB
584
+ STM[Short Term]
585
+ LTM[Long Term]
586
+ end
587
+
588
+ subgraph Store
589
+ direction TB
590
+ DB[(Vector DB)]
591
+ end
592
+
593
+ Input[Input] ---> Agents
594
+ subgraph Agents
595
+ direction LR
596
+ A1[Agent 1]
597
+ A2[Agent 2]
598
+ A3[Agent 3]
599
+ end
600
+ Agents ---> Output[Output]
601
+
602
+ Memory <--> Store
603
+ Store <--> A1
604
+ Store <--> A2
605
+ Store <--> A3
606
+
607
+ style Memory fill:#189AB4,color:#fff
608
+ style Store fill:#2E8B57,color:#fff
609
+ style Agents fill:#8B0000,color:#fff
610
+ style Input fill:#8B0000,color:#fff
611
+ style Output fill:#8B0000,color:#fff
612
+ ```
613
+
614
+ ## AI Agents with Different Processes
615
+
616
+ ### Sequential Process
617
+
618
+ The simplest form of task execution where tasks are performed one after another.
619
+
620
+ ```mermaid
621
+ graph LR
622
+ Input[Input] --> A1
623
+ subgraph Agents
624
+ direction LR
625
+ A1[Agent 1] --> A2[Agent 2] --> A3[Agent 3]
626
+ end
627
+ A3 --> Output[Output]
628
+
629
+ classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
630
+ classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
631
+ classDef transparent fill:none,stroke:none
632
+
633
+ class Input,Output input
634
+ class A1,A2,A3 process
635
+ class Agents transparent
636
+ ```
637
+
638
+ ### Hierarchical Process
639
+
640
+ Uses a manager agent to coordinate task execution and agent assignments.
641
+
642
+ ```mermaid
643
+ graph TB
644
+ Input[Input] --> Manager
645
+
646
+ subgraph Agents
647
+ Manager[Manager Agent]
648
+
649
+ subgraph Workers
650
+ direction LR
651
+ W1[Worker 1]
652
+ W2[Worker 2]
653
+ W3[Worker 3]
654
+ end
655
+
656
+ Manager --> W1
657
+ Manager --> W2
658
+ Manager --> W3
659
+ end
660
+
661
+ W1 --> Manager
662
+ W2 --> Manager
663
+ W3 --> Manager
664
+ Manager --> Output[Output]
665
+
666
+ classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
667
+ classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
668
+ classDef transparent fill:none,stroke:none
669
+
670
+ class Input,Output input
671
+ class Manager,W1,W2,W3 process
672
+ class Agents,Workers transparent
673
+ ```
674
+
675
+ ### Workflow Process
676
+
677
+ Advanced process type supporting complex task relationships and conditional execution.
678
+
679
+ ```mermaid
680
+ graph LR
681
+ Input[Input] --> Start
682
+
683
+ subgraph Workflow
684
+ direction LR
685
+ Start[Start] --> C1{Condition}
686
+ C1 --> |Yes| A1[Agent 1]
687
+ C1 --> |No| A2[Agent 2]
688
+ A1 --> Join
689
+ A2 --> Join
690
+ Join --> A3[Agent 3]
691
+ end
692
+
693
+ A3 --> Output[Output]
694
+
695
+ classDef input fill:#8B0000,stroke:#7C90A0,color:#fff
696
+ classDef process fill:#189AB4,stroke:#7C90A0,color:#fff
697
+ classDef decision fill:#2E8B57,stroke:#7C90A0,color:#fff
698
+ classDef transparent fill:none,stroke:none
699
+
700
+ class Input,Output input
701
+ class Start,A1,A2,A3,Join process
702
+ class C1 decision
703
+ class Workflow transparent
704
+ ```
705
+
706
+ #### Agentic Routing Workflow
707
+
708
+ Create AI agents that can dynamically route tasks to specialized LLM instances.
709
+
710
+ ```mermaid
711
+ flowchart LR
712
+ In[In] --> Router[LLM Call Router]
713
+ Router --> LLM1[LLM Call 1]
714
+ Router --> LLM2[LLM Call 2]
715
+ Router --> LLM3[LLM Call 3]
716
+ LLM1 --> Out[Out]
717
+ LLM2 --> Out
718
+ LLM3 --> Out
719
+
720
+ style In fill:#8B0000,color:#fff
721
+ style Router fill:#2E8B57,color:#fff
722
+ style LLM1 fill:#2E8B57,color:#fff
723
+ style LLM2 fill:#2E8B57,color:#fff
724
+ style LLM3 fill:#2E8B57,color:#fff
725
+ style Out fill:#8B0000,color:#fff
726
+ ```
727
+
728
+ #### Agentic Orchestrator Worker
729
+
730
+ Create AI agents that orchestrate and distribute tasks among specialized workers.
731
+
732
+ ```mermaid
733
+ flowchart LR
734
+ In[In] --> Router[LLM Call Router]
735
+ Router --> LLM1[LLM Call 1]
736
+ Router --> LLM2[LLM Call 2]
737
+ Router --> LLM3[LLM Call 3]
738
+ LLM1 --> Synthesizer[Synthesizer]
739
+ LLM2 --> Synthesizer
740
+ LLM3 --> Synthesizer
741
+ Synthesizer --> Out[Out]
742
+
743
+ style In fill:#8B0000,color:#fff
744
+ style Router fill:#2E8B57,color:#fff
745
+ style LLM1 fill:#2E8B57,color:#fff
746
+ style LLM2 fill:#2E8B57,color:#fff
747
+ style LLM3 fill:#2E8B57,color:#fff
748
+ style Synthesizer fill:#2E8B57,color:#fff
749
+ style Out fill:#8B0000,color:#fff
750
+ ```
751
+
752
+ #### Agentic Autonomous Workflow
753
+
754
+ Create AI agents that can autonomously monitor, act, and adapt based on environment feedback.
755
+
756
+ ```mermaid
757
+ flowchart LR
758
+ Human[Human] <--> LLM[LLM Call]
759
+ LLM -->|ACTION| Environment[Environment]
760
+ Environment -->|FEEDBACK| LLM
761
+ LLM --> Stop[Stop]
762
+
763
+ style Human fill:#8B0000,color:#fff
764
+ style LLM fill:#2E8B57,color:#fff
765
+ style Environment fill:#8B0000,color:#fff
766
+ style Stop fill:#333,color:#fff
767
+ ```
768
+
769
+ #### Agentic Parallelization
770
+
771
+ Create AI agents that can execute tasks in parallel for improved performance.
772
+
773
+ ```mermaid
774
+ flowchart LR
775
+ In[In] --> LLM2[LLM Call 2]
776
+ In --> LLM1[LLM Call 1]
777
+ In --> LLM3[LLM Call 3]
778
+ LLM1 --> Aggregator[Aggregator]
779
+ LLM2 --> Aggregator
780
+ LLM3 --> Aggregator
781
+ Aggregator --> Out[Out]
782
+
783
+ style In fill:#8B0000,color:#fff
784
+ style LLM1 fill:#2E8B57,color:#fff
785
+ style LLM2 fill:#2E8B57,color:#fff
786
+ style LLM3 fill:#2E8B57,color:#fff
787
+ style Aggregator fill:#fff,color:#000
788
+ style Out fill:#8B0000,color:#fff
789
+ ```
790
+
791
+ #### Agentic Prompt Chaining
792
+
793
+ Create AI agents with sequential prompt chaining for complex workflows.
794
+
795
+ ```mermaid
796
+ flowchart LR
797
+ In[In] --> LLM1[LLM Call 1] --> Gate{Gate}
798
+ Gate -->|Pass| LLM2[LLM Call 2] -->|Output 2| LLM3[LLM Call 3] --> Out[Out]
799
+ Gate -->|Fail| Exit[Exit]
800
+
801
+ style In fill:#8B0000,color:#fff
802
+ style LLM1 fill:#2E8B57,color:#fff
803
+ style LLM2 fill:#2E8B57,color:#fff
804
+ style LLM3 fill:#2E8B57,color:#fff
805
+ style Out fill:#8B0000,color:#fff
806
+ style Exit fill:#8B0000,color:#fff
807
+ ```
808
+
809
+ #### Agentic Evaluator Optimizer
810
+
811
+ Create AI agents that can generate and optimize solutions through iterative feedback.
812
+
813
+ ```mermaid
814
+ flowchart LR
815
+ In[In] --> Generator[LLM Call Generator]
816
+ Generator -->|SOLUTION| Evaluator[LLM Call Evaluator] -->|ACCEPTED| Out[Out]
817
+ Evaluator -->|REJECTED + FEEDBACK| Generator
818
+
819
+ style In fill:#8B0000,color:#fff
820
+ style Generator fill:#2E8B57,color:#fff
821
+ style Evaluator fill:#2E8B57,color:#fff
822
+ style Out fill:#8B0000,color:#fff
823
+ ```
824
+
825
+ #### Repetitive Agents
826
+
827
+ Create AI agents that can efficiently handle repetitive tasks through automated loops.
828
+
829
+ ```mermaid
830
+ flowchart LR
831
+ In[Input] --> LoopAgent[("Looping Agent")]
832
+ LoopAgent --> Task[Task]
833
+ Task --> |Next iteration| LoopAgent
834
+ Task --> |Done| Out[Output]
835
+
836
+ style In fill:#8B0000,color:#fff
837
+ style LoopAgent fill:#2E8B57,color:#fff,shape:circle
838
+ style Task fill:#2E8B57,color:#fff
839
+ style Out fill:#8B0000,color:#fff
840
+ ```
841
+
842
+ ## Adding Models
843
+
844
+ <div align="center">
845
+ <a href="https://docs.praison.ai/models">
846
+ <p align="center">
847
+ <img src="https://img.shields.io/badge/%F0%9F%93%9A_Models-Visit_docs.praison.ai-blue?style=for-the-badge&logo=bookstack&logoColor=white" alt="Models" />
848
+ </p>
849
+ </a>
850
+ </div>
851
+
852
+ ## Ollama Integration
853
+ ```bash
854
+ export OPENAI_BASE_URL=http://localhost:11434/v1
855
+ ```
856
+
857
+ ## Groq Integration
858
+ Replace xxxx with Groq API KEY:
859
+ ```bash
860
+ export OPENAI_API_KEY=xxxxxxxxxxx
861
+ export OPENAI_BASE_URL=https://api.groq.com/openai/v1
862
+ ```
863
+
864
+ ## No Code Options
865
+
866
+ ## Agents Playbook
867
+
868
+ ### Simple Playbook Example
869
+
870
+ Create `agents.yaml` file and add the code below:
871
+
872
+ ```yaml
873
+ framework: praisonai
874
+ topic: Artificial Intelligence
875
+ roles:
876
+ screenwriter:
877
+ backstory: "Skilled in crafting scripts with engaging dialogue about {topic}."
878
+ goal: Create scripts from concepts.
879
+ role: Screenwriter
880
+ tasks:
881
+ scriptwriting_task:
882
+ description: "Develop scripts with compelling characters and dialogue about {topic}."
883
+ expected_output: "Complete script ready for production."
884
+ ```
885
+
886
+ *To run the playbook:*
887
+ ```bash
888
+ praisonai agents.yaml
889
+ ```
890
+
891
+ ## Use 100+ Models
892
+
893
+ - https://docs.praison.ai/models/
894
+ <div align="center">
895
+ <a href="https://docs.praison.ai">
896
+ <p align="center">
897
+ <img src="https://img.shields.io/badge/📚_Documentation-Visit_docs.praison.ai-blue?style=for-the-badge&logo=bookstack&logoColor=white" alt="Documentation" />
898
+ </p>
899
+ </a>
900
+ </div>
901
+
902
+
903
+ ## Custom Tools
904
+
905
+ ### Using `@tool` Decorator
906
+
907
+ ```python
908
+ from praisonaiagents import Agent, tool
909
+
910
+ @tool
911
+ def search(query: str) -> str:
912
+ """Search the web for information."""
913
+ return f"Results for: {query}"
914
+
915
+ @tool
916
+ def calculate(expression: str) -> float:
917
+ """Evaluate a math expression."""
918
+ return eval(expression)
919
+
920
+ agent = Agent(
921
+ instructions="You are a helpful assistant",
922
+ tools=[search, calculate]
923
+ )
924
+ agent.start("Search for AI news and calculate 15*4")
925
+ ```
926
+
927
+ ### Using `BaseTool` Class
928
+
929
+ ```python
930
+ from praisonaiagents import Agent, BaseTool
931
+
932
+ class WeatherTool(BaseTool):
933
+ name = "weather"
934
+ description = "Get current weather for a location"
935
+
936
+ def run(self, location: str) -> str:
937
+ return f"Weather in {location}: 72°F, Sunny"
938
+
939
+ agent = Agent(
940
+ instructions="You are a weather assistant",
941
+ tools=[WeatherTool()]
942
+ )
943
+ agent.start("What's the weather in Paris?")
944
+ ```
945
+
946
+ ### Creating a Tool Package (pip installable)
947
+
948
+ ```toml
949
+ # pyproject.toml
950
+ [project]
951
+ name = "my-praisonai-tools"
952
+ version = "1.0.0"
953
+ dependencies = ["praisonaiagents"]
954
+
955
+ [project.entry-points."praisonaiagents.tools"]
956
+ my_tool = "my_package:MyTool"
957
+ ```
958
+
959
+ ```python
960
+ # my_package/__init__.py
961
+ from praisonaiagents import BaseTool
962
+
963
+ class MyTool(BaseTool):
964
+ name = "my_tool"
965
+ description = "My custom tool"
966
+
967
+ def run(self, param: str) -> str:
968
+ return f"Result: {param}"
969
+ ```
970
+
971
+ After `pip install`, tools are auto-discovered:
972
+ ```python
973
+ agent = Agent(tools=["my_tool"]) # Works automatically!
974
+ ```
975
+
976
+
977
+ ## Prompt Expansion
978
+
979
+ Expand short prompts into detailed, actionable prompts:
980
+
981
+ ### CLI Usage
982
+
983
+ ```bash
984
+ # Expand a short prompt into detailed prompt
985
+ praisonai "write a movie script in 3 lines" --expand-prompt
986
+
987
+ # With verbose output
988
+ praisonai "blog about AI" --expand-prompt -v
989
+
990
+ # With tools for context gathering
991
+ praisonai "latest AI trends" --expand-prompt --expand-tools tools.py
992
+
993
+ # Combine with query rewrite
994
+ praisonai "AI news" --query-rewrite --expand-prompt
995
+ ```
996
+
997
+ ### Programmatic Usage
998
+
999
+ ```python
1000
+ from praisonaiagents import PromptExpanderAgent, ExpandStrategy
1001
+
1002
+ # Basic usage
1003
+ agent = PromptExpanderAgent()
1004
+ result = agent.expand("write a movie script in 3 lines")
1005
+ print(result.expanded_prompt)
1006
+
1007
+ # With specific strategy
1008
+ result = agent.expand("blog about AI", strategy=ExpandStrategy.DETAILED)
1009
+
1010
+ # Available strategies: BASIC, DETAILED, STRUCTURED, CREATIVE, AUTO
1011
+ ```
1012
+
1013
+ **Key Difference:**
1014
+ - `--query-rewrite`: Optimizes queries for **search/retrieval** (RAG)
1015
+ - `--expand-prompt`: Expands prompts for **detailed task execution**
1016
+
1017
+
1018
+ ## Web Search, Web Fetch & Prompt Caching
1019
+
1020
+ ### CLI Usage
1021
+
1022
+ ```bash
1023
+ # Web Search - Get real-time information
1024
+ praisonai "What are the latest AI news today?" --web-search --llm openai/gpt-4o-search-preview
1025
+
1026
+ # Web Fetch - Retrieve and analyze URL content (Anthropic only)
1027
+ praisonai "Summarize https://docs.praison.ai" --web-fetch --llm anthropic/claude-sonnet-4-20250514
1028
+
1029
+ # Prompt Caching - Reduce costs for repeated prompts
1030
+ praisonai "Analyze this document..." --prompt-caching --llm anthropic/claude-sonnet-4-20250514
1031
+ ```
1032
+
1033
+ ### Programmatic Usage
1034
+
1035
+ ```python
1036
+ from praisonaiagents import Agent
1037
+
1038
+ # Web Search
1039
+ agent = Agent(
1040
+ instructions="You are a research assistant",
1041
+ llm="openai/gpt-4o-search-preview",
1042
+ web_search=True
1043
+ )
1044
+
1045
+ # Web Fetch (Anthropic only)
1046
+ agent = Agent(
1047
+ instructions="You are a content analyzer",
1048
+ llm="anthropic/claude-sonnet-4-20250514",
1049
+ web_fetch=True
1050
+ )
1051
+
1052
+ # Prompt Caching
1053
+ agent = Agent(
1054
+ instructions="You are an AI assistant..." * 50, # Long system prompt
1055
+ llm="anthropic/claude-sonnet-4-20250514",
1056
+ prompt_caching=True
1057
+ )
1058
+ ```
1059
+
1060
+ **Supported Providers:**
1061
+ | Feature | Providers |
1062
+ |---------|-----------|
1063
+ | Web Search | OpenAI, Gemini, Anthropic, xAI, Perplexity |
1064
+ | Web Fetch | Anthropic |
1065
+ | Prompt Caching | OpenAI (auto), Anthropic, Bedrock, Deepseek |
1066
+
1067
+
1068
+ ## Development:
1069
+
1070
+ Below is used for development only.
1071
+
1072
+ ### Using uv
1073
+ ```bash
1074
+ # Install uv if you haven't already
1075
+ pip install uv
1076
+
1077
+ # Install from requirements
1078
+ uv pip install -r pyproject.toml
1079
+
1080
+ # Install with extras
1081
+ uv pip install -r pyproject.toml --extra code
1082
+ uv pip install -r pyproject.toml --extra "crewai,autogen"
1083
+ ```
1084
+
1085
+ ### Bump and Release
1086
+
1087
+ ```bash
1088
+ # From project root - bumps version and releases in one command
1089
+ python src/praisonai/scripts/bump_and_release.py 2.2.99
1090
+
1091
+ # With praisonaiagents dependency
1092
+ python src/praisonai/scripts/bump_and_release.py 2.2.99 --agents 0.0.169
1093
+
1094
+ # Then publish
1095
+ cd src/praisonai && uv publish
1096
+ ```
1097
+
1098
+ ## Contributing
1099
+
1100
+ - Fork on GitHub: Use the "Fork" button on the repository page.
1101
+ - Clone your fork: `git clone https://github.com/yourusername/praisonAI.git`
1102
+ - Create a branch: `git checkout -b new-feature`
1103
+ - Make changes and commit: `git commit -am "Add some feature"`
1104
+ - Push to your fork: `git push origin new-feature`
1105
+ - Submit a pull request via GitHub's web interface.
1106
+ - Await feedback from project maintainers.
1107
+
1108
+ ## Other Features
1109
+
1110
+ - 🔄 Use CrewAI or AG2 (Formerly AutoGen) Framework
1111
+ - 💻 Chat with ENTIRE Codebase
1112
+ - 🎨 Interactive UIs
1113
+ - 📄 YAML-based Configuration
1114
+ - 🛠️ Custom Tool Integration
1115
+ - 🔍 Internet Search Capability (using Crawl4AI and Tavily)
1116
+ - 🖼️ Vision Language Model (VLM) Support
1117
+ - 🎙️ Real-time Voice Interaction
1118
+
1119
+ ## Video Tutorials
1120
+
1121
+ | Topic | Video |
1122
+ |-------|--------|
1123
+ | AI Agents with Self Reflection | [![Self Reflection](https://img.youtube.com/vi/vLXobEN2Vc8/0.jpg)](https://www.youtube.com/watch?v=vLXobEN2Vc8) |
1124
+ | Reasoning Data Generating Agent | [![Reasoning Data](https://img.youtube.com/vi/fUT332Y2zA8/0.jpg)](https://www.youtube.com/watch?v=fUT332Y2zA8) |
1125
+ | AI Agents with Reasoning | [![Reasoning](https://img.youtube.com/vi/KNDVWGN3TpM/0.jpg)](https://www.youtube.com/watch?v=KNDVWGN3TpM) |
1126
+ | Multimodal AI Agents | [![Multimodal](https://img.youtube.com/vi/hjAWmUT1qqY/0.jpg)](https://www.youtube.com/watch?v=hjAWmUT1qqY) |
1127
+ | AI Agents Workflow | [![Workflow](https://img.youtube.com/vi/yWTH44QPl2A/0.jpg)](https://www.youtube.com/watch?v=yWTH44QPl2A) |
1128
+ | Async AI Agents | [![Async](https://img.youtube.com/vi/VhVQfgo00LE/0.jpg)](https://www.youtube.com/watch?v=VhVQfgo00LE) |
1129
+ | Mini AI Agents | [![Mini](https://img.youtube.com/vi/OkvYp5aAGSg/0.jpg)](https://www.youtube.com/watch?v=OkvYp5aAGSg) |
1130
+ | AI Agents with Memory | [![Memory](https://img.youtube.com/vi/1hVfVxvPnnQ/0.jpg)](https://www.youtube.com/watch?v=1hVfVxvPnnQ) |
1131
+ | Repetitive Agents | [![Repetitive](https://img.youtube.com/vi/dAYGxsjDOPg/0.jpg)](https://www.youtube.com/watch?v=dAYGxsjDOPg) |
1132
+ | Introduction | [![Introduction](https://img.youtube.com/vi/Fn1lQjC0GO0/0.jpg)](https://www.youtube.com/watch?v=Fn1lQjC0GO0) |
1133
+ | Tools Overview | [![Tools Overview](https://img.youtube.com/vi/XaQRgRpV7jo/0.jpg)](https://www.youtube.com/watch?v=XaQRgRpV7jo) |
1134
+ | Custom Tools | [![Custom Tools](https://img.youtube.com/vi/JSU2Rndh06c/0.jpg)](https://www.youtube.com/watch?v=JSU2Rndh06c) |
1135
+ | Firecrawl Integration | [![Firecrawl](https://img.youtube.com/vi/UoqUDcLcOYo/0.jpg)](https://www.youtube.com/watch?v=UoqUDcLcOYo) |
1136
+ | User Interface | [![UI](https://img.youtube.com/vi/tg-ZjNl3OCg/0.jpg)](https://www.youtube.com/watch?v=tg-ZjNl3OCg) |
1137
+ | Crawl4AI Integration | [![Crawl4AI](https://img.youtube.com/vi/KAvuVUh0XU8/0.jpg)](https://www.youtube.com/watch?v=KAvuVUh0XU8) |
1138
+ | Chat Interface | [![Chat](https://img.youtube.com/vi/sw3uDqn2h1Y/0.jpg)](https://www.youtube.com/watch?v=sw3uDqn2h1Y) |
1139
+ | Code Interface | [![Code](https://img.youtube.com/vi/_5jQayO-MQY/0.jpg)](https://www.youtube.com/watch?v=_5jQayO-MQY) |
1140
+ | Mem0 Integration | [![Mem0](https://img.youtube.com/vi/KIGSgRxf1cY/0.jpg)](https://www.youtube.com/watch?v=KIGSgRxf1cY) |
1141
+ | Training | [![Training](https://img.youtube.com/vi/aLawE8kwCrI/0.jpg)](https://www.youtube.com/watch?v=aLawE8kwCrI) |
1142
+ | Realtime Voice Interface | [![Realtime](https://img.youtube.com/vi/frRHfevTCSw/0.jpg)](https://www.youtube.com/watch?v=frRHfevTCSw) |
1143
+ | Call Interface | [![Call](https://img.youtube.com/vi/m1cwrUG2iAk/0.jpg)](https://www.youtube.com/watch?v=m1cwrUG2iAk) |
1144
+ | Reasoning Extract Agents | [![Reasoning Extract](https://img.youtube.com/vi/2PPamsADjJA/0.jpg)](https://www.youtube.com/watch?v=2PPamsADjJA) |
1145
+