Building Zara's brain taught us where an LLM belongs in an agent and where it doesn't. Hallucination cascades and runaway token costs pushed us toward a design where the model only extracts intent into a structured Action DSL, and deterministic code does the rest.
During my internship at ANCI AI, I've worked mainly on the brain of our calendar scheduling agent, Zara. A central theme throughout the development process was deciding which parts of the agent should be deterministic and which should be non-deterministic. In this article, I define both terms, share what we learned about them while building Zara, and explain why we are shifting toward a more deterministic design.
01 / Definitions
A system is deterministic when a specific input always yields the same output, with no randomness involved. In practice this is achieved by writing code that handles predefined use cases. A non-deterministic system, such as a Large Language Model (LLM), can produce different outputs for the same input.
Despite that inherent unpredictability, AI agents depend on LLMs for a reason. Natural language requests are too diverse to handle by hand, and they often carry subtle ambiguity that software alone cannot capture. An LLM can extract structured details from that messy input. It can also select specific tools from a Model Context Protocol (MCP) server to complete the sub-tasks needed to reach a user's goal.
Determinism through code, however, remains essential for implementing guards. Guards keep the agent's workflow controlled and correctable even when the LLM picks the wrong tool or the wrong flow during execution.
02 / What We Tried
Our initial plan put an LLM in charge of the core of the agent's functionality: intent classification, tool selection, and plan revision based on human-in-the-loop feedback. We soon identified two primary limitations.
The only thing we cannot make deterministic is understanding what the user meant. Everything after that, we can.
03 / The Shift
To address these issues, we are moving toward a primarily deterministic agent, where tools are selected through structured code based on user intentions. The one element we cannot manage deterministically is the structured extraction of those intentions from natural language. For that step we use powerful models and work hard to minimize hallucinations.
Our approach follows a clear sequence:
To make sure the LLM extracts intentions accurately, we thoroughly test a wide range of use cases and tune our zero-shot prompts against real-world scenarios. The model's surface area shrinks to one well-tested job, and everything downstream becomes predictable, inspectable, and cheap to run.
04 / Conclusion
Hallucinations and their associated costs are often inevitable when an agent relies solely on LLMs. That is why we have shifted our focus toward maximizing determinism. Through this development process, we have learned that defining exhaustive use case categories and mapping their specific workflows is essential to building a reliable system that successfully fulfills user requests.
Get AI scheduling insights, product news, and Bay Area community updates delivered to your inbox.
No spam. Unsubscribe anytime.