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.
Simple count
easy“How many open tickets mention EMI?”
POST /v1/tenants/:t/ask { "question": "how many open tickets mention EMI?" }
Join via plain English
easy“Which customers in Pune have more than one account?” — a join + group by, from a sentence.
POST /v1/tenants/:t/ask { "question": "which customers in Pune have more than one account?" }
Recent-N with a topic
easy“Show the 5 most recent tickets about fraud” — filter + sort + limit from one sentence.
POST /v1/tenants/:t/ask { "question": "show the 5 most recent tickets about fraud" }
Show the plan
intermediateSame question with ?explain — the generated plan comes back beside the rows.
POST /v1/tenants/:t/ask?explain=1 { "question": "which customers in Pune have more than one account?" }
Cache hit
intermediateRun the previous question twice — the second run skips compilation. Watch the latency drop.
POST /v1/tenants/:t/ask { "question": "which customers in Pune have more than one account?" }
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.
POST /v1/tenants/:t/ask { "question": "which customers referred someone whose account sent money to a flagged account?" }
Time-windowed aggregate
intermediate“Average transaction amount per segment over the last 90 days” — window filter + join + group by, no SQL written.
POST /v1/tenants/:t/ask?explain=1 { "question": "average transaction amount per segment over the last 90 days" }
Month-over-month comparison
intermediate“How many tickets this month vs last month, by category?” — two time windows compared in one question.
POST /v1/tenants/:t/ask { "question": "how many tickets this month vs last month, by category?" }
Error recovery
intermediateA question the grammar and LLM can't ground — you get a structured error, not hallucinated rows.
POST /v1/tenants/:t/ask { "question": "what's the vibe of the loan book lately?" }