Article

Three Pipelines, One Goal: Comparing Bowtie Diagram Generation Methods

Article by Priyank Venkatesh

Illustration of a machine converting inputs labeled RAG, OCR, and Dual LLM into a structured Bowtie Report. Three document streams enter a central processing box with circuit-style graphics, and a single arrow outputs a finished Bowtie diagram on a report sheet.
Images: OpenAI ChatGPT and Google Gemini

 

When generating Bowtie diagrams automatically from FMEA data, there’s no “one-size-fits-all” solution. Think of it like navigating to the same destination but choosing different modes of travel: sometimes you fly, sometimes you drive, sometimes you take the train. Each gets you there, but the best option depends on the context.

In our research, three distinct pipelines were explored for automating Bowtie generation:

  1. RAG – Retrieval-Augmented Generation with FMEA tables.
  2. OCR – Converting scanned tables or PDFs into text.
  3. Dual LLM – Letting a larger LLM extract table and textual content.

 

Pipeline Overview: Three Paths to Automated Bowties

Pipeline 1: RAG-Based Extraction – Giving LLMs a knowledge base

If you’ve been following the rise of LLMs, you’ve probably heard the term RAG: Retrieval-Augmented Generation. At its core, RAG is a way of giving an LLM a smarter memory.Diagram showing structured FMEA text extracted from a PDF, broken into elements like tables, narratives, and pages. These feed into a FAISS index and an LLM, which processes the content and outputs a Bowtie diagram.

Instead of throwing an entire document at a model and hoping it extracts the right parts, RAG works like a research assistant. First, the document is broken into small, manageable chunks. Each chunk is embedded into a vector space so the computer can measure semantic similarity. Then, when you ask a question, the system doesn’t feed the whole document to the LLM; it just fetches the most relevant passages based on the query. Think of it as the difference between manually searching for a quote in a book versus using a digital index: one is brute force; the other is precise.

In the context of Bowtie diagram automation from FMEA/FMECA data, RAG acts as the indexing engine that ensures the LLM only sees the most relevant parts. That’s how we keep the process fast, lightweight, and contextually appropriate.

How It Works: 

Flowchart showing six steps: uploading chunked FMEA/FMECA JSON, user entering a part name, chunk retriever filtering relevant sections, building a structured prompt, a single LLM generating Bowtie JSON, and converting the JSON into a Mermaid diagram.

1. Chunking and Preprocessing

FMEA reports usually contain both narrative descriptions and tabular data. Using tools like PyMuPDF and pdfplumber, the content is extracted and divided into small chunks.Illustration showing an FMEA document being split into pieces like tables, narratives, and pages, which are then fed into a FAISS index for processing.

Each chunk is annotated with metadata such as:

  • Part name
  • Chunk type (table or text)
  • Page number

Chunks are embedded into a vector space using the all-MiniLM-L6-v2 model and indexed with FAISS.

What is all-MiniLM-L6-v2?

It’s a lightweight sentence embedding model from the Sentence Transformers library. Instead of treating text as raw words, it converts each chunk into a vector, basically a list of numbers that capture the meaning of the text. This model lets the system compare passages by semantic similarity rather than exact keywords.

What is FAISS?

FAISS (Facebook AI Similarity Search) is an open-source library for quick similarity search. Once all the chunks are embedded as vectors, FAISS makes it possible to find the ones most like a user query quickly. Think of it as Google Search, but instead of keywords, it’s matching on meaning.

2. Semantic Retrieval

When a user requests information about a part (e.g., Valve Assembly), the system retrieves the most semantically relevant chunks for that component.

These can be filtered to prioritise:

  • Only tables
  • Only narrative text
  • Or a blend of both

3. LLM Inference and Visualisation

The retrieved chunks are assembled into a structured prompt, which the LLM processes in one pass. The output is a Bowtie JSON with fields like critical event, causes and consequences. The JSON can then be rendered as a Mermaid diagram for visual inspection.

Table comparing strengths and weaknesses of a retrieval-augmented LLM: strengths include efficiency, accuracy, scalability, and cost-effectiveness, while weaknesses include retrieval errors, domain-specific confusion, reduced flexibility, and required preprocessing.

 

Pipeline 2: OCR-Based Extraction – Turning Images into Insights

Not all FMEA reports have proper formatting or are cleanly digitised. Engineers often work with scanned PDFs, legacy documents, or quick screenshots of tables. For these situations, RAG alone won’t work because there’s no clean text to retrieve. That’s where OCR (Optical Character Recognition) + LLM comes in. OCR acts as the “translator,” turning pixels into text. From there the text is sent to an LLM creating Bowties.

How It Works:

