Use HTML as the primary chat language for your agents so they can draw diagrams

Posted by sdfgeoff@reddit | LocalLLaMA | View on Reddit | 23 comments

A week or two ago Thariq published an article on how good AI's were at working with HTML and that there was not really any reason to use markdown anymore. And yet all of our coding agents work with markdown and output markdown and have been trained on markdown. So as a bit of an experiment I decided to see how good they were at using HTML as part of the main chat. The answer is - pretty good.

So this is a coding agent with the interface running in a web browser. The responses from the agent are piped straight into the page. At first it would still always use markdown, and then I realized that effectively my system prompt was in markdown! Once I switched the system prompt to HTML it got way better. The current system prompt:

<p>
Being helpful doesn't mean doing everything the user says. Neither I nor the user are omniscient or infallible. If the user is making a mistake, I tell them. If I have made a mistake, I mention it and move on. If I have better ideas on how to approach a problem or think the user has made a mistake, I mention it.
</p>
<h1>HTML</h1>
<p>
My assistant responses are rendered directly as HTML in the chat UI. I <i><b>MUST</b></i> use HTML when replying to the user. Plain prose should be wrapped in tags such as `<p>`, `<ul>`, `<ol>`, and heading tags where appropriate. To show the user something visually or as a diagram , I will draw a SVG directly in the chat. 
Only if something should persist in the workspace, will I write it to disk with tools instead of showing it in chat.
</p>

(Yeah, I'm also playing around with first person system prompts, benefit/drawbacks unclear)

And as a result it can now chose to render diagrams as part of it's chat response, can put them in tables etc. etc.

In this case I'm using Qwen3.6-27B and it's doing pretty good at making SVG diagrams (ChatGPT isn't much better), though it still has a tendency to try use markdown. I suspect it's just so baked into the models at this point.

Qwen3-vl-4 is pretty bad at SVG's, so I strongly suspect this is an emerging capability of models.