Skip to content

Data Connectors

The data connectors service (memorylayer-data-connectors) syncs content from external sources into a VFS catalog backed by blob storage, then enqueues document ingestion work for MemoryLayer Enterprise through Aether. It also mints access-controlled upload and download URLs for files in the catalog.

It runs as its own service (data-connectors, image ghcr.io/scitrera/memorylayer-data-connectors, port 8100), separate from the MemoryLayer server. For the open-source core’s built-in local-directory provider, see Data Providers.


How It Works

  1. A provider records a connector type (provider_type) and its connection_args.
  2. A sync instantiates the connector, discovers new or changed entries since the last checkpoint, and registers each entry in the VFS catalog. Chat connectors (Slack, Discord, Teams) and local files are materialized into the blob store; Google Drive, Dropbox, and GitHub content is fetched from upstream URLs.
  3. For each new or changed entry, the service emits a memorylayer-task.doc_added task through Aether. The enterprise worker fetches the bytes and runs the document ingestion pipeline.

The service registers with Aether as sv::data-connectors::<specifier>; the enterprise server addresses it at sv::data-connectors (MEMORYLAYER_DATA_CONNECTORS_TOPIC). Keep the service behind Aether rather than exposing it directly to end users.


Connector Types

provider_typeSourceconnection_args
manual_uploadClient uploads through presigned URLs (does not poll)—
local_fsLocal directory, walked recursively with SHA-256 content hashesbase_directory
s3S3 or S3-compatible bucket prefixbucket, prefix, endpoint_url, region (default us-east-1), access_key_id, secret_access_key
web_scraperList of web URLs, optionally following linksurls, follow_links (default false), max_depth (default 1)
githubRepository content, issues, and pull requestscredentials.token; settings.repos, settings.include_issues (default true), settings.include_prs (default true)
gdriveGoogle Drive foldercredentials.service_account_json or credentials.oauth_token; settings.folder_id
dropboxDropbox foldercredentials.access_token; settings.path
slackSlack channel messagescredentials.bot_token; settings.channels, settings.include_threads (default false)
discordDiscord guild channel messagescredentials.bot_token; settings.guild_id, settings.channel_ids
teamsMicrosoft Teams channel messages via Microsoft Graphcredentials.client_id, credentials.client_secret, credentials.tenant_id; settings.team_id, settings.channel_ids

connection_args are passed to the connector as keyword arguments. The chat, GitHub, Drive, and Dropbox connectors take nested credentials and settings objects.


Providers API

These endpoints are served by the data connectors service (reached through Aether):

MethodPathDescription
POST/v1/providersCreate a provider (201); metadata.workspace_id sets its workspace (default _default)
GET/v1/providers?workspace_id=...List providers (limit default 50, max 200)
PATCH/v1/providers/{provider_id}Update a provider
DELETE/v1/providers/{provider_id}Delete a provider (204)
POST/v1/sync/triggerStart a sync (202); body {provider_id, workspace_id, full_sync}
GET/v1/sync/jobs/{job_id}Sync job status: pending, running, completed, or failed

Provider fields: name, provider_type, description, enabled, connection_args, schedule, and metadata. Provider IDs are prefixed dp_. The schedule field is stored with the provider but the service does not run syncs on a schedule by itself; trigger syncs with /v1/sync/trigger.

Example: GitHub Repository

Terminal window
curl -X POST "$DATA_CONNECTORS_URL/v1/providers" \
-H "Content-Type: application/json" \
-d '{
"name": "scitrera/memorylayer",
"provider_type": "github",
"connection_args": {
"credentials": {"token": "ghp_..."},
"settings": {
"repos": ["scitrera/memorylayer"],
"include_issues": true,
"include_prs": true
}
},
"metadata": {"workspace_id": "engineering"}
}'
curl -X POST "$DATA_CONNECTORS_URL/v1/sync/trigger" \
-H "Content-Type: application/json" \
-d '{"provider_id": "dp_...", "workspace_id": "engineering", "full_sync": false}'

Example: S3 Bucket

Terminal window
curl -X POST "$DATA_CONNECTORS_URL/v1/providers" \
-H "Content-Type: application/json" \
-d '{
"name": "Research Papers S3",
"provider_type": "s3",
"connection_args": {
"bucket": "research-papers",
"prefix": "published/",
"region": "us-east-1",
"access_key_id": "AKIA...",
"secret_access_key": "..."
},
"metadata": {"workspace_id": "research"}
}'

Deployment

  • Database: set DC_POSTGRESQL_URL to persist the VFS catalog and providers. Migrations run at startup. Without it, the service uses in-memory stores (development only).
  • Blob storage: DC_BLOB_TYPE=s3 (default, configured with DC_BLOB_BUCKET, DC_BLOB_ENDPOINT_URL, and related variables) or DC_BLOB_TYPE=blobgw to use the MemoryLayer Storage gateway.
  • Aether: set AETHER_GATEWAY_ADDR and AETHER_API_KEY so the service can register itself and emit ingestion tasks.

See Configuration for the full variable list and Installation for the container image.