DuckDB is installed in every code interpreter template on getrollouts.dev, as a Python package and as the
duckdb command line tool, together with pyarrow for pandas. It queries Parquet and CSV files where they lie,
without loading them into memory first, so a small sandbox is often enough where pandas would need a large one.
The public NYC taxi trip records for 2019, 2023 and 2024: 36 Parquet files, 2.57 GB, 164 million rows. An AI agent answered the same three questions (trips per year, average tip by hour, top 10 pickup zones by fare) twice: once with pandas after loading everything into one DataFrame, once with DuckDB directly on the files.
| Sandbox | pandas, all rows in memory | DuckDB, three questions |
|---|---|---|
code-interpreter-8g (2 vCPU) | out of memory at file 5 of 36 | 9.3 s |
code-interpreter-32g (8 vCPU) | out of memory when combining the files | 2.6 s |
code-interpreter-64g (8 vCPU) | works: 138 s to load, 36 s for the questions, 49 GiB peak | 3.0 s |
Both approaches returned identical answers. DuckDB used between 0.9 and 4.1 GiB of memory. Measured on getrollouts.dev in December 2026; times include reading the Parquet files.
So if your agent can express its work in SQL, start small: the 8 GiB sandbox costs $0.18 per hour. If it has to keep everything in a pandas DataFrame, use a large-memory sandbox (64 GiB: $1.15 per hour).
from e2b_code_interpreter import Sandbox
sbx = Sandbox.create("code-interpreter-8g") # 2 vCPU, 8 GiB RAM
# download the 36 monthly files in parallel (about 20 seconds)
sbx.commands.run(
"mkdir -p taxi && cd taxi && for y in 2019 2023 2024; do for m in $(seq -w 1 12); do "
"echo https://d37ci6vzurychx.cloudfront.net/trip-data/yellow_tripdata_$y-$m.parquet; "
"done; done | xargs -P 8 -n 1 curl -sSO",
timeout=600,
)
query = (
"SELECT year(tpep_pickup_datetime) AS year, count(*) AS trips "
"FROM read_parquet('/home/user/taxi/*.parquet', union_by_name = true) "
"GROUP BY year HAVING year IN (2019, 2023, 2024) ORDER BY year"
)
result = sbx.run_code("import duckdb\nduckdb.sql(%r).df()" % query)
print(result.text)
.df() returns a pandas DataFrame with the result, so you can keep working in pandas on the small part
that matters. DuckDB also reads CSV and JSON files, and pandas DataFrames that are already in memory.
sbx.commands.run(
"duckdb -c \"SELECT count(*) FROM read_parquet('taxi/*.parquet', union_by_name = true)\""
).stdout
Agents write SQL well, and a query either answers or fails fast. Loading a large data set into pandas on the other hand can run for minutes and then end in an out of memory error, which an agent has to notice and recover from. In our test the agent on the 32 GiB sandbox spent 40 minutes trying to make pandas fit, while DuckDB on the same data took seconds.
Works with the official E2B SDKs after setting E2B_API_KEY and E2B_DOMAIN=getrollouts.dev.
getrollouts.dev is an independent service and not affiliated with E2B or DuckDB.