Applies to v1.3.18

AISI — operations

This page is for whoever keeps AISI running: what to watch, what each failure means and what to do about it, how AISI protects itself and the systems it reads and writes, how to run more than one worker, and what to check when documents are not being indexed or a sync is stuck (§ 7). Deciding on held deletions is in the mass-deletion hold; reindexing and rebuilding an index are in changing an index.


1. Where the work happens

The Jobs Worker does all of AISI's work. The Portal API only stores configuration and records operators' decisions. The worker runs six scheduled jobs, none of them when AISI__ENABLED is false:

Job Default interval (AISI__CHANGETRACKING__…) Does
aisi-change-ticks 1 minute (TICKSCHEDULERINTERVAL) finds syncs whose next check is due, and reads their changes
aisi-document-processing 1 minute (PROCESSINGSWEEPINTERVAL) picks up documents whose retry is due. New changes start processing at once and do not wait for it
aisi-subscription-upkeep 5 minutes (UPKEEPINTERVAL) creates, renews and removes push notification subscriptions
aisi-stale-lease-reaper 2 minutes (REAPERINTERVAL) returns work a stopped worker left behind
aisi-connection-health 15 minutes (HEALTHPROBEINTERVAL) probes every enabled storage connection and index
aisi-index-reconciliation 7 days (RECONCILIATIONINTERVAL) compares each index with the catalog

2. What to watch

In the Portal

AISI → Overview is the place to start:

  • The cards.
    • Change lag is the age of the oldest last check among running syncs.
    • Waiting to be indexed counts queued and processing documents.
    • Needing attention counts failed, abandoned and quarantined ones.
    • Model tokens today shows the day's model spending: summaries, titles, metadata and vision OCR.
  • Syncs needing attention lists every sync that is paused, holds deletions, has fallen back from push to polling, or cannot read its source. It reads Every sync is running normally. when there is nothing to do.
  • Most common failures shows the five classifications most documents are failing with. Each links to Documents, filtered to it.
  • Documents by state links each state to Documents.

Storage Connections and Indexes show each one's health:

Health Means
Healthy the last probe or document succeeded
Degraded the storage asked AISI to slow down; Throttled until says when reads resume
Unhealthy it could not be reached or used; the message says why
Unknown on a connection, nothing on an index nothing has tested it yet

AISI records health whenever Test is pressed, every 15 minutes in the aisi-connection-health job, and whenever a document or a sync fails because of the connection or the index. An outage and its end therefore show without anyone pressing Test.

  • Activity shows, for each sync, how it follows changes, what its last check did (and how many times in a row it failed), its documents by state — each count opens Documents filtered to it — and the changes it has applied. Below, every snapshot with what started it, what it found and how the documents it queued were indexed.
  • Documents explains every failure in words, with the history of each document.

Metrics

AISI publishes OpenTelemetry metrics on the platform meter, with tenant on almost every series:

Metric Type Tags Use it for
aisi_queue_depth gauge tenant, state documents in each state. Take the maximum across workers, not the sum: every worker reports the same counts, sampled at most every 30 seconds (AISI__PROCESSING__QUEUEDEPTHSAMPLEINTERVAL)
aisi_documents_processed_total counter tenant, outcome, provider, destination throughput, and the share of Failed, Skipped, Abandoned, Quarantined outcomes
aisi_change_lag_seconds histogram tenant from a change being seen to its document being indexed: freshness
aisi_stage_duration_ms histogram tenant, stage where time goes (aisi.fetch, aisi.extract, aisi.write, …)
aisi_bytes_fetched_total counter tenant, provider volume read from storage
aisi_tick_duration_ms histogram tenant, mode how long reading a sync's changes takes
aisi_change_events_total counter tenant, kind, mode change events read from storage and applied, by kind (Created, Modified, Deleted, Moved, Observed, …) and by how the sync hears of them (Poll, Push, Queue)
aisi_snapshot_duration_ms histogram tenant how long a full pass takes
aisi_deletions_total counter tenant documents removed from indexes
aisi_deletion_hold_total counter tenant times the mass-deletion guard tripped and held a sync's deletions for approval, whether by a snapshot's end or by incremental changes; a hold still awaiting a decision is not counted again
aisi_throttled_total counter tenant, provider how often storage asks AISI to slow down
aisi_subscription_degraded_total counter tenant, provider push notifications lost, and the sync polling instead
aisi_webhook_requests_total counter outcome (tenant when known) push notifications received, by outcome; rejected growing means something calls with the wrong secret
aisi_ocr_pages_total counter tenant, engine, outcome OCR work
aisi_llm_tokens_total counter tenant, purpose, direction model spending

