Sequence template · local export
AI Agent Tool Calling Mermaid Template
Agent sequence diagram: planning, tool calls, observations, and a cited final answer. Edit the code below, choose a publish preset, then export without signup, watermark, or cloud upload.
AI agenttoolsLLM
Paste or edit Mermaid code
Replace the sample below, or load another example.
Load example
Preparing the local renderer without uploading your diagram.Preparing editor…
Live previewSample preview · Clean Docs
Preparing local editor…
Render & export
Export controls activate after your diagram renders locally.
Sequence
Mode
Default renderNative MermaidOptimized exportStyled download
Export style
Clean DocsGitHub READMETransparent DocsWarm Editorial✦ ProWhiteboard Sketch✦ ProAurora Noir✦ ProBlueprint✦ ProChampagne✦ ProEmerald Suite✦ ProEditorial✦ Pro
Scale
1x2x4x
Or exact width, e.g. 1200px wide
Output: White · comfortable padding
Size: calculated after render
Filename: mermaid-sequence-white-2x.png
When to use the AI Agent Tool Calling template
An agentic tool-use loop as a sequence diagram: the User's task reaches the Agent, which loads prior context from Memory and asks the LLM to plan the next action. The chosen tool call (search_files) executes, its Observation feeds back into the LLM, and the loop ends with a cited final answer returned to the user.
- •Designing an agent runtime and needing to show the plan → act → observe loop before building it.
- •Documenting why your agent keeps Memory separate from the LLM conversation and what state persists.
- •Explaining tool-calling traces to reviewers, with each observation and follow-up call made explicit.
Template code
The full Mermaid source for this template — copy it into any Mermaid-compatible tool, or edit and export it in the editor above.
sequenceDiagram
participant User
participant Agent
participant LLM
participant Tools
participant Memory
User->>Agent: Ask task
Agent->>Memory: Load context
Agent->>LLM: Plan next action
LLM-->>Agent: Call search_files
Agent->>Tools: Execute tool call
Tools-->>Agent: Observation
Agent->>LLM: Continue with evidence
LLM-->>Agent: Final response
Agent-->>User: Answer with citationsHow to customize this template
- •Replace search_files with your real tool inventory, or add a Tools fan-out showing parallel calls.
- •Show Memory writes explicitly if the agent persists observations between steps rather than only loading context.
- •Add a max-iterations guard loop on the LLM plan step to represent how you stop runaway agents.
- •Point the final citations message at your UI rendering if answer format matters to the reader.