Back to feed
Dev.to
Dev.to
7/25/2026
From One-Shot LLM to Multi-Turn Agent: How I Rebuilt My Text-to-Diagram Tool

From One-Shot LLM to Multi-Turn Agent: How I Rebuilt My Text-to-Diagram Tool

Short summary

A text-to-diagram tool evolved from a single LLM call to a multi-turn agent after two failure modes: syntax errors with no recovery and silent semantic drift. The v2 architecture uses two loops — an outer loop for understanding the request and an inner loop for generating and repairing code. Six roles (Clerk, Auditor, Planner, Lawyer, Reviewer, Front Desk) each do exactly one thing, making the pipeline debuggable and each role testable in isolation.

  • Single-shot LLM calls fail on syntax errors and silent semantic drift; multi-turn agents fix both
  • Two-loop architecture separates request understanding from code generation and repair
  • Six single-responsibility roles modeled as pure functions enable isolated testing and debugging

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more