Open Protocol/v0.9 Spec

Your agents speak data.
This is their language.

A2QL is the open protocol that lets AI agents compose, validate, and execute data queries — then stream live results straight into your UI. No middleware. No glue code. Just data flowing where it needs to go.

$npm install @a2ql/core @a2ql/react
incident-dashboard.a2ql.ts
// Agents compose these automatically — humans can read and audit them
const graph: A2QLDataGraph = {
  graphId: 'incident-metrics',
  nodes: [
    { id: 'src', type: 'source', provider: 'servicenow', op: 'aggregate' },
    { id: 'grouped', type: 'transform', op: 'group', input: 'src' },
    { id: 'sorted', type: 'transform', op: 'sort', input: 'grouped' }
  ],
  bindings: { 'dashboard': 'sorted' }
};

// One hook. Live data. Done.
const { surfaces, isRefreshing } = useLiveCanvas(a2uiSurfaces, [graph]);

Plays nicely with

A2UI

UI Rendering

CopilotKit

Agent Orchestration

ServiceNow

Data Provider

React

First-Class Hooks

Why A2QL

Built for agents. Readable by humans.

Six primitives. Zero eval(). One protocol that makes AI-driven data pipelines predictable, parallelized, and actually auditable.

Declarative Data Graphs

Source, transform, parameter — flat, composable, auditable. Agents write them. Humans read them. Everyone sleeps at night.

8 Transform Operations

Map, filter, group, sort, slice, compute, join, merge. Chain them into pipelines. Each one pure, predictable, composable.

Parallel Execution Waves

Topological sort organizes nodes into execution waves. Independent nodes run concurrently — maximum throughput, zero race conditions.

Validated Before Execution

Cycle detection, orphan checks, duplicate ID prevention, binding validation — all at design time. If it compiles, it runs.

Live Data Binding

React hooks stream results directly into your UI. Configurable refresh policies keep dashboards alive — no polling boilerplate.

Secure by Default

No eval(). Restricted arithmetic engine. Parameterized configs. Agent-generated queries that are safe to run — by construction, not convention.

Architecture

Agent thinks. Data flows.

A2QL bridges the gap between what an AI agent wants and what your data infrastructure delivers. Three hops from intent to pixels.

AI Agent

Understands intent, generates the graph

A2QL Protocol

Validates, sorts, executes the data graph

A2UI Renderer

Binds live data to your UI surfaces

What flows through the pipe

ServiceNow Tables
Aggregate Stats
Transform Chains
Live Refresh

How It Works

Three steps to live data

Define a graph. Hook it up. Watch it flow.

1

Define the graph

Compose source, transform, and parameter nodes into a declarative data graph. Your agent generates it from a prompt — or you write it by hand.

{ graphId: 'metrics',
nodes: [...],
bindings: {...} }
2

Hook it up

One React hook gives you live, streaming data. useDataGraph for single graphs, useLiveCanvas for multi-surface dashboards.

const { data, isLoading }
= useDataGraph(graph);
3

Watch it flow

Bind graph outputs to A2UI surfaces. Dynamic values resolve, actions dispatch, and data refreshes on your configured policy. Done.

<A2UIRenderer
surface={surfaces[0]}
onAction={handleAction} />

The Spec

A language agents can think in

Minimal, auditable, deterministic. A2QL is the contract between your AI and your data. Every graph is a validated DAG. Every transform is pure. Every binding is type-safe.

Three node types — that's it

Source, Transform, Parameter. Any data pipeline. No exceptions.

Deterministic execution

Same graph, same order, every time. Topological sort guarantees it.

Named bindings

Export node outputs to UI surfaces with clear, typed contracts.

Runtime parameters

Date ranges, enums, dynamic values — resolved at execution time.

Node Types
Source

Connect to data providers. Query tables, aggregate stats, fetch records with field mapping and display values.

servicenowqueryaggregate
Transform

Pure operations on data. Chain multiple transforms for powerful processing pipelines.

mapfiltergroupsortjoincomputemergeslice
Parameter

Define user inputs with defaults and runtime overrides. Supports date ranges, enums, strings, and numbers.

dateRangeenumstringnumber

Ready to let your agents talk to data?

Install the packages, define your first data graph, and ship an agentic dashboard before lunch.

$npm install @a2ql/core @a2ql/react @a2ui/react