Skip to content
AI · Data2026

Document OCR and RAG on Amazon Bedrock

Textract OCR, chunking, embeddings and pgvector retrieval on Amazon Bedrock, returning structured answers an app can use.

Client
RDPV Solutions
Year
2026
Role
Engineer
Stack
Amazon Bedrock · Textract · pgvector · Postgres
2
PATHS
Ingest and answer, each testable on its own
5
STAGES
OCR, chunking, embeddings, retrieval, structured output

01 · Discover

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.

02 · Architect

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.

IngestAnswertextvectorscontextDocumentsPDFs and scansAmazon TextractOCRChunkingclean and splitEmbeddingsAmazon BedrockpgvectorPostgresQuestionuser or appEmbed queryAmazon BedrockRetrievetop matchesGenerateLLM on BedrockStructured outputJSON fields
Fig. 1 · Ingest and answer paths. Hover or tab through a node to trace its connections.

03 · Build

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.

Next case study

Sarah, an AI employee that answers the phone