loader component reference
This page lists every field and option. The overview shows what it does and a first example.
The load_document component reads a file, URL, or directory into structured Document objects (plain text and metadata). It can also split them into chunks. It is the ingestion step of a RAG pipeline. First load the data. Then give the output to the vector_store or embedding component, which indexes it.
It is a kdeps component from the components asset set. Call it with a component: resource. You do not install it. It calls the load_document tool of the kdeps API. This tool runs the native loader executor. kdeps rejects a workflow that uses loader: directly, as primary or in a before:/after: step.
It runs as a workflow step. In a chat loop, the same job is the load_document tool.
Basic usage
# resources/load.yaml
actionId: load
name: Load Report
component:
name: load_document # from the components asset set; a components/load_document/ of your own wins
with:
type: pdf # text (default), pdf, html, csv, directory, notion
source: /data/quarterly-report.pdf# resources/loadAndChunk.yaml
actionId: loadAndChunk
name: Load and Chunk for RAG
component:
name: load_document
with:
type: text
source: /data/handbook.txt
chunkSize: 500 # split into chunks of 500 characters
chunkOverlap: 50 # 50 characters shared by consecutive chunks
chunkSplitter: recursive # recursive (default), token, or markdownInputs
| Input | Type | Required | Description |
|---|---|---|---|
source | string | yes | File path, URL (for html), or directory path |
type | string | no | text (default), pdf, html, csv, directory, notion. Omitted types follow the file extension |
columns | array | no | CSV only - column filter; empty loads all columns |
password | string | no | PDF only - decryption password for encrypted PDFs |
chunkSize | number | no | When > 0, splits each loaded document into chunks of this size |
chunkOverlap | number | no | Characters of overlap between consecutive chunks |
chunkSplitter | string | no | Splitting strategy: recursive (default), token, or markdown |
Loader types
type | Reads |
|---|---|
text | Plain text file |
pdf | PDF file, page text extracted |
html | A URL - fetches and extracts readable text |
csv | CSV file, one Document per row (or per columns filter) |
directory | Every file in a directory, one Document per file |
Output
{
"documents": [
{ "content": "...", "metadata": { "source": "/data/handbook.txt", "chunk": 0 } }
],
"count": 3
}documents is directly usable as the documents: input to the vector_store component's add_documents operation - each content/metadata pair maps onto a VectorStoreDocument. The component returns the tool's body as a string, so read it with fromJSON.
Size limit
Each loader type reads its full source into memory. This is correct for a report or handbook. But a large ingestion (a large CSV, a directory of documents) can cause a SIGKILL of the process. This can occur when later steps copy the content (chunkSize splitting, json.Marshal of the result, a vector_store embedding step). kdeps rejects a single file larger than 256 MiB with a clear error. type: directory and notion skip a file that is too large and continue to load. All other types fail that load, as for --file/stdin above its 256 MiB default (see Input sources).
Raise or lower it with KDEPS_LOADER_MAX_BYTES (bytes; 0 disables the check):
KDEPS_LOADER_MAX_BYTES=1073741824 kdeps run workflow.yaml # 1 GiB, for a workflow that loads bulk dataRAG pipeline example
# resources/load.yaml
actionId: load
component:
name: load_document
with:
type: pdf
source: "{{ get('filePath') }}"
chunkSize: 500
chunkOverlap: 50# resources/index.yaml
actionId: index
flow:
requires: [load]
component:
name: vector_store
with:
operation: add_documents
provider: qdrant
url: http://localhost:6333
collection: docs
embedModel: text-embedding-3-small # embedding model for the document contents
documents: "{{ fromJSON(output('load')).documents }}" # load_document's Document listSee also
- Component resource - how
component:calls passwith:inputs - Vector store component - index and search the loaded documents
- Embedding component - lightweight keyword-based alternative for local, API-key-free RAG
- Resources overview - all resource types
