Flint-chart: Putting a Compiler Between Agents and Bad Plots
Daniel Lougen’s post put Flint on my radar. His point was simple and correct: AI can write plenty of chart code while still making a bad plot. A repository designed specifically for agentic chart-making is worth attention.
What Flint changes
Today an agent usually writes a native Vega-Lite, ECharts, Plotly, Chart.js, or Excel specification directly. That forces the model to coordinate dozens of coupled details: field parsing, aggregation, axes, domains, baselines, legends, label density, padding, colors, and renderer-specific syntax.
Flint inserts a compact intermediate language:
{
"semantic_types": {
"period": "YearMonth",
"change": "Profit"
},
"chart_spec": {
"chartType": "Heatmap",
"encodings": {
"x": {"field": "period"},
"color": {"field": "change"}
}
}
}
YearMonth tells the compiler that 202601 is not an arbitrary integer. Profit tells it that positive and negative values have a meaningful zero. Flint can derive parsing, labels, a diverging scale, a zero midpoint, and layout choices in ordinary code instead of hoping the model remembers every renderer knob.
The paper reports Flint specifications were 85% shorter on average than native backend code in its exploration case. That is not just token thrift. A smaller output surface means fewer opportunities for malformed JSON and subtle visual contradictions.
How we wired Flint into Hermes
We did not add Flint to the production Hermes configuration. For this trial, Hermes launched the pinned MCP server as an isolated local stdio process, sent semantic intent plus inline public-safe data, and received validated backend artifacts. File-backed data was disabled at the MCP boundary.
The tested path. Hermes makes the semantic choices; Flint validates and compiles them; ECharts renders repeatable artifacts; tests and a human visual-quality gate decide whether anything is publishable. Select the image for the editable SVG.
The deliberately unfair stress test
We tested something harder than a bar chart: recreate our real Local LLM Stack routing diagram from an edge list. This is exactly where we expected Flint’s abstraction to strain. Rich architecture cards, fixed hierarchy, annotations, fallback semantics, and carefully routed connectors are not the same problem as plotting quantitative data.
The target and final editorial diagram. This is custom SVG—not Flint output. It makes Hermes the routing hub, keeps compute lanes distinct, and treats the route guide as documentation rather than a fourth compute node. Select the image for the editable SVG.
Method
- Pinned
flint-chart@0.4.1andflint-chart-mcp@0.4.1in an isolated workspace. - Used four inline, public-safe routes: Hermes → Sparks, M5, M3, and cloud.
- Compiled both Network Graph and vertical Sankey Diagram through Flint’s ECharts backend.
- Preserved the unmodified Flint input and compiled ECharts JSON before any presentation work.
- Rendered twice, verified deterministic SVG structure, and produced 2240×1680 PNGs.
- Ran the MCP server over local stdio with
--disable-file-reference; a controlleddata.urlattempt was rejected.
What actually happened
| Gate | Network | Sankey |
|---|---|---|
| Compiles / renders | PASS | PASS |
| All approved nodes / edges | PASS | PASS |
| Repeatable output | PASS | PASS |
| Route meaning is obvious | FAIL | PARTIAL |
| Blog-width labels | FAIL | FAIL |
| Better than designed SVG | NO | NO |
The better diagram
The custom v2 above is meaningfully better than our earlier diagram in three ways:
- Truthful routing: every lane originates at Hermes Gateway. The default model no longer appears to route to specialists.
- Stronger hierarchy: dual Sparks dominate; M5 specialists are grouped by role; M3 and cloud remain visibly subordinate.
- Less category confusion: the role guide is explicitly documentation, not compute.
It would be dishonest to call that image “made by Flint.” Fixed placement, rich cards, gutter routing, typography, and annotation structure are the design. Flint’s pure outputs remain above as the actual evidence.
Where Flint fits
| Work | Fit | Why |
|---|---|---|
| Benchmark bars, lines, heatmaps | Strong | Semantic types and automatic layout attack common agent mistakes directly. |
| Operational plots and compact dashboards | Strong | Short specs, validation, deterministic compilation, multiple backends. |
| Editable Excel charts | Promising | One semantic input can target native editable artifacts. |
| Simple networks / flows | Conditional | Useful when a standard graph layout communicates enough. |
| Editorial architecture diagrams | Weak | Rich nodes, fixed composition, annotations, and route semantics exceed the abstraction. |
My default policy: use Flint for charts whose truth lives in data encodings. Use designed SVG for diagrams whose truth lives in composition.
Safety and limits
- File references: Flint MCP can read local
data.urlfiles by default. In an untrusted or broadly exposed environment, launch it with--disable-file-reference. We did. - Package audit: the provisional ECharts 6.0 pin produced a moderate XSS advisory. We moved to
echarts@6.1.0, reran the full test, and finished with zero known npm audit findings. - Semantic types can still be wrong: deterministic compilation faithfully amplifies a bad semantic declaration.
- Validation is not taste: a chart can validate with no warnings and still crop a label or communicate the wrong relationship.
- Paper evaluation is not the last word: the LLM chart study used a vision-language grader. Useful evidence, not proof that every human will prefer the result.

