cd /news/developer-tools/show-hn-graph2agent-mermaid-diagrams… · home topics developer-tools article
[ARTICLE · art-91088] src=graph2agent.github.io ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

Show HN: Graph2agent; Mermaid diagrams, explained for agents

Graph2agent, a new open-source tool, converts Mermaid diagrams into rich text for AI agents, reducing errors by 50% across diagram classes and 80% for sequence diagrams, while cutting reasoning tokens by nearly 50%. Built by a developer to help agents read diagrams, it can be used via MCP or in pre-commit jobs.

read1 min views1 publishedAug 10, 2026

During the implementation of a huge high performance service. In order to keep context small (mainly for humans) I kept the specs into mermaid diagrams. When communicating with humans; diagrams were easy to follow and to remember. But when I asked the agent to implement what's in the diagram, most of the times it failed.

So I came into conclusion that agents are good into writing mermaid diagrams but they are not good into reading them.

I built graph2agent in order to deterministically (without inference :) ) convert mermaid diagrams into digestible rich text for agents. examples: https://github.com/graph2agent/examples/blob/main/examples/m...

This gave us 50% error reduction for any class of diagrams and 80% error reduction for sequence diagrams specifically. Also Input tokens increased on avg by 8% (which is expected) but Reasoning tokens dropped by almost 50%.

You can use it either with MCP so agents can call it with any mermaid diagram, and also can put it in pre-commit jobs and run it on every PR so all diagrams are agent ready!

I hope you like it! Let me know your thoughts!

Comments URL: [https://news.ycombinator.com/item?id=49250014](https://news.ycombinator.com/item?id=49250014)

Points: 1

── more in #developer-tools 4 stories · sorted by recency
── more on @graph2agent 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-graph2agent-…] indexed:0 read:1min 2026-08-10 ·