// The constants of the knowledge module: its feature flag, jobs, events, audit actions and the // indexable content types. /** The module flag: knowledge retrieval and indexing, off until an administrator enables document AI. */ export const KNOWLEDGE_FLAG = "knowledge.enabled" export const KNOWLEDGE_FLAG_DEFAULTS = { [KNOWLEDGE_FLAG]: false, } as const /** The worker job that hands one document to the platform's knowledge service. */ export const INDEX_JOB = "knowledge.index" /** The worker job that removes one document from the platform's knowledge service. */ export const REMOVE_JOB = "knowledge.remove" export const COLLECTION_CREATED = "knowledge.collection.created" export const DOCUMENT_INDEX_REQUESTED = "knowledge.document.index_requested" export const DOCUMENT_REMOVE_REQUESTED = "knowledge.document.remove_requested" export const DOCUMENT_AI_ENABLED = "knowledge.settings.document_ai_enabled" export const DOCUMENT_AI_DISABLED = "knowledge.settings.document_ai_disabled" /** A project's automatic PDF indexing switched on (naming a collection) or off. */ export const AUTO_INDEX_CHANGED = "knowledge.autoindex.changed" /** The worker job that reads one uploaded PDF and indexes its passages into the project's opted-in collection. */ export const AUTO_INDEX_JOB = "knowledge.autoindex" /** The files processor that enqueues it on every upload of a matching type; also its jobs' singleton namespace. */ export const AUTO_INDEX_PROCESSOR_KEY = "knowledge.autoindex" /** What the automatic indexing reads, through the platform's document reader. */ export const AUTO_INDEX_CONTENT_TYPES = ["application/pdf"] as const /** A PDF's ceiling for the reader: the files module's upload ceiling, as the documents module reads one. */ export const MAX_AUTO_INDEX_BYTES = 50 * 1024 * 1024 /** * What the indexer reads as text. PDFs and scans are the documents module's worked example; this * module indexes text-shaped files, and refuses anything else at the door with a named field. */ export const INDEXABLE_CONTENT_TYPES = ["text/plain", "text/markdown", "application/json", "text/csv"] as const /** A search query's ceiling; a retrieval question is a sentence, not a document. */ export const MAX_QUERY_LENGTH = 500 /** What one search returns at most, however much the caller asks (the retrieval limit contract). */ export const MAX_SEARCH_RESULTS = 25 /** An indexed file's ceiling: one megabyte of text is already far past useful chunking. */ export const MAX_INDEX_BYTES = 1_048_576