This document defines the capability scope, known limitations, and risk thresholds of the RAG Pipeline preprocessing system for reference.
1. File Type Support Matrix
1.1 Directly Supported File Types
|
File Type |
Extension |
Parsing Step |
Notes |
|---|---|---|---|
|
|
|
|
Basic parsing only applies to text-based PDFs; scanned documents require an OCR step |
|
Word Document |
|
|
Converted to Markdown via |
|
Legacy Word |
|
Must first be converted via |
Cannot be parsed directly; must first be converted to |
|
Markdown |
|
|
Natively supported |
|
Plain Text |
|
|
Natively supported |
|
Excel |
|
|
Subject to row/column limits, see §2 |
|
CSV / TSV |
|
|
— |
|
PowerPoint |
|
Must first be converted via |
Direct content extraction is not supported; must first be converted to PDF |
|
Image |
|
|
Uses a Vision LLM (such as GPT-4o) to describe image content, up to 300 words |
|
Video |
|
|
Extract audio track → transcribe to text |
|
Audio |
|
|
Split into 60-second segments and transcribe segment by segment |
1.2 Unsupported / Explicitly Prohibited File Types
|
Type |
Description |
|---|---|
|
|
Hardcoded blacklist ( |
|
|
No decompression step; the Pipeline does not process them |
|
|
No dedicated parsing step |
|
|
No dedicated parsing step |
|
|
Not supported |
|
|
Not supported |
|
|
No dedicated step (conversion via LibreOffice may be attempted, but not guaranteed) |
|
Encrypted / password-protected files |
Encrypted files of all formats cannot be processed |
2. File Size and Resource Limits
2.1 Precheck Limits (file_limit_checker)
A lightweight precheck is performed during upload. Files exceeding the limits will be rejected from upload or flagged with a warning:
|
Dimension |
Default Threshold |
Configurable |
Description |
|---|---|---|---|
|
Character count |
15,000 characters |
✅ Via the |
Applies to text-based files such as PDF/DOCX/TXT/MD/CSV/XLSX |
|
Page count |
25 pages |
✅ Same as above |
PDF by physical pages, Excel by sheet count, PPT by slide count |
⚠️ Bulk import from knowledge base file sources is not subject to this precheck limit, but oversized files still carry an OOM risk.
2.2 Resource Thresholds Within Pipeline Processing
|
Resource Dimension |
Threshold / Configuration |
Risk |
|---|---|---|
|
Parallel PDF page conversion |
50 pages per batch ( |
Very large PDFs (500+ pages) may consume high memory during |
|
Table row count |
Single sheet ≤ 20,000 rows |
Exceeding the limit causes direct failure and parsing rejection |
|
Table column count |
Single sheet ≤ 200 columns |
Exceeding the limit causes direct failure and parsing rejection |
|
Table images |
Single file ≤ 150 images ( |
Excess images are ignored |
|
Vectorization batch |
100 segments per batch ( |
— |
|
Segment image density |
Single segment ≤ 5~8 images |
Exceeding the limit triggers early splitting to avoid token overflow |
|
Audio slicing |
60 seconds / segment |
Long audio/video files generate a large number of transcription API calls |
|
TextIn OCR |
API-level maximum of 1,000 pages |
Quota exhaustion will cause errors |
2.3 OOM / Resource Overload Risk Scenarios
|
Scenario |
Risk Level |
Cause |
Recommendation |
|---|---|---|---|
|
DF > 200 pages + |
🔴 High |
|
Use OCR steps (TextIn/Azure DI) instead of basic parsing |
|
Excel single sheet > 10,000 rows |
🟡 Medium |
Fully loaded into memory, generating a large number of segments |
Pre-split the file or increase worker memory |
|
Video > 2 hours |
🟡 Medium |
|
Limit video duration or pre-split it |
|
Single file containing 100+ embedded images |
🟡 Medium |
Each image requires a Vision LLM call, resulting in high time and cost |
Extract only key images |
|
Bulk import of 1,000+ files |
🟡 Medium |
Celery worker queue backlog, gevent concurrency limit of 100 |
Import in batches and monitor queue depth |
3. File Parsing Capability Levels
3.1 Parsing Engine Comparison
|
Engine |
Parsing Method |
Applicable Scenarios |
Inapplicable Scenarios |
Dependencies |
|---|---|---|---|---|
|
Basic(pypdf / pdfplumber) |
Direct extraction from text layer |
Native text PDFs (exported from Word, generated by LaTeX, etc.) |
Scanned documents, image PDFs, complex layouts |
No external dependencies |
|
TextIn OCR |
Cloud OCR + layout analysis |
Scanned documents, receipts, mixed-layout PDFs |
— |
|
|
Azure Document Intelligence |
Cloud Layout/Read models |
Table structure preservation, multi-column layouts |
— |
|
|
Ali OCR |
Alibaba Cloud OCR |
Chinese scanned-document scenarios |
— |
Alibaba Cloud API credentials |
|
LLM Parsing(PDF LLM) |
Page screenshots → Vision LLM recognition |
Extremely complex layouts, mixed text-image layouts |
Large files (high cost, slow speed) |
Vision LLM (GPT-4o, etc.) |
|
pypandoc |
Pandoc format conversion |
DOCX → Markdown |
Complex macros, ActiveX controls |
Pandoc binary |
|
LibreOffice / Spire |
Format conversion engine |
|
— |
LibreOffice or Spire runtime |
3.2 Detailed Parsing Capabilities by File Type
PDF
|
Feature |
Basic |
TextIn |
Azure DI |
LLM |
|---|---|---|---|---|
|
Plain text extraction |
✅ |
✅ |
✅ |
✅ |
|
Scanned / image PDF |
❌ Returns empty |
✅ |
✅ |
✅ |
|
Table structure preservation |
❌ Formatting lost |
✅ |
✅(Layout mode) |
✅ |
|
Multi-column layout |
❌ Text disorder |
✅ |
✅ |
✅ |
|
Hyperlink extraction |
✅( |
❌ |
❌ |
❌ |
|
Embedded image extraction |
✅(converted to PNG) |
✅ |
✅ |
✅ |
|
Processing speed |
⚡ Fast |
🐢 Medium |
🐢 Medium |
🐌 Slow |
|
Cost |
Free |
💰 Charged per page |
💰 Charged per page |
💰💰 Charged per token |
DOCX
|
Feature |
Support Status |
|---|---|
|
Paragraph text |
✅ |
|
Tables |
✅(converted to Markdown tables) |
|
Embedded images |
✅(extracted as separate files + Markdown markers) |
|
TOC / bookmarks |
⚠️ Partial (may be lost during Pandoc conversion) |
|
Macros / VBA |
❌ Ignored |
|
Revision marks / comments |
❌ Lost |
|
Complex nested tables |
⚠️ Pandoc behavior is unstable |
Tabular Files (Excel / CSV)
|
Feature |
Support Status |
|---|---|
|
Multiple sheets |
✅ Processed sheet by sheet |
|
Formulas |
⚠️ Only calculated values are read ( |
|
Charts / pivot tables |
❌ Ignored |
|
Embedded images |
✅(up to 150 images / file) |
|
Merged cells |
⚠️ May cause data misalignment |
|
More than 20,000 rows |
❌ Parsing rejected |
|
More than 200 columns |
❌ Parsing rejected |
Audio and Video
|
Feature |
Support Status |
|---|---|
|
Speech-to-text |
✅(60s segmented transcription) |
|
Multilingual recognition |
Depends on the transcription service model |
|
Speaker diarization |
❌ |
|
Background music / noise |
⚠️ Affects transcription quality |
|
Video visual content recognition |
❌ Audio track only is extracted |
|
Subtitle / CC extraction |
❌ |
Images
|
Feature |
Support Status |
|---|---|
|
Image content description |
✅ Vision LLM description(≤ 300 words) |
|
OCR text recognition |
⚠️ Depends on Vision LLM capability; not professional OCR |
|
Chart / flowchart understanding |
⚠️ Limited (determined by LLM comprehension) |
|
SVG vector graphics |
⚠️ Depends on whether the LLM can render them |
4. Segmentation Capabilities and Limitations
|
Segmentation Method |
Applicable Scenarios |
Parameters |
Limitations |
|---|---|---|---|
|
Fixed character count( |
General text |
|
May split in the middle of a sentence; single segment ≤ 5~8 images |
|
By page( |
PDF documents |
— |
Only valid for PDF; segment quality may vary greatly when page content differs significantly |
|
By title( |
Markdown documents |
|
Only recognizes |
|
Tabular( |
Excel / CSV |
— |
Dedicated to tabular files |
|
LLM intelligent( |
Scenarios requiring semantic coherence |
— |
Slow and costly; uneconomical for large files |
|
Refine( |
Secondary optimization of coarse segmentation results |
— |
Must be used together with upstream coarse segmentation steps |
General limitations:
-
Protects tables / code blocks from being split during segmentation (
RecursiveCharacterTextSplitterfallback separators) -
Overlong segments (> 65% of chunk_size) use spaCy for sentence-level refinement
-
Too many images in a single segment (> 5 images) trigger forced splitting
5. Field Extraction Capabilities
|
Step |
Function |
Dependency |
Limitation |
|---|---|---|---|
|
|
Document-level metadata (title/author/date, etc.) |
LLM |
Schema must be predefined |
|
|
Segment-level metadata |
LLM |
One LLM call per segment; costly for large files |
|
|
Keyword extraction |
LLM |
— |
|
|
Segment summary |
LLM |
One LLM call per segment |
|
|
Full-document summary |
LLM |
Long documents require truncation or batch aggregation |
|
|
Table description generation |
LLM |
— |
|
|
Table-level summary + row-level narrative grouping |
LLM |
Effectiveness on complex tables depends on LLM comprehension |
|
|
Image description generation |
Vision LLM |
One LLM call per image |
6. Postprocessing Capabilities
|
Step |
Function |
Configuration |
Limitation |
|---|---|---|---|
|
|
Text vectorization |
|
Depends on the Embedding model; image placeholders are automatically stripped |
|
|
Full-text indexing tokenization |
spaCy language model |
PostgreSQL |
|
|
Write vectors into VectorDB |
— |
Batch writes; depends on VectorDB performance |
|
|
Write tokens into PostgreSQL |
— |
— |
7. Format Conversion Capabilities
|
Input Format |
Output Format |
Conversion Engine |
Limitation |
|---|---|---|---|
|
|
|
LibreOffice / Spire |
Requires the corresponding runtime to be installed on the server |
|
|
|
LibreOffice / Spire |
Animations/transitions are lost |
|
|
|
LibreOffice / Spire |
Same as above |
8. External Service Dependencies
|
Service |
Environment Variable |
Purpose |
Impact if Not Configured |
|---|---|---|---|
|
TextIn OCR |
|
PDF/image OCR |
The corresponding OCR step is unavailable |
|
Azure Document Intelligence |
|
PDF layout analysis |
The corresponding step is unavailable |
|
Ali OCR |
Alibaba Cloud credentials |
Chinese OCR |
The corresponding step is unavailable |
|
Embedding model |
LLM Gateway configuration |
Text vectorization |
The EMBEDDING step is unavailable |
|
Vision LLM |
LLM Gateway configuration |
Image description / LLM PDF parsing |
IMAGE/LLM steps are unavailable |
|
General LLM |
LLM Gateway configuration |
Summary/keyword/metadata extraction |
Field extraction steps are unavailable |
|
LibreOffice |
Server-side binary |
Format conversion |
|
|
Pandoc |
Server-side binary |
DOCX → Markdown |
DOCX parsing is unavailable |
|
ffmpeg |
Server-side binary |
Video audio-track extraction |
Video processing is unavailable |
|
spaCy |
Python package + language model |
Tokenization/sentence splitting |
TOKENIZER step and refinement features are unavailable |
9. Summary of Known Boundary Cases
|
# |
Scenario |
Behavior |
Recommended Handling |
|---|---|---|---|
|
1 |
Scanned PDF + Basic parsing |
Extracted content is empty |
Switch to TextIn / Azure DI / LLM steps |
|
2 |
Multi-column PDF + Basic parsing |
Text order is disordered, paragraphs overlap |
Use Azure DI Layout mode |
|
3 |
Complex tables in PDF + Basic parsing |
Table structure is lost, data becomes prose |
Use TextIn / Azure DI |
|
4 |
Encrypted / password-protected PDF |
|
Remove password protection during preprocessing |
|
5 |
Direct upload of |
No native parser |
Ensure the Pipeline includes a file conversion step |
|
6 |
Excel exceeds 20,000 rows |
Parsing rejected, error thrown |
Split into multiple files |
|
7 |
Excel merged cells |
Data may be misaligned |
Unmerge before upload |
|
8 |
Excel formulas |
Only result values are read, not the formulas themselves |
Expected behavior |
|
9 |
Video extracts audio track only |
Visual content cannot be recognized |
If visual information is needed, extract key frames and process separately |
|
10 |
Image OCR accuracy |
Vision LLM is not professional OCR, accuracy is limited |
Use TextIn for OCR-demanding scenarios |
|
11 |
Large files + LLM parsing |
Extremely high cost (charged by page/token) |
Use LLM parsing only for key documents |
|
12 |
Markdown without heading structure + TITLE segmentation |
The entire document becomes one segment |
Switch to FIXED_SIZE segmentation |
|
13 |
PPT animations/video embedding |
Lost after conversion to PDF |
No solution |
|
14 |
DOCX containing macros/VBA/ActiveX |
All macro content is ignored |
Expected behavior |
|
15 |
DOCX revision marks/comments |
Lost |
Accept all revisions before upload |
10. Capacity Planning Recommendations
|
File Type |
Recommended Upper Limit (Single File) |
Reason |
|---|---|---|
|
PDF (Basic parsing) |
≤ 50 pages |
|
|
PDF (OCR parsing) |
≤ 100 pages |
Limited by OCR service API constraints and cost |
|
DOCX |
≤ 20,000 characters |
Pandoc conversion memory usage |
|
Excel |
≤ 20,000 rows × 200 columns / sheet |
Hard limit |
|
CSV |
≤ 20 MB |
Fully loaded into memory |
|
Audio |
≤ 60 minutes |
60 transcription API calls |
|
Video |
≤ 30 minutes |
ffmpeg extraction + transcription; the longer the duration, the higher the failure probability |
|
Image |
≤ 10 MB / image |
Vision LLM input limit |
This document is generated based on code analysis. Actual runtime behavior may vary depending on the deployment environment (memory / CPU / network) and the status of external services. It is recommended to conduct targeted stress testing before use in production environments.