Controllable and Reliable Knowledge-Intensive Task-Oriented Conversational Agents with Declarative Genie Worksheets

Harshit Joshi, Shicheng Liu, James Chen, Larsen Weigle, Monica S. Lam

Introduction

Large Language Models (LLMs) have revolutionized conversational AI, yet they remain fundamentally unreliable for high-stakes, task-oriented applications. These models frequently suffer from "hallucinations," struggle with complex conditional logic, and fail to consistently integrate diverse knowledge sources. Existing solutions typically fall into two categories: rigid, manual dialogue trees that lack flexibility, or pure LLM agents that are prone to policy violations. To bridge this gap, researchers at Stanford have introduced Genie, a framework that combines a declarative specification language with a deterministic algorithmic runtime to ensure reliability and controllability.

The Genie Framework

Genie shifts the paradigm of dialogue management from a purely generative process to a state-tracking problem governed by a formal specification. The system architecture decouples the "soft" linguistic capabilities of LLMs from the "hard" logical requirements of the task.

The Genie framework architecture spans from the development stage to real-time user interaction, separating parsing, runtime logic, and response generation.

The architecture consists of three primary components:

  1. Genie Parser: An LLM-based component that translates user utterances into formal Python-like state updates or Structured Unstructured Query Language (SUQL) queries.
  2. Genie Runtime: A deterministic system that manages the dialogue state, enforces developer-defined policies, and selects the appropriate "Agent Act" (e.g., asking for information or confirming a choice).
  3. Genie Response Generator: An LLM that translates formal Agent Acts back into natural, grounded conversational responses.

Declarative Genie Worksheets

At the heart of the framework is Genie Worksheets, a novel declarative language. Instead of defining every possible conversational path, developers specify "worksheets" that define the data fields required for a task, the predicates that trigger specific fields, and the actions to execute once data is collected.

Genie Worksheets allow developers to define tasks declaratively using predicates, types, and Python-based actions, which the runtime then executes deterministically.

This approach offers several advantages:

  • Separation of Concerns: LLMs act as translators between natural language and formal state, while the runtime handles the logic.
  • Dynamic Navigation: The runtime can handle out-of-order information or mid-stream changes of mind without needing explicit procedural programming for every scenario.
  • Context Compression: By feeding the LLM a succinct formal representation of the current state rather than a raw chat history, Genie avoids "lost in the middle" errors and maintains focus.

Evaluation and Key Results

The authors evaluated Genie using the StarV2 benchmark and real-world user studies involving complex tasks such as restaurant reservations, university ticket submissions, and course enrollment.

The results demonstrate a significant leap in performance:

  • Goal Completion: In a study with 62 participants, Genie agents achieved an 82.8% goal completion rate, a dramatic improvement over the 21.8% achieved by a standard GPT-4 Turbo agent using tool-calling.
  • Benchmark Superiority: Genie outperformed the previous state-of-the-art (AnyTOD) on the StarV2 benchmark by approximately 20%.
  • Model Efficiency: Genie proved to be model-agnostic; a version using GPT-4o-mini performed within 3% of the GPT-4 Turbo version, indicating that the framework's structure provides the primary performance boost.

Conclusion

Genie represents a significant advancement in building reliable conversational agents. By replacing fragile prompts with declarative specifications and a deterministic runtime, it provides developers with the control needed for high-stakes applications while maintaining the natural flexibility of LLMs. Future work will focus on scaling the system to handle hundreds of concurrent tasks through worksheet retrieval and optimizing latency through model distillation.

Summary updated

BibTeX
@inproceedings{joshi2025controllable,
  author = {Harshit Joshi and Shicheng Liu and James Chen and Larsen Weigle and Monica S. Lam},
  title = {{Controllable and Reliable Knowledge-Intensive Task-Oriented Conversational Agents with Declarative Genie Worksheets}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure