How tommyma3/ai-data-scientist-agent works
The product is a local-LLM agent that iteratively generates tabular ML solutions, executes them under a timeout, and ranks candidates by validation MSE. The main path runs from CLI configuration through orchestration, then draft/debug/improve generation, sandbox execution and journal updates, with best and good code saved between steps. Dataset previews, model inference, and execution results are distinct stages; the journal and text utilities support the search. Major documented features are represented, though generated submissions are produced by candidate code rather than a sampled repository module. Edges reflect sampled calls or README-documented behavior; unsampled internal details are not inferred.
Main entry points: runner.py Run orchestrator · agent.py Stage selector · interpreter.py Sandbox interpreter · cli.py CLI configuration
Components 15
Entry and orchestration
- CLI configuration
src/ai_data_scientist_agent/cli.py - Run orchestrator
src/ai_data_scientist_agent/runner.py - Run settings
src/ai_data_scientist_agent/config.py
Solution search
- CSV preview
src/ai_data_scientist_agent/data_preview.py - Stage selector
src/ai_data_scientist_agent/agent.py - Local LLM client
src/ai_data_scientist_agent/llm.py - Code extraction
src/ai_data_scientist_agent/text_utils.py
Execution and evaluation
- Sandbox interpreter
src/ai_data_scientist_agent/interpreter.py
Search state and artifacts
- Candidate journal
src/ai_data_scientist_agent/models.py - Solution saver
src/ai_data_scientist_agent/persistence.py
Other components
- CLI user
- Generated candidate
- CSV dataset
- Submission CSV
- Saved solutions
Connections 20
- CLI user → CLI configuration: sets options
README.md - CLI configuration → Run settings: builds config
src/ai_data_scientist_agent/cli.py - CLI configuration → Run orchestrator: starts run
src/ai_data_scientist_agent/cli.py - Run orchestrator → Run settings: reads settings
src/ai_data_scientist_agent/runner.py - Run orchestrator → Stage selector: steps search
src/ai_data_scientist_agent/runner.py - Run orchestrator → Local LLM client: creates client
src/ai_data_scientist_agent/runner.py - Run orchestrator → Sandbox interpreter: creates sandbox
src/ai_data_scientist_agent/runner.py - Run orchestrator → Candidate journal: creates journal
src/ai_data_scientist_agent/runner.py - Run orchestrator → Solution saver: saves run
src/ai_data_scientist_agent/runner.py - Stage selector → CSV preview: builds context
src/ai_data_scientist_agent/agent.py - CSV preview → CSV dataset: reads CSVs
src/ai_data_scientist_agent/data_preview.py - Stage selector → Local LLM client: requests generation
src/ai_data_scientist_agent/agent.py - Stage selector → Code extraction: extracts code
src/ai_data_scientist_agent/agent.py - Stage selector → Candidate journal: selects and appends
src/ai_data_scientist_agent/agent.py - Stage selector → Sandbox interpreter: executes code
src/ai_data_scientist_agent/agent.py - Sandbox interpreter → Generated candidate: runs script
README.md - Generated candidate → Submission CSV: writes predictions
README.md - Sandbox interpreter → Stage selector: returns output
src/ai_data_scientist_agent/agent.py - Solution saver → Candidate journal: selects solutions
src/ai_data_scientist_agent/persistence.py - Solution saver → Saved solutions: writes code
src/ai_data_scientist_agent/persistence.py