@collective-intelligence/ai 0.0.0-stage → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +52 -0
- package/README.md +462 -2
- package/dist/api/access-check.d.ts +18 -0
- package/dist/api/answer-sources.d.ts +48 -0
- package/dist/api/attachments-api.d.ts +187 -0
- package/dist/api/catalog-api.d.ts +408 -0
- package/dist/api/chat-api.d.ts +2401 -0
- package/dist/api/chat-surface-api.d.ts +4186 -0
- package/dist/api/compaction.d.ts +52 -0
- package/dist/api/conversations.d.ts +107 -0
- package/dist/api/errors.d.ts +117 -0
- package/dist/api/feedback-api.d.ts +185 -0
- package/dist/api/files.d.ts +22 -0
- package/dist/api/ids.d.ts +33 -0
- package/dist/api/index.d.ts +21 -0
- package/dist/api/intents-api.d.ts +65 -0
- package/dist/api/place-context.d.ts +34 -0
- package/dist/api/projects-api.d.ts +718 -0
- package/dist/api/speech-api.d.ts +345 -0
- package/dist/api/transcript.d.ts +260 -0
- package/dist/api/turns.d.ts +196 -0
- package/dist/api.d.ts +21 -0
- package/dist/api.js +1 -0
- package/dist/domain/access.d.ts +29 -0
- package/dist/domain/context-trail.d.ts +65 -0
- package/dist/domain/data-parts.d.ts +247 -0
- package/dist/domain/errors.d.ts +28 -0
- package/dist/domain/index.d.ts +14 -0
- package/dist/domain/intents.d.ts +101 -0
- package/dist/domain/message.d.ts +173 -0
- package/dist/domain/place.d.ts +17 -0
- package/dist/domain/runtime-value.d.ts +16 -0
- package/dist/domain-50vzrrp9.js +2 -0
- package/dist/domain-5fpd4fte.js +1 -0
- package/dist/domain-9wzbv87n.js +2 -0
- package/dist/domain-g97xs965.js +2 -0
- package/dist/domain-hk3yw2m7.js +1 -0
- package/dist/domain-qyts6dgz.js +0 -0
- package/dist/domain-s07s1ry1.js +2 -0
- package/dist/domain.d.ts +14 -0
- package/dist/domain.js +1 -0
- package/dist/headless/access/access-store.d.ts +28 -0
- package/dist/headless/access/visibility.d.ts +24 -0
- package/dist/headless/blocked-state.d.ts +21 -0
- package/dist/headless/chat-registry.d.ts +63 -0
- package/dist/headless/chat-session-provider.d.ts +109 -0
- package/dist/headless/chat-surface.d.ts +4210 -0
- package/dist/headless/host-ports.d.ts +146 -0
- package/dist/headless/index.d.ts +33 -0
- package/dist/headless/intents/card-ends.d.ts +22 -0
- package/dist/headless/intents/intent-call.d.ts +28 -0
- package/dist/headless/intents/intents-provider.d.ts +108 -0
- package/dist/headless/intents/page-registry.d.ts +129 -0
- package/dist/headless/intents/use-intent-dispatch.d.ts +60 -0
- package/dist/headless/intents/use-intents.d.ts +11 -0
- package/dist/headless/intents/use-returned-intent-handle.d.ts +11 -0
- package/dist/headless/launch/chat-launch.d.ts +42 -0
- package/dist/headless/launch/launch-target.d.ts +25 -0
- package/dist/headless/launch/submit.d.ts +29 -0
- package/dist/headless/run-state.d.ts +16 -0
- package/dist/headless/sent-files.d.ts +20 -0
- package/dist/headless/server-started-turn-follow.proof.d.ts +26 -0
- package/dist/headless/session-machine.d.ts +745 -0
- package/dist/headless/trail/buffer.d.ts +48 -0
- package/dist/headless/trail/json-ld.d.ts +10 -0
- package/dist/headless/trail/switches.d.ts +10 -0
- package/dist/headless/trail/trail-provider.d.ts +53 -0
- package/dist/headless/transcript-messages.d.ts +26 -0
- package/dist/headless.d.ts +33 -0
- package/dist/headless.js +2 -0
- package/dist/transport/chat-client.d.ts +25 -0
- package/dist/transport/chat-transport.d.ts +57 -0
- package/dist/transport/index.d.ts +6 -0
- package/dist/transport/simulated-chat-transport.d.ts +39 -0
- package/dist/transport.d.ts +6 -0
- package/dist/transport.js +1 -0
- package/dist/views/assistant-sidebar/assistant-sidebar.d.ts +15 -0
- package/dist/views/assistant-sidebar/layout.d.ts +47 -0
- package/dist/views/assistant-sidebar/toggle.d.ts +14 -0
- package/dist/views/assistant-sidebar/use-shortcut.d.ts +11 -0
- package/dist/views/blocked/chat-blocked-state.d.ts +15 -0
- package/dist/views/chat-operations.d.ts +46 -0
- package/dist/views/chat-root.d.ts +14 -0
- package/dist/views/chat.d.ts +51 -0
- package/dist/views/composer/capability-picker.d.ts +77 -0
- package/dist/views/composer/capability-pickers.d.ts +24 -0
- package/dist/views/composer/chat-composer.d.ts +15 -0
- package/dist/views/composer/composer-picks.d.ts +31 -0
- package/dist/views/composer/composer-trail.d.ts +21 -0
- package/dist/views/composer/draft-attachments.d.ts +36 -0
- package/dist/views/composer/queued-messages.d.ts +9 -0
- package/dist/views/composer/send-menu.d.ts +11 -0
- package/dist/views/composer/slash-suggestions.d.ts +37 -0
- package/dist/views/composer/trail-chips.d.ts +15 -0
- package/dist/views/composer/voice-input/microphone.d.ts +14 -0
- package/dist/views/composer/voice-input/remote-transcription.d.ts +12 -0
- package/dist/views/composer/voice-input/use-voice-input.d.ts +30 -0
- package/dist/views/composer/voice-input/voice-input.d.ts +15 -0
- package/dist/views/dock/chat-dock.d.ts +57 -0
- package/dist/views/dock/dock-session.d.ts +22 -0
- package/dist/views/header/chat-header.d.ts +10 -0
- package/dist/views/header/compaction-controls.d.ts +17 -0
- package/dist/views/header/memory-switch.d.ts +16 -0
- package/dist/views/index.d.ts +58 -0
- package/dist/views/intents/form-fields.d.ts +38 -0
- package/dist/views/intents/intent-card.d.ts +61 -0
- package/dist/views/intents/intent-form.d.ts +23 -0
- package/dist/views/intents/intent-notices.d.ts +39 -0
- package/dist/views/intents/intent-trigger.d.ts +46 -0
- package/dist/views/intents/labels.d.ts +23 -0
- package/dist/views/labels/en.d.ts +3 -0
- package/dist/views/labels/index.d.ts +13 -0
- package/dist/views/labels/it.d.ts +3 -0
- package/dist/views/labels/types.d.ts +7 -0
- package/dist/views/launch/chat-launch-button.d.ts +21 -0
- package/dist/views/parts/answer-feedback.d.ts +26 -0
- package/dist/views/parts/evidence-part.d.ts +8 -0
- package/dist/views/parts/file-part.d.ts +8 -0
- package/dist/views/parts/image-generation-part.d.ts +9 -0
- package/dist/views/parts/image-generation.d.ts +84 -0
- package/dist/views/parts/intent-card-part.d.ts +8 -0
- package/dist/views/parts/memory-evidence-part.d.ts +7 -0
- package/dist/views/parts/message-parts.d.ts +21 -0
- package/dist/views/parts/question-part.d.ts +8 -0
- package/dist/views/parts/read-aloud.d.ts +23 -0
- package/dist/views/parts/reasoning-part.d.ts +8 -0
- package/dist/views/parts/steering-message-part.d.ts +7 -0
- package/dist/views/parts/text-part.d.ts +4 -0
- package/dist/views/parts/tool-part.d.ts +11 -0
- package/dist/views/parts/types.d.ts +103 -0
- package/dist/views/parts/use-read-aloud.d.ts +13 -0
- package/dist/views/run-trace/message-run.d.ts +17 -0
- package/dist/views/run-trace/run-stream.d.ts +128 -0
- package/dist/views/run-trace/run-trace-parts.d.ts +26 -0
- package/dist/views/run-trace/run-trace.d.ts +31 -0
- package/dist/views/sidebar/conversation-dialogs.d.ts +38 -0
- package/dist/views/sidebar/conversation-row.d.ts +23 -0
- package/dist/views/sidebar/conversation-sidebar.d.ts +10 -0
- package/dist/views/sidebar/date-groups.d.ts +12 -0
- package/dist/views/sidebar/history-filter.d.ts +57 -0
- package/dist/views/sidebar/projects/project-dialogs.d.ts +40 -0
- package/dist/views/sidebar/projects/project-files.d.ts +16 -0
- package/dist/views/sidebar/projects/project-groups.d.ts +19 -0
- package/dist/views/sidebar/projects/project-view.d.ts +21 -0
- package/dist/views/sidebar/projects/projects-section.d.ts +21 -0
- package/dist/views/sidebar/projects/use-chat-projects.d.ts +32 -0
- package/dist/views/slots.d.ts +148 -0
- package/dist/views/transcript/chat-transcript.d.ts +13 -0
- package/dist/views/transcript/sent-trail.d.ts +13 -0
- package/dist/views/transcript/use-image-reload.d.ts +16 -0
- package/dist/views.d.ts +58 -0
- package/dist/views.js +3 -0
- package/docs/guide/ai/index.md +377 -0
- package/docs/guide/ai/studio.md +245 -0
- package/docs/guide/data/connectors.md +267 -0
- package/docs/guide/data/datasets.md +145 -0
- package/docs/guide/data/documents.md +235 -0
- package/docs/guide/data/index.md +62 -0
- package/docs/guide/data/knowledge.md +214 -0
- package/docs/guide/develop/extensions.md +299 -0
- package/docs/guide/develop/external-apps.md +279 -0
- package/docs/guide/develop/infrastructure.md +135 -0
- package/docs/guide/develop/sdks.md +233 -0
- package/docs/guide/index.md +83 -0
- package/docs/guide/platform/access.md +311 -0
- package/docs/guide/platform/architecture.md +166 -0
- package/docs/guide/platform/built-ins.md +225 -0
- package/docs/guide/platform/entrypoints.md +318 -0
- package/docs/guide/scenarios/index.md +130 -0
- package/docs/guide/template/index.md +295 -0
- package/docs/guide/template/state-machines.md +294 -0
- package/package.json +123 -4
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
# Connectors
|
|
2
|
+
|
|
3
|
+
Connect outside systems, map their fields to Knowledge schemas, and run and watch imports.
|
|
4
|
+
|
|
5
|
+
A connector keeps a Data resource in sync with an outside system. CI has two kinds. A Knowledge connector imports records from a source such as Notion, HubSpot or a SQL database into Knowledge records. A Documents connector imports files from Microsoft 365 or Google Drive into one Connected Collection of Documents. The [Data resources](index.md) overview compares Knowledge, Datasets and Documents, and the [Documents](documents.md) page covers Document Collections. The [Built-in catalog](../platform/built-ins.md) lists every connector and connection type that CI ships.
|
|
6
|
+
|
|
7
|
+
A Knowledge import passes through several stages: CI reads the source page by page, stages the records, commits the accepted ones into Knowledge, and then indexes them for search. An app or agent that reads imported data has to wait for the stage it needs. Most of this page covers Knowledge connectors. The last section compares them with Documents connectors.
|
|
8
|
+
|
|
9
|
+
## Connections, templates and instances
|
|
10
|
+
|
|
11
|
+
Three objects work together, and a package usually declares two of them.
|
|
12
|
+
|
|
13
|
+
A connection holds credentials. A connection template, such as `builtin.integrations.notion.connections.internal-integration-token`, defines the credential form and a test, and an Organization connection holds the actual credentials. Connectors, tools and Dataset providers each point at a connection through a slot, so one connection can serve all of them.
|
|
14
|
+
|
|
15
|
+
A connector template is the import capability that a package ships, for example the "Notion API" connector `builtin.integrations.notion.connectors.api`. A connector instance is one configured use of that template in an Organization, with its settings, connection slots, entity bindings, pipelines, schedules and run state. Notion, for example, allows several instances in one Organization.
|
|
16
|
+
|
|
17
|
+
```mermaid
|
|
18
|
+
flowchart LR
|
|
19
|
+
CT[Connection template] --> OC[Organization connection with credentials]
|
|
20
|
+
KT[Connector template] --> CI[Connector instance]
|
|
21
|
+
CI -- slot --> OC
|
|
22
|
+
CI -- entity bindings --> KS[Knowledge schemas]
|
|
23
|
+
CI -- pipelines --> SC[Schedules: full or delta]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Credentials
|
|
27
|
+
|
|
28
|
+
A package declares a connection with `declareConnectionInstance`. The secret comes from a package variable, so the release itself never contains it:
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
const variables = { notionToken: { type: "secret" } } as const
|
|
32
|
+
const vars = packageVariables(variables)
|
|
33
|
+
|
|
34
|
+
const notionConnection = declareConnectionInstance({
|
|
35
|
+
manifest: { fqn: "acme.connections.notion", version: "1.0.0" },
|
|
36
|
+
presentation: { displayName: "Company Notion" },
|
|
37
|
+
definition: {
|
|
38
|
+
templateFqn:
|
|
39
|
+
"builtin.integrations.notion.connections.internal-integration-token",
|
|
40
|
+
lifecycle: { deployMode: "upsert", readonly: false },
|
|
41
|
+
credentials: { integrationToken: vars.notionToken }
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
At deploy time, the Inputs File links the variable to an Organization secret:
|
|
47
|
+
|
|
48
|
+
```json
|
|
49
|
+
{
|
|
50
|
+
"variables": {
|
|
51
|
+
"notionToken": { "link": "NOTION_INTEGRATION_TOKEN" }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`ci deploy --inputs-template` prints every connection slot and variable that the Inputs File must fill. CI stores the link itself as the credential, so a later rotation of the secret reaches the connection. When the linked secret does not exist yet, CI creates it as pending, and the connection makes no provider calls until someone fills in the value. A field that the template declares as secret stays secret even when the setup marks it otherwise.
|
|
57
|
+
|
|
58
|
+
## Declare a connector instance
|
|
59
|
+
|
|
60
|
+
`declareKnowledgeConnectorInstance` names the template, fills its connection slots, binds remote collections to Knowledge schemas and sets the import pipelines. Each connection slot takes exactly one of `{ setupKey }` or `{ connectionInstanceFqn }`. The Inputs File fills a `setupKey` slot at install with an existing connection or a new one. A `connectionInstanceFqn` points at a connection that the package declares. The package must also list the integration, such as `{ fqn: "builtin.integrations.notion" }`, in its `dependencies`.
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
const customers = declareKnowledgeConnectorInstance({
|
|
64
|
+
manifest: { fqn: "com.acme.sales.instances.customers", version: "1.0.0" },
|
|
65
|
+
presentation: { displayName: "CRM customers" },
|
|
66
|
+
definition: {
|
|
67
|
+
templateFqn: "com.acme.integrations.crm",
|
|
68
|
+
lifecycle: { deployMode: "upsert", readonly: false },
|
|
69
|
+
enabled: true,
|
|
70
|
+
connections: { crm: { setupKey: "crm" } },
|
|
71
|
+
entityBindings: [
|
|
72
|
+
{
|
|
73
|
+
key: "customers",
|
|
74
|
+
schemaFqn: "com.acme.sales.customer",
|
|
75
|
+
bindingMode: "managed",
|
|
76
|
+
remoteCollectionId: "customers",
|
|
77
|
+
fieldMap: [
|
|
78
|
+
{
|
|
79
|
+
op: "path",
|
|
80
|
+
remote: "name",
|
|
81
|
+
local: "name",
|
|
82
|
+
direction: "inbound",
|
|
83
|
+
skipIfNull: false
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
],
|
|
88
|
+
pipelines: [
|
|
89
|
+
{
|
|
90
|
+
key: "nightly",
|
|
91
|
+
definition: {
|
|
92
|
+
steps: [{ tasks: [{ kind: "entity", bindingKey: "customers" }] }]
|
|
93
|
+
},
|
|
94
|
+
schedules: [
|
|
95
|
+
{
|
|
96
|
+
key: "nightly_delta",
|
|
97
|
+
cronExpression: "0 2 * * *",
|
|
98
|
+
timezone: "Europe/Rome",
|
|
99
|
+
importMode: "delta",
|
|
100
|
+
enabled: true
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
> **Warning:** Deploying a package that declares a connector instance creates no records and
|
|
110
|
+
> starts no import. Data arrives only when a schedule fires or someone starts
|
|
111
|
+
> the pipeline by hand, so plan for that step before you open the demo.
|
|
112
|
+
|
|
113
|
+
A redeploy follows the `lifecycle` of the instance. `init_only` keeps the existing configuration. `upsert` merges the new declaration, the previous declaration and the live configuration, so a manual edit to an unrelated field survives, and CI refuses changes that compete for the same field. Imported records, run history and cursors are runtime state, and a redeploy never resets them. When you remove a binding from the declaration, CI archives it; when you remove a pipeline, CI disables it. Imported records stay in both cases.
|
|
114
|
+
|
|
115
|
+
## Discovery and field mapping
|
|
116
|
+
|
|
117
|
+
During setup, a connector reports the remote collections and fields it finds, each with a type hint such as `{ kind: "datetime" }`. Knowledge setup uses the hint to choose a local field type. Notion dates, for example, arrive as `datetime` because a Notion date can carry a time.
|
|
118
|
+
|
|
119
|
+
Running setup again does not repair a field that already exists. Setup skips remote models that are already bound, and an existing field keeps its type. To change a `date` field to `datetime` later, update both the schema property and the field definition.
|
|
120
|
+
|
|
121
|
+
A binding's `fieldMap` lists the rules that copy remote values into local fields.
|
|
122
|
+
|
|
123
|
+
| Rule | What it does |
|
|
124
|
+
| ----------- | -------------------------------------------------------------------------------------------------------------- |
|
|
125
|
+
| `path` | Copies one remote value into a local field |
|
|
126
|
+
| `reference` | Stores remote IDs as relation field references to records of another binding of the same connector instance |
|
|
127
|
+
| `embedded` | Maps a nested remote object into a record of another binding, creates that record when needed, and links to it |
|
|
128
|
+
|
|
129
|
+
The `remote` value is a dot path with at most one `[]` segment, which takes every item of an array. This `reference` rule fills a `companies` relation field from HubSpot-style associations:
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
{
|
|
133
|
+
op: "reference",
|
|
134
|
+
local: "companies",
|
|
135
|
+
remote: "associations.companies.results[].id",
|
|
136
|
+
direction: "inbound",
|
|
137
|
+
skipIfNull: true,
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
The records that a Knowledge connector writes and keeps in sync are connected records. Each import brings the source changes into them, and the [Deletions](#deletions) section explains when a connected record leaves CI because its source item is gone.
|
|
142
|
+
|
|
143
|
+
## Imports
|
|
144
|
+
|
|
145
|
+
```mermaid
|
|
146
|
+
flowchart LR
|
|
147
|
+
T[Schedule or manual start] --> P[Pull source pages]
|
|
148
|
+
P --> S[Staged records]
|
|
149
|
+
S --> C[Commit into Knowledge]
|
|
150
|
+
C --> I[Embedding and indexing]
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
A FULL import lists everything in the source. A DELTA import reads only what changed since the Delta Since time, which is the start of the binding's last successful phase minus the connector's overlap. A failed phase does not move Delta Since. The overlap (`deltaOverlapSeconds`, 300 seconds by default and 120 for Notion) reads the edge of the window again to catch late changes. The Notion connector recommends a delta schedule every five minutes. A SQL connector reads only changed rows when you choose a watermark column for the binding: a date, timestamp or integer column that records when a row changed. Without one, a delta import still runs, but it reads every row, adds a warning to the run, and removes nothing.
|
|
154
|
+
|
|
155
|
+
The import writes staged records first and then commits the accepted records into Knowledge. Treat an import as finished only when CI has committed the staged records and the indexing work that follows. Before each remote page, the import saves its cursor and counters. When a worker stops in the middle of a call, the next attempt repeats at most that one page, and repeating a page is safe because page commits are idempotent. Full imports resume from their cursor as well, so a restart does not scan the whole source again.
|
|
156
|
+
|
|
157
|
+
When a source value does not fit the schema field type, for example a Notion date with a time going into a `date` field, the batch fails with a non-retryable `entity_data` error that names the record. The run stays failed until you fix the data or the field type.
|
|
158
|
+
|
|
159
|
+
## Deletions
|
|
160
|
+
|
|
161
|
+
When an item is deleted at the source, the connector decides when its connected record leaves CI. Each Knowledge connector template declares one of two deletion capabilities:
|
|
162
|
+
|
|
163
|
+
- `full`: a full run removes the records whose items are missing from a complete listing of the source, and a delta run removes nothing. A template that declares no capability has this one.
|
|
164
|
+
- `full_and_delta`: a full run removes records in the same way, and a delta run also removes the records that the source reports as deleted in its change feed.
|
|
165
|
+
|
|
166
|
+
A listing page that cannot prove the listing complete removes nothing. When a connector can read a single item, CI also asks the source to confirm that the item is gone before it removes the record.
|
|
167
|
+
|
|
168
|
+
| Knowledge connector | Sync modes | What a delta run reads | Removes on full runs | Removes on delta runs |
|
|
169
|
+
| -------------------------------------- | -------------------------- | ------------------------------------------------------------------ | -------------------- | --------------------- |
|
|
170
|
+
| Notion | Full, delta | Pages edited since the last successful run | Yes | No |
|
|
171
|
+
| HubSpot | Full, delta | Records modified since the last successful run | Yes | No |
|
|
172
|
+
| Monday | Full; delta for items only | Items updated since the last successful run | Yes | No |
|
|
173
|
+
| SQL (PostgreSQL, MySQL) | Full, delta | Rows past the watermark column, or every row without one | Yes | No |
|
|
174
|
+
| Structured File | Full, delta | Nothing when the file is unchanged, the whole file when it changed | Yes | No |
|
|
175
|
+
| External application Knowledge gateway | Full, delta | The change feed that the external application exposes for the data | Yes | Yes |
|
|
176
|
+
|
|
177
|
+
The external application Knowledge gateway is the connector for a customer's own system. Its full run lists every item that the external application exposes, and its delta run reads the application's change feed, where a deleted item removes the record during that run. The application implements both for each Knowledge resource that it shares through its Gateway. The [External apps](../develop/external-apps.md) page explains Gateways.
|
|
178
|
+
|
|
179
|
+
Each entity binding can also limit deletions. `remoteDeletionPropagation` takes `never`, `full` or `full_and_delta`. When you leave it out, the binding follows the connector capability, and CI refuses a value above the capability. `maxRemoteDeletionsPerRun` is the deletion brake for full runs: when a full run finds more records to remove than the limit, it removes none of them and reports that the brake tripped. The brake does not apply to delta runs. A delta run on the external application Knowledge gateway removes every deletion that its change feed reports, however many there are.
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
{
|
|
183
|
+
key: "customers",
|
|
184
|
+
schemaFqn: "com.acme.sales.customer",
|
|
185
|
+
bindingMode: "managed",
|
|
186
|
+
remoteCollectionId: "customers",
|
|
187
|
+
remoteDeletionPropagation: "full",
|
|
188
|
+
maxRemoteDeletionsPerRun: 50,
|
|
189
|
+
fieldMap: [/* ... */],
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
In the Dashboard, the binding shows the same setting under **Fields map**, **Settings**, **Remote deletions**, and it offers only the values that the connector allows. The brake has no Dashboard field. The run detail shows, for each binding, how many records the run removed or why it removed none.
|
|
194
|
+
|
|
195
|
+
> **Warning:** Set `maxRemoteDeletionsPerRun` before the first full run on customer data. If
|
|
196
|
+
> a listing then misses many items by mistake, the run removes nothing and the
|
|
197
|
+
> run detail shows that the brake tripped.
|
|
198
|
+
|
|
199
|
+
For a Notion demo, a page deleted in Notion stays in CI through the delta runs and leaves on the next full run. The next section explains how to schedule that full run.
|
|
200
|
+
|
|
201
|
+
## Choose a sync schedule
|
|
202
|
+
|
|
203
|
+
Start from how old the data in the demo may be. For a Knowledge connector, a change at the source reaches CI within one delta interval plus the run time. A deletion at the source reaches CI within one full-run interval plus the run time, unless the connector removes records on delta runs. Choose the delta schedule from the first figure and the full schedule from the second.
|
|
204
|
+
|
|
205
|
+
Some connectors recommend schedules. The Dashboard Knowledge setup suggests them when it creates bindings. A package does not receive them, so it declares its own `schedules` on each pipeline.
|
|
206
|
+
|
|
207
|
+
| Connector | Recommended schedules |
|
|
208
|
+
| --------------------------------------- | ----------------------------------------------------------------------- |
|
|
209
|
+
| Notion | Delta every 5 minutes (`*/5 * * * *`) |
|
|
210
|
+
| HubSpot | Delta every 15 minutes (`*/15 * * * *`), full every night (`0 3 * * *`) |
|
|
211
|
+
| Monday | Delta every 15 minutes (`*/15 * * * *`), full every night (`0 3 * * *`) |
|
|
212
|
+
| SQL, Structured File, Knowledge gateway | None |
|
|
213
|
+
|
|
214
|
+
HubSpot and Monday pair frequent delta runs with a nightly full run because their delta runs cannot see deletions. Notion recommends only the delta schedule, and a Notion delta run removes nothing either. Add a periodic full schedule to every Notion pipeline so that pages deleted in Notion leave CI, and set its frequency from how long a deleted page may stay visible in the demo.
|
|
215
|
+
|
|
216
|
+
For SQL, choose a watermark column before you schedule delta runs. Without one, a delta run reads as much as a full run and removes nothing, so schedule full runs instead. A Structured File delta run costs little when the file has not changed, because CI compares the file version or its content first, but deletions still need a full run. The Knowledge gateway removes records on delta runs, so frequent delta runs keep both changes and deletions current. Keep an occasional full run for the gateway as well: when the application rejects the stored feed position, CI reads the feed again from the start, and that first delta run removes nothing.
|
|
217
|
+
|
|
218
|
+
Every run calls the source, and a full run reads every record again. HubSpot and Monday stop a run when the account reaches its daily API limit, so frequent full runs can use up the quota that the delta runs need. CI retries the shorter rate limits of all three sources.
|
|
219
|
+
|
|
220
|
+
By default, CI checks for due schedules once a minute, so a schedule shorter than one minute gains nothing. A connector instance has one scheduled run at a time. When a schedule comes due during another run of the same instance, it starts after that run ends, and missed times do not pile up. A long full run therefore delays the delta runs of every pipeline in the instance, so schedule full runs at a quiet hour. Each delta run also reads again the overlap window before its start time, 120 seconds for Notion and Monday and 300 seconds for HubSpot and by default.
|
|
221
|
+
|
|
222
|
+
Indexing and embeddings run after the commit, so search finds new records a little after the run ends. When a run removes a record, the record leaves CI at the commit, and the search index follows.
|
|
223
|
+
|
|
224
|
+
A Documents connector has no schedule to choose. CI checks every minute and starts the sync of a Connected Collection five minutes after its last attempt finished, failed attempts included. You can turn scheduled sync off for a collection, or start a sync by hand, which skips the wait. Each sync applies the deletions that the provider reports.
|
|
225
|
+
|
|
226
|
+
## Health
|
|
227
|
+
|
|
228
|
+
Health belongs to the Organization connection, and CI copies it onto each connector that uses that connection. A failed connection test marks the connection `unhealthy` and records the error. In Knowledge setup, **Refresh data sources** runs the connection refresh again before it updates the connector.
|
|
229
|
+
|
|
230
|
+
An operator follows an import in several places: the connection test result, the readiness of each binding, the status of each pipeline run, the counts of staged records, and the embedding work that follows the commit.
|
|
231
|
+
|
|
232
|
+
## Built-in integrations
|
|
233
|
+
|
|
234
|
+
The platform ships these integrations. Some import data, and others add only connections, tools and workflow nodes.
|
|
235
|
+
|
|
236
|
+
| Role | Integrations |
|
|
237
|
+
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
238
|
+
| Knowledge connectors | Notion, HubSpot, Monday, SQL (PostgreSQL and MySQL), Structured File (with an FTP source), the external application Knowledge gateway |
|
|
239
|
+
| Documents connectors | Microsoft 365 Drive, Google Drive |
|
|
240
|
+
| Dataset providers | Microsoft Fabric, Databricks |
|
|
241
|
+
| Connections, tools and actions only | Apollo, Lusha, Slack, Telegram, Twilio, WhatsApp |
|
|
242
|
+
|
|
243
|
+
Lusha shows the difference. It has an API key connection and prospecting tools and workflow actions, and it imports nothing. Use it to enrich a Lead from a button, and use a connector such as HubSpot to sync a CRM. The [Datasets](datasets.md) page covers Fabric and Databricks.
|
|
244
|
+
|
|
245
|
+
## Knowledge sync and Documents sync
|
|
246
|
+
|
|
247
|
+
Knowledge connectors and Documents connectors have different owners and different rules. A Documents connector never creates Knowledge records, and it does not use the Knowledge import stages or the Knowledge deletion capabilities.
|
|
248
|
+
|
|
249
|
+
| | Knowledge connector | Documents connector |
|
|
250
|
+
| ------------------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------- |
|
|
251
|
+
| Writes | Connected records in bound Knowledge schemas | Files and versions in one Connected Collection |
|
|
252
|
+
| Configured by | A connector instance with entity bindings and pipelines | One Documents connector instance per Connected Collection |
|
|
253
|
+
| Schedule | Cron schedules per pipeline, FULL or DELTA | CI checks every minute and starts a sync five minutes after the last attempt finished |
|
|
254
|
+
| Deletions | Depend on the connector capability, as in the table above | Every sync applies the deletions that the provider reports |
|
|
255
|
+
| Package declaration | `declareKnowledgeConnectorInstance` | `declareDocumentCollection` with a connection slot and remote folders |
|
|
256
|
+
| Folder exclusions | Not applied | Excluded Folder Names skip whole folders |
|
|
257
|
+
|
|
258
|
+
A Documents sync moves its provider checkpoint forward only after it applies the changes. Two Connected Collections on the same provider account cannot overlap their root folders. A finished Documents sync still has to index the files before search finds them, as the [Documents](documents.md) and [Knowledge](knowledge.md) pages explain.
|
|
259
|
+
|
|
260
|
+
## Related pages
|
|
261
|
+
|
|
262
|
+
- [Data resources](index.md)
|
|
263
|
+
- [Knowledge](knowledge.md)
|
|
264
|
+
- [Documents](documents.md)
|
|
265
|
+
- [Datasets](datasets.md)
|
|
266
|
+
- [Extensions](../develop/extensions.md)
|
|
267
|
+
- [Access](../platform/access.md)
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Datasets
|
|
2
|
+
|
|
3
|
+
Query typed tables of measurements, events and warehouse data, and control who can read them.
|
|
4
|
+
|
|
5
|
+
A Dataset is a typed collection of rows that belongs to an Organization. Each Dataset has a stable identity, a versioned definition, a policy that says who may query it, and provenance on every result. Datasets hold data that has many rows and few edits, such as meter readings, monthly sales figures or a table in a customer's data warehouse. Agents, workflows and Studio query that data in bounded, typed requests.
|
|
6
|
+
|
|
7
|
+
## Datasets and Knowledge
|
|
8
|
+
|
|
9
|
+
A Dataset holds observations about the things that Knowledge records describe, with one row per measurement, event or transaction. The [Data resources](index.md) page compares Datasets with Knowledge and Documents and lists which kind fits which demo situation.
|
|
10
|
+
|
|
11
|
+
A strategy Metric shows the split. The Metric itself is a Knowledge record with an owner, a target, a unit, a status and links to goals, and its history of measured values is a Dataset. A Dataset field such as `customerId` can bind to the Customer schema in Knowledge. That binding links the two without copying rows into Knowledge, and deleting one side does not delete the other.
|
|
12
|
+
|
|
13
|
+
```mermaid
|
|
14
|
+
flowchart LR
|
|
15
|
+
subgraph K[Knowledge]
|
|
16
|
+
KS[Customer schema]
|
|
17
|
+
end
|
|
18
|
+
subgraph D[Datasets]
|
|
19
|
+
DS[Orders Dataset]
|
|
20
|
+
end
|
|
21
|
+
K --- KC[Records, relation fields, semantic search]
|
|
22
|
+
D --- DC[Typed rows, measures, aggregates, time buckets]
|
|
23
|
+
DS -. optional binding on customerId .-> KS
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Managed and External Datasets
|
|
27
|
+
|
|
28
|
+
A Dataset has one of two backings. CI stores the rows of a Managed Dataset in PostgreSQL, in the Organization Dataset Store. The rows of an External Dataset stay in the customer's system, and CI queries them live. Both backings use the same query contract, so tools, workflows and Studio do not need to know which one they read. The backing shows only in the provenance, the capabilities and the freshness of a result.
|
|
29
|
+
|
|
30
|
+
CI keeps no hidden copy of External data. Every query reaches the provider and CI caches no results, so when the provider is down the query fails with no fallback.
|
|
31
|
+
|
|
32
|
+
| Provider | Backing | Source |
|
|
33
|
+
| ----------------------------------------------------------------------- | -------- | ---------------------------------------------------------- |
|
|
34
|
+
| `builtin.core.datasets.providers.postgres` | Managed | Rows stored in CI |
|
|
35
|
+
| Microsoft Fabric (package `builtin.integrations.microsoft-fabric`) | External | Fabric Warehouses and Lakehouse SQL analytics endpoints |
|
|
36
|
+
| Databricks (package `builtin.integrations.databricks`) | External | Unity Catalog tables and views through one SQL Warehouse |
|
|
37
|
+
| Remote Gateway (`builtin.core.external-apps.providers.remote-external`) | External | A customer server that exposes rows through the server SDK |
|
|
38
|
+
|
|
39
|
+
The Fabric and Databricks packages do not install automatically, so install the package before you declare a Dataset that uses it. A Fabric connection holds one service principal from the customer's Microsoft Entra tenant, with a tenant ID, a client ID and a client secret or certificate. A Databricks connection uses service principal OAuth and rejects personal access tokens. A Fabric source location has exactly three parts: workspace, item and object. To combine several sources, combine them in the customer's warehouse and point the Dataset at the result. New Lakehouse tables can take a few minutes to appear on the Fabric SQL analytics endpoint, so refresh the metadata in Fabric if a new table is missing.
|
|
40
|
+
|
|
41
|
+
A Remote Gateway Dataset answers `records` queries only, with at most 1,000 rows, 1 MiB and 60 seconds per request. CI checks the Dataset policy first, and the customer server can narrow the result further but cannot widen it.
|
|
42
|
+
|
|
43
|
+
## Load a Managed Dataset
|
|
44
|
+
|
|
45
|
+
In the Dashboard you create a Dataset in one of two ways: import a structured file as a Managed Dataset, or connect a compatible External source. A Managed import accepts CSV, Excel `.xlsx`, JSON arrays of records, JSON Lines and Parquet. CI inspects the file and proposes field types, identity fields and candidate time fields, and a person reviews and approves the proposal before CI loads any rows. There is no spreadsheet-style row editor.
|
|
46
|
+
|
|
47
|
+
Ingestion runs in the background. The API answers `202 Accepted` with a run ID, and you follow the run until it finishes. Each run uses one mode: `append` adds rows, `upsert` inserts or updates rows by their identity fields, and `replace` swaps all visible rows in one step. If an `upsert` run contains the same identity twice, CI rejects the run and does not pick one row for you.
|
|
48
|
+
|
|
49
|
+
The table template of the Dataset decides which modes it allows.
|
|
50
|
+
|
|
51
|
+
| Template | Purpose | Modes |
|
|
52
|
+
| ----------------- | -------------------------------- | ----------------------------- |
|
|
53
|
+
| `generic-table` | General typed records | `append`, `upsert`, `replace` |
|
|
54
|
+
| `entity-snapshot` | Current state keyed by entity | `upsert`, `replace` |
|
|
55
|
+
| `time-series` | Time-indexed measures | `append` |
|
|
56
|
+
| `event-log` | Append-only events | `append` |
|
|
57
|
+
| `fact-table` | Dimensions, measures and periods | `append`, `upsert` |
|
|
58
|
+
| `status-update` | Append-only status history | `append` |
|
|
59
|
+
|
|
60
|
+
## Query a Dataset
|
|
61
|
+
|
|
62
|
+
A Dataset query has one of three kinds. `records` returns selected rows with filters, sort and pagination. `aggregate` groups measures by dimensions with `count`, `countDistinct`, `sum`, `average`, `minimum` and `maximum`. `timeSeries` buckets measures over a time field, with a grain from `minute` to `year`.
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
type RecordsQuery = Readonly<{
|
|
66
|
+
kind: "records"
|
|
67
|
+
datasetId: string
|
|
68
|
+
definitionRevision?: string
|
|
69
|
+
select: readonly string[]
|
|
70
|
+
filters?: DatasetFilter
|
|
71
|
+
sort?: readonly DatasetSort[]
|
|
72
|
+
page: DatasetPageRequest
|
|
73
|
+
}>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
A Managed `records` query returns at most 50 fields, 100 rows and 1 MiB per response. Filters are combined with AND and use `eq`, `ne`, `lt`, `lte`, `gt`, `gte`, `contains` and `isNull`. CI returns 64-bit integers and decimals as exact JSON strings, so parse them before you do arithmetic.
|
|
77
|
+
|
|
78
|
+
Datasets accept no SQL. Calculated measures use a constrained expression model, and an operation that the provider cannot run fails with a typed capability error. CI never loads a whole table to compute a result in memory.
|
|
79
|
+
|
|
80
|
+
> **Note:** The External providers that ship today answer `records` and `aggregate`, and
|
|
81
|
+
> the Remote Gateway answers `records` only. Use a Managed Dataset when the demo
|
|
82
|
+
> needs `timeSeries`.
|
|
83
|
+
|
|
84
|
+
Every result carries its provenance: the Dataset ID, the definition revision, the query kind, the backing, the freshness when the provider knows it, a correlation ID, the timing, and warnings for partial or stale results. Provenance never contains credentials or physical table names.
|
|
85
|
+
|
|
86
|
+
## Access
|
|
87
|
+
|
|
88
|
+
Each Dataset has its own policy, and the policy lists its principals by ID. It holds `principals` (each a `user` or `service` with an `id`), `allowedOperations` (`describe`, `records`, `aggregate`, `time_series`), `allowedFields`, `sensitiveFields`, an optional `rowFilter`, and the limits `maxRows`, `maxBytes` and `maxTimeoutMs`. A user also needs the Organization permission to query Datasets, and a Dataset grant does not give Organization membership or capabilities.
|
|
89
|
+
|
|
90
|
+
Knowledge access works differently: each Knowledge Data Policy targets one schema, and no policy targets a whole domain. The [Access](../platform/access.md) page explains both models.
|
|
91
|
+
|
|
92
|
+
> **Warning:** A package-declared Dataset without a `dataPolicy` grants access to nobody,
|
|
93
|
+
> including the person who deployed it. Always declare the principals that the
|
|
94
|
+
> demo needs.
|
|
95
|
+
|
|
96
|
+
## Declare a Dataset in a package
|
|
97
|
+
|
|
98
|
+
`declareDatasetConnectorInstance` declares a Dataset in a package. An External declaration names the provider, a connection slot, the source location and the policy:
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
const orders = declareDatasetConnectorInstance({
|
|
102
|
+
manifest: { fqn: "com.acme.sales.instances.orders", version: "1.0.0" },
|
|
103
|
+
presentation: { displayName: "Warehouse orders" },
|
|
104
|
+
definition: {
|
|
105
|
+
lifecycle: { deployMode: "init_only", readonly: false },
|
|
106
|
+
bindingMode: "external",
|
|
107
|
+
providerFqn: "com.acme.integrations.warehouse",
|
|
108
|
+
connection: { setupKey: "warehouse" },
|
|
109
|
+
sourceLocation: {
|
|
110
|
+
segments: [
|
|
111
|
+
{ kind: "container", opaqueId: "sales", label: "Sales" },
|
|
112
|
+
{ kind: "dataset", opaqueId: "table:orders", label: "Orders" }
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
dataPolicy: {
|
|
116
|
+
principals: [{ kind: "user", id: "7f824c46-..." }],
|
|
117
|
+
allowedOperations: ["describe", "records"],
|
|
118
|
+
allowedFields: ["id", "total"],
|
|
119
|
+
maxRows: 1000,
|
|
120
|
+
maxBytes: 1048576
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
A deploy configures Datasets and loads no data. An External Dataset is ready to query live once its connection works, and its optional schedules run health checks or propose definition changes for review. A Managed declaration creates an empty Dataset, and loading rows stays a manual import. CI refuses a Managed declaration when the Organization Dataset Store is not enabled. Removing the package never deletes Managed rows.
|
|
127
|
+
|
|
128
|
+
## Datasets for agents and workflows
|
|
129
|
+
|
|
130
|
+
Agents use one tool, Query Dataset (`builtin.core.datasets.tools.query`). It lists, describes and queries the Datasets that an agent may use, with bounded `records`, `aggregate` and `timeSeries` requests. You choose those Datasets by ID in the Skill binding, and an empty selection gives the agent no Datasets. The agent never passes SQL, provider names, connections or table locations. The [AI](../ai/index.md) page explains Skills and tool bindings.
|
|
131
|
+
|
|
132
|
+
Workflows have one node for each operation: describe, query records, query aggregate and query time series. Studio shows Datasets in their own area, apart from the Knowledge views.
|
|
133
|
+
|
|
134
|
+
## Limits
|
|
135
|
+
|
|
136
|
+
Datasets are sized for about 100,000 to 1,000,000 data points per Organization and do not fit a high-volume telemetry stream. Joins across Datasets, writes back to External Datasets, streaming ingestion and copying External data into a Managed Dataset are not available. A route for external applications to query Datasets directly is planned; today agents, workflows and Studio run the queries.
|
|
137
|
+
|
|
138
|
+
## Related pages
|
|
139
|
+
|
|
140
|
+
- [Data resources](index.md)
|
|
141
|
+
- [Knowledge](knowledge.md)
|
|
142
|
+
- [Connectors](connectors.md)
|
|
143
|
+
- [Access](../platform/access.md)
|
|
144
|
+
- [AI](../ai/index.md)
|
|
145
|
+
- [Extensions](../develop/extensions.md)
|