Skip to main content

Drawing the Line Between LLM Agents and Rule Engines: The Model Decides What, Rules Decide Whether

· 5 min read
Jack Ning
Maintainer of Bytedesk

Upgrading a customer service bot from "a talking FAQ" to "an agent that gets things done" is a shared goal for many teams lately. But the first question that surfaces is: which scenarios dare you hand to a free-roaming LLM Agent, and which must stay locked inside rule engines and fixed workflows? Let the model freely reason about refunds, and one mistake becomes a financial incident; turn product Q&A into a rigid decision tree, and the experience immediately regresses as every question gets dragged through stale branches.

This post is part of an experience-sharing series for AI customer service product managers and developers, drawn from hands-on practice as an intelligent service product manager at a large general e-commerce platform. In this post I want to share how to decide which scenarios suit an LLM Agent and which should keep rule engines or fixed workflows when pushing a Q&A bot toward an AI Agent with real execution capability — and how to design collaboration and switching between them.

This is not about enthusiasm for new tech — it is about respect for risk and a sense of architectural proportion.

Illustration: The boundary between LLM agents and rule engines

Three Key Points in Drawing the Agent-Rules Boundary​

  • Boundary judgment: articulating where Agents versus rule engines each fit, rather than "Agent everything".
  • Hybrid architecture design: LLM + workflow + rule engine collaboration instead of picking one side.
  • Risk-control awareness: money- and transaction-touching operations need admission gates, confirmation, fallback, and audit trails.

The Overall Design​

Step 1: Score every scenario on four dimensions​

DimensionSuits an LLM AgentSuits rule engine / fixed workflow
Input varietyDiverse phrasing, vague intentStandardized input, fixed entry
Process determinismNo fixed path, dynamic decisions neededFixed, enumerable steps
Risk levelRead-only, low risk (consultation, recommendations)Involves money and transactions (refunds, price changes)
Cost of failureRecoverable, clarifiableIrreversible, needs strict approval

Applied to e-commerce: product consultation, comparison recommendations, multi-turn clarification → Agent; refund applications, order modifications, price protection → fixed workflow + parameter validation. The former has wildly varied input but tolerates wrong answers; the latter has fixed phrasing but zero tolerance for a wrong step.

Step 2: Design collaboration and switching​

  • Adopt a "brain and hands" layered architecture: the LLM is the orchestration layer that understands the user, plans steps, and composes language; fixed workflows are the execution layer that performs real business operations; the rule engine handles eligibility checks and risk interception. Three layers, clear responsibilities, no one oversteps.
  • The Agent triggers workflows through tool calls (Function Calling), but every write tool has admission conditions in a fixed chain: pre-checks (business rules) → user double confirmation → execution → result return. Any unmet step interrupts the flow.
  • Design degradation paths: when Agent confidence is low or a tool call fails, automatically degrade to a fixed workflow or human handoff instead of letting the model retry. Repeated retries in transaction scenarios multiply risk.

Step 3: Grayscale rollout and validation​

Open Agent capability scenario by scenario: read-only first, write operations later. For each scenario, A/B test resolution rate, erroneous-operation rate, and complaint rate; do not expand until the data passes. The pace of capability rollout is decided by data, not by technical enthusiasm.

Two points worth emphasizing​

One-line principle: "The model decides what to do, rules decide whether it may be done, APIs do the doing." Truly irreversible operations are never left to the model's free play.

The other must-have is Agent observability: every plan, every tool call, every result must be recorded. Without traces, evaluation is impossible and incidents cannot be reconstructed — for any transaction-facing system, unobservable means unshippable.

How This Maps to Bytedesk​

Bytedesk, the open-source AI customer service system (GitHub, site), is built on exactly this layering: the AI Agent plays the "brain", handling intent understanding, knowledge retrieval (RAG), and tool-call planning; tickets and skill-group routing provide the deterministic "hands" that lock transactional tasks into configurable workflows; FAQ and rule configuration handle eligibility checks and interception; and human-bot collaboration auto-transfers to humans when Agent confidence drops or execution fails. Session logging, statistics, and quality inspection provide the observability foundation for continuous evaluation and regression checks.

Key Takeaways​

  • Judge scenarios on input variety, process determinism, risk level, and cost of failure — not gut feeling.
  • "Brain and hands" layering: model orchestrates, workflow executes, rules validate — no overstepping.
  • Every write tool needs the pre-check → double confirmation → execution → result return admission chain.
  • Degrade to workflow or human when confidence is low or calls fail; never let the model retry in transaction scenarios.
  • Read-only before write, A/B validated, fully traced — rollout pace and observability decide whether an Agent can ship at all.