ai-data-science-team 0.0.0.9013__tar.gz → 0.0.0.9015__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 (54) hide show
  1. {ai_data_science_team-0.0.0.9013/ai_data_science_team.egg-info → ai_data_science_team-0.0.0.9015}/PKG-INFO +6 -5
  2. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/README.md +4 -3
  3. ai_data_science_team-0.0.0.9015/ai_data_science_team/__init__.py +22 -0
  4. ai_data_science_team-0.0.0.9015/ai_data_science_team/_version.py +1 -0
  5. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/agents/data_cleaning_agent.py +17 -3
  6. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/agents/data_loader_tools_agent.py +13 -1
  7. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/agents/data_visualization_agent.py +187 -130
  8. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/agents/data_wrangling_agent.py +31 -10
  9. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/agents/feature_engineering_agent.py +17 -4
  10. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/agents/sql_database_agent.py +15 -2
  11. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/ds_agents/eda_tools_agent.py +15 -6
  12. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/ml_agents/h2o_ml_agent.py +15 -3
  13. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/ml_agents/mlflow_tools_agent.py +13 -1
  14. ai_data_science_team-0.0.0.9015/ai_data_science_team/multiagents/__init__.py +2 -0
  15. ai_data_science_team-0.0.0.9015/ai_data_science_team/multiagents/pandas_data_analyst.py +305 -0
  16. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/multiagents/sql_data_analyst.py +126 -48
  17. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/templates/agent_templates.py +41 -5
  18. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/tools/eda.py +2 -0
  19. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015/ai_data_science_team.egg-info}/PKG-INFO +6 -5
  20. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team.egg-info/SOURCES.txt +1 -0
  21. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team.egg-info/requires.txt +1 -1
  22. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/requirements.txt +1 -1
  23. ai_data_science_team-0.0.0.9013/ai_data_science_team/_version.py +0 -1
  24. ai_data_science_team-0.0.0.9013/ai_data_science_team/multiagents/__init__.py +0 -1
  25. ai_data_science_team-0.0.0.9013/ai_data_science_team/utils/__init__.py +0 -0
  26. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/LICENSE +0 -0
  27. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/MANIFEST.in +0 -0
  28. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/agents/__init__.py +0 -0
  29. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/ds_agents/__init__.py +0 -0
  30. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/ds_agents/modeling_tools_agent.py +0 -0
  31. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/ml_agents/__init__.py +0 -0
  32. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/ml_agents/h2o_ml_tools_agent.py +0 -0
  33. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/multiagents/supervised_data_analyst.py +0 -0
  34. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/orchestration.py +0 -0
  35. {ai_data_science_team-0.0.0.9013/ai_data_science_team → ai_data_science_team-0.0.0.9015/ai_data_science_team/parsers}/__init__.py +0 -0
  36. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/parsers/parsers.py +0 -0
  37. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/templates/__init__.py +0 -0
  38. {ai_data_science_team-0.0.0.9013/ai_data_science_team/parsers → ai_data_science_team-0.0.0.9015/ai_data_science_team/tools}/__init__.py +0 -0
  39. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/tools/data_loader.py +0 -0
  40. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/tools/dataframe.py +0 -0
  41. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/tools/h2o.py +0 -0
  42. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/tools/mlflow.py +0 -0
  43. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/tools/sql.py +0 -0
  44. {ai_data_science_team-0.0.0.9013/ai_data_science_team/tools → ai_data_science_team-0.0.0.9015/ai_data_science_team/utils}/__init__.py +0 -0
  45. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/utils/html.py +0 -0
  46. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/utils/logging.py +0 -0
  47. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/utils/matplotlib.py +0 -0
  48. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/utils/messages.py +0 -0
  49. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/utils/plotly.py +0 -0
  50. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team/utils/regex.py +0 -0
  51. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team.egg-info/dependency_links.txt +0 -0
  52. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/ai_data_science_team.egg-info/top_level.txt +0 -0
  53. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/setup.cfg +0 -0
  54. {ai_data_science_team-0.0.0.9013 → ai_data_science_team-0.0.0.9015}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ai-data-science-team
3
- Version: 0.0.0.9013
3
+ Version: 0.0.0.9015
4
4
  Summary: Build and run an AI-powered data science team.
5
5
  Home-page: https://github.com/business-science/ai-data-science-team
