⭐ Inspiration

Understanding code and complex processes is often slow and frustrating. Developers waste hours creating flowcharts manually, students struggle to visualize logic, and teams find documentation tedious.

We imagined a tool that could instantly convert any code or text into a clean visual flowchart, making technical understanding effortless. That spark became FlowMind AI.

⭐ What it does

FlowMind AI automatically transforms:

🟦 Python, Java, C, JavaScript, etc.

🟩 Plain English process descriptions

🟪 Pseudocode

into fully interactive Mermaid flowcharts within seconds.

Users simply paste input → AI analyzes logic → produces a flowchart that can be copied, edited, exported, or embedded.

FlowMind AI helps with:

Code understanding

Debugging

Teaching & learning

Documentation

System design & architecture

Rapid prototyping

It turns complexity into clarity—instantly.

⭐ How we built it

We built FlowMind AI using:

🔹 Frontend & App

Streamlit for a clean, simple UI

Real-time rendering of Mermaid diagrams

🔹 AI/Model

Hugging Face TroyDoesAI/MermaidStable3B, a model specialized for diagram generation

Prompt engineering to ensure the model outputs only valid Mermaid syntax

Code parsing + preprocessing for accurate structure extraction

Fallback logic using FLAN-T5 for text-based logical interpretation

🔹 Backend

Python (Transformers, HuggingFace Hub)

Custom flow extraction pipeline

Response validation + auto-correction (detect grammar errors in Mermaid syntax)

🔹 Infrastructure

Running on local GPU/CPU

Caching for faster subsequent generations

Robust error handling for malformed code blocks

⭐ Challenges we ran into

Custom code loading issues with the MermaidStable3B model on Windows

Handling trust_remote_code=True and missing signals like SIGALRM

Ensuring the model outputs clean Mermaid syntax only

Parsing messy user code with inconsistent indentation

Preventing the AI from generating explanations instead of diagrams

Managing long prompts causing latency

Rendering large diagrams without UI lag in Streamlit

Each problem forced us to improve the model prompts, add validators, and refine the pipeline.

Built With

Share this project:

Updates