DEV Community

srinivas reddy gouru
srinivas reddy gouru

Posted on • Originally published at Medium on

I Built Scrivio: An AI Pipeline That Researches, Fact-Checks, and Polishes Technical Articles

Why I stopped asking a chatbot to “write me an article” and instead built a multi-stage pipeline.

github.com/srinivas-reddy-gouru/scrivio

I like writing about the things I build and learn. The hard part was never the writing itself; it was everything that comes before the writing: digging up sources, checking that what I remembered about a framework was still true, drawing the diagram, and then rewriting the whole thing twice because the first draft sounded like a product brochure.

At some point, I did the obvious thing and asked an AI to write a draft for me. And it did, in about four seconds. But the draft had a familiar problem. It was confident, fluent, and quietly wrong in a few places. It cited nothing. It pulled “facts” from training data that may or may not have matched the current version of the library I was writing about. The diagrams didn’t exist. And it had that unmistakable AI texture where every paragraph is the same temperature.

So I kept the idea but threw away the approach. Instead of one model doing one pass, I wanted a pipeline: research first, draft against real evidence, verify every claim, then edit and polish as an actual editorial team would. That turned into Scrivio.

This is the story of what it does, how it works, and the honest answer to the question everyone asks first: why not just use ChatGPT or Claude directly?

What Scrivio actually does

You type a topic. That’s the whole input. Something like How does Kafka handle backpressure? or Spring Security 6 filter chain. From there, Scrivio runs the full chain on its own:

  • Researches the live web for real, recent sources instead of leaning on training data
  • Plans a section-by-section structure tuned to your audience and depth level
  • Draft each section with inline citations tied to the evidence it actually fetched
  • Generates Mermaid diagrams for architecture, flows, and sequence interactions
  • Verifies every factual claim against the source it came from
  • Edits for thesis alignment, voice, and structure (it’ll add a comparison table when the content calls for one)
  • Polishes the voice so it reads like a colleague explaining something, not a generated document
  • Compiles the final article with numbered references resolved at the end

The output is a clean Markdown file, ready to paste into a blog, Notion, or docs site that renders Markdown and Mermaid.

One thing to get straight up front: Scrivio isn’t locked to a single provider. It auto-selects based on the API key you give it. Drop in an Anthropic key, and Claude runs the pipeline. Drop in an OpenAI key and the whole pipeline runs on GPT-4o and GPT-4o-mini instead. Set both, and it defaults to Anthropic unless you tell it otherwise with a LLM_PROVIDER setting. There's no code change involved — a single adapter presents the OpenAI client to every worker as if it were the Anthropic one, so the workers don't even know which provider they're talking to.

Which provider runs the pipeline depends on the keys you set:

  • Anthropic only  — Pipeline runs on Claude (Sonnet + Haiku) · Verifier: GPT-4o-mini (needs the OpenAI key)
  • OpenAI only  — Pipeline runs on GPT-4o + GPT-4o-mini · Verifier: GPT-4o-mini
  • Both  — Anthropic by default, or OpenAI via LLM_PROVIDER=openai · Verifier: GPT-4o-mini

The three quality presets let you trade speed for polish, depending on whether you’re prototyping or shipping. The model names below are the Anthropic defaults; in OpenAI mode, each one maps to its nearest GPT equivalent (Sonnet → GPT-4o, Haiku → GPT-4o-mini), so the preset slider still does its job either way:

Quality presets  — model names are the Anthropic defaults; in OpenAI mode, Sonnet maps to GPT-4o and Haiku to GPT-4o-mini.

  • Fast  — Routing: Haiku / GPT-4o-mini · Writing: Sonnet / GPT-4o · Best for: quick drafts and prototyping
  • Balanced (default) — Routing: Haiku / GPT-4o-mini · Writing: Sonnet / GPT-4o · Best for: the best cost/quality ratio
  • Best  — Routing: Sonnet / GPT-4o · Writing: Sonnet / GPT-4o · Best for: production-quality articles

The slider in the UI doesn’t just change one model. Every stage in the pipeline asks for a central config which model it should use for the current preset, so the whole writing chain moves together when you flip it.

Under the hood: it’s a pipeline, not a prompt

The core mental model is simple. Scrivio is a FastAPI server that takes a request, runs the job in the background, and streams progress to the browser stage by stage so you can watch it think. The UI is a single static page.

