pgchat is a CLI tool that provides a chat interface for PostgreSQL databases, powered by Inferable AI. Current stable version 0.0.12, updated frequently on npm. It allows querying databases via natural language without exposing connection strings by proxying queries through a local function. Key differentiators: approval mode to review queries before execution, privacy mode to keep data local, and no need for connection tunneling. Uses Inferable's Node.js SDK, supports local or self-hosted Inferable instances. Ideal for developers who want to interact with Postgres using conversational AI.
npm install pgchatNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Launches pgchat CLI connected to a local Postgres database with approval mode enabled and privacy mode disabled.
Provide a persistent Inferable API secret and cluster ID via --secret and --cluster-id for long-running sessions
Use --privacy-mode if you must keep data local, but be aware of reduced AI capabilities
Explicitly set --approval-mode to your desired value (always, mutate, off) to avoid unexpected behavior
Upgrade Node.js to version 20 or higher
Use --secret <value> to provide the Inferable API cluster secret
Run `npm install @inferable/inferable` or use `npx pgchat` to auto-install
Ensure Postgres is running and the connection string is correct (e.g., postgresql://user:pass@localhost:5432/db)
Verify and provide correct --secret and --cluster-id options, or omit them to use an ephemeral cluster
Disable --privacy-mode if you need full AI reasoning, or accept the limitation