Skip to content

Commit 9814a50

Browse files
authored
Merge pull request #3 from togethercomputer/fede/more-tests
tests
2 parents 54b648f + ce58891 commit 9814a50

File tree

10 files changed

+162629
-10
lines changed

10 files changed

+162629
-10
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Install test dependencies
2121
run: |
2222
python -m pip install --upgrade pip
23-
pip install pytest httpx requests
23+
pip install pytest pytest-asyncio httpx requests
2424
pip install -e .
2525
2626
- name: Build Docker image
@@ -42,8 +42,9 @@ jobs:
4242
TOGETHER_API_KEY: ${{ secrets.TOGETHER_API_KEY }}
4343
run: |
4444
python -m pytest tests/test_functional.py -v
45-
python -m pytest tests/test_executors.py -v
4645
python -m pytest tests/test_agent_data_analysis.py -v
46+
python -m pytest tests/test_variable_isolation.py -v
47+
python -m pytest tests/test_executors.py -v
4748
4849
- name: Stop container
4950
if: always()

README.md

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
An AI-powered data analysis assistant that follows the ReAct (Reasoning + Acting) framework to perform comprehensive data science tasks. The agent can execute Python code either locally via Docker or in the cloud using Together's Code Interpreter.
44

5+
## ⚠️ Experimental Software Notice
6+
7+
**This is an experimental tool** powered by large language models. Please be aware of the following limitations:
8+
9+
- **AI-Generated Code**: All analysis and code is generated by AI and may contain errors, bugs, or suboptimal approaches
10+
- **No Guarantee of Accuracy**: Results should be carefully reviewed and validated before making important decisions
11+
- **Learning Tool**: Best suited for exploration, learning, and initial analysis rather than production use
12+
- **Human Oversight Required**: Always verify outputs, especially for critical business or research applications
13+
- **Evolving Technology**: Capabilities and reliability may vary as the underlying models are updated
14+
15+
516
## 🚀 Installation
617

718
### Prerequisites
@@ -50,7 +61,7 @@ The ReAct agent supports two execution modes for running Python code:
5061
| **Setup Required** | API key only | Docker + docker-compose |
5162
| **File Handling** | ☁️ Files uploaded to cloud | 🏠 Files stay local |
5263
| **Session Persistence** | ✅ Managed by Together | ✅ Local session management |
53-
| **Session Isolation** | ✅ Independent isolated sessions | ⚠️ Shared filesystem across sessions |
64+
| **Session Isolation** | ✅ Independent isolated sessions | ⚠️ Limited isolation (see below) |
5465
| **Concurrent Usage** | ✅ Multiple users/processes safely | ⚠️ File conflicts possible |
5566
| **Dependencies** | Pre-installed environment | Custom Docker environment |
5667
| **Plot Saving** | ✅ Can save created plots to disk | ❌ Plots not saved to disk |
@@ -61,6 +72,44 @@ The ReAct agent supports two execution modes for running Python code:
6172

6273
**Docker Mode**: All code execution and file processing happens locally in your Docker container.
6374

75+
## ⚠️ Docker Mode Session Isolation Limitations
76+
77+
**Important**: While Docker mode provides basic session isolation for variables, it has significant limitations:
78+
79+
### ✅ What IS Isolated:
80+
- **User variables**: `x = 1` in one session won't affect another session
81+
- **Session state**: Each session maintains its own execution context
82+
83+
### ❌ What is NOT Isolated:
84+
- **Module modifications**: Changes to imported libraries affect ALL sessions
85+
- **Global state changes**: Modifications to `sys.path`, `os.environ`, etc. are shared
86+
- **Library monkey-patching**: Modifying `json.dumps`, `numpy` settings, etc. corrupts other sessions
87+
88+
### Examples of Problematic Code:
89+
```python
90+
# These operations will affect ALL sessions:
91+
import json
92+
json.dumps = custom_function # ❌ Breaks all sessions
93+
94+
import sys
95+
sys.path.append('/custom/path') # ❌ Affects all sessions
96+
97+
import os
98+
os.environ['KEY'] = 'value' # ❌ Global environment change
99+
```
100+
101+
### Docker Mode is OK For:
102+
- **Data analysis workflows**: Reading CSV/JSON files, pandas operations, statistical analysis
103+
- **Machine learning**: Training models, feature engineering, model evaluation
104+
- **Visualization**: Creating plots with matplotlib, seaborn, plotly
105+
- **Standard data science**: EDA, data cleaning, hypothesis testing
106+
- **Single-user development** and **testing environments**
107+
108+
### When to Use TCI Mode Instead:
109+
- **Multi-user environments** where sessions must be completely isolated
110+
- **Production applications** with concurrent users
111+
- **Workflows that modify global state** (if unavoidable)
112+
64113
## 🛠️ Usage
65114

66115
### 🖥️ Command Line Interface
@@ -234,7 +283,6 @@ Both modes support automatic file discovery and upload:
234283
# - Text files (.txt)
235284
# - JSON files (.json)
236285
# - Python files (.py)
237-
# - Excel files (.xlsx, .xls) - handled by pandas
238286

239287
agent = ReActDataScienceAgent(
240288
executor="tci", # or "internal"

0 commit comments

Comments
 (0)