黑洞智能体BLACK HOLE AGENTS
Docs

Document Parsing and OCR

A knowledge base can only search text that has already been extracted. For scanned PDFs, two-column papers, complex tables and image-based pages, get the text parsed correctly first, then tune models and recall parameters.

Start by Identifying the Material Type

Material typeRecommended startMust check
Markdown, TXT, HTMLDefault readingHeading levels, encoding, line breaks
PDF with selectable text, DOCX, PPTXDefault processing firstParagraph order, headers and footers, tables
Scanned PDFs, screenshots, image-based pagesLocal or system OCRRecognition language, amounts, dates, reference numbers
Multi-column, formula-heavy or complex-table PDFsA dedicated document processorReading order, table structure, footnotes

Where Parsing Sits in the Retrieval Chain

Knowledge base retrieval architecture: material goes through parsing and OCR, chunking, keyword and vector search before reaching the answer

Parsing errors carry through to chunking and recall; downstream models can't restore content already lost from the text.

Configure and Verify With a Sample Document

1. Pick a representative sample

Don't import the whole batch first. Pick the document most likely to expose problems, such as a scanned PDF with tables or a two-column manual.

2. Configure processing

Open Settings → Document Processing, choose a parsing service from the dropdown (such as MinerU), and fill in its API Key and API Base URL. OCR is configured separately under Settings → OCR. Local options may need a model download first.

Settings → Documents: configure document parsing and OCR, then verify a sample document (Chinese interface).Settings → Documents: configure document parsing and OCR, then verify a sample document (Chinese interface).

Settings → Documents: configure document parsing and OCR, then verify a sample document (Chinese interface).

3. Import and wait until ready

Add the sample document to the knowledge base. Once processing finishes, open the text and check the headings, paragraphs, page numbers, tables and OCR text.

4. Check the Chunks

Make sure key conditions and conclusions haven't been split apart, and that headers, footers and tables of contents aren't repeatedly filling up chunks.

5. Retest with a real question

In Recall Test, enter a question whose answer is in this document. The results should include the correct source, the complete conditions and the key numbers.

6. Lock in the setup, then import in bulk

Once the sample passes, import material of the same type in batches. If you change the processor, OCR or chunking settings, run Re-index on existing material and test again.

Choosing a Processor and OCR

OptionWhen to useStrengthsCaveats
Default readingCommon text-based formatsLittle setup, fastComplex layouts and scanned pages may lose content
System OCRSupported by your OS and the images are clearNo extra API key, fastAccuracy depends on the OS, language and image quality
Local PaddleOCRYou need offline recognitionDocuments never leave your computerA local model must be downloaded before first use
Cloud or self-hosted processorsTwo-column layouts, complex tables, lots of formulasUsually stronger layout analysisCloud options receive the document content for processing

Diagnosing Common Problems

SymptomCheck firstWhat to do
Text is empty or very shortWhether the file is a scanEnable OCR or switch processors
Two columns interleavedThe reading order of the textUse a processor that's good at layout analysis
Tables turned into scattered textHeaders and row/column relationshipsSwitch processors, or turn the key rules into a Markdown note
Headers and footers keep appearingRepeated noise in ChunksClean up the source file or switch parsers — don't just raise Top K
OCR gets numbers wrongAmounts, dates, reference numbersImprove image clarity and manually check high-risk fields

Settings Reference

SettingRecommended startWhen to change itWhat to do after
File processorDefault processing firstMisordered text, missing tables, empty scanned pagesRe-index the sample document
OCRPrefer local or system options for clear scansImage-based pages have no text or many errorsRe-index and check key fields
Chunk size and overlapKeep the knowledge base defaults at firstConditions and conclusions are split apartChange one thing per round and re-index
Test questions3–5 real questionsAfter changing the processor, OCR or chunkingCompare using the same question set

Example

Lin imports a two-column travel policy PDF. Its status shows ready, but the text interleaves the left and right columns, and the approval conditions in the recall results are incomplete. Instead of raising Top K first, he switches to a processor better suited to layout analysis, re-indexes the same file, and checks the text and Chunks again.

His bar for done: the approval conditions read in their original order, amounts and dates are correct, and the fixed questions recall passages containing the complete conditions.

FAQ

If the text is correct, do I still need to look at the Chunks?

Yes. Correct text only means parsing passed; conditions and conclusions can still be split apart during chunking.

Can raising Top K fix parsing problems?

No. Top K only controls how many passages are returned; it can't restore content that was lost or misordered in the text.

Why didn't the results change after I switched processors?

Existing material is still using the old index. Run Re-index on the relevant items, then retest with the same questions.

Add and organize material
Choose sources and check processing status.
Check material and recall
Verify parsing and chunking with fixed questions.
Data, privacy and maintenance
Understand the boundary between local and cloud data.

On this page