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
- A provider records a connector type (
provider_type) and itsconnection_args. - 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.
- For each new or changed entry, the service emits a
memorylayer-task.doc_addedtask 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_type | Source | connection_args |
|---|---|---|
manual_upload | Client uploads through presigned URLs (does not poll) | — |
local_fs | Local directory, walked recursively with SHA-256 content hashes | base_directory |
s3 | S3 or S3-compatible bucket prefix | bucket, prefix, endpoint_url, region (default us-east-1), access_key_id, secret_access_key |
web_scraper | List of web URLs, optionally following links | urls, follow_links (default false), max_depth (default 1) |
github | Repository content, issues, and pull requests | credentials.token; settings.repos, settings.include_issues (default true), settings.include_prs (default true) |
gdrive | Google Drive folder | credentials.service_account_json or credentials.oauth_token; settings.folder_id |
dropbox | Dropbox folder | credentials.access_token; settings.path |
slack | Slack channel messages | credentials.bot_token; settings.channels, settings.include_threads (default false) |
discord | Discord guild channel messages | credentials.bot_token; settings.guild_id, settings.channel_ids |
teams | Microsoft Teams channel messages via Microsoft Graph | credentials.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):
| Method | Path | Description |
|---|---|---|
POST | /v1/providers | Create 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/trigger | Start 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
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
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_URLto 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 withDC_BLOB_BUCKET,DC_BLOB_ENDPOINT_URL, and related variables) orDC_BLOB_TYPE=blobgwto use the MemoryLayer Storage gateway. - Aether: set
AETHER_GATEWAY_ADDRandAETHER_API_KEYso the service can register itself and emit ingestion tasks.
See Configuration for the full variable list and Installation for the container image.
Related Pages
- Data Providers — the core server’s
/v1/data-providersAPI and local provider - Document Ingestion — how synced documents become memories