Chat with a CSV

Attaching a small CSV to a chat in ChatGPT or Claude works well. For a one-off question about a file of a few hundred rows, it’s often all you need.

Bigger files are harder. When a model reads the rows themselves, they take up its context, and adding up thousands of numbers by reading them is where mistakes come in. Many assistants can run Python on an attached file instead, which does the arithmetic properly. What’s left is the file itself: it belongs to one chat, and next week you attach it again.

rho takes the approach a data team would: the data stays in a database, the agent writes queries, and the database does the calculations. And the table is still there next time.

Why large files are different

There are two ways an AI can work with a table:

The rows in the model’s contextThe rows in a database
What the model seesThe rows themselvesEach column’s type and summary, and the results of its queries
Who calculatesThe model, by readingThe database, over every row
SizeLimited by the context, and costly in tokensThe model reads only what it asks for
Good forSmall files, and questions about what’s writtenTotals, averages and counts over many rows

Reading rows is fine for “what does this column mean?” or “find the order from Acme”. For “what’s the average order value per country?” over 20,000 rows, it’s the wrong tool: the answer should come from a calculation, not from reading.

Let SQL do the calculations

With rho, the file is uploaded once and stored as a table. The agent never needs to read all of it. It works like this:

  1. It finds the table. It lists the tables there are, and picks sales/orders.
  2. It reads what the table holds. Each column’s name and type, a summary of its values (ranges, most common values, how many are empty) and the first few rows.
  3. It writes SQL for your question, and rho runs it over every row of the table, in DuckDB.
  4. It gets the result: a few rows, not the whole table. Those rows do go into the conversation, and that’s what the agent reasons over and explains.
  5. Optionally, a receipt: a link beside the figure that shows the SQL, the version of the table it read and the rows it got back.

The stored table stays in rho; only the query’s result goes back to the model.

An example: orders by country

Say you exported last quarter’s orders as a CSV, orders.csv, with columns order_id, order_date, country and order_total_eur, and uploaded it to rho as sales/orders. You ask:

You: Using sales/orders in rho, which country had the highest average order value last quarter? Include a receipt.

The agent runs:

SELECT country, count(*) AS orders, round(avg(order_total_eur), 2) AS avg_order_eur
FROM "sales/orders"
WHERE order_date >= DATE '2026-07-01' AND order_date < DATE '2026-10-01'
GROUP BY country
ORDER BY avg_order_eur DESC

And gets back five rows (with made-up figures):

countryordersavg_order_eur
DK400127.15
FR400120.80
NL400119.40
DE400113.05
SE400106.75

It answers: Denmark, at €127.15 over 400 orders, with a receipt linked beside the figure. The model saw five rows, not 2,000 orders.

The query names the time period, so it’s clear which quarter the answer is for, and the totals are in one currency, which the column’s name says. A file with several currencies needs them converted, or grouped by currency, before an average means anything. SQL does the arithmetic right; whether the query asks the right question is still worth checking, and a receipt shows exactly what was asked.

Keep the data for next time

SQL over a file isn’t unique to rho: an assistant running Python on an attached file gets the arithmetic right too. What rho adds is that the table stays:

WITH previous AS (
SELECT country, avg(order_total_eur) AS avg_order_eur
FROM "sales/orders@1"
WHERE order_date >= DATE '2026-07-01' AND order_date < DATE '2026-10-01'
GROUP BY country
), latest AS (
SELECT country, avg(order_total_eur) AS avg_order_eur
FROM "sales/orders"
WHERE order_date >= DATE '2026-07-01' AND order_date < DATE '2026-10-01'
GROUP BY country
)
SELECT country,
round(previous.avg_order_eur, 2) AS before,
round(latest.avg_order_eur, 2) AS after
FROM latest
FULL OUTER JOIN previous USING (country)
ORDER BY after DESC
countrybeforeafter
SE106.75137.40
DK127.15127.15
FR120.80120.80
NL119.40119.40
DE113.05113.05

Sweden now has the highest average. The receipt from the first question still shows the answer it gave, on version 1, and, opened now, that the answer has changed on the new data.

More on keeping an agent’s tables: A database for your AI agent.

When to use what

If people mostly edit the rows by hand, a spreadsheet is the better tool.

How to start

  1. Sign up. There’s no password.
  2. Drop your file anywhere in the app. rho reads CSV, TSV, Excel, JSON, NDJSON and Parquet, and shows the types it read before it saves anything: see Upload a file.
  3. Add rho to your agent, once: see the Quickstart.
  4. Ask about the table by its name:

Using sales/orders in rho, which country had the highest average order value last quarter? Include a receipt.

An agent can also load a file itself from a URL, with import_table, so the rows never pass through the chat.