AI Article Gen — Document-to-Publish Pipeline
Turns a raw Word document into a publish-ready article package — headline, key takeaways, table of contents, body, SEO metadata, FAQs — plus the DOCX, PDF and HTM artefacts the public site serves.

- Year
- 2026
- Type
- Day job
- Role
- Solo developer · In production
- Status
- In production
What needed solving
Preparing an article for publication meant retyping eight derived fields by hand for every piece, then hoping the table-of-contents anchors lined up with the headings they were supposed to jump to. It was slow, it was the same work every time, and the anchors were a recurring source of broken pages.
The solution
Built a six-phase pipeline in Python + FastAPI. Intake is deliberately deterministic — mammoth converts the .docx to semantic HTML with no LLM involved — then editorial guidelines resolve from SQL, and three JSON-mode LLM calls handle structure, body and metadata for a short article. The body pass is chunked by character budget so a long research paper can't exhaust the context window. Render writes the DOCX, PDF and HTM artefacts.
What changed
- Editor's job goes from retyping eight derived fields to upload, review, save
- Table-of-contents anchors match the contents list by construction — both derive from the same document walk, so the model is never asked to keep them in sync
- Editorial rules live as SQL rows resolved exact-type → any-type default → built-in prompt, fail-open on a database fault, so guidelines change without a code deploy
- Three LLM calls for a short article, each retried and budget-counted
Technical highlights
Need something like this?
I take on a small number of projects each quarter. Let's talk if your idea fits.

News Desk — Human-in-the-Loop Story-Discovery Agent
An automated newsroom agent that reproduces an editorial team's morning routine — harvests ~65 primary and ~75 secondary curated source pages across 17 countries for textile/apparel news, scores and de-dupes the best stories with an LLM, confirms each against its primary source, then drafts publish-ready articles. Two-phase with a human in the loop, streamed live over SSE.