Ingestion and connectors

From BuilderIO/agent-native · View interactive version

Ingestion and connectors is an AI agent skill from the GitHub repository BuilderIO/agent-native. Create, sync, and diagnose Brain sources across all providers (manual, generic, clips, slack, granola, github, zoom, gmail, google_calendar, google_drive) — health states, sync scheduling, and credential resolution. Use when adding a source, running or debugging a sync, or the user asks why a source

How to use this skill

Skill file

Ingestion and Connectors

For Slack-specific rollout steps (channel allow-lists, pilot runs, scope

checklist), read brain-runbook instead — this skill covers the

provider-agnostic source lifecycle.

Source Providers

create-source accepts exactly manual, generic, clips, slack,

granola, github, zoom, gmail, google_calendar, or google_drive (sourceProviderSchema in actions/_schemas.ts), and

rejects anything else. There is no arbitrary/custom

provider string — a generic webhook-fed source uses provider: "generic"

with a sourceKey + minted ingestToken, not a made-up provider id.

pnpm --filter brain action create-source \
  --title "Support call transcripts" \
  --provider generic \
  --sourceKey support-calls \
  --visibility org

create-source returns ingestToken in the response once — it is stored

only as a SHA-256 hash (ingestTokenHash) on the source row, so it cannot be

retrieved again later. Surface it to the user immediately (e.g. for wiring

into an external system's webhook config) rather than assuming you can read

it back with get-source.

Manual sources are push/import-driven and private by default. Use

import-markdown-files for a bounded folder or batch of .md / .markdown

files; it preserves relative paths for deduplication and reports each file's

import or privacy outcome. Files default to document captures; pass

kind: "transcript" when every file in the batch is a meeting transcript.

Passage withholding applies to manual, Zoom, and Granola transcripts only when

the source configuration contains only validated settings, not configured

transcript items or unrecognized fields. Other providers and unsafe or unreadable

configurations use whole-capture screening. Configured items remain in source

config and are visible to source readers; Brain does not remove them. Imported

partial files include a passageQuarantine receipt and withheldPassages count;

disclose incompleteness and never infer omitted text. Use the standard sharing actions to change a source to organization visibility or grant

specific access. Do not use sync-source for a manual source.

Personal Google Sources

Calendar, Gmail and Drive are indexed sources as well as available provider APIs.

Start with list-connection-providers. Reuse a connected workspace OAuth grant

owned by the signed-in user and granted to Brain; pass its workspaceConnectionId

in source config. A shared organization connection owned by someone else is not

a substitute for the user's mailbox/calendar/Drive. Do not request new scopes or

copy tokens into source config.

Create google_calendar, gmail or google_drive sources with private visibility.

Sync/configuration is owner-only. Captures use restricted per-resource owner

audiences, even when a source later has a share; an organization share cannot

broaden a mailbox's evidence. At each scan cycle, old audiences become stale;

only successfully re-read, screened resources regain access. Scope changes,

connection failures and resources that are no longer returned fail closed.

Use configJson for these objects (the outer keys are merged, so preserve a

whole nested google object when editing it):

Imports are bounded. Calendar resumes provider pages; Gmail reads plain-text

message parts and labels snippet-only fallback as incomplete. Drive reads only

the explicitly approved Google Docs, plain-text and Markdown files. It does not

claim full folder crawling, binary file parsing or source-sharing synchronization.

Use the provider API tools for live questions outside these indexed readers.

Failures and remaining pages are reported by sync results; do not call a partial

page an exhaustive import.

Zoom

Zoom sources import cloud-recording transcripts through a Server-to-Server

OAuth app. Credentials are the vault secrets ZOOM_ACCOUNT_ID,

ZOOM_CLIENT_ID, and ZOOM_CLIENT_SECRET; the app needs scopes

cloud_recording:read:list_account_recordings:admin and

cloud_recording:read:recording:admin, plus

cloud_recording:read:list_recording_files:admin for transcript download URLs. Config is

{"zoom":{"meetingIds":[...],"userIds":[...],"lookbackDays":7}}. Without userIds, one

account-wide recording list (/accounts/me/recordings, which needs only the :admin scope) covers every user.

userIds (up to 50, user ID or email) narrows the import to those users and

additionally needs cloud_recording:read:list_user_recordings:admin.

lookbackDays is 1-30, default 7.

meetingIds (required, 1-100) is the allowlist of recurring meeting series

whose owners opted in; spaces are allowed, as Zoom displays them, and every

occurrence of a series keeps its ID. The S2S :admin scopes are account-wide

and Zoom cannot narrow them to a series, so this allowlist is the only

boundary: Brain lists recording metadata, discards every unapproved meeting,

and fetches recording details and transcript files only for approved IDs. A

detail response naming an unapproved

meeting is dropped. With no approved IDs the sync fails before contacting

Zoom. Titles are never matched (any host can reuse one); create/update reject

meetingTopics. An approved personal meeting ID would admit every meeting in

that room, so approve only real recurring series. Keep Zoom's account-wide

auto-recording and AI Companion summary settings off and enable cloud

recording per approved series; Brain ignores unapproved recordings either way.

update-source replaces the whole zoom object, so send every Zoom field you

want to keep, including meetingIds. Changing the allowlist or raising

lookbackDays rewinds the next sync to the lookbackDays window, so newly

approved series are backfilled (raise lookbackDays, up to 30, to reach

further back). Run stats report approvedMeetingSeries,

meetingsSkippedByFilter (a count only; unapproved meetings are not

described), filterChanged, transcriptsWithoutDownloadUrl, and

matchedMeetings (ID, title, start, file types). The account-wide list omits

download URLs, so an approved meeting with a finished transcript is looked up

with /meetings/{uuid}/recordings

(cloud_recording:read:list_recording_files:admin) to get the transcript URL.

Only Brain admins (organization owners and admins) can create a Zoom source or

change a Zoom source's config (including meetingIds, lookbackDays,

userIds, pollMinutes, and autoSync) or cursor; anyone