The interesting part is what sits behind that server. Rather than one big “write an article” call, the work is split across a chain of specialised workers, each with one job and its own prompt:

topic
  → brief (thesis, angle, hook)
  → relevance check (does the brief match what you asked?)
  → web search + extraction (fetch real pages, chunk them, score relevance)
  → planning (section-by-section outline mapped to evidence)
  → gap-fill search (find more sources for thin sections)
  → drafting (every section in parallel, each claim cited)
  → diagrams (Mermaid spec → rendered SVG)
  → verification (claim-by-claim fact check)
  → editor review + targeted revision
  → critic (final quality gate)
  → humanizer (voice polish, AI-tell scrub)
  → compile (resolve citations into numbered references)
Enter fullscreen mode Exit fullscreen mode

A few of these stages are the ones I’m quietly proud of, because they’re the parts a single chatbot call doesn’t do.

The relevance check runs a cheap Haiku pass right after the brief is written, purely to catch drift. If you ask, “What is X?” and the brief quietly decides to write a dramatic war story instead, it gets caught before the expensive stages spend tokens on the wrong article.

The editor runs two passes. First, it reviews the assembled draft and flags up to a few sections that need rewriting, plus structural hints (for example, “these three things are being compared across two dimensions, turn this into a table”). Then it re-drafts only the flagged sections, so a single weak paragraph doesn’t trigger a full regeneration.

The critic is the final gate. It checks title patterns, opening framing, citation completeness, diagram accuracy, internal consistency, and code-block fidelity, and grades issues as blocking, moderate, or minor. The article only ships if nothing is blocking the remains.

“But Claude or ChatGPT can already write an article…”

This is a fair question, and I want to answer it honestly rather than pretend Scrivio invented writing.

Yes. If you open Claude or ChatGPT and ask for a technical article, you’ll get something readable in seconds. For a casual post, that’s often enough, and Scrivio is overkill. I’m not going to tell you to spin up a pipeline to write a 300-word “5 tips” listicle.

The gap shows up the moment you care about a technical article being correct, sourced, and not obviously machine-written. A single chat call gives you one pass from a single model working off training data. Scrivio is built around the things that one pass skips:

Here’s that comparison table reflowed for Medium. Since it has three columns, the clearest way is one bolded item per line with the two sides underneath:

A single Claude or ChatGPT call gives you a fast draft. Here’s where Scrivio differs, point by point:

  • Up-to-date facts  — Single call: from training data, no live sources. Scrivio: live web search, fetched per run.
  • Citations  — Single call: rarely, and often invented. Scrivio: every claim tied to a fetched source, numbered at the end.
  • Fact-checking  — Single call: the model checks itself, if at all. Scrivio: a separate verifier model checks every claim (a different family when you run in Claude mode).
  • Diagrams  — Single call: described in text, not drawn. Scrivio: real rendered Mermaid SVGs.
  • Editing  — Single call: one pass, one voice. Scrivio: separate editor, critic, and humaniser passes.
  • Reproducibility  — Single call: new chat means starting over. Scrivio: same topic, same pipeline, repeatable settings.

The verification step is the one I’d point to first. Whoever does the writing, a separate verifier model goes through the draft claim by claim and downgrades anything the cited source doesn’t actually support. A model grading its own homework is a known weak spot, and this catches a class of confident-but-wrong statements that self-review tends to wave through. It’s strongest in the default Claude setup, where the writer is Claude and the verifier is GPT-4o-mini — a genuinely different model family doing the checking. If you run the whole thing on OpenAI, the verifier is still an independent, smaller-model pass, just from the same family, so treat it as a second opinion rather than a fully independent one.

So the honest framing is this: a chatbot is a brilliant writer. Scrivio is closer to a small newsroom — researcher, drafter, fact-checker, editor, and copy-editor — that happens to be made of models. Where it shines is exactly where a fast single draft falls: sourced, verifiable, diagram-supported technical writing you’d actually put your name on.

Using it

There are three ways in, depending on how much setup you want.

Web UI (the nice one). Start the server, open localhost:8899, Type a topic, pick depth and audience, choose a preset, and hit generate. The progress panel streams each stage live, which honestly became my favourite part to watch. You can toggle live web search on or off, and flip diagrams on or off, right there in the form.

Command line. If you’d rather script it:

