English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

Conversation Routines: The Prompt Engineering Framework Letting AI Perform Business Logic Written in Natural Language

Forum topic · QianXun · 2025-11-20

Summary

This article explores "Conversation Routines" (CR), a prompt engineering framework proposed by Giorgio Robino (arXiv:2501.11613) that enables large language models (LLMs) to directly read and execute business workflows written in natural language. Instead of hard-coding dialog logic, domain experts write "scripts" describing roles, goals, function-calling protocols, workflow control patterns (sequencing, conditionals, iterations, confirmation checkpoints), and output style; the LLM then interprets and performs these routines like an actor following a playbook. The post walks through two proof-of-concept systems: a train-ticket booking agent built on GPT-4o-mini that handled fuzzy queries, pagination, and mid-flow changes across 50+ test runs, and an industrial conveyor-belt troubleshooting assistant using a two-agent setup (guide plus report writer) with rigid embedded safety protocols. It compares CR against RASA CALM, LangGraph, and Hugging Face Smolagents, noting CR's advantages in accessibility, flexibility, and business-expert involvement versus costs in determinism, latency, and debuggability. Future directions include standardized evaluation, joint prompt/tool optimization, small local LLMs, adaptive dialog strategies, and modular multi-agent CR engineering.

Conversation Routines: When Code Learns to "Improvise"

This is a structured summary of a long-form Chinese post analyzing Giorgio Robino's *Conversation Routines: A Prompt Engineering Framework for Task-Oriented Dialog Systems* (arXiv:2501.11613v7).

Key points

  • The core idea: Rather than hard-coding dialog flows, Conversation Routines (CR) embed business processes as natural-language instructions in LLM prompts, turning the model itself into the workflow interpreter—an "executable specification" readable by both humans and machines.
  • Paradigm shift: As LangChain's Harrison Chase put it, "AI agents are systems that use LLMs to decide the control flow of an application." Instruction-tuned chat models can maintain multi-turn context, track state, and generate contextually appropriate responses.
  • Single vs. multi-agent: Robino's experiments started with a single agent but moved toward OpenAI's SWARM-style architecture—specialized agents with distinct system prompts, dynamic handoffs, and context-aware transitions.
  • Anatomy of a CR script (eight elements)

    1. Persona & goals for both agent and user 2. Function integration protocol — when/how to call tools (e.g., search_railway_station(), book_train_ticket()) 3. Workflow control patterns using systematic indentation (Markdown/YAML-like):

  • Sequential steps and conditional branches (IF ... ELSE)
  • Iteration logic for pagination and validation retries (max 3 attempts)
  • Explicit binary confirmation checkpoints ("YES or NO") before critical actions
  • 4. Output format and tone directives

    Proof of concept 1: Train ticket booking

  • Built on GPT-4o-mini (128k context, function calling, low latency).
  • A key design insight: stateless functions outperformed stateful Python classes—letting the LLM track pagination state in-context eliminated transaction-ID synchronization issues.
  • In 50+ test runs, booking almost always succeeded; failures occurred only with deliberately uncooperative users. The agent gracefully handled vague queries ("a station in Genova, I forget the name"), pagination navigation, fuzzy time expressions, and multi-turn confirmations. A sample session took 3m41s and 36,208 tokens.
  • Proof of concept 2: Industrial troubleshooting

  • An 18-step conveyor-belt troubleshooting manual (with conditionals, loops, and safety preconditions) was used as-is as the CR script.
  • Two-agent architecture: a troubleshooting guide agent and a report-writer agent, connected via handoff_report().
  • Rigid safety rules were embedded: mandatory warnings before hazardous steps, explicit confirmation, never skipping voltage-zero verification.
  • The system recovered seamlessly from interrupted flows (part lookup mid-procedure) and interpreted ambiguous confirmations, producing a structured compliance report with step IDs.

Comparison with other frameworks

| Framework | Approach | Trade-off vs. CR | |---|---|---| | RASA CALM | Hybrid: LLM intent understanding + deterministic dialog manager | Cheaper/lower latency, but YAML-hard-coded logic; experts sidelined | | LangGraph | Graph of nodes (Python functions) and edges | Fine-grained control and persistence, but logic lives in code | | HF Smolagents | LLM generates executable Python | Efficient, but debugging code hallucinations is hard |

CR's edge: accessibility, flexibility, fast iteration, business-expert involvement. Its costs: non-determinism, token/latency overhead, and debugging complexity.

Future directions

1. Goal-based evaluation: two-stage LLM-judge metrics (task completion, coherence, robustness, safety) feeding an eval-improve-validate loop—a CI/CD pipeline for prompts. 2. Prompt optimization pipelines: joint optimization of function signatures and CR text; possibly "CR compilers" translating high-level routines into framework-specific workflows. 3. Small LLMs for edge deployment: Mistral Small 3 (23.6B) matched GPT-4o-mini on tool-selection quality (TSQ 0.832) at lower cost. 4. Adaptive dialog design: intent recovery for off-topic queries, user-expertise-aware tone, risk-scaled confirmation granularity. 5. Modular multi-agent CR engineering: shared memory, style protocols, and arbiter agents to handle context drift and inter-agent conflicts.

Takeaway

CR frames a broader movement toward "Natural Language as Code": business logic expressed in plain language, executable by LLMs, iterated at text-editing speed. It does not replace traditional programming but opens a new abstraction layer—letting the people closest to the problem shape the solution.

References

1. Robino, G. (2025). *Conversation Routines: A Prompt Engineering Framework for Task-Oriented Dialog Systems*. arXiv:2501.11613v7. 2. Chase, H. (2023). *What is an AI agent?* LangChain Blog. 3. OpenAI (2023). *SWARM Framework: Orchestrating Agents with Routines and Handoffs*. 4. Ouyang, L., et al. (2022). *Training language models to follow instructions with human feedback*. NeurIPS.

Tags

#conversation-routines#prompt-engineering#llm-agents#conversational-ai#task-oriented-dialog#multi-agent-systems#function-calling#natural-language-programming

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/176360512