PostgreSQL with upstream Citus
Single-node PostgreSQL 17 reference deployment, persistent volumes, a separate management database, and bounded read-only agent queries.
A small, auditable access layer between AI agents and the databases your applications already use. Keep normal SQL for your app. Give agents narrowly scoped, read-only tools with real limits and an audit trail.
Use the same project, identity, policy, and tool model as database connectors are added. The engine still owns SQL semantics and data behavior.
Single-node PostgreSQL 17 reference deployment, persistent volumes, a separate management database, and bounded read-only agent queries.
Use TiDB as the MySQL-compatible distributed option. One MySQL protocol connector can serve TiDB and MySQL deployments through the same integration path.
TiDB implements much of the MySQL protocol and common syntax, but it is not identical to MySQL. Validate SQL, transactions, and features against the selected version. Read TiDB's compatibility notes.
Agents ask for named operations. Your service checks identity and policy, then queries with restricted database credentials.
Applications continue to use standard PostgreSQL clients and a separate application role.
Operator-managed tokens are tied to a project, database, and allowed operations. Revocation takes effect at the service.
Database roles, read-only transactions, schema grants, query deadlines, row and byte caps, and per-token concurrency bound the request.
The same authenticated operation model backs REST, CLI, and local MCP. Agent credentials cannot run operator backup or token-management actions.
/v1/list_databasesShow only databases visible to the caller/v1/inspect_schemaRead approved columns and indexes without table rows/v1/query_readonlyRun one bounded query with explicit truncation reporting/v1/explain_queryInspect a plan without running it; ANALYZE is disabled/v1/cluster_healthReturn caller-scoped service and database health/v1/backup_statusShow backup and separate restore-verification statusDeploy the service you can inspect. The npm client calls the authenticated API; it does not receive database credentials.
# Clone the repository, then initialize unique local credentials ./bin/agentdb init ./bin/agentdb config-validate ./bin/agentdb start ./bin/agentdb health
Docker Compose · loopback-bound API and database · synthetic sample events · named persistent volumes
# npm release pending npm install @profullstack/db-agentic-layer // Keep the token in your secret manager or environment. import { createClient } from '@profullstack/db-agentic-layer'; const db = createClient({ baseUrl: process.env.AGENTDB_URL, token: process.env.AGENTDB_TOKEN, }); const schema = await db.inspectSchema();
Preview package target: @profullstack/db-agentic-layer · Node 20.3+ · no SQL driver or database password in the agent process
Useful agent access depends on the database being understandable and recoverable.
Request IDs, identity, operation, duration, outcome, row counts, limit events, and safe query fingerprints. No result rows or raw SQL in audit records.
Create an operator backup, restore into a new isolated database, then compare schema, known counts, and deterministic checksums.
Citus workers and TiDB's distributed architecture are choices to evaluate with representative data and published measurements, not automatic speed switches.
Proof-of-concept limits: one PostgreSQL/Citus node, no high availability, no production recovery objective, and no distributed backup claim. Do not place production data on the reference stack.