Overview
JSON loader processes JSON and JSONL files with support for single or multi-document extraction using JQ queries. Flexible content and metadata mapping for structured data. Loader Class:JSONLoader
Config Class: JSONLoaderConfig
Install
Install the JSON loader optional dependency group:
Examples
Parameters
| Parameter | Type | Description | Default | Source |
|---|---|---|---|---|
encoding | str | None | File encoding (auto-detected if None) | None | Base |
error_handling | "ignore" | "warn" | "raise" | How to handle loading errors | ”warn” | Base |
include_metadata | bool | Whether to include file metadata | True | Base |
custom_metadata | dict | Additional metadata to include | Base | |
max_file_size | int | None | Maximum file size in bytes | None | Base |
skip_empty_content | bool | Skip documents with empty content | True | Base |
mode | "single" | "multi" | Processing mode | ”single” | Specific |
record_selector | str | None | JQ query to select records (required for multi) | None | Specific |
content_mapper | str | JQ query to extract content | ”.” | Specific |
metadata_mapper | dict[str, str] | None | Map metadata keys to JQ queries | None | Specific |
content_synthesis_mode | "json" | "text" | Format for extracted content | ”json” | Specific |
json_lines | bool | File is in JSON Lines format | False | Specific |

