Data model
The tables of the gateway's Postgres schema and what each holds.
The gateway keeps everything in one Postgres schema, sypnia_ai.
| Table | Holds |
|---|---|
projects | each project’s settings: whether model names are allowed directly, the zero-retention rule |
route_versions | every version of a project’s routes, as written, with who applied it and when |
keys | keys: name, prefix, a slow hash of the secret (never the secret), scopes, caps, last use, revocation |
provider_keys | your own provider keys, encrypted, or the AWS role to assume |
origins | sites allowed to use browser tokens |
limits, limit_leases | the limits, and the leases each copy of the gateway holds |
calls | one row per call: task, route version, case, the person’s id hashed, model, attempts, tokens, credits, result, timings, trace id. Split by day; days older than the retention are dropped whole |
usage_daily | totals per day, case, task, key, person and model, kept as long as the organization |
stored_bodies | where a kept question and answer are, and when they are deleted |
cache_entries | the response cache’s index and expiry |
audit | route changes, key changes, reads of kept bodies, deletions of people |
What a person wrote is never in Postgres: kept bodies and cached answers live encrypted in object storage, and the tables only point to them.