# Convert PDFs and Office documents to RAG-ready Markdown with Apify and OpenAI

> Quick overview Paste document links into a form, convert them into Markdown chunks with page numbers using the Apify Document to Markdown Actor, store them with OpenAI embeddings, and chat with an AI agent that answers only from your files and cites the title and page. How it works 1. Add documents is a form where you paste links to PDF, DOCX, PPTX, XLSX, HTML, EPUB or image files, one per line. 2. Configure turns the pasted text into a list of URLs and sets the chunk size and overlap. 3. Convert to Markdown runs the Apify Document to Markdown Actor. It keeps headings and tables (also borderless PDF tables), reads scanned pages with OCR and returns heading-aware chunks with page numbers. 4. One item per chunk keeps each chunk's text with its source URL, title, page and heading. Files that fail are logged and skipped. 5. Store chunks embeds each chunk with OpenAI and saves it in the Simple Vector Store with that metadata. 6. Chat with your documents opens a chat. The AI agent searches t

- **Domain**: `n8n-workflow-20774.n8n.io`
- **Provider**: n8n.io (https://n8n.io)
- **Kind**: workflow
- **Live-responds (last probe)**: None
- **Signed card**: False
- **Streaming**: False
- **Quality score**: 40%

## URLs
- Agent card: https://n8n.io/workflows/20774
- Page (HTML): https://agenstry.com/agents/n8n-workflow-20774.n8n.io
- Documentation: https://n8n.io/workflows/20774
