Skip to main content
Version: 0.9.20

Code interpreter and datasets

Agents don't just talk — they can run code to analyze your data, transform files, and produce results. This page explains how agents run code in your execution environments, the per-conversation workspace where files live, and how results become datasets that the chat can preview as tables and charts.

How agents run code

When an agent needs to compute something — query a connected database, crunch numbers, generate a file — it runs Python and shell commands inside its execution environment. This all happens in your own AWS account, so your data and computations stay inside your boundary.

The agent's data connectors are available to the code it runs, so it can pull from your databases, APIs, and other sources, then analyze what it retrieves. You don't write this code yourself — you ask in plain language, and the agent decides when to run code to fulfill the request.

For the technical detail of how execution is sandboxed and isolated, see How agents run code.

The conversation workspace

Each conversation gets its own isolated workspace — a working folder for files the agent creates or reads while it works (data extracts, generated charts, exports, intermediate results). The workspace:

  • Is per conversation, so one conversation's files don't bleed into another.
  • Is stored in your own account, and the files persist so you can view and download them.
  • Is private to you — workspaces are scoped to the user who owns the conversation.

You can browse a conversation's workspace from the Workspace view in chat (see Chat), which lists files with their sizes and lets you download them. While the agent is actively working, the workspace updates live.

[Screenshot: Conversation workspace viewer]

Datasets: results without dumping rows

When an agent produces a tabular result — say, the output of a database query or an analysis — it registers that result as a dataset rather than pasting every row into the conversation. A dataset is a reference to the full data (kept in your workspace storage) plus a small amount of metadata: its name, the columns, the row and column counts, and a few preview rows.

This matters for two reasons:

  • The chat stays readable. Instead of a wall of raw rows, you see a compact preview, a sortable grid, or a chart.
  • Full data is preserved. The complete result stays in your account and can be paged through or charted on demand, without forcing the entire table through the model.

Registered datasets are retained for about 6 hours, which covers the life of an active conversation. If you need a result permanently, download it from the workspace.

Previews, grids, and charts

From a dataset reference, the chat can render results in compact, interactive forms:

  • Preview — the first few rows, so you can see the shape of the result at a glance.
  • Grid — a paginated table you can scroll through; rows are fetched on demand from the full dataset.
  • Chart — a visualization built from specific columns of the dataset.

Because these are drawn from the dataset reference, you can explore a large result inline without the conversation becoming unwieldy.

[Screenshot: Inline dataset grid and chart in chat]

Datasets across workflow steps

In a workflow, each step runs with its own workspace, so steps don't automatically share files. When a later step needs a dataset that an earlier step produced, the data is loaded into the later step's workspace from the shared storage — letting results flow from one step to the next even though the steps run separately. See Datasets and data flow for how this works.