What is DB9?
DB9 is a PostgreSQL-compatible serverless database built on TiKV.
It speaks the PostgreSQL wire protocol, so any tool that connects to Postgres — psql, Prisma, Drizzle, SQLAlchemy, or a raw driver — connects to DB9 with no adapter needed.
What makes DB9 different is what ships inside the database: vector search and built-in embeddings, a queryable file system (fs9), HTTP calls from SQL, scheduled jobs via pg_cron, and zero-copy branching. These capabilities are compiled into the server, not bolted on through external services.
Who is DB9 for?
Section titled “Who is DB9 for?”AI agents and agent frameworks. An agent can provision a database in under a second using the CLI or TypeScript SDK, store structured data alongside embeddings and files, call external APIs from SQL, and tear the database down when the task is done — all without leaving the SQL layer.
Developers building with ORMs and frameworks. If you use Prisma, Drizzle, TypeORM, Sequelize, Knex, or SQLAlchemy, DB9 works as your Postgres backend with no driver changes. You get instant creation and branching on top of the ORM workflow you already have.
Teams that need disposable or per-tenant databases. DB9 provisions databases programmatically, so patterns like database-per-user, database-per-test-run, or ephemeral preview databases are first-class, not workarounds.
Core capabilities
Section titled “Core capabilities”Instant provisioning
Section titled “Instant provisioning”Create a database in under a second with zero configuration. No signup is required — anonymous trial databases work immediately:
db9 create myappOr from TypeScript:
import { instantDatabase } from 'get-db9';
const db = await instantDatabase({ name: 'myapp' });console.log(db.connectionString);Built-in vector search and embeddings
Section titled “Built-in vector search and embeddings”DB9 includes a pgvector-compatible vector type with HNSW indexing, plus a built-in embedding() function that generates and caches embeddings without external infrastructure.
Enable it once per database with CREATE EXTENSION embedding:
-- Generate an embedding and store itINSERT INTO docs (content, vec)VALUES ('DB9 overview', embedding('DB9 overview')::vector);
-- Semantic searchSELECT contentFROM docsORDER BY vec <-> embedding('search query')::vectorLIMIT 5;fs9 — queryable file system
Section titled “fs9 — queryable file system”Store and query files — CSV, JSONL, Parquet — directly from SQL:
-- Read a CSV file as a tableSELECT * FROM fs9('/data/users.csv');
-- Copy local files into the database filesystem-- (via CLI: db9 fs cp ./report.csv myapp:/data/report.csv)The file system is also accessible as an interactive shell (db9 fs sh myapp) or a FUSE mount.
HTTP from SQL
Section titled “HTTP from SQL”Call external APIs without leaving a SQL query:
SELECT * FROM http('https://api.example.com/data');Supports GET, POST, PUT, and DELETE. Useful for enrichment pipelines, webhook triggers, and agent tool integrations.
Database branching
Section titled “Database branching”Create a branch of any database for safe testing, preview environments, or rollback points:
db9 db branch create myapp --name previewBranches are lightweight copies. They share history with the parent but diverge on write.
Scheduled jobs with pg_cron
Section titled “Scheduled jobs with pg_cron”Run periodic SQL inside the database with no external scheduler:
SELECT cron.schedule('refresh-stats', '*/5 * * * *', 'REFRESH MATERIALIZED VIEW stats');Manage jobs via SQL or the CLI (db9 db cron list myapp).
Migrations, type generation, and observability
Section titled “Migrations, type generation, and observability”- Migrations: version-controlled SQL files applied with
db9 migration up. - Type generation:
db9 gen types myapp --lang typescriptproduces type definitions from live schema. - Observability:
db9 db inspect myappshows query samples, slow queries, schemas, tables, and indexes.
When to choose DB9
Section titled “When to choose DB9”- You need a Postgres-compatible database that provisions instantly for agents, tests, or per-tenant isolation.
- You want vector search, file ingestion, HTTP calls, and cron in one database instead of separate services.
- You are building AI agent workflows where the database is a tool the agent creates, uses, and discards.
- You want branching for preview environments or safe schema experiments.
When DB9 may not be the right fit
Section titled “When DB9 may not be the right fit”- You need a full application platform with auth, storage, edge functions, and a dashboard (consider Supabase).
- Your workload depends on PostgreSQL extensions that DB9 does not yet support — check the extensions overview and SQL limits first.
- You need an on-premises or self-hosted deployment today.
Architecture at a glance
Section titled “Architecture at a glance”DB9 separates the control plane from the data plane:
- Control plane — the API server, CLI, and SDK handle database creation, user management, token lifecycle, branching, and observability. You interact with it through
db9commands or the TypeScript SDK. - Data plane — the
db9-serverprocess speaks the PostgreSQL wire protocol and executes SQL against TiKV. Each database gets its own isolated keyspace in TiKV, so tenants share infrastructure but never data.
Extensions like fs9, HTTP, embedding, vector, and pg_cron run inside the data plane as compiled-in capabilities, not separate microservices.
For a deeper look, see the Architecture page.
Next steps
Section titled “Next steps”- Why DB9 for AI Agents — the agent-native capabilities that make DB9 different
- Connect to DB9 — connection strings, psql, ORMs, drivers, and authentication
- Quick Start — install the CLI and create your first database in under a minute
- CLI Reference — full command reference for
db9 - TypeScript SDK —
instantDatabase(), client API, and credential management - Extensions — fs9, HTTP, pg_cron, vector search, full-text search, and more
- SQL Reference — data types, DDL/DML, functions, and compatibility notes