Suggested alerts:

  • aisi_queue_depth{state="Queued"} growing for an hour;
  • {state="Abandoned"} or {state="Quarantined"} above zero;
  • aisi_subscription_degraded_total increasing;
  • the 95th percentile of aisi_change_lag_seconds above what your users expect.

Logs

Read at Information, the worker's log stays readable at millions of documents:

  • Information is milestones: snapshots started and completed, with counts.
  • Warning is something an operator may need to act on: a host not allowlisted, a source throttling, a circuit opened, a connection or index unhealthy, deletions held.
  • Error means something unexpected that needs action.
  • Debug holds per-document detail.

Document content, credentials and connection strings are never logged at any level.


3. When documents fail

Every failure has a classification, shown in Documents with an explanation. The classification's class decides what happens next:

Class The document Uses up an attempt
Temporary is retried after 1 minute, then 2, 4, … up to 6 hours, with jitter. After 5 attempts (AISI__PROCESSING__MAXATTEMPTS) it is Abandoned yes
Content is Skipped: retrying the same file cannot help —
Connection waits a minute, or until a throttle ends, and is tried again no
Index waits a minute and is tried again no
Budget is Awaiting budget until the index's daily token budget renews at midnight UTC no
Security is Quarantined for review —

So an outage of storage or of an index never exhausts a document's attempts: it waits, however long the outage lasts.

Classification Class What to do
TRANSIENT, TIMEOUT Temporary nothing; if many documents end Abandoned, look for an Error in the worker's log. For TIMEOUT on very large files, raise AISI__PROCESSING__DOCUMENTTIMEOUT
LLM_UNAVAILABLE, SUMMARY_INVALID Temporary check the index's model profile and its provider
OCR_ENGINE_UNAVAILABLE Temporary check the Tesseract installation in the worker image, or the vision model profile
UNSUPPORTED_FORMAT, TYPE_MISMATCH, MALFORMED_DOCUMENT, EMPTY_DOCUMENT Content nothing in AISI: the file cannot be indexed as it is
ENCRYPTED_DOCUMENT Content remove the password at the source
TOO_LARGE, TOO_MANY_PARTS, FIELD_TOO_LONG Content raise the index's limits, or the sync's file-size cap, if the file should be indexed
EXPORT_TOO_LARGE Content Google will not export the document; split it at the source
OCR_REQUIRED_BUT_DISABLED Content enable OCR on the index if scans should be indexed
OCR_INCOMPLETE Content the document has more pages needing OCR than AISI__OCR__MAXPAGESPERDOCUMENT, or a page image over AISI__EXTRACTION__MAXIMAGEPIXELS; the message names which. Raise the limit on the Jobs Worker, then Retry document (or Retry all shown filtered on the classification)
SOURCE_ITEM_NOT_FOUND Content nothing: the file went away; the next check records its deletion
SOURCE_AUTH_FAILED Connection the credentials were rejected, and every sync of the connection is paused: fix the secret or the grant at the storage, then save the secrets or Test the connection, and the syncs resume on their own
SOURCE_ROOT_UNAVAILABLE Connection the folder, drive or bucket cannot be reached. Nothing is deleted meanwhile. Check the server, the root's name and the account's access
HOST_NOT_ALLOWED Connection add the host the message names to the Outbound Allowlist
HOST_KEY_MISMATCH Connection the server presented a different identity: confirm it out of band before trusting it on the connection
SECRET_UNRESOLVED Connection the bound secret is missing or unreadable: bind another, or restore it in the Secret Store
THROTTLED Connection nothing: the storage asked AISI to wait, and it does
NOTIFICATIONS_UNAVAILABLE Connection push could not be set up; the sync polls meanwhile. See push and queue notifications
DESTINATION_UNAVAILABLE Index the index's database or cluster cannot be reached, or rejects the writer
DESTINATION_THROTTLED Index nothing, unless it persists: the Elasticsearch or OpenSearch cluster is rejecting work (HTTP 429, or a full write queue). The index's documents wait and are retried without spending attempts; neither the index nor the storage connection is marked unhealthy. If it persists, the cluster is undersized for the load
DESTINATION_SCHEMA_MISSING Index the index's tables or indexes are missing or the writer lacks a privilege on them: Provision index again, or, on an index a DBA manages, have the DBA run its schema script and Verify index
DESTINATION_SCHEMA_MISMATCH Index the index's objects exist but not in the shape AISI needs; the message names each difference. Have the DBA run the index's schema script again, then Verify index
DESTINATION_OBJECTS_TAKEN Index objects of the index's name belong to another index, or were not created by AISI. AISI never drops them: have a DBA remove them, or create the index with another slug
FULL_TEXT_NOT_INSTALLED, ORACLE_TEXT_NOT_INSTALLED, ORACLE_TEXT_GRANT_MISSING Index install SQL Server Full-Text Search or Oracle Text, or grant CTXAPP
READER_CANNOT_READ Index the reader may not read the units table: grant it SELECT on the table (and USAGE on the schema on PostgreSQL), then Provision index or Verify index again
READER_NOT_READ_ONLY Index the reader secret can write: grant it read access only
TOKEN_BUDGET_EXHAUSTED Budget wait, or raise the index's daily token budget
PROMPT_INJECTION_DETECTED Security review it; Release from quarantine if it should be indexed anyway

