Skip to content

Connectors

Connectors are pluggable data source adapters that pull data from external services into Botmem's memory store. Each connector extends the BaseConnector class from @botmem/connector-sdk and implements a standard interface for authentication and data synchronization.

Available Connectors

ConnectorAuth TypeWhat It Syncs
Gmail / GoogleOAuth 2.0Emails, contacts, attachments
OutlookOAuth 2.0Emails, contacts
SlackAPI TokenChannel messages, DMs, user profiles, files
WhatsAppQR CodeChat messages, group chats
TelegramPhone CodeChat messages, group chats
iMessageLocal TooliMessage chat history (macOS only)
Photos / ImmichAPI KeyPhotos, albums, facial recognition tags
Locations / OwnTracksAPI KeyGPS location history

How Connectors Work

Every connector follows the same lifecycle:

1. Registration

Connectors are registered via the plugin system at startup. Each connector provides a manifest describing its ID, name, auth type, configuration schema, entity types, trust score, and pipeline configuration. Built-in connectors are loaded via loadBuiltin() in plugins.service.ts.

2. Authentication

Depending on the auth type:

  • OAuth 2.0 -- User is redirected to the service's consent screen, then back to Botmem with an authorization code which is exchanged for access/refresh tokens
  • QR Code -- A QR code is displayed in the web UI for the user to scan with their mobile app
  • Phone Code -- A verification code is sent to the user's phone number
  • API Key -- User provides credentials directly in the configuration form
  • Local Tool -- No authentication needed; the connector reads from a local resource

3. Sync

When a sync is triggered (manually or on a schedule), the connector's sync() method is called with a SyncContext containing the account credentials, a cursor for incremental sync, and a logger. The connector emits ConnectorDataEvent objects for each piece of data it finds.

4. Processing

Each emitted event flows through the pipeline:

  1. Sync queue -- raw event is saved to the database
  2. Embed queue -- memory record created, embedding generated, contacts resolved
  3. File queue -- (for file/photo events) content extracted and re-embedded
  4. Enrich queue -- entities extracted, factuality classified, graph links created

Connectors can customize pipeline behavior by overriding clean(), embed(), and enrich() methods.

Data Types

Connectors emit events with one of these source types:

Source TypeDescriptionConnectors
emailEmail messages with headers, body, and recipientsGmail, Outlook
messageChat messages with sender and channelSlack, WhatsApp, Telegram, iMessage
contactPeople/contacts with metadata (name, email, phone, org)Gmail, Outlook, Slack
photoPhotos with EXIF data, descriptions, and face tagsPhotos/Immich
locationGPS coordinates with timestampsOwnTracks
fileDocuments, spreadsheets, PDFs, images from servicesGmail (attachments), Slack (files)

Trust Scores

Each connector has a base trust score that influences the final ranking of memories:

ConnectorTrust ScoreRationale
Gmail0.95Official email with verified sender
Outlook0.90Enterprise email with verified sender
Slack0.90Workspace-authenticated messages
Telegram0.85Phone-verified accounts
Photos / Immich0.85EXIF-verified timestamps and locations
Locations / OwnTracks0.85GPS sensor data
WhatsApp0.80End-to-end encrypted but metadata limited
iMessage0.80Local database, no server verification
Manual0.70User-entered data, no source verification

Default Sync Behavior

Botmem's default behavior is to pull the maximum data available from any connector -- full history, not just recent items. This ensures complete coverage of your personal memory. Incremental sync (using cursors) is used for subsequent syncs to only pull new data.

Adding a New Connector

See Building a Connector for a complete guide to creating a custom connector, including examples for both API-key and OAuth2 auth flows.

Your memories. Your agents. Your control.