Parsing for RAG
Extend Parse is a document-to-markdown API built for retrieval-augmented generation (RAG). It turns PDFs, scans, images, spreadsheets, presentations, and email into clean, layout-aware markdown that is already split into semantic chunks, each carrying the page number and bounding box you need to cite the source. You embed the chunks with the model and vector store of your choice.
This page is the end-to-end recipe. For field-level options, see Configuration; for the response shape, see Response Format.
What Parse gives a retrieval pipeline
Recommended configuration
parse_autoroutes simple pages through the Light pipeline and complex pages through Performance, which keeps cost low on mixed document sets. Useparse_lightfor born-digital text at the lowest cost, orparse_performancewhen scans, handwriting, or dense tables dominate.sectionchunking requirestarget: "markdown". TuneminCharactersandmaxCharactersto your embedding model’s ideal input size.- Markdown tables embed well for most retrieval use cases. Switch to
htmlwhen tables have merged cells or nested headers that markdown cannot express. - Advanced chart extraction requires
parse_performancev2.0.0 (or Auto routing a page to Performance) and adds latency proportional to the number of charts.
Ingest: parse, embed, store
Each snippet parses one file with the recommended configuration and builds one record per chunk: the markdown to embed plus the file ID, page numbers, and block IDs you will need to cite the source.
Python
TypeScript
Java
Go
Store the block IDs, page numbers, and bounding boxes alongside each embedding. At answer time, they let you cite the exact region of the source document rather than only the file. The engine value parse_auto is passed as a string in the Java and Go snippets because those SDKs’ typed enum constants predate the Auto engine; both accept unknown enum values.
Retrieve and cite
When a chunk is retrieved, its blocks carry everything needed for a source-grounded answer:
Pass content to the LLM as context, and render boundingBox on page.number as the citation highlight. See Bounding box coordinates for reconciling coordinates with your renderer.
Scale to large document sets
- Use the asynchronous
/parse_runsendpoint and webhooks for anything larger than a handful of pages, and batch processing for backfills. - Bill only for what you need: Light Parse is 0.5 credits per page and Performance is 2 credits per page; see How Credits Work for the per-engine rates and worked monthly totals.
- Re-parse only when the source changes. Block IDs are derived from content, so unchanged blocks keep stable IDs across runs.
When to add extraction
Parse alone answers “what does this document say.” When you also need “what are the fields,” run Extract against a schema on the same file. Extraction reuses the parse, returns citations with bounding boxes and confidence scores per field, and can feed a human review step for accuracy-critical records.

