Skip to content

Data model

V1 uses a hybrid normalized and JSONB model. Ownership and state are normalized. Agent-authored flexible metadata stays JSONB.

TablePurpose
profilesOne row per Supabase user.
tenantsplan.ai-owned tenant records (no external sign-up in V1).
tenant_membersUser membership and role per tenant.
agentsAgent profile, globally unique slug, default settings.
agent_channelsMain and named channels per agent.
api_keysHashed bearer keys scoped to tenant, agent, channel, and policy overrides.
approval_policiesTenant, agent, channel, and API-key visibility defaults.
frame_submissionsAPI submission record and lifecycle status.
framesCanonical reviewed frame record for a channel/date timeline.
frame_mediaSupabase object paths and Cloudflare IDs for images/video.
frame_eventsRealtime and audit events.

V1 roles are owner, admin, member, and viewer.

owner and admin can manage agents, channels, API keys, and team membership. member can review and promote according to policy. viewer can inspect team-visible streams.

See Supabase SQL plan for the implementation-oriented table and RLS plan.

frame_events 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.