DataChat lets analysts ask CSV questions in plain English and get an answer plus a chart. The single-file Java Swing desktop app requires no external dependencies. It works with Claude from Anthropic for natural-language understanding and ships with a built-in offline engine and demo data so you can try it without an API key.

How the question-to-chart pipeline works

DataChat splits the problem so the language model never has to do arithmetic. When you type a question the app follows three steps. First Claude reads the question plus a compact schema of your table and replies with a small JSON analysis plan. Second the app runs that plan itself on the full dataset so numbers are exact. Third Claude writes a short plain-English answer from the computed result table and the app draws the chart. This design gives accuracy because every number comes from Java code running over all your rows not from a model's estimate. It gives privacy because Claude sees only the schema and the small aggregated result not your raw rows. It gives transparency because the How it was computed tab shows the exact plan that ran so you can verify the answer. And it has a graceful fallback if the API call fails the app falls back to the offline engine and tells you.

Three ways to run the app

You can run DataChat from the GitHub source with Java 11 or newer. The command java DataChat.java launches the app directly from the source file. Or compile first with javac DataChat.java then run java DataChat. The app opens with demo data already loaded so you can click an example question straight away. Either paste your API key into the Claude API key field in the toolbar or set environment variables before launching. Export ANTHROPIC_API_KEY="sk-ant-..." and optionally export ANTHROPIC_MODEL="claude-sonnet-5-5" this is the default. The key is held in memory only and is never written to disk. Without a key or with Offline mode ticked the built-in rule-based engine answers instead.

Demo data and the built-in story

The demo loads 2,317 synthetic financial transactions from January to June 2026. The columns are TransactionID, Date, Region, Category, Channel, Status and Amount. The data contains a deliberate story March dips because the North region (store closures) and the Hardware category (supply shortage) sell much less. Ask "What's driving the drop in March?" and the analysis should surface exactly those two insights.

As soon as a file loads DataChat scans it and posts a short list of things worth a closer look in the chat. Each line ends with an explore link click it and the full analysis runs immediately with no typing needed. At most five insights are shown in this priority order biggest drop biggest rise over-indexing segment unusual values overall trend missing data. The main measure is the first numeric column whose name looks like money amount revenue sales price cost profit otherwise the first numeric column. With no numeric columns insights count rows instead. A last month that stops part-way through is ignored when looking for drops so an incomplete month never shows up as a fake slump. Insights are computed locally so they never call the API clicking explore does use Claude for the explanation if a key is set.

The toolbar and chat area

The toolbar has two rows. Top row has Load CSV Demo data and Export PDF report. Bottom row has Claude API key model name Offline mode and the sample-rows privacy toggle. The chat area on the left shows your questions the analyst's plain-English answers the auto-insights for the loaded file and clickable example questions. The status bar shows the loaded file row and column counts and which engine is active Claude or offline.

You can click Load CSV or drag and drop a .csv .tsv or .txt file onto the window. Click Demo data to load or reload the built-in sample. The app auto-detects delimiters comma semicolon tab or pipe and supports quoted fields and escaped quotes. Encoding defaults to UTF-8 with BOM handling and falls back to Windows-1252 if invalid bytes are found. Number columns whose every value is ambiguous default to US style if there is no evidence anywhere in the file. Columns named like IDs Customer ID OrderID zip phone are kept as text so they aren't summed. Blank headers become Column N and duplicate headers get a numeric suffix.

The your data tab shows a scrollable view of the loaded CSV. The chart tab shows the chart for the latest answer hover for exact values. Save chart as PNG exports it. The result table tab shows the exact numbers behind the answer Save result as CSV exports them. The How it was computed tab shows the JSON plan that was executed how many rows were used and the computed facts.

Plain-English questions the app understands

Type questions in the box at the bottom of the chat and press Enter or click Ask. With Claude enabled follow-ups can build on the previous question for example "now split that by channel" or "only for North". The last three turns are sent as context.

