Liteparse documents

From lemma-work/lemma-platform · View interactive version

Liteparse documents is an AI agent skill from the GitHub repository lemma-work/lemma-platform. Use this skill to parse documents that live OUTSIDE the pod's file system — a PDF an agent fetched from the web, a local one-off, or any file you won't upload — or as a fallback when a pod file lacks its auto-produced markdown/page-images. Extracts text, layout, bounding boxes, OCR, page screenshots

How to use this skill

Skill file

LiteParse Documents

Use LiteParse (lit) to parse documents that aren't in the pod — a PDF an agent pulled from the web, a local scratch file, anything you won't upload — when you need text, spatial layout, OCR, bounding boxes, or page screenshots. It's also the fallback for a pod file whose auto-produced markdown/page-images are missing or insufficient (scanned/OCR, bounding boxes). For a document that lives in (or is going into) the pod, prefer the pod's built-in conversion and search — see below.

When `lit` vs. the pod's built-in processing

Decide by where the document lives — that's the first question, not an afterthought:

Common flow: lit screenshot or lit parse an outside file to inspect it, then lemma files upload the ones worth keeping so the pod converts and indexes them.

Tooling

The machine image installs lit (and the liteparse alias) from

@llamaindex/liteparse, alongside Node and a headed Chromium. That is what you

can count on:

lit --help

Everything else is a probe, not a promise. LibreOffice, ImageMagick and

Tesseract language data are not installed by the machine image, and nothing

sets $TESSDATA_PREFIX. Some runtimes inherit them from their base image and

some do not, so check before you plan around them rather than after a parse

fails:

command -v libreoffice soffice magick convert tesseract
echo "${TESSDATA_PREFIX:-<unset>}"

When one is missing, say so and take the other route rather than trying to

install it: a Word or ODT document can go through lemma files upload and be

read back as the pod's converted markdown (a spreadsheet or presentation cannot:

the pod does not convert those), and a scanned PDF can be rendered with

lit screenshot and read with the image-viewing capability instead of OCR.

Workflow

  1. Identify the file type and the desired output: plain text, JSON with bounding boxes, or page screenshots.
  2. For searchable text or layout extraction, run lit parse.
  3. For visual inspection, charts, scans, handwriting, dense tables, or agent vision workflows, run lit screenshot.
  4. Save generated outputs beside the source file or in a clearly named working directory, then inspect the result before relying on it.
  5. When a file is scanned or image-heavy, keep OCR enabled. Use --no-ocr only when the user wants embedded text only or speed matters more than recall.

Common Commands

Parse to text:

lit parse input.pdf -o output.txt

Parse to JSON with bounding boxes:

lit parse input.pdf --format json -o output.json

Parse selected pages:

lit parse input.pdf --target-pages "1-5,10" --format json -o output.json

Parse Office documents or images:

lit parse input.docx --format json -o output.json
lit parse input.png --format json -o output.json

Generate screenshots:

lit screenshot input.pdf --target-pages "1-3" --dpi 200 -o screenshots

Batch parse a directory:

lit batch-parse input-directory output-directory --recursive --format json

Output Guidance

Troubleshooting

See also

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.