# Fastest: no web search, no diagrams
python main.py --topic "pytest best practices" --level basic --no-web --no-diagrams

# Full run with search and diagrams
python main.py --topic "How does Kafka handle backpressure?" --level intermediate
Enter fullscreen mode Exit fullscreen mode

Output gets written to a timestamped folder with the finished Markdown and a meta.json containing the request params and verification reports, in case you want to see why a claim was kept or dropped.

Claude Code skill (no setup at all). There’s a standalone generate-article.skill in the repo. Drag it into a Claude Code chat (or install it from Settings → Skills), ask it to "write an article about how Kafka handles backpressure," and it runs the workflow with no server, no clone, and no API keys of your own. It's a single self-contained SKILL.md that walks Claude Code through the same eight stages — brief, research, plan, draft, editorial review, critique, and file output — using Claude Code's built-in web search and file tools. This is the lowest-friction way to try the idea before touching the full project.

It is worth being precise about one difference: because the skill runs entirely inside Claude Code on a single model, it skips the separate cross-model verification step that the full server pipeline does. Its review and critique passes are Claude checking its own draft, not an independent verifier from another family. So the skill is the fastest way to feel out the workflow, and the full pipeline is the one to reach for when you want that extra layer of fact-checking.

What’s still rough (and what I’m working on)

I’d rather be upfront about the edges than oversell this. It works well for what it does, but it’s early, and there’s a list I’m actively chipping away at.

Job storage is in-memory right now. Jobs live in the server process, so a restart loses in-flight work. Moving to a persistent store (and a proper queue) is near the top of the list, especially before anyone tries to host this rather than run it locally.

Key setup could still be simpler. You can already run the whole pipeline on a single provider key — just Anthropic, or just OpenAI — and web search is optional on top of that. What I still want to smooth out is the verifier: right now, it always reaches for OpenAI, so the cleanest “one key only” experience is OpenAI mode. Making the verifier fully provider-agnostic (so an Anthropic-only setup needs nothing else) is on the list.

There’s no auth on the server. That’s fine for localhost, but a hosted deployment needs it, so it's a prerequisite for the "run it as a small service" direction I'd like to take.

Output is Markdown only. The pipeline already reasons about basic/intermediate/advanced depth levels internally, but the surfaced output is a single file.

Cost visibility. A full “Best” run touches on many models. I want the UI to show a token and cost estimate up front so a run never surprises you.

None of these is blockers for the core use case, but they’re the difference between “a tool I built for myself” and “a tool other people can comfortably depend on,” and that’s the direction I’m steering it.

Try it

If sourced, fact-checked technical writing is a problem you also have, the repo is here, and it’s MIT-licensed:

github.com/srinivas-reddy-gouru/scrivio

There are five real example articles in the examples/ folder if you want to judge the output before installing anything. And if you try it, I'd genuinely like to hear where it breaks for you — what topics it nails, where the verification is too strict or too loose, and which export format you'd reach for first. That feedback determines what I build next.

Thanks for reading.

A few quick FAQs

Does this replace writing the article yourself?

No, and it’s not trying to. It removes the blank page, the source-hunting, and the first three drafts. The judgment, the opinions, and the final read-through are still yours.

Do I need both Anthropic and OpenAI?

No. Scrivio runs on whichever you give it — an Anthropic key runs the pipeline on Claude, an OpenAI key runs it on GPT-4o. The one nuance is verification, which currently uses GPT-4o-mini, so an OpenAI key gives you the most self-contained single-key setup today. In the default Claude setup, the writer and the verifier come from different model families on purpose, since a model checking its own work is exactly what I wanted to avoid.

Is it free to run?

The code is MIT and free. The API calls are not — you bring your own keys, and a full “Best” run with web search costs real tokens. The “Fast” and “Balanced” presets exist precisely to keep that reasonable.

What’s the minimum to get started?

One LLM key. Just Anthropic or just OpenAI is enough to generate articles; web search is optional and only needs its own key if you want live sources instead of model knowledge. So the smallest setup is a single key, no search.

Do I need to clone the repo to try it?

No. The generate-article.skill file installs straight into Claude Code (drag it in, or Settings → Skills), and from there you just ask it to write an article. It uses Claude Code's own tools, so there's nothing else to set up. The full repo is for when you want the server UI, the cross-model verification, and full control over the pipeline.

Top comments (0)