Once the cause is fixed, Retry document, or Retry all shown on a filtered list, starts the affected documents again with their attempts reset.


4. How AISI protects itself and others

Throttling

When storage answers too many requests (or unavailable, with a time to wait), AISI pauses the whole connection until the time it was given, 30 seconds if none, and never more than an hour. Its documents and change checks wait without spending an attempt. The connection shows Degraded and Throttled until. The worker logs one Warning per throttle, not one per document, and aisi_throttled_total counts it.

Circuit breakers

When half of a storage connection's documents, or of an index's, fail for the connection's or the index's own sake within two minutes (at least 5 documents), its circuit opens:

  • Its documents wait in the queue for a minute, without spending an attempt.
  • Then one is let through to test it. If it succeeds, processing resumes; if it fails, the wait starts again.
  • A deletion waits only on its index, never on its storage connection.

Content failures and throttling do not count. The worker logs the opening at Warning, and the half-open test and the closing at Information. The thresholds are AISI__PROCESSING__CIRCUITBREAKER…, described in the configuration reference.

Fair sharing

  • Per storage connection: no more than 4 documents at once, across all workers (AISI__PROCESSING__MAXCONCURRENTPERCONNECTION). This is a soft limit: it can be exceeded by one claim batch per worker.
  • Per sync: no more than the sync's Concurrency override, when it sets one, across all workers. It can only be lower than the connection's limit, and is a soft limit in the same way.
  • Per tenant: no more than 8 documents at once, across all workers (MAXCONCURRENTPERTENANT), and no more than that on any one worker. A soft limit in the same way as the connection's.
  • Per sweep: tenants take turns. One sweep processes at most 500 documents (MAXDOCUMENTSPERSWEEP); the next sweep picks up the rest, and the worker logs at Information when that ceiling is reached.

Deletions are held, not rushed

  • Mass deletions wait for an operator. When a sync would delete more than 20 % of its indexed documents, and at least 100 of them, within an hour, the deletions are held. They stay held until someone with AISI Operate approves or discards them; see the mass-deletion hold.
  • An unreachable root deletes nothing. A storage root that cannot be reached marks the sync as unavailable and deletes nothing.
  • Single deletions wait out a grace period. An ordinary deletion waits for the sync's grace period, so a file moved out and back again is never removed.

5. Retention

The platform's data lifecycle job on the worker (DataLifecycle__Enabled) prunes what AISI no longer needs:

Setting (DataLifecycle__…) Default Removes
AisiTombstoneRetentionDays 30 records of deleted documents, with their history
AisiSnapshotHistoryRetentionDays 90 finished snapshots
AisiDocumentEventRetentionDays 30 document history entries
AisiArtifactRetentionDays 7 OCR pages and section summaries kept while a document was being indexed
AisiSummaryCacheRetentionDays 180 cached summaries not used since

Each kind is pruned in batches of 5,000 rows per run. When a batch fills, the worker logs a Warning and the rest is pruned on later runs. Push notifications are never stored, so there is nothing of theirs to prune.


6. Running more than one worker

Every Jobs Worker replica can process AISI work. They coordinate through the database, so nothing is processed twice:

  • Shared between workers:
    • a document is claimed by one worker at a time;
    • a sync's change check is leased by one worker at a time;
    • throttles, health, held deletions, and the per-connection and per-tenant limits.
  • Per worker:
    • documents processed in parallel (MAXDEGREEOFPARALLELISM, 4);
    • change checks at once (AISI__CHANGETRACKING__MAXCONCURRENTTICKS, 4);
    • the spool budget (MAXSPOOLBYTES);
    • the circuit breakers. One worker may still be trying a connection that another has stopped trying, until its own circuit opens.

When a worker stops, its work is not lost. The reaper returns the documents it held once their claims have gone 5 minutes without a heartbeat (AISI__PROCESSING__STALECLAIMAFTER), and its change checks after 5 minutes (AISI__CHANGETRACKING__STALELEASEAFTER). A document that has used up its attempts this way is abandoned. The reaper logs what it recovered at Warning.

