AI · Data
Document OCR and RAG on Amazon Bedrock
Textract OCR, chunking, embeddings and pgvector retrieval on Amazon Bedrock, returning structured answers an app can use.
- RDPV Solutions
- 2026
- Engineer
- Amazon Bedrock · Textract · pgvector · Postgres
2
PATHS
Ingest and answer, each testable on its own
5
STAGES
OCR, chunking, embeddings, retrieval, structured output
Scanned documents in, structured answers out
The goal was an app that could ask questions of PDFs and scans and get back fields it can use directly, not a paragraph of prose to parse.
Two paths through one store
Ingest: Amazon Textract reads the pages, the text is cleaned and split into chunks, Amazon Bedrock embeds each chunk, and the vectors land in pgvector on Postgres. Answer: the question is embedded with the same model, the closest passages are retrieved, and a model on Bedrock answers in JSON fields.
Stage by stage
The pipeline was built stage by stage: OCR first, then chunking and embeddings, then retrieval and structured output, each one testable on its own.