else gets brain_admin_required (403). Other editors can still change a Zoom

source's title, status, or trusted-answer policy. A sync refuses to run when

the source owner is not a Brain admin, which also covers sources created

before this rule. When a non-admin asks to set up or change Zoom, tell them an

organization owner or admin has to do it.

brain_zoom_audit_events records: Zoom source creation, and edits that add or

remove meetingIds or change lookbackDays or userIds

(actor, series added/removed, settings changed; an edit to only pollMinutes

or autoSync is not recorded); an allow record for each approved meeting whose

recording details or transcripts a sync fetches; a deny record when Zoom's

response names an unapproved

meeting; refused syncs; and sync completion. Meetings the allowlist excludes

are only counted in run stats (meetingsSkippedByFilter), never recorded

individually. It never stores transcript text, and no action reads it yet.

The complete scope set Brain uses is

cloud_recording:read:list_account_recordings:admin,

cloud_recording:read:list_recording_files:admin,

cloud_recording:read:recording:admin, cloud_recording:read:list_user_recordings:admin

(only with userIds). Remove every other scope from the app. Brain does not

import Zoom AI Companion summaries or call Zoom's summary endpoints, so it

needs no meeting:read:* scope; a stored includeSummaries is ignored.

Sources auto-sync hourly; each run overlaps the previous one by one day to

catch late-processed transcripts, and captures dedupe by zoom:<meeting uuid>.

Captures use the organization audience. There are no Zoom webhooks. Only

meetings cloud-recorded with audio transcript on reach Brain; Brain cannot

read local recordings, live captions, or AI Companion transcripts.

For eligible live Zoom sources, a restricted remark does not discard a transcript. Brain withholds the

restricted transcript lines, plus one neighbouring line on each side, and keeps

the rest: deterministic credential lines are dropped directly, and when Jev

rejects the transcript, Brain bisects it with Jev down to the restricted lines.

Each withheld run becomes […]. The remaining transcript must still pass the

normal whole-capture screen, so anything restricted only as a whole meeting (a

sensitive title, a workspace rule, a transcript over Jev's length limit, or a

screen that exceeds its call or time budget) is still quarantined whole.

Eligible partial captures do not store withheld text and drop links to the original.

Existing source configurations and previously stored partial captures are not

rewritten by this change. metadata.zoomPassageQuarantine.withheldPassages (Zoom) or

metadata.passageQuarantine.withheldPassages (other providers, including legacy

receipts) counts the gaps and is

returned as withheldPassages by get-capture, list-captures, and capture

search results (null means the count is unknown, not zero). Disclose that

such captures are incomplete and never reconstruct omitted text. A meeting that

was quarantined whole is re-screened when a sync downloads it again; one outside

the incremental scan window is not recovered automatically.

Blessed FAQ And Docs Publishers

Approved FAQs, docs, handbooks, and similar owned resources use the same

generic signed source contract. They are not a new provider and do not require

Brain to crawl the entire upstream system. The source owner publishes only the

records Brain is allowed to use:

