Postgres but for agents_

Create, manage, and query serverless PostgreSQL databases from your terminal. Branching, migrations, observability, type generation — all built in.

CLI
$ curl -fsSL https://db9.ai/install | sh

macOS / Linux (x86_64, arm64)

AI Agents
Read https://db9.ai/skill.md and follow the instructions

Your agent learns to install, auth, and use db9 autonomously

// Create a database with vector support
$ db9 db create --name rag-app
Database created: abc123

// Upload docs to cloud filesystem (for RAG)
$ db9 fs cp ./docs/ abc123:/knowledge/
Uploaded 42 files to /knowledge/

// Create embeddings table with pgvector
$ db9 db sql abc123 -q "CREATE TABLE docs ( id serial PRIMARY KEY, content text, embedding vector(1536), metadata jsonb)"
CREATE TABLE

// Semantic search with cosine similarity
$ db9 db sql abc123 -q "SELECT content, 1 - (embedding <=> $1) AS score FROM docs ORDER BY embedding <=> $1 LIMIT 3"
content                              score
──────────────────────────────────── ─────
Authentication uses JWT tokens...     0.94
API rate limits are per-customer...   0.87
Webhooks require HTTPS endpoints...   0.82
(3 rows)

Everything you need

From database creation to production monitoring, db9 covers the full lifecycle.

Instant databases

Spin up a serverless Postgres instance in seconds. No provisioning, no config files.

Vector search

pgvector built-in with HNSW indexes. Semantic search, RAG, and embeddings — no external vector DB needed.

SQL from CLI

Execute queries inline, from files, or pipe from stdin. Output as table, JSON, or CSV.

Database branching

Create schema branches for testing and development. Isolated environments in one command.

Built-in observability

Inspect QPS, latency, slow queries, and connection metrics without external tools.

Migration management

Create, apply, and track SQL migrations. Integrated status tracking per database.

Type generation

Generate TypeScript or Python types from your database schema automatically.

JSONB + GIN indexes

Store and query semi-structured data with lightning-fast GIN indexes. Perfect for agent memory and tool outputs.

Dump & seed

Export schemas and data as SQL. Seed databases from files for reproducible environments.

Cloud filesystem

Read, write, and manage files per database via the SDK or interactive shell. Built for RAG pipelines.

30+ commands

A comprehensive toolkit for every database operation.

db9 db create --name myappCreate a serverless Postgres database
db9 db sql <id> -q "..."Execute SQL queries directly
db9 db branch create <id> --name devBranch a database for dev/test
db9 db inspect <id>View QPS, latency, and metrics
db9 gen types <id> --lang typescriptGenerate TS/Python types from schema
db9 migration up <id>Apply pending migrations
db9 db dump <id> -o backup.sqlExport database as SQL
db9 db connect <id>Get connection string for psql
db9 fs sh <id>Interactive filesystem shell
db9 fs cp local.txt <id>:/data/Upload files to cloud filesystem

Start building in seconds

One command to install. One command to create a database. Zero config.

$ curl -fsSL https://db9.ai/install | sh