Epic: Tier-gated RAG + cloud document sources #42

Open
opened 2026-08-01 13:05:23 -07:00 by westfarn · 0 comments
Owner

Summary

Ship RAG as a subscription feature for founders / backer / pro / business (not standard), with Documents UI gated by plan, personal upload + Drive connect, and Business manager setup for company Microsoft 365 and Google Shared Drives.

Architecture decisions

Topic Decision
Auto Drive after SSO? No silent access. Identity SSO stays openid email profile. Incremental Drive/Graph scopes via post-login connect (prefer matching IdP).
Apple No iCloud Drive path. Apple Sign-In (auth only) is out of scope.
Connect later Yes — Account / Documents connect + disconnect.
Sync Refresh tokens; webhooks + periodic delta + manual Sync.
Copies Uploads keep Postgres blobs. Drive: remote id + etag/hash + metadata; vectors in Chroma; temp files for loaders.
Vectors Keep Chroma (no pgvector migration in this epic).
Business KB Both Microsoft 365 (SharePoint / OneDrive for Business) and Google Shared Drives; is_company_manager configures.

Goals

  • allows_rag entitlement on plans; gate document APIs + RAG chat
  • FE hides/locks Documents for Standard; upgrade CTA
  • Email/password: upload and/or connect Drive after the fact
  • SSO: guided connect to matching Drive (incremental scopes)
  • Business manager: company M365 and/or Google Shared Drive → company workspace
  • Harden RAG lifecycle (delete/dedupe/active) so Drive sync is safe

Out of scope

  • Apple iCloud document sync / Apple Sign-In
  • Chroma → pgvector migration
  • Making Standard/Pro/Business public/selectable at checkout

Existing related work

  • #11 — Connect OneDrive / Google Drive as RAG document sources

Child tickets

Backend (chat_backend)

  • #43allows_rag entitlement + seed + plan_to_dict
  • #44 — Enforce RAG on document APIs + RAG chat
  • #45 — RAG lifecycle hardening
  • #46 — Personal + company workspace clarity
  • #47 — OAuth Drive connect + incremental scopes
  • #48 — Google Drive personal sync
  • #49 — OneDrive personal sync
  • #50 — Business M365 admin consent
  • #51 — Business Google Shared Drives
  • #52 — Drive sync workers
  • #53 — Docs + env

Frontend (chat_web_app)

  • #81 — Subscription-aware Documents / RAG UI gate
  • #82 — Documents UX polish
  • #83 — Connect Drive UI (personal)
  • #84 — Business manager company knowledge UI
  • #85 — RAG-denied chat UX

Implementation order

  1. Entitlement + API/WS gates + FE lock
  2. RAG lifecycle hardening
  3. Personal Drive connect (Google + Microsoft) + UI
  4. Business dual-cloud manager setup + sync workers
  5. Polish (webhooks, SSO nudge, chat upgrade UX)
## Summary Ship RAG as a subscription feature for **founders / backer / pro / business** (not **standard**), with Documents UI gated by plan, personal upload + Drive connect, and Business manager setup for company Microsoft 365 **and** Google Shared Drives. ## Architecture decisions | Topic | Decision | |-------|----------| | Auto Drive after SSO? | No silent access. Identity SSO stays `openid email profile`. Incremental Drive/Graph scopes via post-login connect (prefer matching IdP). | | Apple | No iCloud Drive path. Apple Sign-In (auth only) is out of scope. | | Connect later | Yes — Account / Documents connect + disconnect. | | Sync | Refresh tokens; webhooks + periodic delta + manual Sync. | | Copies | Uploads keep Postgres blobs. Drive: remote id + etag/hash + metadata; vectors in Chroma; temp files for loaders. | | Vectors | Keep Chroma (no pgvector migration in this epic). | | Business KB | Both Microsoft 365 (SharePoint / OneDrive for Business) and Google Shared Drives; `is_company_manager` configures. | ## Goals - [ ] `allows_rag` entitlement on plans; gate document APIs + RAG chat - [ ] FE hides/locks Documents for Standard; upgrade CTA - [ ] Email/password: upload and/or connect Drive after the fact - [ ] SSO: guided connect to matching Drive (incremental scopes) - [ ] Business manager: company M365 and/or Google Shared Drive → company workspace - [ ] Harden RAG lifecycle (delete/dedupe/active) so Drive sync is safe ## Out of scope - Apple iCloud document sync / Apple Sign-In - Chroma → pgvector migration - Making Standard/Pro/Business public/selectable at checkout ## Existing related work - [#11](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/11) — Connect OneDrive / Google Drive as RAG document sources ## Child tickets ### Backend (`chat_backend`) - [#43](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/43) — `allows_rag` entitlement + seed + plan_to_dict - [#44](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/44) — Enforce RAG on document APIs + RAG chat - [#45](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/45) — RAG lifecycle hardening - [#46](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/46) — Personal + company workspace clarity - [#47](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/47) — OAuth Drive connect + incremental scopes - [#48](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/48) — Google Drive personal sync - [#49](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/49) — OneDrive personal sync - [#50](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/50) — Business M365 admin consent - [#51](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/51) — Business Google Shared Drives - [#52](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/52) — Drive sync workers - [#53](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/53) — Docs + env ### Frontend (`chat_web_app`) - [#81](https://git.aimloperations.com/ai_ml_operations/chat_web_app/issues/81) — Subscription-aware Documents / RAG UI gate - [#82](https://git.aimloperations.com/ai_ml_operations/chat_web_app/issues/82) — Documents UX polish - [#83](https://git.aimloperations.com/ai_ml_operations/chat_web_app/issues/83) — Connect Drive UI (personal) - [#84](https://git.aimloperations.com/ai_ml_operations/chat_web_app/issues/84) — Business manager company knowledge UI - [#85](https://git.aimloperations.com/ai_ml_operations/chat_web_app/issues/85) — RAG-denied chat UX ## Implementation order 1. Entitlement + API/WS gates + FE lock 2. RAG lifecycle hardening 3. Personal Drive connect (Google + Microsoft) + UI 4. Business dual-cloud manager setup + sync workers 5. Polish (webhooks, SSO nudge, chat upgrade UX)
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ai_ml_operations/chat_backend#42