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.
// 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
Why A2QL
Six primitives. Zero eval(). One protocol that makes AI-driven data pipelines predictable, parallelized, and actually auditable.
Source, transform, parameter — flat, composable, auditable. Agents write them. Humans read them. Everyone sleeps at night.
Map, filter, group, sort, slice, compute, join, merge. Chain them into pipelines. Each one pure, predictable, composable.
Topological sort organizes nodes into execution waves. Independent nodes run concurrently — maximum throughput, zero race conditions.
Cycle detection, orphan checks, duplicate ID prevention, binding validation — all at design time. If it compiles, it runs.
React hooks stream results directly into your UI. Configurable refresh policies keep dashboards alive — no polling boilerplate.
No eval(). Restricted arithmetic engine. Parameterized configs. Agent-generated queries that are safe to run — by construction, not convention.
Architecture
A2QL bridges the gap between what an AI agent wants and what your data infrastructure delivers. Three hops from intent to pixels.
Understands intent, generates the graph
Validates, sorts, executes the data graph
Binds live data to your UI surfaces
What flows through the pipe
How It Works
Define a graph. Hook it up. Watch it flow.
Compose source, transform, and parameter nodes into a declarative data graph. Your agent generates it from a prompt — or you write it by hand.
One React hook gives you live, streaming data. useDataGraph for single graphs, useLiveCanvas for multi-surface dashboards.
Bind graph outputs to A2UI surfaces. Dynamic values resolve, actions dispatch, and data refreshes on your configured policy. Done.
The Spec
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.
Connect to data providers. Query tables, aggregate stats, fetch records with field mapping and display values.
Pure operations on data. Chain multiple transforms for powerful processing pipelines.
Define user inputs with defaults and runtime overrides. Supports date ranges, enums, strings, and numbers.
Install the packages, define your first data graph, and ship an agentic dashboard before lunch.