6
6
  Author: Matt Dancho
@@ -18,7 +18,7 @@ Requires-Dist: langchain
18
18
  Requires-Dist: langchain_community
19
19
  Requires-Dist: langchain_openai
20
20
  Requires-Dist: langchain_experimental
21
- Requires-Dist: langgraph>=0.2.57
21
+ Requires-Dist: langgraph>=0.2.74
22
22
  Requires-Dist: openai
23
23
  Requires-Dist: pandas
24
24
  Requires-Dist: sqlalchemy
@@ -136,9 +136,9 @@ This project is a work in progress. New data science agents will be released soo
136
136
 
137
137
  ### NEW: Multi-Agents
138
138
 
139
- This is the internals of the SQL Data Analyst Agent that connects to SQL databases to pull data into the data science environment. It creates pipelines to automate data extraction, performs Joins, Aggregations, and other SQL Query operations. And it includes a Data Visualization Agent that creates visualizations to help you understand your data.:
139
+ **🔥 Pandas Data Analyst Agent:** Combines the ability to wrangle, transform, and analyze data with an optional data visualization agent that can create interactive plots.
140
140
 
141
- ![Business Intelligence SQL Agent](/img/multi_agent_sql_data_visualization.jpg)
141
+ ![Business Intelligence SQL Agent](/img/multi_agent_pandas_data_analyst.jpg)
142
142
 
143
143
  ### Data Science Apps
144
144
 
@@ -182,7 +182,8 @@ This is a top secret project I'm working on. It's a multi-agent data science app
182
182
 
183
183
  #### Multi-Agents
184
184
 
