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 context | The rows in a database | |
|---|---|---|
| What the model sees | The rows themselves | Each column’s type and summary, and the results of its queries |
| Who calculates | The model, by reading | The database, over every row |
| Size | Limited by the context, and costly in tokens | The model reads only what it asks for |
| Good for | Small files, and questions about what’s written | Totals, 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:
- It finds the table. It lists the tables there are, and picks
sales/orders. - 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.
- It writes SQL for your question, and rho runs it over every row of the table, in DuckDB.
- 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.
- 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_eurFROM "sales/orders"WHERE order_date >= DATE '2026-07-01' AND order_date < DATE '2026-10-01'GROUP BY countryORDER BY avg_order_eur DESCAnd gets back five rows (with made-up figures):
| country | orders | avg_order_eur |
|---|---|---|
| DK | 400 | 127.15 |
| FR | 400 | 120.80 |
| NL | 400 | 119.40 |
| DE | 400 | 113.05 |
| SE | 400 | 106.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:
- Next week, in another agent. Cursor, Claude Code or another chat finds
sales/ordersby its name, with nothing to attach again. - A new export is a new version. Upload the updated CSV as the table’s next version, from the table’s menu in the app. The first upload is still version 1.
- Compare the two. The new export added late orders from Sweden, and one query shows what that did to each country’s average:
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 afterFROM latestFULL OUTER JOIN previous USING (country)ORDER BY after DESC| country | before | after |
|---|---|---|
| SE | 106.75 | 137.40 |
| DK | 127.15 | 127.15 |
| FR | 120.80 | 120.80 |
| NL | 119.40 | 119.40 |
| DE | 113.05 | 113.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
- An ordinary chat, with the file attached: a small file and a one-off question. Quickest, nothing to set up.
- An assistant that runs code on the file: a bigger file, a one-off analysis, or work that needs Python (a chart, a model). It calculates properly; the file and its results stay in that chat.
- rho: data you’ll come back to. The same table in later chats and other agents, each new export as a version to compare with the last, answers with receipts, and a table you can share as a link or an API.
If people mostly edit the rows by hand, a spreadsheet is the better tool.
How to start
- Sign up. There’s no password.
- 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.
- Add rho to your agent, once: see the Quickstart.
- 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.