Tier-gated RAG + Drive document sources (#42) #54

Merged
westfarn merged 1 commits from feature/rag-epic-42 into master 2026-08-01 14:02:36 -07:00
Owner

Summary

Implements epic #42 (children #43–#53) and advances #11.

  • Entitlement: allows_rag on plans (founders / backer / pro / business; not standard); exposed as features.rag
  • Gates: document REST + WS PromptType.RAG use assert_feature_allowed(..., "rag")
  • Lifecycle: dedupe ingest, delete vectors by document_id, honor active, fix document detail PATCH/DELETE
  • Workspaces: auto-create default company workspace; fail-closed scoping
  • Drive: personal + company Google/Microsoft connect (link_drive / link_company_drive), resource selection, sync, webhooks stubs, sync_drive_connections management command
  • Docs/env: README + .env*.example updated

Companion FE: chat_web_app branch feature/rag-epic-42-ui (#81–#85).

Test plan

  • SKIP_RAG_INIT=1 uv run python manage.py test (457 OK)
  • Migrate finance 0004 + chat_backend 0028 on beta
  • Verify Standard user: Documents API 403 + no RAG retrieval
  • Verify Founders/Pro: upload + list + active toggle
  • Connect Google/Microsoft Drive (incremental scopes) and Sync
  • Company manager: link_company_drive; non-manager 403
  • Run manage.py sync_drive_connections
## Summary Implements epic [#42](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/42) (children #43–#53) and advances [#11](https://git.aimloperations.com/ai_ml_operations/chat_backend/issues/11). - **Entitlement:** `allows_rag` on plans (founders / backer / pro / business; not standard); exposed as `features.rag` - **Gates:** document REST + WS `PromptType.RAG` use `assert_feature_allowed(..., "rag")` - **Lifecycle:** dedupe ingest, delete vectors by `document_id`, honor `active`, fix document detail PATCH/DELETE - **Workspaces:** auto-create default company workspace; fail-closed scoping - **Drive:** personal + company Google/Microsoft connect (`link_drive` / `link_company_drive`), resource selection, sync, webhooks stubs, `sync_drive_connections` management command - **Docs/env:** README + `.env*.example` updated Companion FE: `chat_web_app` branch `feature/rag-epic-42-ui` (#81–#85). ## Test plan - [x] `SKIP_RAG_INIT=1 uv run python manage.py test` (457 OK) - [ ] Migrate finance `0004` + chat_backend `0028` on beta - [ ] Verify Standard user: Documents API 403 + no RAG retrieval - [ ] Verify Founders/Pro: upload + list + active toggle - [ ] Connect Google/Microsoft Drive (incremental scopes) and Sync - [ ] Company manager: `link_company_drive`; non-manager 403 - [ ] Run `manage.py sync_drive_connections`
westfarn added 1 commit 2026-08-01 13:34:22 -07:00
Add tier-gated RAG and Drive document sources (#42)
CI / test (pull_request) Successful in 10s
Unit Tests / test (pull_request) Successful in 10s
c5efe60e0b
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
westfarn merged commit d54094f5e0 into master 2026-08-01 14:02:36 -07:00
westfarn deleted branch feature/rag-epic-42 2026-08-01 14:02:36 -07:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ai_ml_operations/chat_backend#54