ingest_documents
Convert PDFs into structured Document Manifests by extracting text and images, then index them in LightRAG for AI-ready retrieval.
Instructions
Process PDF files and create Document Manifests.
ETL Pipeline:
Extract text (to markdown) and images
Generate structured Document Manifest
Index in LightRAG (if enabled)
Args: file_paths: List of absolute paths to PDF files async_mode: Kept for backwards compatibility. PDF ingestion is routed to a background job from the MCP tool layer to keep stdio clients responsive. use_marker: Backwards-compatible flag that requests the configured structured extractor. The active packaged structured route is Docling; MinerU and Marker are dependency security holds. Default False uses PyMuPDF (faster and always available). marker_max_pages_per_chunk: When using a configured structured extractor, split PDFs into fixed-size page chunks. Set 0 to use the safe automatic strategy. extract_figures: When using a configured structured extractor, control whether image crops are extracted and saved. Disable this first for image-heavy textbooks to reduce memory pressure. page_ranges: 1-indexed inclusive page ranges applied to every input file, e.g. ["1-50", "120-160"].
Returns:
Job ID for tracking progress with get_job_status.
Example: # Async (recommended for large files): ingest_documents(["/papers/study1.pdf"]) # Then check status: get_job_status("job_xxx")
# With the configured structured extractor for precise source tracking:
ingest_documents(["/papers/textbook.pdf"], use_marker=True)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deskew | No | ||
| async_mode | No | ||
| file_paths | Yes | ||
| use_marker | No | ||
| ocr_enabled | No | ||
| page_ranges | No | ||
| ocr_language | No | eng | |
| rotate_pages | No | ||
| extract_figures | No | ||
| index_knowledge_graph | No | ||
| marker_max_pages_per_chunk | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |