The OCR & Speech Workspace was built to make books searchable — page-batched, concurrent OCR over PDFs, then document-scoped RAG chat with page citations. The OCR model is the easy part. The pipeline around it is what decides whether page 214 is findable six months later.

Split into pages, then batch

Process the PDF page by page and OCR pages in concurrent batches. Per-page processing gives you natural checkpoints (a crash on page 300 does not lose 299 pages), natural citations, and natural parallelism. Tune batch size to the OCR provider's rate limits, and record per-page status so a re-run only touches failures.

Keep the layout, not just the words

Modern OCR returns structure — headings, paragraphs, tables — as markdown or blocks. Preserve it. A table flattened into a paragraph is unsearchable and uncitable. Structure is also what makes chunking for RAG work downstream: heading context travels with each chunk.

Quality checks that catch bad pages

  • Character count far below the document average — a blank or failed page.
  • High ratio of non-dictionary tokens — a rotated or low-resolution scan; re-run with rotation detection.
  • Repeated headers and footers — strip them before chunking or every chunk starts with the book title.
  • Language detection per page for bilingual documents, so the right embedding model is used.

Store for search and for citation

  1. Text per page, with page number and document id.
  2. Chunks with page ranges and heading context, embedded for hybrid retrieval.
  3. A content hash per document so re-uploads do not re-OCR.

What it enables

Once pages are text with metadata, "where does this book discuss X?" becomes a retrieval question with a page-level answer, and citations in RAG answers become links a reader can open. I wrote about the workspace itself in every page and every word, searchable.

Pranjul Rathour, GenAI Engineer from Kanpur, India. Open to GenAI roles, hackathon judging, mentorship sessions and guest talks at any campus: pranjulrathour41@gmail.com.