Docs
GuidesWebsite GitHub
OverviewGetting StartedTry the Demo DatabaseApprove a Database WriteTerminal and CLIBackground Host
AgentConversationsConfigurationAuthenticationLLM ProvidersToolsPython Analysis
Data SourcesSQLitePostgreSQLFiles and FoldersHTTP APIsQueryingCatalogDatabase WritesRemote MCP ToolsPrivate Database
Work BoardArtifactsJobsRoutines
Memory and LearningSemanticsSkills
Observation EventsError HandlingEvaluation
Daita / Docs
OverviewGetting StartedTry the Demo DatabaseApprove a Database WriteTerminal and CLIBackground Host
AgentConversationsConfigurationAuthenticationLLM ProvidersToolsPython Analysis
Data SourcesSQLitePostgreSQLFiles and FoldersHTTP APIsQueryingCatalogDatabase WritesRemote MCP ToolsPrivate Database
Work BoardArtifactsJobsRoutines
Memory and LearningSemanticsSkills
Observation EventsError HandlingEvaluation

Daita Agents · Guide

Python Analysis

Let Daita compute, transform and chart your data with Python in an isolated, bounded workspace.

For work SQL cannot do, Daita can run Python: statistics, simulations, text processing, checking structured records, combining datasets, charts. It uses one tool, python_execute, in the Analysis toolbox. The model finds and loads it on demand. See Tools.

#What it runs

Ordinary Python with DuckDB, NumPy, pandas, SciPy, PyArrow, Matplotlib and NetworkX.

RequirementDetail
PlatformmacOS ARM64
Managed installerIncludes the pinned scientific environment
Source checkoutpip install -e '.[dev,analysis]'

On other platforms, or when a package is missing or mismatched, the tool is unavailable. Daita never installs packages at run time and never falls back to an uncontained interpreter. Agent.analysis_runtime() reports availability and package versions without starting a worker.

Ask in plain language:

text
Fit a trend to monthly paid revenue and chart it with the fitted line.

#How a run works

Python state lasts for one run. Variables and scratch files survive between cells of the same run, not between messages or between routine runs.

  • A Python exception keeps earlier assignments. The result says state_may_have_changed.
  • A timeout, resource failure or protocol failure closes the interpreter. The next cell starts fresh and its result says state_reset: true. Failed code is never replayed.

Code reads data through the same tools the model already has. Inside a cell:

python
result = tools.call("file_read", {"source": "Working folder", "path": "sales.json"})
if result["is_error"]:
    raise ValueError(result["output"])
data = result["output"]["data"]

tools.call returns output, is_error, evidence_id and sensitivity. tools.batch runs independent reads together. Only read tools already callable in the run can be used. Python cannot load tools, write to a database, make external calls or start a model. Every call shares the run's tool-call allowance and goes through the usual checks.

Always check is_error before using output. A failed read is a result, not necessarily a Python exception. A partial read stays partial: keep reported coverage and limitations in your conclusions.

#Complete data for statistics

data_query rows are a bounded preview. For dataset statistics, export the exact result as Arrow and read it in Python:

python
captured = tools.capture("data_query", export_arguments, name="orders")
if captured["is_error"]:
    raise ValueError(captured["output"])
 
import pyarrow.ipc as ipc
with ipc.open_file(inputs.path("orders")) as reader:
    orders = reader.read_all()

You can also run data_query(output="arrow") first and pass the artifact in inputs. Capture accepts only the relational Arrow export.

inputs maps names to earlier results or artifacts from the same run:

text
{"sales": {"kind": "tool_result", "result_ref": "r3"},
 "saved": {"kind": "artifact", "artifact_id": "..."}}

Supported inputs are JSON, UTF-8 text, CSV, Arrow IPC and Parquet. Job runs can also import artifacts that runs of the same job saved.

#Save results

Write a file in the scratch directory and register it:

python
import json
 
with open("summary.json", "w", encoding="utf-8") as output:
    json.dump({"total": 42}, output)
outputs.add("summary", "summary.json")

Registering does not publish anything. Set save_output="summary" on the cell, or save_outputs=["summary", "chart"] for up to four, to store them as artifacts. Use one or the other, not both.

RuleDetail
FormatsCSV, Parquet, JSON, PNG, Markdown, UTF-8 text, Python or SQL source
NamesStart with a letter. Letters, digits, _ and -
Candidates4 per cell, 16 per run
ChartsMatplotlib, saved as PNG
FailureA failed save reports save_status="failed". Earlier files stay saved

Each saved artifact keeps its code, the inputs it used, coverage and an output hash. Agent.artifact_computation_evidence(artifact_id) returns that record, even after history is cleared. Raw input data is not kept, so a result may not be reproducible without it. A run that completed is not proof the analysis is correct.

#Limits

AgentConfig.analysis_limits takes daita.config.AnalysisLimits. You can narrow limits, within their ceilings.

LimitDefault
Time per cell30 seconds (also bounded by the run's remaining time)
CPU per run120 seconds
Memory per worker1.5 GiB
Scratch space64 MiB, 256 files
Code per cell64 KiB
Output per cell16 KiB each for stdout and stderr
Child reads per cell16
Captured inputs and saved outputs64 MiB each per run
Table parsing10 seconds, 128 MiB, 1,000,000 rows, 256 columns
Workers1 (worker_count, at most 2)

The worker runs without network, host credentials, Daita state or the ability to start processes. Memory and scratch limits are watched about every 20 ms, not hard quotas, so reported overshoot is real. Print short previews, not full datasets.

#Scheduled and job runs

Routines can use python_execute within their saved sources. They cannot read local computer files, import retained artifacts or save local files. Jobs and their sub-runs can import artifacts saved by runs of the same job, which is how a job hands tables from one run to the next.

#Python API

python
runtime = agent.analysis_runtime()
evidence = await agent.analysis_evidence(run_id)
usage = await agent.analysis_usage(run_id)

analysis_evidence returns host-measured facts for a run: CPU, wall time, peak memory, scratch use and child-call counts. Unavailable measurements are null, never zero.

PreviousTools
NextData Sources

On this page

What it runsHow a run worksComplete data for statisticsSave resultsLimitsScheduled and job runsPython API