The app understands many question types. Chart the financial transactions by region gives a bar chart of total Amount per Region. Monthly revenue by category gives a multi-line chart one line per Category. What's driving the drop in March gives a trend chart plus a ranked breakdown of which segments caused the change. Why did revenue rise in May gives the same analysis for an increase. Compare February and March gives driver analysis between two named periods. Share of revenue by channel as a pie chart gives a pie chart with percentages. Average amount by category excluding refunded gives filtered average per Category. How many transactions per month gives row counts over time. Revenue by weekday gives totals for Mon to Sun. Show amount by region for Q2 gives date-filtered totals. Top 5 largest transactions gives the five biggest rows as a table. Describe this data gives a column-by-column overview.

The rule-based planner keyword-based works without an API. It understands measures column names mentioned in the question plus words like average median max min how many count. If you don't name a measure it picks the most money-like numeric column and says so. Grouping by per each across column names and their plurals and time words such as monthly per week over time trend weekday. Filters category values appearing in the question exclusions excluding refunded without retail and dates in March Q2 2026. Ranking and charts top 5 bottom 3 lowest best and pie line bar. Change questions drop fell decline rise why driving compare X and Y.

Privacy and offline operation

Without an API key or with Offline mode ticked nothing leaves your machine. The offline planner understands the same question types as the API-dependent planner but is keyword-based so unusual phrasing and conversational follow-ups work best with Claude enabled.

When Claude is enabled the planning call sends the table name row count and for each column its type NUMBER DATE or TEXT. Per column it sends numeric min max and mean date range or the distinct values of text columns up to 25 otherwise a few examples. Optionally the first three rows if Send sample rows to AI is ticked. The last three question-plan pairs and today's date. Both planning and explanation calls go to https://api.anthropic.com/v1/messages using Java's built-in HttpClient.

Claude only ever receives the schema summary the aggregated result table at most 30 rows and the first three data rows if you tick Send sample rows to AI. Text-column summaries include distinct values up to 25 per column so avoid using Claude with columns whose values are sensitive or use Offline mode. In Offline mode nothing leaves your machine.

For the explanation call the app sends your question the executed plan the computed facts and at most the first 30 rows of the result table. Numbers currency symbols thousands separators and percent signs are stripped before sending. So $1,200.50 becomes 1200.50 and 12% becomes 12. European number formats are detected per column 1.234,56 12,5 1 234,5 € are all read correctly. A value like 1.234.567,89 or 12,5 counts as European evidence and one like 1,234.56 or 1,234,567 as US evidence. Values that could be either 1,234 or 1.200 on their own follow the rest of the column then the rest of the file and default to US style if there is no evidence anywhere. Dotted dates such as 01.03.2026 are still recognised as dates not numbers.

Exporting results and reports

Click Export PDF report in the top row of the toolbar next to Demo data to save everything you've asked in the current session as a single A4 document. The button is greyed out until you've asked at least one question. The report contains a title block with the dataset name row and column counts the date and the column list. The key insights found on load. For every question in order the question the plain-English answer how many rows were used and any filters applied the chart(s) and the result table first 25 rows.

Charts are embedded as images and tables are real selectable text. Long tables continue across pages with the header repeated. The writer is built into the program using standard Helvetica fonts. Characters outside Western European text appear as ?. For the complete table behind an answer use Save result as CSV from the Result table tab. The suggested file name comes from the answer's title. Numbers are written as plain values so they open cleanly in Excel Numbers or Google Sheets. Percentage columns stay as text. The file is UTF-8 with a byte-order mark which Excel needs to display non-ASCII characters correctly and fields containing commas quotes or line breaks are quoted.

Open the Result table tab and click Save result as CSV to save the table behind the latest answer. The chart isn't part of the CSV use Save chart as PNG for that.

What this means for spreadsheet users

DataChat removes the need for pivot tables or remembering which formula does what. The app handles delimiter detection encoding number-format differences and date parsing so you don't have to. Numbers come from Java code running over every row so they are exact not estimated. The offline engine means you can explore data without an API key or without an internet connection. The PDF report feature gives a shareable record of your analysis. And the transparency of the How it was computed tab means you can verify every number before you trust the answer.

For teams that need to explore many CSV files the single-file design means no installation no environment setup and no runtime dependencies. Drop the jar or the source file on any machine with Java and start asking questions.