nlqdb
OfficialThis server lets agents and users interact with nlqdb's natural-language database layer: querying memory in plain English, inspecting and managing databases, writing structured memories, and connecting existing databases.
nlqdb_query — Query an agent's memory in natural language (GROUP BY / JOIN / aggregate), returning rows plus the compiled SQL; auto-targets or creates a database, and supports model presets and two-step confirmation for destructive writes.
nlqdb_list_databases — List the memory databases scoped to the authenticated user.
nlqdb_describe — Inspect schema metadata (slug, engine, schema name) for one memory database.
nlqdb_remember — Write typed rows (facts, episodes, entities) directly into an agent_memory_v1 database without an LLM, including optional thread/end-user scoping and TTLs.
nlqdb_connect_database — Connect an existing ClickHouse or Postgres database so it can be queried in natural language; credentials are stored sealed and never echoed back.
Provides a framework wrapper for Astro to easily embed nlqdb-powered components.
Plans to support ClickHouse as an additional analytical database engine.
Uses DuckDB as an embedded analytical database engine.
Provides GitHub OAuth as a sign-in method for users.
Provides Google OAuth as a sign-in method for users.
Provides a framework wrapper for Next.js to easily embed nlqdb-powered components.
Provides a framework wrapper for Nuxt to easily embed nlqdb-powered components.
Supports OpenAI's models as the LLM backend for natural-language to SQL conversion.
Provides a framework wrapper for React to easily embed nlqdb-powered components.
Uses Redis as a database engine for storing and querying data.
Provides a framework wrapper for Solid to easily embed nlqdb-powered components.
Handles billing and payment processing via Stripe webhooks.
Provides a framework wrapper for Svelte to easily embed nlqdb-powered components.
Provides a native Swift package for integrating nlqdb into iOS/macOS applications.
nlqdb — your autonomous DBA.
Build a real app from day one with no data modeling. nlqdb infers your schema from how you use it, evolves it, and keeps it optimized — and shows you every change before it lands.
Your app talks to its database in plain English — over HTTP, the SDK, the
nlq CLI, or MCP from Claude, Cursor and Codex. The first insert creates the
shape; later inserts and reads evolve it; the DBA builds the indexes and
places data on the right engine, and every change is previewed, versioned and
one click to undo. The LLM never emits SQL: it returns a typed plan, our
compiler emits the parameterised statement, and you see the exact SQL every time.
No backend to build. You write HTML; each component asks for what it wants in plain English; nlqdb infers the schema, writes the SQL, runs it, and renders the result. There is no backend for you to build.
Two actions. That's the whole product:
Create a database — one word: a name (or a goal).
Talk to it in plain English.
<script src="https://elements.nlqdb.com/v1.js" type="module"></script>
<nlq-data
goal="the 5 newest orders, with customer and item"
api-key="pk_live_xxx"
template="table"
refresh="10s"
></nlq-data>That's the entire backend for a live order list — no API to write, no schema to define, no JSON to parse. Engine choice (Postgres / Mongo / Redis / DuckDB / pgvector / …), schema inference, indexing, backups, and auto-migration between engines based on your real workload are background concerns you never have to see.
Status — early, open
nlqdb is early and built in the open, but fully public — no gate, no
invite code. The marketing site, the /v1/ask pipeline, the <nlq-data> /
<nlq-action> elements, the chat app, the TypeScript SDK, the hosted MCP
server, and the nlq CLI are all live in some form (see the surface table
below). Natural-language → SQL accuracy is still climbing toward our public
bar (BIRD ≥ 0.65, Spider 2.0 ≥ 0.75 on the free model chain), so answers can
be wrong — every response carries a confidence signal and the SQL it ran.
Related MCP server: ogham-mcp
Use it
Connecting an agent over MCP? On Claude Code, one marketplace add wires the hosted server and both memory skills in a single step:
/plugin marketplace add nlqdb/nlqdb
/plugin install nlqdb-memory@nlqdbOn any other MCP host, connect your agent
with one browser-OAuth approval; headless hosts skip the browser with
npx -y @nlqdb/mcp (0.1.1) and an sk_mcp_* MCP key
(MCP setup). @nlqdb/sdk (0.4.0) and
@nlqdb/mcp (0.1.1) are both published and importable from npm.
The 60-second walkthrough — plain HTML, CLI, and ten framework wrappers —
lives at docs.nlqdb.com. Start with the
HTML tutorial or the
CLI tutorial.
You don't generate an API key separately: describe your database at
nlqdb.com, and the chat hands you a
<nlq-data> snippet with the key already inlined.
Examples
examples/ — minimal scaffolds in plain HTML, Next.js,
Nuxt, SvelteKit, Astro, plus a CLI-only walkthrough. Each is the smallest
valid integration around one <nlq-data> element or one CLI session.
What makes it different
Four things every release has to move, none allowed to regress
(GLOBAL-025):
Engine quality — natural-language → SQL accuracy (measured continuously on BIRD + Spider 2.0 + an internal eval), plus the multi-engine layer that moves your data to the right engine for your workload.
Onboarding — landing to first answer in under a minute, no card, no config.
UX — see the diff before any write, see the SQL behind every answer, and on low confidence get a one-click clarify — a guided turn, never a dead-end, and never a silent guess.
Performance — sub-400 ms cached, sub-1.5 s cold.
The bet: get this right on free, open models and it only gets better on frontier ones — the scaffolding compounds with whatever model is underneath.
Models & plans
Free forever on the built-in open-model chain — queries, embeds, and the elements, no card required.
Bring your own LLM key (Anthropic / OpenAI / Gemini / Grok / OpenRouter) on any tier, at no markup.
Hosted premium models on paid plans, when you'd rather not manage a key of your own.
Self-host the source — the engine, CLI, MCP server, and SDKs are source-available under FSL-1.1-ALv2: free to self-host for any non-competing use, bring your own LLM key, no per-call fees. The license auto-converts to Apache 2.0 two years after each release.
The hosted-premium model lane went live 2026-08-14. The full model strategy is in
GLOBAL-026.
Surfaces at a glance
Surface | Status | Where |
HTTP API ( | ✓ shipped |
|
| ✓ shipped (v0.1) |
|
| ✓ shipped (incl. |
|
Framework wrappers (React / Next / Vue / Nuxt / Svelte / SvelteKit / Astro / Solid + Swift) | ~ built + CI-tested; npm / SPM publish pending |
|
Chat app | ✓ shipped |
|
Hosted MCP server | ✓ shipped (host auto-detect pending) |
|
Local stdio MCP server | ✓ shipped ( |
|
Droppable agent artifacts (AGENTS.md · Claude Code skill + plugin · Cursor rules · Codex config) | ✓ shipped — |
|
| ✓ shipped (core verbs; device-login pending) |
|
Full integration matrix in docs/progress.md.
Packages on npm
Published to the public npm registry with build provenance
(SK-CIPERM-003). Version badges
are live from npm; the table itself is generated from the workspace by
scripts/sync-readme-packages.mjs, so it
lists exactly the packages that are un-gated ("private" removed) and nothing
that isn't.
Package | Version | What it is | Source |
Shim that installs the nlq CLI binary for the host platform. | |||
Analytical-memory MCP server for nlqdb — a real database your AI agent can GROUP BY / JOIN / aggregate over in natural language, not just recall. | |||
Typed HTTP client for the nlqdb /v1 API — works in browsers, Node, Bun, Workers. |
Roadmap
The two sections below are the live focus; the numbered phases after
them are the engine roadmap. Canonical plan + exit gates:
docs/phase-plan.md. Legend:
✓ shipped · ~ in progress · ◯ planned.
This roadmap is yours to shape. Want something added, reprioritised, or dropped? Open a PR editing this section (and
docs/phase-plan.mdif it's engine-facing), or open an issue to float it first. Say why now — which of the four north-star pillars (engine quality, onboarding, UX, performance) it moves. New to the codebase? Point your coding agent at this repo and paste:Read README.md and docs/phase-plan.md, then propose a roadmap change: add/change "<your idea>" under the right section in one line, with a "why now" naming which north-star pillar it moves. Open a PR with just that edit — no code.Setup, branch naming, and the CLA are in CONTRIBUTING.md.
Now — Phase A: the schema infers itself (GLOBAL-041)
The first insert creates the shape; later inserts and reads evolve it. KPI:
first-insert inference rate ≥ 95 % at Phase A exit on the dogfood workload.
Build order in GLOBAL-041.
~
kind=extendtyped plan — a write naming an unseen table or field widens the schema in the same transaction as the insert, never aschema_mismatch(both unseen-table and unseen-column cases merged tomain+ executor-walked; awaiting a prod deploy, live rate 0 %)~ Extend diff + trace on every surface —
trace.widenlive on SDK · MCP ·<nlq-data>; CLI/web render pending✓ KPI counters
asks_extend_ok/asks_extend_failedon the/v1/askwrite path (SK-SCHEMA-010; the rate reads on/app/admin)◯ Phase B —
pg_stat_*+EXPLAINcollection → typed proposals (index / retype / drop / rename / move-to-engine) →/app/dbadashboard with 1-click apply + undo✓ Rails kept from the prior bet for the expert-knowledge app:
agent_memory_v1preset,nlqdb_remember/nlqdb_readMCP tools, per-agent RLS isolation, the Claude Code plugin,/agents
Next — the expert-knowledge marketplace ("Become AI")
Non-technical professionals turn their expertise into structured,
queryable knowledge that AI agents pay to use. Decisions locked; build
gated on Phase A (SK-EKP-005)
(docs/features/expert-knowledge-platform/).
◯ Interview authoring — answer questions about your craft, get queryable rows (pilot: language tutor)
✓ Cross-tenant read grants — mint/list/revoke control plane + live fail-closed granted read on
/v1/ask(schema-only plan, rows-only egress, exactly-once per-query metering proven at the route boundary); revoke-in-flight bound measured against live Postgres◯ One catalog — free packs + paid expert knowledge DBs
~ Trust hardening — buyer queries schema-only end-to-end: knowledge-DB asks skip narration by default and the granted cross-tenant read is un-narrated (returned rows never reach an LLM); no-training interview-provider pin pending
Phase 0 — Foundations ✓
Worker skeleton · KV + D1 + R2 bindings · Neon adapter + OTel · LLM router
(free chain) · Better Auth (GitHub + Google + magic link) · /v1/ask
end-to-end · events queue + drain · Stripe webhook · CI/CD + PR preview
environments.
Phase 1 — On-ramp
A stranger lands on nlqdb.com, creates a DB in plain English, embeds it,
and shares the link — in under 60 seconds, no card, no config.
✓ Marketing site (Astro, live at
nlqdb.com)✓
<nlq-data>+<nlq-action>elements (v0.1)✓ Sign-in — magic link + GitHub + Google
✓ Chat surface — streaming three-part response (answer / data / trace), anonymous mode
✓ Anonymous mode — 72h token, adopted onto your account on sign-in
✓ Hosted db.create pipeline (table-card embeddings stubbed pending the pgvector slice)
✓ API keys dashboard (
/app/keys)◯ Hello-world tutorial polish
Phase 1.5 — Trust + telemetry
✓ Diff preview on writes + visible SQL trace on every response
✓ Demand-signal telemetry on every "not yet" path
◯ Confidence floor (clarify-on-low-confidence — a guided turn, not a dead-end) — lands with quality-eval
Phase 2 — Distribution (agent + developer surfaces)
✓ Hosted MCP server (
mcp.nlqdb.com/mcp) — host auto-detect pending; local stdio@nlqdb/mcp@0.1.1is on npm, sonpx -y @nlqdb/mcpwith ansk_mcp_*key is a headless route in with no browser consent step (/agentsnow carries it; the per-host install panel is still OAuth-only). On Claude Code,/plugin marketplace add nlqdb/nlqdbinstalls the server + both memory skills in one step✓ CLI
nlq(Go) — core verbs + raw-SQL escape hatch; device-login + chat REPL pending✓
@nlqdb/sdk— basic methods +runSql+ cross-tenant grant + pack-import runner verbs; published and importable from the registry (0.4.0)~ Framework wrappers + native Swift package — built + CI-tested; npm / SPM publish pending
✓ Quality-eval harness (BIRD + Spider 2.0) — a CI regression alarm for the NL→SQL interface, not a KPI
~ Bring-your-own-LLM dispatch — HTTP lane live; remaining surfaces in progress
◯ CSV upload in chat
~ Docs-site reference completeness — SDK + framework-wrapper guides, an enumerable error-code reference, and a build-time
/llms.txtfor agents now live; tutorial polish remains◯ Custom domains for embeds
Phase 3 — Multi-engine engine (the moat)
◯ Workload analyzer → migration orchestrator
◯ ClickHouse / DuckDB / Redis as additional engines
◯ Dual-read verification
✓ Hosted-premium model lane (demand-gated) — live 2026-08-14 (
PREMIUM_METER_LIVEflipped)
Phase 4 — Beyond v1
~ Bring-your-own Postgres / ClickHouse — connect path live end-to-end (
POST /v1/db/connect+ web UI, CLI, SDK, query dispatch); prod-gated on theBYO_SECRET_KEKsecret. Supabase adds one-click OAuth connect over the read-only Management-API (no DSN to paste); prod-gated on theSUPABASE_OAUTH_CLIENT_ID/_SECRETsecrets, with a graceful fall-back to paste when unset◯ SSO (SAML / OIDC), audit-log export, per-org quotas
◯ EU data residency, VPC peering, SOC 2
Develop locally
git clone git@github.com:nlqdb/nlqdb.git && cd nlqdb
scripts/bootstrap-dev.sh # installs everything, pulls Ollama models, seeds .envrc
scripts/login-cloud.sh # signs you into cloud providers that have a CLI flowbootstrap-dev.sh stands up the whole toolchain in one shot — Bun, Node
20+, Go 1.25+, uv; Biome / gofumpt / golangci-lint / ruff; lefthook git
hooks; the cloud CLIs (wrangler, flyctl, stripe, gh); a local Ollama so the
LLM router works offline; and a .envrc with self-generated dev secrets.
Details in
docs/history/infrastructure-setup.md §8.
Day-to-day:
bun run fix # biome format + lint --write (most issues)
bun run check:all # biome + golangci-lint + ruff (what CI runs)
bun run hooks:run # run pre-commit hooks against staged filesEnd-to-end tests (manual trigger)
E2E coverage is persona-driven and manually triggered so cost stays
inside the free-tier envelope — one workflow_dispatch workflow per
surface:
gh workflow run e2e-opencheck.yml # web — live LLM, Neon branch, Workers preview
gh workflow run e2e-cli.yml # Go testscript, hermetic
gh workflow run e2e-sdk.yml # vitest + cassettes, hermetic
gh workflow run e2e-mcp.yml # InMemoryTransport protocol tests, hermetic
gh workflow run e2e-examples.yml # Playwright across HTML/Next/Astro/Nuxt/SvelteKit
gh workflow run e2e-examples.yml -f live=true # + staging for the curl + CLI shell smokesRun the hermetic surfaces locally without GitHub:
( cd tests/e2e/cli && go test ./... )
( cd tests/e2e/sdk && bun install && bun run test )
( cd tests/e2e/mcp && bun install && bun run test )
( cd tests/e2e/examples && bun install && bun run install:browsers && bun run test )Only execution is manual: tests/e2e/{sdk,mcp,examples} live outside the root
workspace, so CI's typecheck-e2e job tscs them on every PR — the free
backstop against a suite that compiles today and rots before the next dispatch.
Conventions, persona mapping, and cassette governance are in
docs/features/e2e-coverage/FEATURE.md.
Docs & reference
docs/architecture.md— system design (auth, pricing, the $0 stack, model selection, hosted db.create, hello-world).docs/phase-plan.md— canonical phase plan and exit gates.docs/decisions.md— cross-cuttingGLOBAL-NNNdecisions; per-feature records live underdocs/features/.docs/performance.md— SLOs, latency budgets, span/metric catalog.docs/competitors.md— competitive landscape.
Community & legal
CONTRIBUTING.md — dev setup, branch naming, commits, CLA flow.
CODE_OF_CONDUCT.md — Contributor Covenant 2.1. Reports to
conduct@nlqdb.com.SECURITY.md — vulnerability disclosure (
security@nlqdb.com). 90-day fix target.SUPPORT.md — where to ask questions and what we don't (yet) offer.
CLA.md — Contributor License Agreement, signed once via the bot on your first PR.
TRADEMARKS.md — what you can and can't do with the nlqdb name and logo.
SUBPROCESSORS.md — third-party services that may process personal data on our behalf.
IMPRESSUM.md — Swiss UWG-mandated operator disclosures.
Privacy policy and terms of service: nlqdb.com/privacy · nlqdb.com/terms.
License
FSL-1.1-ALv2 — Functional Source License, Apache 2.0 future license. Source-available for any non-competing use; auto-converts to Apache 2.0 two years after each release. (Pattern used by Sentry, Convex, and others.)
nlqdb™ is an unregistered trademark of the project's licensor. See
TRADEMARKS.md for usage guidelines.
Available Tools
5 toolsnlqdb_connect_databaseConnect an existing database so the agent can query it in EnglishAInspect
Connect an existing ClickHouse or Postgres database so the agent can query it in natural language with nlqdb_query — no migration, no schema upload. Pass the engine and a connection URL; the credential is stored sealed server-side and never echoed back. Returns the new dbId and a preview of the discovered schema.
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Optional display name for the connection; defaults to the database/host name. | |
| engine | Yes | Which engine the existing database runs — 'clickhouse' or 'postgres'. | |
| connection_url | Yes | The full connection URL for the database, including credentials (e.g. postgres://user:pass@host:5432/db or https://host:8443?user=…). Stored sealed server-side and never echoed back. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations only provide destructiveHint=false, so the description carries the transparency burden. It adds key behavioral context: no migration or schema upload, credentials stored sealed server-side and never echoed back, and the return of a new dbId plus schema preview. This is substantive and does not contradict the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two crisp sentences that front-load the core purpose, then provide usage, security, and return information. Every phrase earns its place; no fluff or repetition of schema field names beyond necessary context.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity and lack of output schema, the description covers the goal, required inputs, security behavior, and return value. It lacks explicit error-handling or network/prerequisite details, but the essential flow (connect, get dbId, query later) is clear, making it fairly complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all three parameters. The description mostly reinforces existing schema details (engine and connection URL) without adding new semantic meaning. It does not explain the 'name' parameter beyond what schema provides, yielding a baseline score of 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific action (Connect an existing ClickHouse or Postgres database) with a clear purpose (so the agent can query it in natural language with nlqdb_query). It clearly distinguishes this tool from siblings like nlqdb_query by positioning it as the setup step that returns a dbId for later queries.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives clear context: use this to connect an existing database, pass engine and connection URL, and it enables subsequent nlqdb_query calls. It implies the tool should be called before querying, but it doesn't explicitly state when not to use it or name alternatives such as nlqdb_remember or nlqdb_list_databases.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
nlqdb_describeDescribe one memory databaseARead-onlyInspect
Inspect the shape of one of your agent's memory databases. Return schema metadata (slug, engine, schema name) for one database. Requires a user-scoped key (sk_live_ or sk_mcp_).
| Name | Required | Description | Default |
|---|---|---|---|
| db | Yes | Database id or slug to describe. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The readOnlyHint annotation already indicates a safe read operation, and the description adds context by specifying the exact metadata returned and the required key type. This goes beyond the annotation without contradicting it, but does not disclose potential error or edge cases.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three concise sentences, each with clear value: the operation, the return structure, and the auth prerequisite. No redundant or filler content is present.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (one parameter, no output schema, no nested objects), the description covers all necessary aspects: purpose, return value, and prerequisites. The description fully compensates for the lack of an output schema by explicitly listing the metadata fields returned.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The single 'db' parameter is described in the schema as 'Database id or slug to describe,' and the tool description does not add any additional parameter-specific detail beyond that.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states a specific action ('Inspect the shape of one of your agent's memory databases') and specifies the return value ('schema metadata (slug, engine, schema name)'). This distinguishes it from siblings like list_databases and query, which handle listing and querying respectively.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly notes it operates on a single database, contrasting with list_databases. It also mentions the auth requirement ('Requires a user-scoped key'), though it does not explicitly name alternative tools or provide a 'when not to use' exclusion.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
nlqdb_list_databasesList your agent's memory databasesARead-onlyInspect
List the memory databases your agent can query, scoped to the authenticated user. Requires a user-scoped key (sk_live_ or sk_mcp_). Returns engine per row.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, so the read-only nature is known. The description adds the auth requirement (user-scoped key) and the return format ('engine per row'), which exceeds what annotations provide and helps set expectations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three short sentences each carry distinct value: purpose, auth requirement, and return format. The description is front-loaded with the primary action and contains no filler or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter listing tool, the description covers all essential aspects: what is listed, scope, authentication prerequisite, and return shape. No output schema exists, so the description appropriately compensates by mentioning 'engine per row'.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so schema coverage is trivially 100%. Baseline 4 applies, and the description appropriately mentions the scope and auth context without needing to explain parameter syntax.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('List') and resource ('memory databases') with clear scoping ('scoped to the authenticated user'), making the operation unambiguous. It also distinguishes itself from siblings like query or remember, which perform different actions.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides useful context: the tool lists databases the agent can query and requires a user-scoped key. It does not explicitly name alternatives or when-not-to-use, but the naming and description sufficiently imply the intended use case.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
nlqdb_queryQuery your agent's memory in natural languageADestructiveInspect
Query your agent's structured memory in natural language — a real database it can GROUP BY / JOIN / aggregate over, not just recall. Returns rows + the compiled SQL (in trace). The database is materialised on first reference — no separate create tool. Destructive plans return requires_confirm: true + a diff; re-call with confirm: true to commit.
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes | The natural-language goal. Example: 'top 5 customers by revenue this year'. Name tables explicitly when you know them; avoid pronouns. | |
| db | No | Target database id or slug. Optional: omit to let nlqdb pick — it auto-targets your only DB (or creates one from the goal when you have none), and on multiple DBs returns ambiguous_db with candidate ids to choose from. Ignored for pk_live_ keys (already scoped to one DB). | |
| model | No | Model preset: 'fast' pins the free built-in chain, 'best' requires a frontier model (errors model_unavailable unless the account stored a BYOLLM key or has a paid plan), omit/'auto' lets nlqdb pick. | |
| confirm | No | Destructive writes are two calls: the first (confirm absent) returns requires_confirm: true plus a diff preview; show the diff, then re-call with confirm: true to commit. Read-only queries ignore this. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the destructiveHint annotation, the description discloses the two-step confirmation for destructive plans (requires_confirm + diff, then confirm: true), the auto-creation of the database on first reference, and the return of rows along with compiled SQL in trace. These details give the agent a clear understanding of side effects and expected output.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three sentences, each delivering unique value: purpose and capabilities, return values and auto-creation, and destructive confirmation. It is front-loaded and free of redundant or filler content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description adequately covers return behavior (rows + SQL trace) and critical side effects (auto-creation, destructive confirm flow). Parameter descriptions handle errors like ambiguous_db and model_unavailable. It could be slightly more explicit about result formatting, but given the tool's complexity, it is sufficiently complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already provides 100% parameter descriptions, including examples, edge cases, and enumeration. The tool description adds no further parameter semantics beyond what the schema states; even the confirm behavior is repeated verbatim from the schema. Baseline 3 is appropriate as the schema handles parameter documentation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool queries the agent's structured memory in natural language, emphasizing its capability for GROUP BY/JOIN/aggregate operations. It distinguishes itself from simple recall and the sibling tools by positioning itself as a real database query interface.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies this tool is for structured queries involving joins or aggregations, contrasting with 'not just recall' which hints at nlqdb_remember. It also explains the confirmation flow for destructive plans, guiding when confirm is needed. However, it does not explicitly name alternatives for listing or connecting databases, so it lacks a fully explicit when/when-not structure.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
nlqdb_rememberRemember something in your agent's memoryAInspect
Write a typed row into your agent's memory database — a fact to recall later, a conversation episode, or an entity (person/project/thing). Materialises directly into the agent_memory_v1 schema with no LLM in the loop, so it's deterministic. The DB must be an agent_memory_v1 preset; query it back later with nlqdb_query (which can GROUP BY / aggregate over what you remembered).
| Name | Required | Description | Default |
|---|---|---|---|
| db | Yes | The agent_memory_v1 database id (db_agent_memory_v1_…). Provision one with db.create { preset: 'agent_memory_v1' }; a non-memory DB is rejected with wrong_preset. | |
| kind | Yes | Which memory table to write into: 'fact' (a durable statement to recall later), 'episode' (one conversation/tool turn), or 'entity' (a person/project/thing — upserts on agent+kind+name). | |
| payload | Yes | Kind-specific fields. fact: { content, kind?, tags?, source? }. episode: { role, content, tool_calls?, tokens? }. entity: { kind, canonical_name, properties? }. | |
| threadId | No | Optional thread/conversation scope (facts / episodes). | |
| endUserId | No | Optional end-user scope (facts / episodes). | |
| ttlSeconds | No | Optional TTL in seconds — sets expires_at on a fact so it can be swept later. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations only state destructiveHint=false, so the description carries the burden. It reveals deterministic behavior (no LLM), direct schema materialization, rejection of non-memory DBs, and upsert behavior for entity kind. This fully covers behavioral traits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three sentences, front-loaded with the core purpose. It is concise and structured, with no redundant information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the absence of an output schema and the complexity of parameters (nested objects, enums), the description covers the main points well: purpose, constraints, and relationship to query tool. It could mention return value, but that is a minor gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so parameters are already explained. The description adds context by explaining the overall purpose and the role of each kind, but does not provide new details beyond what the schema offers. The deterministic note adds value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool writes a typed row into the agent's memory database, listing three specific kinds (fact, episode, entity). It distinguishes from sibling tools (nlqdb_query for reading, others for listing/describing/connecting) by focusing on the write operation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains when to use the tool (to remember facts/episodes/entities) and references nlqdb_query for querying. It also specifies the DB must be an agent_memory_v1 preset. However, it does not explicitly state when not to use it or mention alternatives beyond querying.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
v0.1.0- First observed
nlqdb_connect_database - First observed
nlqdb_describe - First observed
nlqdb_list_databases - First observed
nlqdb_query - First observed
nlqdb_remember
TDQS
Scored across 5 tools
Each tool targets a distinct operation: listing databases, describing schema, executing queries, writing typed rows, and connecting external databases. No two tools have overlapping purposes, making it clear which to use for a given task.
All tools follow the pattern nlqdb_[verb] or nlqdb_[verb]_[noun]. While list_databases and connect_database include the noun, describe and query omit it, creating minor inconsistency but remaining readable and predictable.
Five tools is well-scoped for a database server: listing, describing, querying, writing, and connecting. Each tool serves a necessary function without bloat, fitting the common pattern of 3-15 tools.
The tool set covers the core lifecycle: connect external databases, list and describe them, query (read/write/destructive), and write via remember. A minor gap is the lack of a dedicated delete tool for remembered rows, though destructive queries partially address it.
Maintenance
Related MCP Connectors
Graph-native persistent memory for AI agents — 33 MCP tools, zero-LLM writes.
Shared cross-LLM long-term memory over MCP: semantic recall, sessions, and media (pgvector).
- memnodeOAuthdev.memnode
Persistent, inspectable memory for AI agents with lineage, correction, and a hosted MCP endpoint.
Versioned agent memory in your own Postgres: portable context, permissioned, audit trail.
Related MCP Servers
AlicenseNot gradedqualityBmaintenanceLets you use Claude Desktop, or any MCP Client, to use natural language to accomplish things with Neon.1,032 npm650MIT- AlicenseNot gradedqualityAmaintenancePersistent shared memory for AI agents. Hybrid search (pgvector + tsvector), knowledge graph, cognitive scoring, and 16-language temporal extraction. 97.2% Recall@10 on LongMemEval with one PostgreSQL query. Works across Claude Code, Cursor, Codex, OpenClaw, and any MCP client.22 PyPI115MIT
- AlicenseNot gradedqualityDmaintenancePersistent semantic memory for AI agents using PostgreSQL and vector embeddings, enabling cross-session continuity and semantic search.AGPL 3.0
- AlicenseNot gradedqualityDmaintenanceProvides a standardized interface for interacting with Neon's tools and services through a unified API via the Model Context Protocol.MIT