Skip to main content

Overview

Daytona sandboxes enable secure, isolated execution of AI-generated data analysis code. Build agents that can explore datasets, generate visualizations, and provide insights - all through natural language prompts.

Key Capabilities

Secure Code Execution

  • AI-generated Python code runs in isolated sandboxes
  • No risk to host system from untrusted code
  • Automatic environment setup and cleanup
  • Package installation on demand

Natural Language Interface

  • Describe analysis tasks in plain English
  • Agent generates appropriate Python code
  • Automatic chart and visualization generation
  • Structured result extraction

File Management

  • Upload datasets to sandbox environments
  • Download generated charts and reports
  • Process multiple files in batch
  • Persistent storage during analysis session

Framework Integration

LangChain Integration

LangChain provides powerful agent capabilities with the DaytonaDataAnalysisTool. Example: Vehicle Price Analysis
Output Example:
Key Features:
  • Multi-step reasoning and planning
  • Automatic artifact handling (charts, tables)
  • Dataset upload with metadata
  • Custom result handlers
  • Sandbox file management
Reference: LangChain Data Analysis Example

OpenAI Direct Integration

Build custom data analysis workflows with OpenAI’s API. Python Example: Cafe Sales Analysis
TypeScript Example:
Reference:

Advanced Patterns

Recursive Analysis with DSPy

DSPy enables recursive language models that can call sub-LLMs during analysis. Example: RLM with Daytona
How it works:
  1. RLM prompts LLM with task and REPL history
  2. LLM generates Python code
  3. Code executes in Daytona sandbox (persistent REPL)
  4. Code can call llm_query() for sub-reasoning
  5. Output appends to history
  6. Loop continues until SUBMIT() called
Reference: DSPy RLM Example

Custom Tools Integration

Best Practices

Dataset Preparation

Error Handling

Result Processing

Package Management

Common Use Cases

Exploratory Data Analysis

Time Series Analysis

Statistical Modeling

API Reference

DaytonaDataAnalysisTool (LangChain)