Skip to content

Document AI workflows

Enterprise

Document work usually has three separate decisions: what the document says, where it belongs, and what a person or domain handler should do next. Kumiko Enterprise keeps those steps separate so an extraction result is not silently turned into a business write.

NeedFeature or recipeResult
Read fields from a PDF or text payloadai-extractJSON-Schema-shaped data that the caller validates
Classify an inbound messageai-triageCategory, sentiment, urgency, and proposed actions
Upload and parse asynchronouslyDocument ingest recipeFile event, worker job, extraction entity, and admin read side
Let the assistant read an uploaded fileAssistant attachmentsPDF, image, CSV, and TXT go to the model directly; Word files as extracted text
upload or receive → extract → validate → classify → review or domain write

The model produces a candidate result. Your application validates it against its own schema and decides whether to persist it, ask a person, or reject it. For pipelines, step policies can be drafted, activated, rolled back, and tested against golden fixtures without writing domain data.

document-ingest-foundation turns an upload into a documentExtract row. It has no parser of its own and no built-in list of accepted types. Parser features register as providers for the MIME types they handle, and each one runs its extraction as a job on the worker lane, outside the upload transaction.

ProviderTypesMax file sizeParser
LiteParsePDF, PNG, JPEG, TIFF25 MiBLiteParse with OCR for scans, capped at the tenant’s max-pages-per-file

The Office provider for DOCX and DOC files is no longer published. Word files need a parser provider of your own, registered as shown in Registering a provider.

A file whose type no mounted provider claims is skipped with the reason unsupported-mime-type, and mounting the foundation without any provider is valid. When the source file is deleted or forgotten, its extract is forgotten with it.

A provider feature declares r.requires({ features: ["document-ingest-foundation"] }), registers its MIME types and size cap through EXT_DOCUMENT_INGEST_PROVIDER, and triggers its job with documentIngestProviderTrigger("<name>"). The trigger filters the shared documentIngest.requested event to that provider’s requests.

import {
documentIngestProviderTrigger,
EXT_DOCUMENT_INGEST_PROVIDER,
} from "@cosmicdrift/kumiko-bundled-features/document-ingest-foundation";
import { defineFeature } from "@cosmicdrift/kumiko-framework/engine";
export const myParserFeature = defineFeature("my-parser", (r) => {
r.requires({ features: ["document-ingest-foundation"] });
r.applyExtension({
name: EXT_DOCUMENT_INGEST_PROVIDER,
entity: "my-parser",
mimeTypes: ["application/rtf"],
maxFileBytes: 10 * 1024 * 1024,
});
r.job({
name: "parse",
trigger: documentIngestProviderTrigger("my-parser"),
runIn: "worker",
handler: parseJob,
});
});

Boot fails when two providers claim the same MIME type, when a job triggers on documentIngest.requested without a provider filter, when a job filters to a provider nobody registered, or when a registered provider has no job.

  • Keep provider credentials in tenant-scoped secrets.
  • Choose a provider per tenant when the data classification requires it.
  • Use the mock provider for deterministic integration tests.
  • Use an OpenAI-compatible endpoint for hosted, local, or self-operated models.
  • Treat extracted text and model output as application data with an explicit retention and access policy.

See Cost control for step policy and provider cost.

You can implement this with your own query handler, worker, parser, and domain commands. Enterprise provides the reusable provider routing, prompt controls, step policy model, and tested compositions. Your own version still needs schema validation, retries, authorization, data classification, and an operational failure path.