FlowDiagram
UML: sequence, class & stateMermaid

LLM tool call with RAG sequence diagram template

Shows an AI assistant request where the model retrieves documents from a vector store and calls an external tool before answering; used by teams building LLM applications. This sequence diagram template contains 5 labelled participants.

Open in the editor →
  • Free — no account, no trial, no watermark
  • Fully editable shapes and connectors, not a screenshot
  • Export PNG, SVG or PDF, or share it as a link
  • Private: the diagram never leaves your browser

Participants in this sequence diagram

  • User
  • Assistant backend
  • Vector store
  • LLM API
  • Weather API

How to use this sequence diagram template

  1. Click Open in the editor. The sequence diagram opens on a new page in FlowDiagram — nothing is uploaded and there is no sign-up.
  2. Rename, add or delete shapes and drag them where you want; connectors stay attached as things move.
  3. Drop in vendor logos from the library — 1,160 of them, including every AWS, Azure and Google Cloud service icon — or restyle it with the colour and theme controls.
  4. Prefer text? Edit the Mermaid source below and paste it in through ☰ → Import diagram (see the Mermaid editor); it imports as an editable diagram.
  5. Export to PNG, SVG or PDF, or press Ctrl+L for a link that carries the whole diagram.

Mermaid source

The whole template is the text below. Paste it into FlowDiagram, keep it in Git next to the code it describes, or hand it to an AI assistant to extend.

sequenceDiagram
  autonumber
  actor U as User
  participant App as Assistant backend
  participant VS as Vector store
  participant LLM as LLM API
  participant Tool as Weather API
  U->>App: "Do I need an umbrella for my Paris trip?"
  App->>VS: Embed query, top-k search
  VS-->>App: Trip itinerary chunks
  App->>LLM: Prompt + context + tool schemas
  loop Until model returns final answer
    LLM-->>App: tool_call get_forecast(city=Paris)
    App->>Tool: GET /forecast?city=Paris
    Tool-->>App: Rain 70% on Friday
    App->>LLM: Tool result
  end
  LLM-->>App: Final answer with citations
  alt Guardrail check passes
    App-->>U: Streamed answer
  else Unsafe or ungrounded
    App-->>U: Fallback response
  end
  Note right of App: Backend logs tokens, latency and tool calls

Related: Mermaid editor · All uml: sequence, class & state templates · All 521 templates