Graphy · Senior AI Product Engineer · 2025 to now
Charts from a sentence, without trusting the LLM with the numbers
- TypeScript
- Vercel AI SDK
- Zod
- QuickJS
- Evalite
- MCP
- OAuth 2.1
- Langfuse

The problem
People describe the chart they want, and an agent builds it from their data. A chart with a wrong number is worse than no chart, and LLMs are bad at numbers.
My part
I designed the agent framework behind Graphy Agents and wrote its rules and architecture docs. I built the mutate agent, the chart knowledge layer and the explore agent, the retry and error system, the sandbox for model-written code, and the statistics that gate evals. A teammate built state rollback, the fast execution mode, budget enforcement and the eval tooling on top.
One edit, end to end
A user looks at a chart and types “make it monthly and drop Europe”. Deterministic code sits on both sides of a thin LLM layer:
- Before the model. The dataset is profiled and every chart type is ranked. The model gets metadata, the top three chart types with the reason for each, and tool schemas. It never sees raw rows.
- The model decides. The mutate agent picks from 17 data and chart tools: filter out Europe, change the grain to months. Tools write to a typed state and hand the model a short acknowledgement, not data.
- The chart is checked at every step. Before each step the data is re-profiled and the chart types re-ranked. If monthly data no longer suits the current type, the model is told. Setting a type the data disqualifies is refused, with the reasons.
- Mistakes become corrections. Nine typed checks catch made-up columns, empty output and double aggregation, and send the failure back to the model as its next turn.
- After the model. Deterministic passes validate the result and fix what would render badly. Every number on the chart comes from code.
The rest of the system exists to make those five steps hold.
Chart knowledge, without the model
Choosing a chart type is a decision problem, so I treated it as one. The scorer follows Belton and Stewart’s Multiple Criteria Decision Analysis: a veto for charts that cannot work (a pie with two measures, a funnel with negative values), then an additive value function over three buckets, data shape, encoding and intent. The weights, 0.54, 0.30 and 0.16, come from swing weighting rather than taste, and their ratios sit in the band the book recommends.
Around the scorer sit about 88 named facts about a dataset, rule files for each chart family, and a menu of about 25 chart recipes with the slots a user can fill. All of it is plain code with no LLM, shared by every agent and exposed through its own API.
Explore, Tukey as tools
The explore agent finds the strongest story in a dataset. It works the way Tukey’s Exploratory Data Analysis does, with his methods as tools: median polish to split a table into row and column effects, the ladder of powers to tame skew, running medians to pull a trend out of noise. Next to them sit checks for duplicates, gaps, functional dependencies and value concentration, 18 tools in all.
A deterministic pass computes correlations, outliers and concentration before the model starts, so it skips the obvious first round of calls. Each finding is scored twice, for statistical strength and for relevance to the question, and the best one decides what the chart should show.
The harness
The rules that make agents dependable, enforced by the framework rather than left to each agent:
- Errors written for the model. Every error says what failed, why, and what to do, with the valid options listed. A failing tool returns the error to the model instead of crashing the run.
- Retries as conversation. The bad output and the error go back as the next turn, so the model fixes its own mistake. Only failures a model can fix are retried.
- A reason before every action. Every tool call must state its intent. One field gives forced reasoning, progress messages for the user and a trace for debugging.
- A sandbox for model-written code. Expressions run in QuickJS compiled to WebAssembly, with no network or file access and hard memory and time limits.
- Agents as tools. Agents share state instead of passing results, so an agent works the same at the top level or called by another agent. One typed event stream carries progress from any depth to the client.
Evals first
LLM output varies from run to run, so “it looks better” is not evidence. I wrote the eval architecture before the agents grew: a regression is flagged only when Welch’s t-test gives p < 0.05 and Cohen’s d is at least 0.5. A fixed “score below X” check fires on ordinary run-to-run noise; the two-test rule was designed to bring false alarms down to about 1%, from an estimated 10 to 20%. Regression suites gate CI, and capability suites measure headroom. The framework rule is short: if you can’t write an eval for it, it’s not ready to ship.
I also benchmarked cost across GPT, Claude and Gemini and validated about 10¢ per chart, with Langfuse for observability.
MCP
I built the Graphy MCP connector, so MCP-native clients can make charts directly: OAuth 2.1, Streamable HTTP, and charts rendered inline through MCP Apps.