In LlamaIndex
You want full control of the retrieval, prompt, and query-engine internals.
Comparison
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 LlamaIndex
You want full control of the retrieval, prompt, and query-engine internals.
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
| 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. |
| 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
No sign-in. The anonymous database lasts 72 hours; adopt it with one click if you keep it.
Start with a goal →The error has been recorded. Reload to recover; if it persists, sign out and back in.