Every AI interaction — prompt, response, tool call, side effect — is a first-class
immutable record in your PostgreSQL database. The audit trail is a JOIN.
Authorization is a policy row. The causal chain from session to changed row
is one query.
Built on Aquameta — the all-database platform
where everything is data.
current_user — enforced by the enginecurrent_userEvery AI interaction is bound to a PostgreSQL role at insert time via column default — not an application parameter, not a token, not a claim. It cannot be spoofed. RLS policies apply automatically. No separate identity fabric required.
Allow/deny matrices for providers, tool sets, and individual tools live in tables. Authorization decisions are snapshotted at evaluation time — including the exact policy rows that drove the decision. Future policy changes don't rewrite history.
Tool executions record their effects atomically. If the evidence can't be written, the action doesn't happen. The causal chain — session → prompt → response → tool call → row change — is a view, not a reconstruction across five log sources.
Context assembly is a versioned SQL function over your own governed data — memory, RAG, conversation history, workflow state. Every block that reached the model is recorded with its permission basis. "What did the agent see?" is a query, not a guess.
The LLM is a compute utility.
Aquameta owns the state.
Provider-managed threads, vector stores, and assistant definitions are
convenient today and a moat tomorrow. When your audit trail lives in
OpenAI's infrastructure, you have a dashboard, not ownership. When your
embeddings live in a proprietary vector store, switching providers means
a migration from a system with no standard export format.
Aquameta's position: use the primitive API — a messages array in, a
completion out. All context assembly, memory, tool execution, and state
management happens in your PostgreSQL. The LLM is interchangeable.
Your data model is the platform.
Aquameta.ai is built on Aquameta —
the open source all-database platform where schema, code, UI, and version
control are all rows in PostgreSQL. The same primitives that make UI
components queryable make AI interactions auditable.
meta.row_id, bundle VCS, RLS-as-identity —
the governance layer is a natural extension of the platform, not a bolt-on.