You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(knowledge): project document ACL and chunk changes asynchronously
Document ACL/source changes and chunk writes mark their document in
knowledge_projection_dirty (one upsert with a generation bump) in the
writer's transaction. A knowledge projector converges every search
projection per document in short pages bounded by chunk rows, several
documents at once, and removes a mark only on the generation it read.
Writers that declare sim.projection_mode = 'async' skip the synchronous
embedding and document fan-out triggers. The processing commit and every
connector-lease ACL page declare it while the knowledge-async-projection
flag is on; every other writer, and every release before this one, keeps
writing projection rows itself. Marks are written in both modes so a
projector pass can never settle over a concurrent synchronous write.
Migrations 0021-0023 keep their trigger body; 0024 alone installs the
marking.
Search decides a marked document's rows on the document itself, so a
pending projection never admits a revoked grant. A document that moved
sources joins the new source's per-source ranking after its pass.
The projector runs as a Trigger.dev task, requested after writes and
swept every minute while there is work, or in-process without
Trigger.dev. A pass opens one worker per mark up to
KB_CONFIG_PROJECTION_CONCURRENCY. The separate source/ACL backfill is
folded into it behind knowledge-projection-fill.
Copy file name to clipboardExpand all lines: apps/docs/content/docs/platform/self-hosting/background-jobs.mdx
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,7 @@ Point cron at an **internal** address where possible (the in-cluster Service, or
47
47
| Time pause/resume |`/api/resume/poll`|`*/1 * * * *`| Workflows paused on a timer |
48
48
| Outbox processing |`/api/webhooks/outbox/process`|`*/1 * * * *`| Transactional-outbox retries for billing, membership, enterprise issuance, and workflow-deployment side effects |
49
49
| Workspace file search dispatch |`/api/cron/workspace-file-search-dispatch`|`*/1 * * * *`| Dispatches indexing work for workspace file search |
50
+
| Knowledge projection |`/api/cron/knowledge-projection`|`*/1 * * * *`| Brings knowledge base search up to date with document, permission, and chunk changes |
| Connector member sync |`/api/knowledge/connectors/member-sync`|`*/5 * * * *`| Per-member access sync for permission-aware connectors |
52
53
| Connector directory sync |`/api/knowledge/connectors/directory-sync`|`*/5 * * * *`| Refreshes the directory groups administrator-mode connectors mirror, so a membership change takes effect without waiting for a content sync |
KB_CONFIG_CONCURRENCY_LIMIT: z.number().optional().default(20),// Per-tenant concurrent document-processing runs in the interactive lane
465
465
KB_CONFIG_BACKFILL_CONCURRENCY_LIMIT: z.number().optional().default(20),// Per-tenant concurrent document-processing runs in the connector-backfill lane
466
466
KB_CONFIG_EMBEDDING_CONCURRENCY: z.number().optional().default(8),// Concurrent embedding API requests within one embed call
467
+
KB_CONFIG_PROJECTION_CONCURRENCY: z.number().optional().default(8),// Most documents one knowledge projector pass projects at once, each on its own connection
467
468
/** Deployment operating budgets shared by every caller using the same provider credential. */
0 commit comments