In LangChain SQL agent
You want full control of the agent loop, prompts, tools, and retrieval.
Comparison
Pick the LangChain SQL agent if you want to build and own the agent loop — its prompts, tools, retries, and deployment — 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 LangChain SQL agent
You want full control of the agent loop, prompts, tools, and retrieval.
In your HTML
<nlq-data goal="monthly active users for the last 6 months"></nlq-data> A from-scratch SQL agent needs a wired DB, model, prompt, and guardrails before this works; nlqdb answers it from one English goal over a Postgres it provisioned, SQL shown.
What's different
| Dimension | nlqdb | LangChain SQL agent | Note |
|---|---|---|---|
| Provisions + owns the database (from English) | The LangChain SQL agent connects to 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 agent yourself | LangChain gives you the toolkit and a ReAct loop; you assemble, prompt, and tune the agent. nlqdb ships the pipeline — nothing to wire. | ||
| Compiled SQL shown with every answer | You can log the agent's intermediate SQL, 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 | SQLDatabaseToolkit's query tool runs whatever SQL the model emits; guardrails are yours to add. nlqdb validates against an allowlist and fails closed. |
| Dimension | nlqdb | LangChain SQL agent | Note |
|---|---|---|---|
| Destructive-op diff preview before apply | LangGraph can pause for human approval before a tool call, but it computes no before/after diff of a write. nlqdb diff-previews writes and DDL. | ||
| Plan cache (repeat questions skip the LLM) | Caching identical questions is yours to build in LangChain. 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 LangChain agent is code you deploy and host yourself. | ||
| Self-host / open source | LangChain is open source and self-hostable; nlqdb's platform is hosted-only during pre-beta (SDKs / CLI / elements open at GA). | ||
| 100s of framework integrations (models, stores, loaders) | LangChain's reach across models, vector stores, and loaders is its moat; nlqdb is Postgres-first NL→SQL, not a general agent 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.