Connector Retrieve Contract
Connector-backed retrieve is the L5 lane of Connector Experience v2. It lets Driftless search materialized connector documents, but only after an explicit import/index writes those documents into Driftless-owned storage. This contract exists to prevent the most dangerous shortcut: retrieve must never call a provider live. It reads Topics and Driftless-owned connector documents. It does not read Nango, Broker, Notion, Drive, provider SDKs, or provider APIs during a retrieve request.Non-goals
- No provider live calls from retrieve.
- No automatic Topic creation from connector documents.
- No automatic Collection record creation.
- No writes to external systems.
- No raw provider credentials, connection ids, tokens, or Nango config in output.
- No default behavior that silently mixes external source data into Knowledge.
Source Model
Retrieve has two source families:topics remain the canonical context memory path. Connector documents are
external source data: useful, citeable, freshness-tracked, but not Knowledge.
Connector-backed retrieve may be enabled through an explicit source filter:
sources is omitted, the default remains ["topics"] until the product
explicitly changes the default behind a rollout gate.
Query Contract
Connector retrieve accepts only bounded, workspace-scoped filters:
Provider filters are not authority. The tenant boundary is always
workspace_id, and connector document reads must apply the same access scope that
the import/index path stored on each row.
Result Shape
Every result carries a source discriminator:trust semantics. Connector results
must not reuse reviewed, draft, or note; the only connector trust label is
external.
Ranking
Ranking is blended only after each source produces bounded candidates.- Query each selected source under its own source-specific bounds.
- Score within source using the native indexed fields:
- Topics: existing topic retrieve ranking.
- Connectors: title + materialized
content_textfull-text rank, then freshness and indexed time as tie breakers.
- Merge results with a source-aware bias:
- Topics rank ahead when scores are comparable because they are team memory.
- Connector documents may outrank topics only on strong text relevance.
- Stale connector documents are demoted but may appear if explicitly allowed.
- Return a single bounded result set with source labels and citations.
Freshness
Connector freshness is derived from materialized fields, not provider calls:fresh: active row, recent import/index relative to product threshold, and no known source staleness marker.stale: row is active but source metadata or import state is old.deleted: source disappeared or access was lost; excluded from normal retrieve.error: last import attempted and failed; excluded unless an operator surface asks for diagnostics.
trust:"external".
Citations
Connector citations come fromconnector_documents.citation_id and provenance
columns, not from provider lookups at retrieve time.
Citation requirements:
- stable within a workspace for a given connector document;
- includes provider, display label, source URL when available, external id, and freshness fields;
- never includes provider secrets, connection ids, Nango provider config keys, or raw sync payloads;
- survives re-indexing of the same external object.
Payload Budgets
Connector retrieve must be cheaper than live provider reads:- default
limitshould stay small and share the existing retrieve caps; - snippets are bounded independently from stored
content_text; view:"full"may include a larger bounded excerpt, never arbitrary full provider payload;- output carries
has_more/next_actioninstead of expanding automatically; - deleted/error rows are excluded by default to avoid noisy payloads.
Failure Semantics
Connector-backed retrieve should fail closed and explain the next action:
If
sources:["connectors"] is explicitly requested and connector retrieve cannot
run, the response should be explicit rather than silently returning topics.
Static Guard
The implementation must include a static test proving the retrieve path imports none of:broker.service;nango.service;- provider client modules;
notion-content.service;- any source-controlled Nango function file.
