feat: add Google Drive knowledge connector#3695
Closed
CalvinMagezi wants to merge 1 commit intoarchestra-ai:mainfrom
Closed
feat: add Google Drive knowledge connector#3695CalvinMagezi wants to merge 1 commit intoarchestra-ai:mainfrom
CalvinMagezi wants to merge 1 commit intoarchestra-ai:mainfrom
Conversation
Adds a Google Drive connector for syncing documents and files from Google Drive into the Archestra knowledge base. **Backend** (`platform/backend/src/knowledge-base/connectors/google-drive/`): - `GoogleDriveConnector` — implements `validateConfig`, `testConnection`, and `sync` via the Drive REST API v3 (no third-party SDK) - Dual auth: service account JSON key (auto-generates JWT via `node:crypto`) or raw OAuth 2.0 access token - Syncs Google Docs (exported as plain text), Sheets (CSV), Slides, `.txt`, `.md`, `.csv`, `.json`, `.html`, and other text MIME types - Incremental sync via `modifiedTime` with 5-minute safety buffer - Supports filtering by Shared Drive (`driveId`), folder (`folderId`), and MIME type (`mimeTypes`) - Pagination via `nextPageToken` - Full vitest test suite covering config validation, auth, sync batching, pagination, checkpoint advancement, and query building **Types** (`platform/backend/src/types/knowledge-connector.ts`): - `GoogleDriveConfigSchema` / `GoogleDriveConfig` - `GoogleDriveCheckpointSchema` / `GoogleDriveCheckpoint` - `googledrive` literal added to `ConnectorTypeSchema` and union schemas **Registry** (`registry.ts`): `googledrive` → `GoogleDriveConnector` **Frontend**: - `google-drive-config-fields.tsx` — Shared Drive ID, folder ID, MIME types - `connector-icons.tsx` — Google Drive icon (`/icons/google-drive.png`) - `create-connector-dialog.tsx` — Google Drive option + config fields - `edit-connector-dialog.tsx` — Google Drive label + config fields - `transform-config-array-fields.ts` — `mimeTypes` added to array fields **Shared** (`platform/shared/knowledge-base.ts`): - `googledrive: "Google Drive"` label Closes archestra-ai#3689
|
|
Contributor
|
hi there 👋 #3689 has already been assigned to another contributor, but thank you for your contribution 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #3689 — adds a Google Drive knowledge connector for syncing documents and files into the Archestra knowledge base.
google-drive-connector.ts): Uses the Drive REST API v3 directly (no SDK dependency). Supports dual auth: paste a service account JSON key (auto-generates JWT vianode:crypto) or a raw OAuth 2.0 access token.modifiedTimewith a 5-minute safety buffer to avoid re-syncing unchanged files..txt,.md,.csv,.json,.html.driveId), folder (folderId), MIME type (mimeTypes).Files changed
platform/backend/src/knowledge-base/connectors/google-drive/google-drive-connector.tsplatform/backend/src/knowledge-base/connectors/google-drive/google-drive-connector.test.tsplatform/backend/src/knowledge-base/connectors/registry.tsGoogleDriveConnectorplatform/backend/src/types/knowledge-connector.tsGoogleDriveConfigSchema,GoogleDriveCheckpointSchema,googledrivetypeplatform/shared/knowledge-base.tsgoogledrive: "Google Drive"labelplatform/frontend/public/icons/google-drive.pngplatform/frontend/src/app/knowledge/knowledge-bases/_parts/connector-icons.tsxplatform/frontend/src/app/knowledge/knowledge-bases/_parts/google-drive-config-fields.tsxplatform/frontend/src/app/knowledge/knowledge-bases/_parts/create-connector-dialog.tsxplatform/frontend/src/app/knowledge/knowledge-bases/_parts/edit-connector-dialog.tsxplatform/frontend/src/app/knowledge/knowledge-bases/_parts/transform-config-array-fields.tsmimeTypesto array fieldsTest plan
earn_discoverto verify the connector appears in the listfolderIdset and verify only files from that folder are syncedlastSyncedAtcheckpoint advances after each syncpnpm testinplatform/backendto verify all unit tests pass🤖 Generated with Claude Code