Skip to content
Cipher
Engineering7 min read

From Natural Language to Execution Plan: Inside the Intent Layer

Translating ambiguous human requests into reliable, bounded agent tasks is harder than it looks. Here's what we learned.

James Okafor

Natural language is the most powerful user interface ever invented, and also the most dangerous one to build software on top of. When a user says "clean up the customer database," they might mean delete duplicate records, archive old accounts, normalize phone number formats, or all three. The Intent Layer's job is to resolve this ambiguity before a single agent action is taken.

We experimented with several approaches to intent resolution before settling on the current design. Our first attempt used a single large model to decompose requests directly into tool call sequences. This worked well for simple tasks but produced wildly inconsistent results for complex ones, and it was nearly impossible to test systematically. Our second attempt introduced a planning step that generated a structured plan before execution, which improved consistency but made the latency unacceptable for interactive use cases. The current design, which we call progressive intent refinement, strikes a balance between these extremes.

In progressive intent refinement, the Intent Layer first classifies the request into one of a set of task archetypes — query, mutate, schedule, notify, report — and identifies the primary data domain the task operates on. This classification step is fast and cheap. It then retrieves the most relevant workflow templates from a curated library and asks the model to select and parameterize the best-fitting template. For requests that don't match any template well, it falls back to unconstrained planning with the full tool catalog. In practice, roughly 80 percent of production requests match a template, which means 80 percent of tasks benefit from the speed, reliability, and auditability of template-based execution.

The most surprising lesson we learned during development was how often the right response to an ambiguous request is to ask a clarifying question rather than to guess. We built a clarification threshold into the Intent Layer: when the model's confidence in its intent classification falls below a tunable value, it generates a targeted clarifying question and returns it to the calling application. This shifts the burden of ambiguity resolution to the human, where it belongs, and dramatically reduces the rate of confidently-wrong plan generation. Customers who enable the clarification threshold report a 35 percent reduction in failed task rate, with no meaningful increase in user-perceived latency because the question-and-answer round trip takes less time than recovering from a bad plan.