100,000-Word Coursebook. ~$500 in AI Costs.

Written by, Adnan Khan on March 2, 2026

case-studyai-engineeringeducation

A 100,000-word professional coursebook. 43 sections. 50+ diagrams and photographs. Print-ready PDF with color-coded chapters and professional typesetting. The works.

Total AI cost: ~$500.

The manual alternative? $10,000+ in writer fees. Months of subject matter expert time. And you’d still need someone to typeset it.

The Problem

CEOSH is an accredited awarding body for professional qualifications. They needed a coursebook for the NEBOSH International General Certificate, one of the most recognized health and safety certifications on the planet.

This isn’t a blog post or a marketing ebook. People study this to pass a professional exam. Every fact needs to be accurate. Every section needs to map to the official syllabus. Every claim needs to trace back to real reference material. Get it wrong and you’re failing students.

Producing this the traditional way means hiring subject matter experts to write 100,000+ words from scratch. You’re looking at months of work and a five-figure budget before you even think about typesetting, diagrams, or review cycles.

But here’s what makes this an engineering problem, not a writing problem: the content already exists. It’s spread across eight reference textbooks. The syllabus specifies exactly what needs to be covered. The knowledge is there. It just needs to be organized, written at the right level, and formatted into a coherent coursebook.

What We Actually Built

We built a multi-stage AI pipeline that takes reference books and a syllabus specification as inputs and produces a complete, professionally typeset coursebook as output.

“AI pipeline” is a phrase that means everything and nothing though. So here’s what actually happens under the hood.

Step 1: Build the Knowledge Base

Eight reference textbooks get parsed, chunked, and embedded into a vector database. Think of this as giving the AI a searchable library. When it needs to write about fire risk assessments, it searches the library and pulls the relevant passages from the actual textbooks.

This is the foundation that prevents hallucination. The AI isn’t making things up. It’s synthesizing content from real sources.

Step 2: Map the Syllabus

The NEBOSH syllabus has 11 elements, 43 sections, and hundreds of specific topics that must be covered. We parse this into a structured specification. A planning agent then maps every syllabus topic to the relevant reference material.

Some of the reference books were pre-2019 while the syllabus is current. Where they’re outdated, the planner flags topics that need supplementation from authoritative sources like the UK Health and Safety Executive, OSHA, and ISO standards.

Nothing gets written until we know exactly what needs to be said and where the source material lives.

Step 3: Write, Critique, Revise

This is where it gets interesting. For each of the 43 sections:

A writer agent drafts the section using dual-RAG retrieval. It pulls from both the reference textbook knowledge base and all previously approved sections. That second part matters a lot. It means Section 8.3 knows what terminology was used in Section 2.1. The whole book stays consistent without a single human holding every detail in their head.

A critic agent evaluates the draft against the syllabus. Not a vibe check. A structured evaluation with a numeric coverage score, a list of specific missing topics, and targeted revision suggestions.

If coverage falls below 85%, the writer revises with the critic’s specific feedback. One targeted revision pass. We’re not running some infinite loop that burns tokens for no reason.

Then a humanizer agent does a final style pass. It strips out the patterns that make AI writing sound like AI writing: the banned vocabulary, the repetitive transitions, the suspiciously uniform sentence structures. After that, the section goes to a human subject matter expert for review. They can approve it, reject it with feedback, or request a full regeneration.

Step 4: Generate the Visuals

Every section includes diagrams and photographs. The AI writes image descriptions during drafting, and those get fulfilled in two ways.

SVG diagrams (hierarchy charts, flowcharts, risk matrices, PDCA cycles) are generated as raw code by an LLM agent. Photographs are generated via DALL-E 3 with carefully written prompts specifying UK workplace context, correct PPE, and photorealistic style.

Every single image goes through its own human approval loop. Nothing goes to print without a real person signing off.

Step 5: Typeset and Output

Approved sections get compiled into a print-ready PDF using Typst. The template handles color-coded chapters, professional headers and footers, automatic table of contents, inline images, callout boxes, and review questions.

You could hand it to a student and they’d never know the first draft was written by AI.

Why This Doesn’t Produce Garbage

If you’ve worked with AI-generated content before, you probably have a healthy skepticism right now. Good.

Every fact is grounded. The writer doesn’t generate from its training data. It searches the reference textbook knowledge base and synthesizes from real sources. No source material, no claim.

Every section is evaluated. The critic agent checks each draft against the specific syllabus requirements for that section. Missing a required topic? It gets flagged and the writer addresses it. This isn’t “generate and pray.”

Every output is structured. Every agent returns validated data models. The critic returns typed fields for coverage score, quality assessment, missing topics, and feedback. There’s no free-text parsing or regex extraction. Malformed outputs are structurally impossible.

Every section has human review. A subject matter expert approves every piece of content before it’s final. The AI gets you to 85%+ accuracy on the first pass. The human closes the gap.

The system remembers what it already wrote. Dual-RAG means the writer can search both the source textbooks and all previously approved sections. Section 11 references concepts from Section 1 correctly because it has access to the approved version. Cross-section consistency without a single author holding the entire book in their head.

The Numbers

That last point matters more than you’d think. When you’re running a 43-section pipeline, things will go wrong. API timeouts. Rate limits. Session interruptions. Every stage writes its output to disk. The pipeline picks up exactly where it left off.

What This Means for You

You’re probably not building a NEBOSH coursebook. But here’s what you might have:

A training program that lives in someone’s head and a handful of slide decks. A compliance manual that needs to exist but nobody has time to write. An onboarding curriculum that should be 10x better than it is. A body of knowledge spread across documents, textbooks, and institutional memory that should be a structured course but isn’t, because the cost of creating it properly has always been prohibitive.

That cost equation just changed.

The pattern is general: take existing knowledge sources, map them to a structured specification, and use AI to produce a high-quality first draft with human oversight closing the gap. The specific implementation changes based on your domain. The architecture doesn’t.

Let’s Talk

If you’re sitting on content that should be a course, or a manual, or a training program, and the thing stopping you is the time and cost of producing it properly, we should have a conversation.

Not a sales pitch. Just a conversation about what you have, what you need, and whether a system like this makes sense for your situation.

Start a conversation.

elfmachines-ai

$ AI assistant coming soon...

In the meantime, start a conversation with our team.

> Type a message... _