pnpm --filter brain action create-source \
  --title "Blessed Agent-Native docs" \
  --provider generic \
  --sourceKey agent-native-docs \
  --policy '{"trustTier":"blessed","answerEligible":true,"authority":100,"freshnessWindowDays":null,"reviewRequired":false,"conflictBehavior":"prefer-higher-authority"}' \
  --visibility org

The source answer policy is code-enforced:

| Field | Effect |

| --------------------- | ----------------------------------------------------------------------------------- |

| trustTier | blessed, standard, or untrusted; cited answers rank higher trust first. |

| answerEligible | Excludes the source from ask-brain answers when false. |

| authority | Ranks otherwise eligible sources from 0 to 100. |

| freshnessWindowDays | Excludes source-backed results after the configured window; null disables expiry. |

| reviewRequired | Raw captures cannot support ask-brain answers. |

| conflictBehavior | Prefer higher authority, surface conflicts, or require review before raw support. |

Legacy sources remain standard, answer-eligible, authority 50, with no

freshness expiry. Use update-source --policy ... to tighten an existing

source without recreating it.

Source Health States

get-brain-health (readBrainHealth in server/lib/brain-health.ts) is the

single action to check before telling a user "your source is broken" or

"nothing has synced yet." Each source gets one deterministic health value:

| Health | Meaning |

| ------------- | ----------------------------------------------------------------------------------------------------------------- |

| error | Source status === "error", has lastError, or its latest sync run failed. |

| paused | Source status is paused or archived. |

| needs_setup | Slack source with no configured channel allow-list yet (channelIds/channels/allowedChannels all empty). |

| needs_sync | Auto-sync-eligible provider (slack/granola/github/zoom) that has never completed a sync (lastSyncedAt is null). |

| stale | Past its computed nextSyncAt by more than a 15-minute grace window. |

| healthy | None of the above. |

get-brain-health also reports distillationQueue counts (pending,

failed, stale — a processing row untouched for 15+ minutes counts as

stale), proposals.pending, sources.attention (every non-healthy source),

and ordered setup.nextSteps. Read this before diagnosing a "why isn't X in

Brain yet" question — it is cheaper and more reliable than inspecting

individual sources by hand.

Running a Sync

(requires editor access on that source). Slack scans only its allow-listed

channels; Granola polls accessible notes; GitHub imports approved

repository issues/PRs; Zoom imports recording transcripts.

passed. Prefer this for "catch everything up" requests instead of listing

sources and calling sync-source in a loop.

zoom, gmail, google_calendar, and google_drive sources, and only

when the source's own config doesn't explicitly set autoSync: false

(sourceAutoSync in brain-health.ts). manual, generic, and clips

sources are push/import-driven, not polled — there's no nextSyncAt to

wait on for those.

Beyond the Source Actions

Source sync actions are convenience readers, not integration limits. For ad hoc

provider analysis, or a question that needs an endpoint, filter, or payload the

source actions do not model, call provider-api-catalog / provider-api-docs

first, then provider-api-request against the provider's real HTTP API. Use

connectionId for a specific shared grant and accountId for a specific OAuth

account.

Credential Resolution Order

For connector work, use existing workspace integration grants when available;

do not duplicate provider tokens into Brain. Every provider-backed source

resolves its credential in this order (never skip ahead or ask for a duplicate

token if an earlier tier already has one):

  1. Granted workspace_connections / workspace_connection_grants for

appId=brain — a shared credential another app or Dispatch already

connected and granted to Brain.

  1. Backward-compatible Brain-local SQL credentials (legacy, pre-workspace-grant

sources).

  1. Registered vault secrets scoped to the same user/org/workspace.

Brain source credentials do not fall back to raw deploy-level environment

variables — .env/.env.local alone will not satisfy a source's credential

check. list-connection-providers reports per-provider readiness

(connected, granted, needs_grant, not_connected) plus credential

health, so check that before telling a user to paste a new token — if a

provider shows needs_grant, the fix is granting Brain access to the existing

connection, not creating a new one.

Editing And Removing Sources

existing source. From chat, pass config as configJson, a JSON object

encoded as a string (create-source accepts it too); model gateways strip

the keys of the free-form config object. Top-level keys are merged into the

stored config, and a call with no changes is rejected.

exposed as an action; setting status: "paused" via update-source is the

reversible way to stop a source without losing its captures.

accessFilter — sharing/visibility rules apply the same way they do for

knowledge and proposals.

Related Skills

capture exists.

scheduled sync cron wiring, demo/eval seeding, and the generic ingest

webhook payload shape.

and capture reads.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.