Use when a task involves a document file (PDF, DOCX, PPTX, XLSX, or image) and the agent needs to read it, answer questions about contents, or extract text, tables, or specific values. Provides fast, local, model-free extraction via the `lit` CLI with low-cost search patterns.
Extract text from documents locally with the lit CLI. This skill is about using LiteParse cheaply: each lit parse call re-runs extraction, and every dumped line stays in context on later turns.
Parse once to a file, then search that file.
lit parse "/abs/path/doc.pdf" --format text --no-ocr -o /tmp/doc.txt && wc -l /tmp/doc.txtUse --no-ocr for born-digital PDFs. Drop it only for scanned PDFs or images.
--format text for bounded grep/BM25 question answering. It is the smallest useful working representation.--format markdown when headings, lists, links, table structure, and reading order are part of the answer or downstream artifact.Do not select Markdown because a launch benchmark called it universally more accurate. Parser quality varies by document class; test representative inputs, inspect tables and multi-column pages, and escalate complex or scanned pages. Whichever output you choose, parse once and reuse it.
Get context in the same command instead of grepping and then doing a second read:
grep -n -i -C4 "total assets" /tmp/doc.txt | head -40Batch independent lookups into one command:
for q in "carbon intensity" "scope 1" "total revenue"; do
echo "=== $q ==="
grep -n -i -C3 "$q" /tmp/doc.txt | head -25
doneKeep output bounded with head. Aim to resolve a question in three search commands or fewer. If two targeted greps do not find the answer, switch to the bundled BM25 helper instead of trying one keyword variant per turn.
Use the helper when keywords are uncertain:
./skills/engineering/liteparse/scripts/search.py /tmp/doc.txt \
-q "materiality assessment priority topics" \
-k 8 \
-e 5-k is the number of matches. -e is the number of context lines before and after each match.
--no-ocr.Only screenshot when text search cannot answer the question: dense tables, figures, charts, or bad OCR. Render one page at modest DPI.
lit screenshot "/abs/path/doc.pdf" --target-pages "13" --dpi 150 -o /tmp/shots/Do not start at 300 DPI, and do not re-render the same page unless the first image is illegible.
Keep /tmp/doc.txt and reuse it across questions. Do not reparse the same document for each question.
PDFs work out of the box. If lit is missing:
npm i -g @llamaindex/liteparseOffice documents require LibreOffice. Images require ImageMagick. Both are converted into PDF before LiteParse extraction.