PromptQL Design | Hasura PromptQL

PromptQL Design | Hasura PromptQL

Visit Site

Introducing PromptQL: A Revolutionary Approach to High-Trust LLM Interaction

Hasura PromptQL is a novel agent approach that enables high-trust Large Language Model (LLM) interaction with business data and systems. This innovative solution addresses the challenges of traditional tool calling and RAG approaches, providing a high degree of explainability, accuracy, and repeatability for complex tasks.

Key Features:

  1. Explainable and Steerable Query Plans: PromptQL composes tool calls and LLM tasks in a way that provides transparent and controllable interactions with business data.
  2. High Accuracy and Repeatability: PromptQL achieves near-perfect accuracy and repeatability, even for complex tasks and large working sets.
  3. Constant Context Size: PromptQL ensures a constant context size as the amount of data in the working set increases.
  4. Lower Token Consumption: PromptQL reduces token consumption for complex tasks.

Benefits:

  1. Improved Accuracy: PromptQL achieves significant improvements in accuracy compared to traditional tool calling approaches.
  2. Enhanced Repeatability: PromptQL ensures near-perfect repeatability, even as task complexity and data size increase.
  3. Increased Efficiency: PromptQL's constant context size and lower token consumption enable more efficient interactions with business data.

How it Works:

  1. Query Plan Creation: A PromptQL agent creates a query plan that describes the interaction with business data.
  2. Programmatic Primitives: PromptQL uses LLM primitives to generate Python programs that read and write data via Python functions.
  3. Artifact Management: PromptQL artifacts, such as text and table artifacts, are created and referenced from PromptQL programs.

Challenges and Solutions:

  1. Challenge #1: Accuracy and repeatability deteriorate with increasing instruction complexity and data size.
  2. Challenge #2: In-context approaches risk hitting hard LLM limitations around input and output token limits. PromptQL addresses these challenges by separating query plan creation from execution, using programmatic primitives, and managing artifacts.

Key Components:

  1. PromptQL Programs: Python programs that read and write data via Python functions, generated by LLMs.
  2. PromptQL Primitives: AI functions available as Python functions in PromptQL programs to perform common AI tasks on data.
  3. PromptQL Artifacts: Stores of data referenced from PromptQL programs, enabling structured memory and surpassing limitations introduced by passing data in context.

By introducing PromptQL, Hasura enables high-trust LLM interaction with business data and systems, ensuring accuracy, repeatability, and efficiency for complex tasks.