Answers / Get data into your AI
My CSV is too large for ChatGPT to analyse. What can I do?
Chat assistants analyse uploaded files in a sandbox with limited memory and time, so a large CSV gets cut short or fails. Load the file into a database your AI can query instead: it's loaded once, your AI runs exact queries over every row, and only the results come back into the conversation.
Steps
- Connect your assistant to your instance (this writes, so it needs your own instance with a ReadWrite key
from the accounts portal; the public demo is read-only). In Claude Code:
claude mcp add --transport http mcpdata https://[you].mcpdata.org/mcp --header "Authorization: Bearer $CDB_API_KEY"
Replace
[you]with your instance's name. Other apps: Connect your AI. - Install the client and sign it in. One
pip install, then approve this computer in your browser (the key is kept in~/.cdb/):pip install https://[you].mcpdata.org/help/download/cdb-0.3.4-py3-none-any.whl cdb-localdata login --to https://[you].mcpdata.org
- Load the folder that holds the CSV. Here the sample orders_sample.csv (100,000 rows) in a folder called
csv; each file becomes a table under the namespace you choose:cdb-localdata add ./samples/csv --to https://[you].mcpdata.org --namespace files cdb-localdata sync
- Ask your question. Give your AI this prompt:
Using mcpdata, total revenue and order count by region from files.orders_sample.
| region | revenue | orders |
|---|---|---|
| Americas | 22,107,385 | 41,803 |
| EMEA | 20,392,046 | 37,936 |
| APAC | 10,875,258 | 20,261 |
The assistant needs mcpdata connected (step 1) to run the query.
Why this works
A context window holds a limited amount of text, and in-chat file analysis runs with limited memory and time. A database keeps the data outside the conversation: the AI asks for exactly the totals, filters or rows it needs, and the answer is computed over all of the data. Big files are sent in parts and retried safely, so the size of the file isn't the problem any more.