Add tier-gated RAG and Drive document sources (#42)
CI / test (pull_request) Successful in 10s
Unit Tests / test (pull_request) Successful in 10s

Ship allows_rag entitlement (founders/backer/pro/business), enforce it on
document APIs and RAG chat, harden ingest/delete/active lifecycle, and add
Google/Microsoft Drive connect + sync for personal and company knowledge bases.

Closes #43 #44 #45 #46 #47 #48 #49 #50 #51 #52 #53
Parent epic: #42
Related: #11
This commit is contained in:
2026-08-01 15:33:55 -05:00
parent 2e9e95e16c
commit c5efe60e0b
38 changed files with 3166 additions and 98 deletions
+10 -3
View File
@@ -41,6 +41,7 @@ PLAN_SEED: list[dict[str, Any]] = [
"is_selectable": True,
"allows_text_generation": True,
"allows_image_generation": True,
"allows_rag": True,
"allows_all_future_features": True,
"prompt_quota_per_window": 300,
"prompt_window_hours": 6,
@@ -59,6 +60,7 @@ PLAN_SEED: list[dict[str, Any]] = [
"is_selectable": False,
"allows_text_generation": True,
"allows_image_generation": False,
"allows_rag": False,
"allows_all_future_features": False,
"prompt_quota_per_window": 100,
"prompt_window_hours": 6,
@@ -70,13 +72,14 @@ PLAN_SEED: list[dict[str, Any]] = [
"name": "Pro / Creator",
"description": (
"Higher message caps and multi-modal workflows for heavy users, "
"including image generation when available."
"including image generation and Drive/RAG sync when available."
),
"price_cents": 4000,
"is_public": False,
"is_selectable": False,
"allows_text_generation": True,
"allows_image_generation": True,
"allows_rag": True,
"allows_all_future_features": False,
"prompt_quota_per_window": 200,
"prompt_window_hours": 6,
@@ -87,14 +90,16 @@ PLAN_SEED: list[dict[str, Any]] = [
"slug": SubscriptionPlan.Slug.BUSINESS,
"name": "Business Team",
"description": (
"Team seats, centralized auth, priority support, and absolute data "
"privacy for local companies handling sensitive data."
"Team seats, centralized auth, priority support, company Drive/RAG "
"sync, and absolute data privacy for local companies handling "
"sensitive data."
),
"price_cents": 9900,
"is_public": False,
"is_selectable": False,
"allows_text_generation": True,
"allows_image_generation": True,
"allows_rag": True,
"allows_all_future_features": False,
"prompt_quota_per_window": 300,
"prompt_window_hours": 6,
@@ -113,6 +118,7 @@ PLAN_SEED: list[dict[str, Any]] = [
"is_selectable": False,
"allows_text_generation": True,
"allows_image_generation": True,
"allows_rag": True,
"allows_all_future_features": True,
"prompt_quota_per_window": 300,
"prompt_window_hours": 6,
@@ -415,6 +421,7 @@ def plan_to_dict(plan: SubscriptionPlan | None) -> dict[str, Any] | None:
"features": {
"text_generation": plan.allows_feature("text_generation"),
"image_generation": plan.allows_feature("image_generation"),
"rag": plan.allows_feature("rag"),
"all_future_features": plan.allows_all_future_features,
},
"prompt_quota_per_window": plan.prompt_quota_per_window,