← all features

NQL · live examples

Ask in English, get rows back.

NQL compiles a natural-language question into a query plan — a deterministic rule grammar handles the common shapes, an LLM steps in only when the rules can't parse, and compiled plans are cached so the second ask is milliseconds. The plan itself is inspectable.

01
Compile
Rule grammar first — deterministic, fast, no model in the hot path.
02
Fallback
The LLM only sees questions the grammar can't parse — never your data.
03
Cache
Compiled plans are cached per tenant; repeat questions skip compilation entirely.
checking instance…one substrate · sql / graph / vector / fts / nql
Foundations
01

Simple count

easy

“How many open tickets mention EMI?”

request
POST /v1/tenants/:t/ask
{
  "question": "how many open tickets mention EMI?"
}
02

Join via plain English

easy

“Which customers in Pune have more than one account?” — a join + group by, from a sentence.

request
POST /v1/tenants/:t/ask
{
  "question": "which customers in Pune have more than one account?"
}
03

Recent-N with a topic

easy

“Show the 5 most recent tickets about fraud” — filter + sort + limit from one sentence.

request
POST /v1/tenants/:t/ask
{
  "question": "show the 5 most recent tickets about fraud"
}
Intermediate patterns
04

Show the plan

intermediate

Same question with ?explain — the generated plan comes back beside the rows.

request
POST /v1/tenants/:t/ask?explain=1
{
  "question": "which customers in Pune have more than one account?"
}
05

Cache hit

intermediate

Run the previous question twice — the second run skips compilation. Watch the latency drop.

request
POST /v1/tenants/:t/ask
{
  "question": "which customers in Pune have more than one account?"
}
06

Multi-hop question — NL over the graph

intermediate

“Which customers referred someone whose account sent money to a flagged account?” — three hops, from one sentence.

request
POST /v1/tenants/:t/ask
{
  "question": "which customers referred someone whose account sent money to a flagged account?"
}
07

Time-windowed aggregate

intermediate

“Average transaction amount per segment over the last 90 days” — window filter + join + group by, no SQL written.

request
POST /v1/tenants/:t/ask?explain=1
{
  "question": "average transaction amount per segment over the last 90 days"
}
08

Month-over-month comparison

intermediate

“How many tickets this month vs last month, by category?” — two time windows compared in one question.

request
POST /v1/tenants/:t/ask
{
  "question": "how many tickets this month vs last month, by category?"
}
09

Error recovery

intermediate

A question the grammar and LLM can't ground — you get a structured error, not hallucinated rows.

request
POST /v1/tenants/:t/ask
{
  "question": "what's the vibe of the loan book lately?"
}