RAG & Knowledge Base Operations — Unique AI Documentation

RAG & Knowledge Base Operations

Audience: Platform administrators with chat.admin.all. These are advanced maintenance operations on a tenant's RAG stores (vector database + search index). They can run for hours on large tenants. Coordinate with Unique before running on a production tenant.

What these are

Maintenance operations let an administrator reshape or rebuild a company's Retrieval-Augmented Generation (RAG) stores without re-ingesting source files. They run as asynchronous, checkpointed background jobs and are non-destructive by default — the live collection keeps serving search until an atomic swap at the very end.

All operations share the same framework (below); each has its own runbook for the specifics.

Available operations

Operation operationType What it does When to use
Re-embedding SWITCH_EMBEDDING_MODEL Re-embeds all content with a different embedding model and switches the live vector collection to it Upgrading or changing the embedding model / dimension
Re-sharding a Collection RESHARD_COLLECTION Recreates the company's vector collection with a different shard count and swaps to it (copies vectors, no re-embed) Scaling a vector collection for size / query performance
Rebuild Index REBUILD_INDEX Rebuilds the vector index and/or the Elasticsearch full-text index from existing data Recovering from index issues, or applying new index settings

How maintenance jobs work (shared framework)

Monitoring (all operations)

query {
  maintenanceJob(jobId: "mjob_xxx") {
    id status phase processed total failed errorMessage startedAt completedAt result
  }
}

List all jobs for the company with maintenanceJobs { id status phase operationType processed total createdAt }. Cancel a running job with cancelMaintenanceJob(jobId: "mjob_xxx").

Field Meaning
status PENDING → RUNNING → COMPLETED (or FAILED / CANCELLED)
phase Operation-specific (see each runbook)
processed / total Progress
failed Per-item failures (non-fatal)
errorMessage Populated on FAILED

Common prerequisites & sizing

Common troubleshooting

Symptom Cause Resolution
A maintenance job for this company is still holding the lock A job is active or recently finished Wait, or cancelMaintenanceJob, then retry (one job per company)
Job stays PENDING No worker picked it up Ensure the ingestion / maintenance worker is running
Transient vector-DB errors (EPIPE, socket) Network / keep-alive blips Retried automatically; if persistent, check vector-DB health/capacity
Job FAILED partway Operation-specific error Read errorMessage; see the operation's runbook. Re-trigger to restart (jobs do not auto-resume after FAILED)

Runbooks

_Each runbook covers the operation's specific parameters, phases, prerequisites, and troubleshooting. Shared mechanics (permissions, monitoring, dry run, safety) are described above.