Skip to content

Loader resource

The loader: resource reads a file, URL, or directory into structured Document objects - plain text plus metadata - and optionally splits them into chunks. It is the ingestion step of a RAG pipeline: load, then feed the output into vectorStore: or embedding: for indexing.

Where it runs

Both workflow mode and agent mode. In agent mode, the same loader is available as the load_document built-in tool.

Basic usage

yaml
# resources/load.yaml
actionId: load
name: Load Report
loader:
  type: pdf
  source: /data/quarterly-report.pdf
yaml
# resources/loadAndChunk.yaml
actionId: loadAndChunk
name: Load and Chunk for RAG
loader:
  type: text
  source: /data/handbook.txt
  chunkSize: 500
  chunkOverlap: 50
  chunkSplitter: recursive

Configuration options

OptionDescription
typeLoader to use: text (default), pdf, html, csv, directory
sourceFile path, URL (for html), or directory path (required)
columnsCSV only - optional column filter (empty = all columns)
passwordPDF only - decryption password for encrypted PDFs
chunkSizeWhen set (> 0), splits each loaded document into chunks of this size
chunkOverlapCharacters of overlap between consecutive chunks
chunkSplitterSplitting strategy: recursive (default), token, or markdown

Loader types

typeReads
textPlain text file
pdfPDF file, page text extracted
htmlA URL - fetches and extracts readable text
csvCSV file, one Document per row (or per columns filter)
directoryEvery file in a directory, one Document per file

Output

json
{
  "documents": [
    { "content": "...", "metadata": { "source": "/data/handbook.txt", "chunk": 0 } }
  ],
  "count": 3
}

documents is directly usable as the documents: input to a vectorStore: add_documents operation - each content/metadata pair maps onto a VectorStoreDocument.

RAG pipeline example

yaml
# resources/load.yaml
actionId: load
loader:
  type: pdf
  source: "{{ get('filePath') }}"
  chunkSize: 500
  chunkOverlap: 50
yaml
# resources/index.yaml
actionId: index
requires: [load]
vectorStore:
  operation: add_documents
  provider: qdrant
  url: http://localhost:6333
  collection: docs
  documents: "{{ get('load').documents }}"
  embedModel: text-embedding-3-small

See also

Released under the Apache 2.0 License.