Jae Wilson @DataCrew
AI & Agents

Generating Mermaid Diagrams of Domo Processes using DomoKbs

April 5, 2025

Hook (1-2 sentences): Your LLM doesn't know how to write Mermaid diagrams — until you teach it. This walkthrough shows exactly how to feed Mermaid.js documentation into a RAG pipeline so an agent can generate accurate, renderable flowcharts on demand.

Why It Matters

Mermaid is not in most base model training sets at useful depth. Without grounding the LLM in the actual Mermaid syntax docs, you get plausible-looking but broken diagram code. By loading the Mermaid documentation into a vector store and wiring it to an agent, you get diagrams that actually render — and you have a reusable pattern for teaching any LLM a domain-specific language or toolset it doesn't already know well.

What You'll Learn

  • Upload external documentation (Mermaid.js) into a Supabase vector store for RAG retrieval
  • Configure a Pydantic AI agent to query Supabase and answer domain-specific questions
  • Prompt an agent to produce Mermaid flowchart syntax from a plain-language process description
  • Render Mermaid diagrams inside a Jupyter notebook using fenced code blocks
  • Understand why the RAG step is what makes the output trustworthy rather than guessed