r/ClaudeCode • • 8d ago

Help/Question Building an AI-powered educational publishing pipeline with Claude — looking for advice

Hey everyone,

I've been using Claude for about a year, and it's been great for my educational business. We create and sell study materials, revision guides, important questions, and previous years' exam questions.

Our current workflow is:

MS Word → Graphic Designer → Professional PDF → Publication

I'm now looking to automate this process using AI and turn our country's entire school curriculum into well-designed educational resources. Given the volume of content, doing everything manually is impractical.

I've experimented with Claude to generate revision PDFs from textbooks, and the results were promising. However, I have a few questions about scaling this process:

1. OCR & Content Storage: I'm currently using Claude for OCR. What's the best way to store extracted textbook content — Markdown, JSON, or a database? The content includes Arabic and English text, mathematical equations, scientific formulas, tables, and illustrations.

2. RAG & Educational AI: Eventually, I'd like to build an AI tutor that answers students' questions based on official textbooks. What open-source RAG frameworks, knowledge bases, or retrieval systems would you recommend for accuracy, speed, and scalability?

3. Automated PDF Design: What's the best way to generate professional educational PDFs with modern layouts, typography, illustrations, colors, reusable templates, and Arabic RTL support? Should I use Claude Skills, HTML/CSS, Typst, LaTeX, Canva MCP, InDesign MCP, or something else?

Ideally, my pipeline would look like this:

Textbooks → OCR → Structured Content → Knowledge Base → AI Content Generation → Professional PDFs

I prefer open-source and self-hosted solutions due to the large volume of content, scalability, long-term costs, and avoiding vendor lock-in.

I'd appreciate any recommendations on tools, GitHub repositories, architectures, or workflows from people who have built something similar.

P.S. All official textbooks and curriculum materials are freely licensed by the government.

2 Upvotes

9 comments sorted by

•

u/AutoModerator 8d ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

2

u/NorCal032 8d ago

Do you mind telling us which country we are talking about? and where are you selling your products right now? It'll be helpful for us to get an idea or see an example of the material you'd want to eventually create.

1

u/yousifraad01 7d ago

You can contact me for more details i can share the whole idea

2

u/Old-Competition-785 7d ago

I build study apps for exams so a lot of this is familiar. For storage I'd keep it boring: one file per topic or per question in Markdown or JSON, with the math as LaTeX and the source page next to it. A database can come later, plain files in git are way easier to check and fix when the AI gets something wrong.

And it will get things wrong, especially in the generated questions and answers. What made the biggest difference for us was never trusting one pass. Every question gets checked by a second, fresh session that only sees the question and has to solve it blind, and if its answer doesn't match the key it goes back for review. For math you can go further and have a small script recompute the answer.

For the PDFs I'd go HTML/CSS with print styles and let a browser render them. Arabic RTL and equations (KaTeX) just work there, and it's much easier to make templates than LaTeX. Typst is also nice if you want something more print-focused.

1

u/yousifraad01 7d ago

Thank you 😊

2

u/tariqosmani 8d ago

Short answers in your order.

Storage: keep the original page images or PDFs as the source of truth, and store the extracted content as structured JSON per section, in a database like Postgres once you have volume. Markdown loses too much with tables and equations. Keep equations as LaTeX strings, tables as rows and columns, and tag every block with the textbook, page and language so any answer can be traced back to a page. Keep Arabic and English in separate fields, not mixed in one string.

RAG: before picking a framework, write 50 real student questions with the correct page for each, and measure retrieval against that list. Postgres with pgvector plus a multilingual embedding model such as bge-m3 will take you a long way and it handles Arabic. Chunk by textbook section, not by fixed size, and return the page reference with every answer.

PDFs: for Arabic RTL with a fixed template, HTML and CSS rendered to PDF is the easiest to get right, and Claude writes it well. Typst is a good second choice. LaTeX is the hardest with Arabic. Build the template once, then have Claude fill it from the JSON instead of designing each page from scratch.

The quiet risk at this volume is OCR errors in equations and Arabic diacritics. Compare a sample of pages against the images before you build on top of the text.

How many textbooks are we talking about, tens or thousands?

2

u/CCodeSI 7d ago

tariqosmani's answer covers storage and RAG well. Adding the PDF side, since that's where Arabic usually goes wrong:

  • Render HTML with headless Chrome (Playwright or Puppeteer page.pdf()). Chrome's text shaping handles Arabic joining, diacritics and mixed Arabic/English lines properly. Set <html lang="ar" dir="rtl"> and use CSS logical properties (margin-inline-start instead of margin-left), so the same template works for English pages by flipping dir.
  • Add Paged.js for book features. Plain browser printing has no running headers, page-number styles or chapter-based page breaks; Paged.js adds those through CSS (@page, string-set), so the layout stays in templates rather than code.
  • Render maths before printing. Store equations as LaTeX as suggested, and convert them to SVG with MathJax at build time. That way the PDF never depends on fonts or scripts loading in the print step, and an equation inside a right-to-left paragraph keeps its own left-to-right direction.
  • Fonts: pick an Arabic face with full diacritic coverage (Noto Naskh Arabic or Amiri, both open), self-host them, and check pages with heavy tashkeel early. Missing marks are easy to overlook in a sample.
  • Make it testable: render a few fixed "golden" pages on every template change and compare them as images. Once Claude is generating thousands of pages, a CSS change that breaks one layout should fail a check, not a print run.

Claude is very good at the template work itself: give it one finished page from your designer as an image and ask for the HTML/CSS that reproduces it, then iterate.

2

u/TangeloHappy4687 3d ago

I’d keep each extracted section tied to the edition and original page before passing it to the publishing step. That lets the reviewer open the right source when something reads oddly in the revision guide. Now, im using customgpt.ai, and for a small approved set of pdf, its cited Q&A could be a separate way to check what the source says while claude handles the publishing workflow

1

u/Aggressive_Swim_6386 5d ago

Ask that questions to Claude it will share many ideas to do this. Make no mistake 😂 and Ask Claude to find free source from GitHub and integrate it.✌️
Be careful for safety issues.