185
- 1. **SQL Data Analyst Agent:** Connects to SQL databases to pull data into the data science environment. Creates pipelines to automate data extraction. Performs Joins, Aggregations, and other SQL Query operations. Includes a Data Visualization Agent that creates visualizations to help you understand your data. [See Example](https://github.com/business-science/ai-data-science-team/blob/master/examples/multiagents/sql_data_analyst.ipynb)
185
+ 1. **🔥🔥 Pandas Data Analyst Agent:** Combines the ability to wrangle, transform, and analyze data with an optional data visualization agent that can create interactive plots. [See Example](https://github.com/business-science/ai-data-science-team/blob/master/examples/multiagents/pandas_data_analyst.ipynb)
186
+ 2. **🔥🔥 SQL Data Analyst Agent:** Connects to SQL databases to pull data into the data science environment. Creates pipelines to automate data extraction. Performs Joins, Aggregations, and other SQL Query operations. Includes a Data Visualization Agent that creates visualizations to help you understand your data. [See Example](https://github.com/business-science/ai-data-science-team/blob/master/examples/multiagents/sql_data_analyst.ipynb)
186
187
 
187
188
  ### Agents Coming Soon
188
189
 
@@ -82,9 +82,9 @@ This project is a work in progress. New data science agents will be released soo
82
82
 
83
83
  ### NEW: Multi-Agents
84
84
 
85
- This is the internals of the SQL Data Analyst Agent that connects to SQL databases to pull data into the data science environment. It creates pipelines to automate data extraction, performs Joins, Aggregations, and other SQL Query operations. And it includes a Data Visualization Agent that creates visualizations to help you understand your data.:
85
+ **🔥 Pandas Data Analyst Agent:** Combines the ability to wrangle, transform, and analyze data with an optional data visualization agent that can create interactive plots.
86
86
 
87
- ![Business Intelligence SQL Agent](/img/multi_agent_sql_data_visualization.jpg)
87
+ ![Business Intelligence SQL Agent](/img/multi_agent_pandas_data_analyst.jpg)
88
88
 
89
89
  ### Data Science Apps
90
90
 
@@ -128,7 +128,8 @@ This is a top secret project I'm working on. It's a multi-agent data science app
128
128
 
129
129
  #### Multi-Agents
130
130
 
131
- 1. **SQL Data Analyst Agent:** Connects to SQL databases to pull data into the data science environment. Creates pipelines to automate data extraction. Performs Joins, Aggregations, and other SQL Query operations. Includes a Data Visualization Agent that creates visualizations to help you understand your data. [See Example](https://github.com/business-science/ai-data-science-team/blob/master/examples/multiagents/sql_data_analyst.ipynb)
131
+ 1. **🔥🔥 Pandas Data Analyst Agent:** Combines the ability to wrangle, transform, and analyze data with an optional data visualization agent that can create interactive plots. [See Example](https://github.com/business-science/ai-data-science-team/blob/master/examples/multiagents/pandas_data_analyst.ipynb)
132
+ 2. **🔥🔥 SQL Data Analyst Agent:** Connects to SQL databases to pull data into the data science environment. Creates pipelines to automate data extraction. Performs Joins, Aggregations, and other SQL Query operations. Includes a Data Visualization Agent that creates visualizations to help you understand your data. [See Example](https://github.com/business-science/ai-data-science-team/blob/master/examples/multiagents/sql_data_analyst.ipynb)
132
133
 
133
134
  ### Agents Coming Soon
134
135
 
@@ -0,0 +1,22 @@
1
+ from ai_data_science_team.agents import (
2
+ DataCleaningAgent,
3
+ DataLoaderToolsAgent,
4
+ DataVisualizationAgent,
5
+ SQLDatabaseAgent,
6
+ DataWranglingAgent,
7
+ FeatureEngineeringAgent,
8
+ )
9
+
10
+ from ai_data_science_team.ds_agents import (
11
+ EDAToolsAgent,
12
+ )
13
+
14
+ from ai_data_science_team.ml_agents import (
15
+ H2OMLAgent,
16
+ MLflowToolsAgent,
17
+ )
18
+
19
+ from ai_data_science_team.multiagents import (
20
+ SQLDataAnalyst,
21
+ PandasDataAnalyst,
22
+ )
@@ -0,0 +1 @@
1
+ __version__ = "0.0.0.9015"
@@ -12,6 +12,7 @@ from langchain_core.messages import BaseMessage
12
12
 
13
13
  from langgraph.types import Command
14
14
  from langgraph.checkpoint.memory import MemorySaver
15
+ from langgraph.types import Checkpointer
15
16
 
16
17
  import os
17
18
  import json
@@ -85,6 +86,8 @@ class DataCleaningAgent(BaseAgent):
85
86
  If True, skips the default recommended cleaning steps. Defaults to False.
86
87
  bypass_explain_code : bool, optional
87
88
  If True, skips the step that provides code explanations. Defaults to False.
89
+ checkpointer : langgraph.types.Checkpointer, optional
90
+ Checkpointer to save and load the agent's state. Defaults to None.
88
91
 
89
92
  Methods
90
93
  -------
@@ -159,7 +162,8 @@ class DataCleaningAgent(BaseAgent):
159
162
  overwrite=True,
160
163
  human_in_the_loop=False,
161
164
  bypass_recommended_steps=False,
162
- bypass_explain_code=False
165
+ bypass_explain_code=False,
166
+ checkpointer: Checkpointer = None
163
167
  ):
164
168
  self._params = {
165
169
  "model": model,
@@ -172,6 +176,7 @@ class DataCleaningAgent(BaseAgent):
172
176
  "human_in_the_loop": human_in_the_loop,
173
177
  "bypass_recommended_steps": bypass_recommended_steps,
174
178
  "bypass_explain_code": bypass_explain_code,
179
+ "checkpointer": checkpointer
175
180
  }
176
181
  self._compiled_graph = self._make_compiled_graph()
177
182
  self.response = None
@@ -320,7 +325,8 @@ def make_data_cleaning_agent(
320
325
  overwrite = True,
321
326
  human_in_the_loop=False,
322
327
  bypass_recommended_steps=False,
323
- bypass_explain_code=False
328
+ bypass_explain_code=False,
329
+ checkpointer: Checkpointer = None
324
330
  ):
325
331
  """
326
332
  Creates a data cleaning agent that can be run on a dataset. The agent can be used to clean a dataset in a variety of
@@ -369,6 +375,8 @@ def make_data_cleaning_agent(
369
375
  Bypass the recommendation step, by default False
370
376
  bypass_explain_code : bool, optional
371
377
  Bypass the code explanation step, by default False.
378
+ checkpointer : langgraph.types.Checkpointer, optional
379
+ Checkpointer to save and load the agent's state. Defaults to None.
372
380
 
373
381
  Examples
374
382
  -------
@@ -400,6 +408,11 @@ def make_data_cleaning_agent(
400
408
  """
401
409
  llm = model
402
410
 
411
+ if human_in_the_loop:
412
+ if checkpointer is None:
413
+ print("Human in the loop is enabled. A checkpointer is required. Setting to MemorySaver().")
414
+ checkpointer = MemorySaver()
415
+
403
416
  # Human in th loop requires recommended steps
404
417
  if bypass_recommended_steps and human_in_the_loop:
405
418
  bypass_recommended_steps = False
@@ -680,9 +693,10 @@ def make_data_cleaning_agent(
680
693
  error_key="data_cleaner_error",
681
694
  human_in_the_loop=human_in_the_loop,
682
695
  human_review_node_name="human_review",
683
- checkpointer=MemorySaver() if human_in_the_loop else None,
696
+ checkpointer=checkpointer,
684
697
  bypass_recommended_steps=bypass_recommended_steps,
685
698
  bypass_explain_code=bypass_explain_code,
699
+ agent_name=AGENT_NAME,
686
700
  )
687
701
 
688
702
  return app
@@ -13,6 +13,7 @@ from langchain_core.messages import BaseMessage, AIMessage
13
13
 
14
14
  from langgraph.prebuilt import create_react_agent, ToolNode
15
15
  from langgraph.prebuilt.chat_agent_executor import AgentState
16
+ from langgraph.types import Checkpointer
16
17
  from langgraph.graph import START, END, StateGraph
17
18
 
18
19
  from ai_data_science_team.templates import BaseAgent
@@ -50,6 +51,8 @@ class DataLoaderToolsAgent(BaseAgent):
50
51
  Additional keyword arguments to pass to the create_react_agent function.
51
52
  invoke_react_agent_kwargs : dict
52
53
  Additional keyword arguments to pass to the invoke method of the react agent.
54
+ checkpointer : langgraph.types.Checkpointer
55
+ A checkpointer to use for saving and loading the agent's state.
53
56
 
54
57
  Methods:
55
58
  --------
@@ -73,11 +76,13 @@ class DataLoaderToolsAgent(BaseAgent):
73
76
  model: Any,
74
77
  create_react_agent_kwargs: Optional[Dict]={},
75
78
  invoke_react_agent_kwargs: Optional[Dict]={},
79
+ checkpointer: Optional[Checkpointer]=None,
76
80
  ):
77
81
  self._params = {
78
82
  "model": model,
79
83
  "create_react_agent_kwargs": create_react_agent_kwargs,
80
84
  "invoke_react_agent_kwargs": invoke_react_agent_kwargs,
85
+ "checkpointer": checkpointer,
81
86
  }
82
87
  self._compiled_graph = self._make_compiled_graph()
83
88
  self.response = None
@@ -188,6 +193,7 @@ def make_data_loader_tools_agent(
188
193
  model: Any,
189
194
  create_react_agent_kwargs: Optional[Dict]={},
190
195
  invoke_react_agent_kwargs: Optional[Dict]={},
196
+ checkpointer: Optional[Checkpointer]=None,
191
197
  ):
192
198
  """
193
199
  Creates a Data Loader Agent that can interact with data loading tools.
@@ -200,6 +206,8 @@ def make_data_loader_tools_agent(
200
206
  Additional keyword arguments to pass to the create_react_agent function.
201
207
  invoke_react_agent_kwargs : dict
202
208
  Additional keyword arguments to pass to the invoke method of the react agent.
209
+ checkpointer : langgraph.types.Checkpointer
210
+ A checkpointer to use for saving and loading the agent's state.
203
211
 
204
212
  Returns:
205
213
  --------
@@ -228,6 +236,7 @@ def make_data_loader_tools_agent(
228
236
  model,
229
237
  tools=tool_node,
230
238
  state_schema=GraphState,
239
+ checkpointer=checkpointer,
231
240
  **create_react_agent_kwargs,
232
241
  )
233
242
 
@@ -277,7 +286,10 @@ def make_data_loader_tools_agent(
277
286
  workflow.add_edge(START, "data_loader_agent")
278
287
  workflow.add_edge("data_loader_agent", END)
279
288
 
280
- app = workflow.compile()
289
+ app = workflow.compile(
290
+ checkpointer=checkpointer,
291
+ name=AGENT_NAME,
292
+ )
281
293
 
282
294
  return app
283
295