Data Science ML Agent is an AI-powered platform that combines a FastAPI backend with a Streamlit frontend to let users perform common data science workflows using plain English commands.
The project supports:
- Loading CSV and Parquet datasets
- Uploading dataset files via API
- Setting target columns and describing data
- Training classification and regression models
- Optimizing models with Optuna
- Saving and downloading the best model and predictions
- Tracking experiment history
This repository is useful for developers and data scientists who want a conversational interface for fast prototyping and model exploration. It makes it easy to interact with datasets, train models, and inspect results without writing boilerplate code.
- Python 3.11+ (or compatible Python 3.x)
pippackage manager- NVIDIA-compatible API key in environment variable
NVIDIA_API_KEY
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txtCreate a .env file in the repository root or export NVIDIA_API_KEY in your shell:
export NVIDIA_API_KEY="your_api_key_here"The application also reads app/config.yaml for defaults such as base_url, app_name, and model_name.
Start the FastAPI server from the repository root:
fastapi dev app/main.pyThis exposes the API on http://127.0.0.1:8000 and provides interactive docs at http://127.0.0.1:8000/docs.
In a separate terminal, launch the Streamlit UI:
streamlit run frontend/app.pyThe UI connects to the backend and allows chat-style commands, file upload, and downloads.
Use natural language commands in the Streamlit chat interface or send them to the /chat API endpoint.
Example commands:
load_dataset("data/train.csv", "target")
set_target("target")
describe_data()
preview_data(5)
train_classification()
train_regression()
optimize_logistic(20)
optimize_forest_regressor(30)
show_best_model("accuracy")
show_history(5)
predict("data/test.csv", "predictions.csv")
help()
The backend exposes the following operations:
POST /chat— send a chat command and receive an AI-paraphrased responsePOST /upload— upload dataset filesGET /history— get recent experiment historyPOST /clear— clear conversation historyGET /download/model— download the best trained modelGET /download/predictions— download generated prediction results
app/main.py— FastAPI backend entrypointapp/agents/chat_agent.py— conversational ML agent and tool registryapp/services/llm.py— LLM client configuration and API integrationapp/agents/tools/— data loading, model training, optimization utilitiesfrontend/app.py— Streamlit user interfacerequirements.txt— Python dependenciesdata/— example or sample dataset files
- Use the built-in API docs at
http://127.0.0.1:8000/docs - Open an issue in the repository for bugs or feature requests
- Review
LICENSEfor licensing details
Contributions are welcome via issues and pull requests. Keep changes focused on features, bug fixes, and documentation improvements.
This project is released under the MIT License. See LICENSE for details.