# Scribase for AI apps

> Scribase for AI apps: real Postgres for embeddings, plus an agent control surface where every mutation has a CLI flag, an API op and an approval gate.

Source: https://scribase.com/for/ai-app

AI apps need two things from a backend: a database that can hold both application data and embeddings, and a control surface an agent can drive without becoming an incident. Scribase gives you Postgres with extensions for vector search alongside your relational data, and a control API where every mutation is a typed operation with an idempotency key, an operation ID, and an approval gate for the destructive ones.

## What this audience is building

- One database for app data and vector embeddings, not two systems
- A backend an agent can provision and change through a typed API
- Guardrails so autonomy never means unsupervised data loss

## How Scribase meets each need

**Postgres for data and embeddings** — Keep relational data and vector embeddings in the same Postgres instance with extensions, so retrieval and application queries share one database and one set of policies.

**CLI and OpenAPI parity for agents** — Everything a person can do in the console is a CLI flag and an OpenAPI operation, so an agent has a complete, typed surface — including MCP-driven workflows — instead of dashboard-only actions.

**Idempotent, gated, auditable** — Each mutation carries an idempotency key and returns an operation ID over a durable executor, so retries are safe. Sensitive operations sit behind an approval model, and every change is auditable by its operation ID.

_# every mutation is idempotent and returns an operation id_

```
$ scribase env create acme agent-app pr-42 \
    preview sanitized us-east create-pr-42-2f9c 48

{"id":"op_01J…","kind":"create_environment","state":"pending"}

$ scribase operation get acme op_01J…
{"id":"op_01J…","state":"succeeded","attempt_count":1}
```

## FAQ

**Can I store vector embeddings in Scribase?**

Yes. Scribase runs real Postgres with extensions, so you can keep embeddings alongside relational data and query both from one database under the same policies.

**How do agents change the backend safely?**

Every mutation is a typed CLI and OpenAPI operation with an idempotency key and an operation ID, and destructive actions sit behind an approval gate — so retries are safe and autonomy is auditable.

## Related

- [AI agents use case](https://scribase.com/use-cases/ai-agents)
- [Deploy an edge function](https://scribase.com/guides/deploy-an-edge-function)
- [Control API docs](https://scribase.com/docs/control-api)