"매 시간 축으로 actor 간 message 주고받음 시각화". 매 UML 의 dynamic behavior 다이어그램, 매 distributed system / API 흐름 / agent loop 설명에 매 standard. 매 2026: AI agent 가 code → diagram 자동 생성 (Claude, Mermaid Chart, Eraser AI), 매 text-as-code (Mermaid) 가 GUI tool 보다 dominant.
매 핵심
매 element
Lifeline: 매 actor / object 의 vertical line.
Message: 매 horizontal arrow (sync solid, async dashed, return dotted).
Activation bar: 매 처리 중 vertical bar.
Combined fragment: alt / opt / loop / par / critical.
Note: 매 inline annotation.
매 vs 다른 다이어그램
Flowchart: control flow, no actors. 매 single perspective.
Activity diagram: state machine 비슷, branching 강조.
Component diagram: static structure.
Sequence: 매 dynamic interaction over time — "누가 누구에게 언제".
매 응용
API contract docs (REST/gRPC handshake).
Auth flow (OAuth, OIDC, SAML).
Distributed transaction (saga, 2PC).
AI agent loop (user → LLM → tool → LLM → user).
Bug reproduction trace.
Onboarding 신입 — 매 system overview.
💻 패턴
Mermaid basic
sequenceDiagram
participant U as User
participant A as App
participant DB
U->>A: GET /profile
A->>DB: SELECT * FROM users
DB-->>A: row
A-->>U: 200 OK (json)
Mermaid with alt/loop
sequenceDiagram
actor User
participant API
participant LLM
User->>API: question
loop until done
API->>LLM: prompt
LLM-->>API: tool_call
alt tool == search
API->>SearchAPI: query
SearchAPI-->>API: results
else tool == done
API-->>User: final answer
end
end
PlantUML
@startuml
actor Client
participant "Auth Service" as Auth
participant "Resource API" as API
Client -> Auth: POST /token (creds)
activate Auth
Auth --> Client: JWT
deactivate Auth
Client -> API: GET /data (Bearer JWT)
API -> API: verify JWT
API --> Client: 200 data
@enduml
Generate from code (Claude)
importanthropicc=anthropic.Anthropic()diagram=c.messages.create(model="claude-opus-4-7",max_tokens=2048,messages=[{"role":"user","content":f"Generate a Mermaid sequenceDiagram from this code:\n```python\n{src}\n```",}],).content[0].text