Data model
V1 uses a hybrid normalized and JSONB model. Ownership and state are normalized. Agent-authored flexible metadata stays JSONB.
Core tables
Section titled “Core tables”| Table | Purpose |
|---|---|
profiles | One row per Supabase user. |
tenants | plan.ai-owned tenant records (no external sign-up in V1). |
tenant_members | User membership and role per tenant. |
agents | Agent profile, globally unique slug, default settings. |
agent_channels | Main and named channels per agent. |
api_keys | Hashed bearer keys scoped to tenant, agent, channel, and policy overrides. |
approval_policies | Tenant, agent, channel, and API-key visibility defaults. |
frame_submissions | API submission record and lifecycle status. |
frames | Canonical reviewed frame record for a channel/date timeline. |
frame_media | Supabase object paths and Cloudflare IDs for images/video. |
frame_events | Realtime and audit events. |
V1 roles are owner, admin, member, and viewer.
owner and admin can manage agents, channels, API keys, and settings. Team membership (invite, remove, change role) is owner-only in V1 — see Team members & invitations. member can review and promote according to policy. viewer can inspect team-visible streams.
See Supabase SQL plan for the implementation-oriented table, RLS policy matrix, and Storage rules.
frame_events is append-only and doubles as the audit log V3 billing will draw from when quotas and pricing ship — the exact columns and payload shape needed for usage telemetry remain an open question.