Registry / database / pgchat

pgchat

JSON →
library0.0.12jsnpmunverified

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 pgchat
INSTALL
IMPORT
SIG · PGCHAT
P
pgchat
databasejavascriptv0.0.12
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pgchat CLI
npx pgchat <connection_string>
npm install pgchat && pgchat
Tool is designed to be run via npx without global install; local install works but may have version conflicts
InferableClient (from @inferable/inferable)
import { InferableClient } from '@inferable/inferable'
const InferableClient = require('@inferable/inferable')
The package is ESM-only; require will fail in Node < 20 or without ESM module configuration

Launches pgchat CLI connected to a local Postgres database with approval mode enabled and privacy mode disabled.

npx pgchat postgresql://user:pass@localhost:5432/mydb --approval-mode always --privacy-mode false
Debug
Known issues
gotchaRunning without --secret and --cluster-id uses an ephemeral Inferable cluster that is deleted after 24 hours
fix
Provide a persistent Inferable API secret and cluster ID via --secret and --cluster-id for long-running sessions
affects: >=0.0.0
gotchaBy default, the LLM (model) sees your data; enabling --privacy-mode prevents data from being sent but reduces AI reasoning quality
fix
Use --privacy-mode if you must keep data local, but be aware of reduced AI capabilities
affects: >=0.0.0
breakingThe option --approval-mode default changed from 'always' to 'mutate'? Check current docs.
fix
Explicitly set --approval-mode to your desired value (always, mutate, off) to avoid unexpected behavior
affects: >=0.0.0
gotchaNode.js version must be >=20.x; older versions may cause runtime errors
fix
Upgrade Node.js to version 20 or higher
affects: >=0.0.0
deprecatedThe --api-secret option may be deprecated; use --secret instead
fix
Use --secret <value> to provide the Inferable API cluster secret
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module '@inferable/inferable'
Missing dependency when using local install instead of npx
fix
Run `npm install @inferable/inferable` or use `npx pgchat` to auto-install
Error: connect ECONNREFUSED ::1:5432
PostgreSQL is not running or connection string is incorrect
fix
Ensure Postgres is running and the connection string is correct (e.g., postgresql://user:pass@localhost:5432/db)
Error: Invalid secret or cluster-id provided
Wrong or missing Inferable API secret or cluster ID
fix
Verify and provide correct --secret and --cluster-id options, or omit them to use an ephemeral cluster
Error: This operation is not allowed in privacy mode
Trying to perform an operation that sends data to the model while privacy mode is enabled
fix
Disable --privacy-mode if you need full AI reasoning, or accept the limitation
Upgrade
Version history
0.0.12latest on npm
Audit
Dependencies
@inferable/inferablerequiredCore dependency for AI agent functionality, chat state management, and execution engine
Agent activity
4 hits · last 30 days
node
4
Resources
packagepgchat
pgchat — npm install pgchat · libregistry