Flowchart outlining six steps: uploading a table image and part name, running OCR, sending extracted table text to the LLM, selecting a prompt, generating structured Bowtie JSON, and visualizing it as a Bowtie diagram.

  1. Image Preprocessing  
    The pipeline begins when the user uploads an image of an FMEA table. The system runs OCR tools such as PaddleOCR or Img2Table to extract structured content. The user also enters the component name in the screenshot.
    – Rows and columns are detected.
    – Text is reconstructed into Markdown format (or simplified text) of a table.
    – The result is a clean, LLM-ready version of the original table.
  2. Feed structured text to the LLM 
    The processed table is inserted into a tailored Bowtie prompt. The LLM reads this context and generates a structured JSON output containing critical events, causes, barriers, and consequences.
  3. LLM Inference and Visualisation 
    The JSON output is converted into a visual Bowtie diagram, allowing engineers to analyze and validate the extracted causal structure.

Table comparing strengths and weaknesses of OCR-based FMEA processing: strengths highlight compatibility with scanned images, accessibility, and flexible OCR backends; weaknesses note OCR errors, formatting loss, and added preprocessing latency.

 

Pipeline 3: Dual LLM – When the Model Can See

Diagram showing a four-step pipeline: upload a screenshot of a table, a vision model extracts the table text, an LLM processes the input (e.g., “Valve Assembly”), and the system outputs a structured Bowtie diagram.

An alternative to the OCR pipeline is to use a Multimodal LLM (Mistral-small). Instead of separating image recognition from text reasoning, these models combine both capabilities: they can “see” an input (like a scanned table, a diagram, or a screenshot of an FMEA report) and directly extract the textual and structural content needed for Bowtie generation.

This makes the approach multimodal, it doesn’t just process text, it integrates information across formats: images, tables, and diagrams. The extracted content can then be passed through the same Bowtie JSON generation process as in other pipelines.

How It Works: 

Flowchart showing a dual-LLM process: upload a table image and part name, vision LLM extracts a table description and markdown, user selects a prompt type, a second LLM generates Bowtie JSON, and the JSON is converted into a Mermaid diagram.

  1. Upload & Identify 
    Input a screenshot of an FMEA table (or mixed page) and the part name (e.g., “Valve Assembly”).
  2. Vision LLM → Structured Readout
    The Vision LLM converts the image to base 64 and proceeds to extract content:
    – A Markdown-formatted table that reconstructs rows/columns and headers.
    – A short table description/summary capturing failure modes, causes/mechanisms/effects observed in the image.
    This step bypasses traditional OCR by letting the model perform recognition and interpretation jointly (multimodal).
  3. Choose Prompting Style for Generation 
    User selects prompt type: Zero-shot/Few-shot/Chain-of-Thought (CoT)
    What’s passed forward: Part name, Markdown table + summary from Step 2, a structured instruction specifying the target schema (Bowtie JSON). More on the prompting style will follow in Blog 3.
  4. Second LLM → Bowtie JSON 
    The text LLM receives the structured context and generates Bowtie JSON with the standard set of JSON keys. Then the JSON can be converted to Markdown and render as a Mermaid diagram for review.

Table comparing strengths and weaknesses of a vision-based LLM approach: strengths include handling mixed content, reduced OCR dependency, future-proofing, and versatility; weaknesses include inconsistency at early stages, higher compute cost, harder debugging, and the need for careful evaluation before deployment.

 

So, which pipeline should you choose?

The choice begins with a simple question: what kind of data do you have?Flowchart asking “What kind of data do you have?” with three options: structured documents leading to RAG, a single screenshot leading to OCR, and mixed text plus tables leading to a Dual LLM approach, each labeled with its ideal use case.

  • Large set of structured documents → Use RAG. 
    Retrieval-Augmented Generation works best when you can index and chunk text. This pipeline excels with digital FMEA/FMECA reports where tables and narratives are easily accessible.
  • Single screenshot or scanned table → Use OCR. 
    Optical Character Recognition is the pragmatic choice when there is a table, and you want a quick turnaround for a Bowtie. So, snap a screenshot of it for the LLM to process.
  • Mixed text and tables in one screenshot → Use Dual LLM. 
    Vision-enabled models can capture both narrative and tabular content in one pass. This pipeline is still maturing, but it is beneficial for hybrid documents that combine text/tabular content with diagrams
Previous article: From FMEA Tables to Bowtie Diagrams: How LLMs Are Changing Failure Analysis
Coming up next: Why Prompt Engineering Still Matters in the Age of Advanced LLMs?

Ready to explore your digitalization challenges together?

Book a call with Artur LoorpuuSenior Solutions Engineer in Digitalization. Artur specialises in turning industrial challenges into practical digital solutions through expertise in predictive maintenance, digital twins, data science, and strategic product management.

Let’s explore how we can support your goals!

Related Articles