Skip to content

Conversation

@manojag115
Copy link
Contributor

@manojag115 manojag115 commented Jan 9, 2026

Description

Add Microsoft Teams connector to surfsense. See below screenshots for celery worker logs and ui being able to search through teams messages
Steps followed:

  • Add new connector, choose Teams, follow steps to add, make sure your app on azure gives required permissions for the graph api
  • Index Teams connector
  • Tested chat, selected teams connector
  • Also run the db migration using alembic

Motivation and Context

FIX #147

Screenshots

Screenshot 2026-01-08 at 3 43 30 PM

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • [x
Screenshot 2026-01-08 at 5 15 16 PM ] New feature - [ ] Performance improvement - [ ] Refactoring - [ ] Documentation - [ ] Dependency/Build system - [ ] Breaking change - [ ] Other (specify):

Testing Performed

  • Tested locally
  • Manual/QA verification

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

High-level PR Summary

This PR adds a new Microsoft Teams connector to SurfSense, enabling users to connect their Teams workspaces and index messages from channels they have access to. The implementation follows the existing connector pattern with OAuth 2.0 authentication via Microsoft Graph API, secure token encryption and refresh, message indexing with date range filtering, and full integration into the search and chat functionality. Both backend (Python/FastAPI) and frontend (TypeScript/React) components are added, along with a database migration to support the new TEAMS_CONNECTOR enum values.

⏱️ Estimated Review Time: 30-90 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_backend/.env.example
2 surfsense_backend/app/config/__init__.py
3 surfsense_backend/app/db.py
4 surfsense_web/contracts/enums/connector.ts
5 surfsense_web/contracts/types/connector.types.ts
6 surfsense_backend/alembic/versions/59_add_teams_connector_enums.py
7 surfsense_backend/app/schemas/teams_auth_credentials.py
8 surfsense_backend/app/routes/teams_add_connector_route.py
9 surfsense_backend/app/connectors/teams_connector.py
10 surfsense_backend/app/connectors/teams_history.py
11 surfsense_backend/app/tasks/connector_indexers/teams_indexer.py
12 surfsense_backend/app/tasks/celery_tasks/connector_tasks.py
13 surfsense_backend/app/routes/search_source_connectors_routes.py
14 surfsense_backend/app/services/connector_service.py
15 surfsense_backend/app/utils/connector_naming.py
16 surfsense_backend/app/utils/periodic_scheduler.py
17 surfsense_backend/app/routes/__init__.py
18 surfsense_backend/app/agents/new_chat/tools/knowledge_base.py
19 surfsense_web/components/assistant-ui/connector-popup/constants/connector-constants.ts
20 surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/teams-config.tsx
21 surfsense_web/components/assistant-ui/connector-popup/connector-configs/index.tsx
22 surfsense_web/components/assistant-ui/connector-popup/utils/connector-document-mapping.ts
23 surfsense_web/contracts/enums/connectorIcons.tsx

Need help? Join our Discord

Analyze latest changes

@vercel
Copy link

vercel bot commented Jan 9, 2026

@manojag115 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@recurseml recurseml bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by RecurseML

🔍 Review performed on 3c93c74..4532cc3

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (22)

surfsense_backend/.env.example
surfsense_backend/alembic/versions/59_add_teams_connector_enums.py
surfsense_backend/app/agents/new_chat/tools/knowledge_base.py
surfsense_backend/app/config/__init__.py
surfsense_backend/app/connectors/teams_connector.py
surfsense_backend/app/connectors/teams_history.py
surfsense_backend/app/db.py
surfsense_backend/app/routes/__init__.py
surfsense_backend/app/routes/teams_add_connector_route.py
surfsense_backend/app/schemas/teams_auth_credentials.py
surfsense_backend/app/services/connector_service.py
surfsense_backend/app/tasks/celery_tasks/connector_tasks.py
surfsense_backend/app/tasks/connector_indexers/teams_indexer.py
surfsense_backend/app/utils/connector_naming.py
surfsense_backend/app/utils/periodic_scheduler.py
surfsense_web/components/assistant-ui/connector-popup/connector-configs/components/teams-config.tsx
surfsense_web/components/assistant-ui/connector-popup/connector-configs/index.tsx
surfsense_web/components/assistant-ui/connector-popup/constants/connector-constants.ts
surfsense_web/components/assistant-ui/connector-popup/utils/connector-document-mapping.ts
surfsense_web/contracts/enums/connector.ts
surfsense_web/contracts/enums/connectorIcons.tsx
surfsense_web/contracts/types/connector.types.ts

@manojag115 manojag115 marked this pull request as ready for review January 9, 2026 21:24
@manojag115
Copy link
Contributor Author

@RecurseML review

@MODSetter MODSetter merged commit 488927e into MODSetter:dev Jan 10, 2026
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants