Comment by LeonidBugaev

Comment by LeonidBugaev 4 days ago

1 reply

Nice one! I had my own spin on this issue as well, but from the other angle https://github.com/probelabs/maid

Getting AI to generate valid mermaid diagrams on scale extremely hard. With maid i'm hitting 100% accuracy.

Maid is basically built from scratch mermaid parser, without any dependnecies, which knows how to auto-fix common AI slop diagramming issues.

ijustlurk 3 days ago

Nice one. Mermaid validation is a huge issue given how mermaid.js is architected.

I built a mermaid generation harness last year and even the best model at it (Claude Sonnet 3.7 at the time; 4o was okay, Gemini struggled) only produced valid mermaid ~95% of the time. That failure rate adds up quickly. Had to detect errors client-side and trigger retries to keep server load reasonable.

Having a lightweight parser with auto-fix like this back then would have simplified the flow quite a bit.