langgoap.render_mermaid

Contents

langgoap.render_mermaid#

render_mermaid(plan, *, show_resources=True, show_schedule=True)[source]#

Render a Plan as a Mermaid flowchart TD diagram.

Nodes are actions; edges are effect→precondition dependencies from langgoap.planner.csp.build_dependency_graph(). When plan.metadata.csp carries a schedule, actions at the same start time are grouped into subgraph blocks to highlight parallelism. Resource totals are appended as a Mermaid comment block at the bottom when show_resources is True.

Parameters:
  • plan (Plan) – Plan to render.

  • show_resources (bool) – If True, append resource usage summary.

  • show_schedule (bool) – If True, group parallel actions into subgraphs and highlight the critical path.

Returns:

Mermaid source code as a plain string.

Return type:

str