Tables overview

  1. communities
  2. chat_sources
  3. exports
  4. message_hashes
  5. daily_digests
  6. weekly_summaries_public
  7. weekly_health_snapshots_public
  8. weekly_concept_graph_public
  9. ai_quota_usage
  10. ai_usage_log
  11. quota_settings

Sources: beacon-platform/docs/database-structure.md, beacon-platform/packages/db/schema.sql


Key tables

communities

  • community_id (PK), name, description, created_at, updated_at.

chat_sources

  • (community_id, source_id) composite PK.
  • name, description, timestamps.

exports

  • Tracks R2 objects and processing state.
  • Includes message_count, new_message_count, status, processing progress.

message_hashes

  • Deduplication key: (community_id, source_id, day_date, content_hash).
  • sender_hash supports unique sender counts without storing PII.

daily_digests

  • Per-day AI output with sentiment, themes, summary, counts.
  • Internal-only input to weekly summaries.

weekly_summaries_public

  • Public-safe weekly aggregates with sentiment, themes, summary, totals, confidence.

weekly_health_snapshots_public

  • Serialized health snapshot data for community health pillars (vNext).

weekly_concept_graph_public

  • Concept graph output used for visualization.

ai_quota_usage and ai_usage_log

  • Daily counters and per-call usage logs for AI costs and limits.

quota_settings

  • Stores daily digest processing mode and AI quota settings.

Sources: beacon-platform/docs/database-structure.md, beacon-platform/docs/community-health.md, beacon-platform/packages/db/schema.sql


Notes and constraints

  • Weeks are Sunday-Saturday (UTC) and aligned to SQLite weekday 0.
  • Public endpoints read from weekly_summaries_public and related public tables only.
  • Retention is not enforced in code; use R2 lifecycle and D1 cleanup jobs.

Sources: beacon-platform/docs/architecture.md, beacon-platform/docs/privacy.md, beacon-platform/AUDIT_REPORT.md