Document AI workflows
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.
Choose the workflow
Section titled “Choose the workflow”| Need | Feature or recipe | Result |
|---|---|---|
| Read fields from a PDF or text payload | ai-extract | JSON-Schema-shaped data that the caller validates |
| Classify an inbound message | ai-triage | Category, sentiment, urgency, and proposed actions |
| Upload and parse asynchronously | Document ingest recipe | File event, worker job, extraction entity, and admin read side |
| Let the assistant read an uploaded file | Assistant attachments | PDF, image, CSV, and TXT go to the model directly; Word files as extracted text |
A safe default flow
Section titled “A safe default flow”upload or receive → extract → validate → classify → review or domain writeThe 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.
Parser providers
Section titled “Parser providers”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.
| Provider | Types | Max file size | Parser |
|---|---|---|---|
| LiteParse | PDF, PNG, JPEG, TIFF | 25 MiB | LiteParse 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.
Registering a provider
Section titled “Registering a provider”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.
Data and provider boundaries
Section titled “Data and provider boundaries”- 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.
Build your own document flow
Section titled “Build your own document flow”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.