Sunday, 23 November 2025

How to use AI to generate software architecture diagrams from simple prompts

In a previous post, I shared some of my experience adding AI features into this proof of concept application I've been building entirely with AI coding assistants. This weekend, I found a way to break through the obstacle I faced with attempting to use Gemini to generate images through its Imagen API. A much simpler way to realise my goal of getting an AI to generate architecture diagrams from a simple prompt, is to instruct the LLM to produce Mermaid diagrams.

All it needed was a carefully crafted system prompt, instructing the AI to create the Mermaid diagram syntax from the data model, and voila! We now have a way to generate almost any diagram one can think of. 

Take a look at this video:


And here's built-in native features of the app that shows different Mermaid diagrams for the system under inspection:



Play with the app here
Source code
Project Wiki


No comments:

Post a Comment