nlqdb

Comparison

nlqdb vs LlamaIndex

Pick LlamaIndex if you want to assemble your own text-to-SQL query engine — its schema retrieval, prompt, and guardrails — over a database you already run. Pick nlqdb if you want NL→SQL working today as a hosted pipeline you embed, with the SQL shown, writes diff-previewed, and a Postgres provisioned for you.

The same goal, two ways.

> monthly active users for the last 6 months

In your HTML

<nlq-data goal="monthly active users for the last 6 months"></nlq-data>

A from-scratch LlamaIndex query engine needs a wired DB, model, prompt, and schema retrieval before this works; nlqdb answers it from one English goal over a Postgres it provisioned, SQL shown.

What's different

Four dimensions that decide it

Dimension nlqdb LlamaIndex Note
Provisions + owns the database (from English) LlamaIndex wraps a SQLAlchemy engine over a database you already stood up; it provisions nothing. nlqdb materialises a Postgres from the first English goal.
NL→SQL without building or tuning the engine yourself LlamaIndex gives you the query-engine classes; you assemble, prompt, and tune them. nlqdb ships the pipeline — nothing to wire.
Compiled SQL shown with every answer The query engine exposes the generated SQL in its metadata, but surfacing it to a user is your wiring. nlqdb returns the compiled SQL with every answer by default.
Fail-closed read-only SQL validation The docs warn the query tool runs whatever SQL the model emits; restricted roles and sandboxing are yours to add. nlqdb validates against an allowlist and fails closed.
Show 4 more rows
Dimension nlqdb LlamaIndex Note
Destructive-op diff preview before apply LlamaIndex synthesises read queries; it computes no before/after diff of a write. nlqdb diff-previews writes and DDL before they apply.
Plan cache (repeat questions skip the LLM) Caching identical questions is yours to build in LlamaIndex. nlqdb caches the compiled plan so a repeated question returns without another model call.
HTML embed element + anonymous try nlqdb ships `<nlq-data>` and anonymous mode (a first answer before sign-in); a LlamaIndex query engine is Python you deploy and host yourself.
Broad RAG / retrieval framework (documents, vectors, agents) LlamaIndex's reach across loaders, indexes, and retrievers is its moat; nlqdb is Postgres-first NL→SQL, not a general data framework.

shipped  ·  partial  ·  not shipped

When to choose nlqdb

  • You want NL→SQL working today without assembling a query engine, validator, and eval stack.
  • You want the compiled SQL shown with every answer so you can audit the grain.
  • You want a Postgres provisioned from English — no database to stand up first.
  • You want destructive writes and migrations diff-previewed before they apply.

When to choose LlamaIndex

  • You want full control of the retrieval, prompt, and query-engine internals.
  • You're already in the LlamaIndex ecosystem building RAG over other data.
  • You need it free, open source, and self-hosted against a database you run.
  • You want to combine SQL with vector/document retrieval in one framework.

Questions buyers ask

Is nlqdb a replacement for LlamaIndex?
Only for the NL→SQL job. LlamaIndex's text-to-SQL is a query engine you assemble — schema retrieval, model, prompt, guardrails — over a database you already run. nlqdb is the hosted pipeline that does NL→SQL for you, provisions the Postgres, shows the SQL, and diff-previews writes. One is build-it-yourself; the other is embed-and-go.
Can I use LlamaIndex and nlqdb together?
Yes. A LlamaIndex agent or pipeline can call nlqdb as one tool — letting nlqdb own the database and the NL→SQL step while LlamaIndex handles document retrieval, vectors, and wider orchestration. You get nlqdb's validated, SQL-shown answers without hand-building the SQL query engine.
Does LlamaIndex provision a database for me?
No. `NLSQLTableQueryEngine` wraps a SQLAlchemy engine over a database you've already created and configured; it reads schema and runs SQL against it. nlqdb materialises a Postgres from your first English goal, so there's nothing to stand up before the first question.
What do I have to build myself with LlamaIndex's text-to-SQL?
The model choice, the prompt, schema retrieval (a TableIndex when the schema overflows context), SQL guardrails, caching, deployment, and evaluation. That flexibility is the point. nlqdb ships those as a managed pipeline, so you trade tunability for not maintaining the stack.
Is running LlamaIndex's generated SQL safe by default?
The LlamaIndex docs explicitly warn that executing arbitrary generated SQL is a security risk and recommend restricted roles, read-only databases, and sandboxing — the query tool runs whatever the model emits. nlqdb validates every query against a read-only allowlist and fails closed, and diff-previews any write before it applies.

Try nlqdb in 30 seconds

No sign-in. The anonymous database lasts 72 hours; adopt it with one click if you keep it.

Start with a goal →

Want a comparison against another tool? Email us or browse all comparisons.