Whatever message this page gives is out now! Go check it out!

DocumentService

Last update:
May 18, 2026
Creates and returns a DocumentProcessingService instance providing granular, standalone document operations: loading, splitting, transforming, and ingesting documents.

Syntax

DocumentService()

Parameters

DocumentService() takes no arguments. All configuration is passed per-operation on the returned object.

Returns

Returns a DocumentProcessingService object. See the DocumentProcessingService method reference topics for the full list of available methods: load(), loadAsync(), lazyLoad(), split(), transform(), transformSegments(), ingest(), and registerCustomParser().

Example: Standalone pipeline

docService = DocumentService();

documents = docService.load({
    path:      "./company-docs/",
    recursive: true,
    pattern:   "*.{pdf,docx,txt,md}"
});

segments = docService.split(documents, {
    splitterType: "recursive",
    chunkSize:    1000,
    chunkOverlap: 100
});

vectorStore = VectorStore({ provider: "inmemory" });
result = docService.ingest(segments, vectorStore, { batchSize: 50 });
writeOutput("Ingested: #result.successfulSegments# / #result.totalSegments#");

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page