To add capacity, add worker replicas: each brings its own parallelism, within the per-connection and per-tenant limits that protect the storage and the other tenants. Give each worker a spool volume sized for AISI__PROCESSING__MAXSPOOLBYTES. Every AISI setting is in the configuration reference.

Workers for AISI alone

By default every worker does all the platform's background work, AISI included. When AISI's load matters — a first snapshot of a large drive, OCR over a scanned archive — run AISI on workers of its own, so that it cannot slow audit delivery, A2A push notifications or API enrichment:

  • Roles. Each worker serves the roles in JOBS__WORKER__ROLES: Platform, Aisi, or both (the default). A worker that serves only Aisi does AISI's work and nothing else; one that serves only Platform does none of it. Splitting roles needs the RabbitMQ transport.
  • With the installer, set JOBS__WORKER__ROLES to Platform on the main Jobs Worker and add a second worker service that serves only Aisi; without the first step, both process AISI work. How to do it, and how to run more workers of either kind, is in AISI on workers of its own.
  • Sizing. Each AISI worker processes up to MAXDEGREEOFPARALLELISM documents at once, so its CPU and memory follow that number and the largest documents you index: OCR uses about one core per page being recognized, and a document is spooled to disk up to MAXSPOOLBYTES before it is extracted. Start from 2 cores and 4 GB per worker, watch aisi_stage_duration_ms and aisi_queue_depth, and add workers rather than raising parallelism: more workers spread the load without raising the per-connection limit that protects the storage.
  • Checking the split. A worker's GET / lists its roles, and the jobs_worker_role{role} metric counts workers per role. At least one worker must serve each role; a role with none has its work queue up until one starts.

Rolling restarts. A stopping worker finishes what it can for up to JOBS__WORKER__SHUTDOWNTIMEOUT (2 minutes in the installer's compose file), and anything it could not finish is returned to the queue by the reaper as above.


7. When documents are not indexed, or a sync is stuck

Start with the Jobs Worker's log: AISI's Warnings say what it is waiting for.

Documents are not being indexed (Waiting to be indexed keeps growing, aisi_queue_depth{state="Queued"} rises):

  1. Is the worker running AISI? AISI__ENABLED must be true on the Jobs Worker, and at least one worker must serve the Aisi role. If AISI logs nothing at all for several minutes, restart the worker.
  2. Is something waiting rather than failing?
    • a paused sync, listed under Syncs needing attention: its documents are not processed until it is resumed;
    • a storage connection Degraded with Throttled until: its documents wait until then;
    • a connection or an index Unhealthy, or an open circuit (AISI circuit opened for … in the log): fix the cause the message names, then Test connection or Test destination;
    • an index that is disabled, not yet provisioned, being deleted, or Awaiting schema (a DBA-managed index whose definition changed waits for the DBA to rerun its schema script and for Verify index).
  3. Is it just volume? A first snapshot of a large folder queues every file at once; it is a backlog only if Waiting to be indexed stops falling. When the log says the processing sweep reached its ceiling, add Jobs Worker replicas first (§ 6). Raise AISI__PROCESSING__MAXCONCURRENTPERCONNECTION only with the storage owner's agreement, or MAXCONCURRENTPERTENANT when one tenant holds most of the work. aisi_stage_duration_ms by stage shows whether OCR or summaries take the time.
  4. Is the index's model budget spent? Documents Awaiting budget wait for the next UTC day, unless the index's daily token budget is raised.

A sync is stuck (listed under Syncs needing attention, its last change no longer moving):

  1. Read its note on the Syncs grid, Activity or Overview: the pause reason, the failing check's message, or why push fell back to polling.
  2. Failing: fix what the message names (SOURCE_AUTH_FAILED, HOST_NOT_ALLOWED, SOURCE_ROOT_UNAVAILABLE; § 3), then Test connection and Collect now to check at once rather than wait for the retry.
  3. Push degraded to polling: changes still arrive at the poll interval; see when notifications are unavailable.
  4. Paused: Resume sync if the reason recorded at the pause no longer applies. A sync AISI paused because the storage refused its credentials resumes by itself once the connection's secrets are saved or a test succeeds.
  5. Nothing obvious: Collect now. If the check does not complete within a few minutes, look in the worker's log for AISI sync {id}. A check left by a stopped worker is released after AISI__CHANGETRACKING__STALELEASEAFTER.

Documents keep ending Abandoned after a worker stops: they are probably what stops it, a file that exhausts its memory for example. Look at their size and type, and lower the index's limits.