Built for autonomous software

The database for AI agents

Your agent needs real storage — scratch space, memory, query targets. DBaaS.dev gives it PostgreSQL on demand: one API call, ready in seconds, cleaned up automatically. No signup flow in the loop, no infrastructure for you to babysit.

Three ways your agent gets a database

REST API

Ephemeral databases

POST one endpoint → PostgreSQL with a TTL. No account needed. Auto-deletes when the task is done. Run SQL over HTTP or connect any Postgres driver.

MCP

Model Context Protocol

Claude, ChatGPT, Cursor and friends create and query databases conversationally through our hosted remote MCP server — one URL, no local install.

A2A

Agent-to-Agent

A full A2A agent with natural-language workflows: provision, design schemas, load sample data, migrate, query — chained autonomously from a single instruction.

Agent quickstart — database in one call

This is the entire integration. No API key required for ephemeral databases.

import requests, time, psycopg2

API = "https://api.dbaas.dev/v1"

# Your agent needs a database? One call. No signup, no credit card.
db = requests.post(f"{API}/ephemeral/create", json={"ttl": 2}).json()["data"]

# Poll until ready (~15-30s), then connect with any Postgres driver
while True:
    state = requests.get(f"{API}/ephemeral/{db['id']}").json()["data"]
    if state["status"] == "running":
        conn = psycopg2.connect(state["connectionString"])
        break
    time.sleep(3)

# The agent now has a real PostgreSQL 17 database.
cur = conn.cursor()
cur.execute("CREATE TABLE memory (id SERIAL, role TEXT, content TEXT, ts TIMESTAMPTZ DEFAULT now())")
cur.execute("INSERT INTO memory (role, content) VALUES ('user', 'Remember: ship on Friday')")
conn.commit()

# TTL expires -> database deletes itself. Zero cleanup code.

As LangChain tools

# LangChain / LangGraph: give your agent a scratch database as a tool
from langchain_core.tools import tool
import requests

@tool
def create_database(ttl_hours: int = 2) -> str:
    """Create a temporary PostgreSQL database. Returns the connection string."""
    db = requests.post("https://api.dbaas.dev/v1/ephemeral/create",
                       json={"ttl": ttl_hours}).json()["data"]
    # ...poll until running (see quickstart), then:
    return db_connection_string

@tool
def run_sql(database_id: str, sql: str) -> list:
    """Run SQL over HTTP — no driver needed inside the agent sandbox."""
    r = requests.post(f"https://api.dbaas.dev/v1/ephemeral/{database_id}/sql",
                      json={"sql": sql})
    return r.json()["data"]["rows"]

Works identically from CrewAI, AutoGen, LangGraph, or hand-rolled agents — it's plain HTTP.

What agents build with it

Agent memory & state

Conversation history, task state, learned facts — structured in SQL instead of stuffed into context windows. Survives restarts; queryable with real WHERE clauses.

Safe SQL sandboxes

Let an agent practice schema changes or run untrusted generated SQL against a disposable database — production stays untouched, the sandbox deletes itself.

Data analysis tasks

Agent receives a CSV, loads it into Postgres, runs aggregations, returns answers. The heavy lifting happens in SQL, where it belongs.

Per-user / per-session stores

Multi-tenant agent products spin up an isolated database per customer session — clean blast radius, zero shared-state bugs.

Why not SQLite / vectors / a big shared DB?

SQLite dies with the sandbox. Agent environments are ephemeral by design — the moment the run ends, the file is gone. A hosted Postgres survives across runs, machines, and handoffs between agents.

Vector stores answer "what's similar?" — they can't answer "how many orders since Tuesday?" Agents doing real work need joins, aggregates, constraints, and transactions. That's SQL.

One big shared database means one agent's mistake is everyone's incident. Per-task databases give each run a clean blast radius — and TTL cleanup means nobody has to remember to delete anything.

Frequently asked questions

Can an AI agent create a database autonomously?

Yes — that's the point. The ephemeral endpoint needs no account or key, so an agent can POST and get PostgreSQL in seconds. For persistent databases, it authenticates with an API key via REST or MCP.

Is it really free?

Ephemeral databases are free with no signup. The free account tier adds persistent managed PostgreSQL with backups — no credit card.

How fast is provisioning?

Typically 15–30 seconds from API call to accepting connections.

What about cleanup?

Ephemeral databases carry a TTL and delete themselves on expiry. Your agent never needs teardown logic.

Can agents use it for long-term memory?

Yes — use a persistent database (free tier) instead of an ephemeral one. Same API family, plus dashboards, backups, and connection pooling.

Which frameworks work with it?

Anything that can make an HTTP request or open a Postgres connection: LangChain, LangGraph, CrewAI, AutoGen, OpenAI tool-calling, or plain Python/JS. MCP covers Claude, ChatGPT, Cursor and other MCP clients.

Give your agent a real database

One POST request away. No signup for ephemeral DBs.