How to generate valid BPMN 2.0 diagrams with a local LLM

I participated in the "AI Assistants for Energy" hackathon and developed a working AI prototype named "BPMN Diagram Architect". This prototype converts text descriptions of business processes into valid BPMN 2.0 diagrams.

Main Feature • 100% Offline Mode. The system uses a local Small Language Model. It keeps all company data safe and private.

System Architecture • Backend (Python). The system sends the text description to the local LLM. The system uses a system prompt and a JSON schema. The LLM generates a structured JSON file. • Conversion. A Python script parses the JSON file. The script generates a BPMN XML file with Diagram Interchange data. This file complies with the BPMN 2.0 XML specification. • Frontend (JavaScript). The web browser displays the result. The interface uses Node.js libraries. You can move and scale the BPMN diagram.

Current Status and Limitations • Limitation. The automatic layout of elements does not always match user expectations.

Project Backlog • Upgrade to a multi-agent AI system for code validation and automated tests. • Integrate Node.js libraries to improve coordinate rendering and XML validation. • Add a Retrieval-Augmented Generation (RAG) system with the BPMN 2.0 specification. • Do fine-tuning of the model with "invalid XML to valid XML" datasets.

Please share your experience about LLM generation of complex XML structures in comments

#llm #bpmn #python #javascript #ai #asdste100

How to generate valid BPMN 2.0 diagrams with a local LLM | Сетка — социальная сеть от hh.ru