Regex first, LLM second
Context
Most questions repeated a small set of parcel lookups. Routing every message through an LLM raised cost and made incorrect answers harder to control.
Alternatives
- LLM on every message: more natural language coverage, less predictability and higher cost.
- Forms only: safer for the backend, poor fit for farmers who needed chat.
Decision
Classify common intents with validation and regex, and pass ambiguous requests to an LLM for context.
Trade-off
Less open-ended coverage early on, with more predictable answers on the common path.