Fetch It AI · developer engine
The text cleanup step that ships inside your product
Clean AI generated text, flag what still reads as AI, and hand it back to your app. One install, one function call. It runs entirely in your process, so your users' text never leaves it.
@fetchitai/engine and @fetchitai/review on npm, fetchit-engine on PyPI, source and issues on GitHub.
// one import, one call import { clean } from "@fetchitai/engine"; const result = clean(aiDraft); result.cleaned.text; // safe to send result.flags; // AI phrasing found result.aiReport; // how AI it reads
Runs in your process
No server to call and no key for the core. The text never leaves your app.
Deterministic
The same input always gives the same output. Safe to run on every item, unattended.
Zero dependencies
Nothing else gets pulled in. Pure JavaScript, and pure standard library in Python.
One engine, two languages
Identical results in JavaScript and Python, held in lockstep by a shared test suite.
Quickstart
Install it into whatever service already generates your text, then call it. Nothing to configure.
import { clean } from "@fetchitai/engine";
const result = clean(aiDraft);
result.cleaned.text; // the finished string, safe to send
result.edits; // every change, with positions
result.flags; // AI-sounding phrases, with positions
result.aiReport; // a 0 to 100 score and levelfrom fetchit_engine import clean result = clean(ai_draft) result["cleaned"]["text"] # the finished string result["edits"] # every change, with positions result["flags"] # AI-sounding phrases result["aiReport"] # a 0 to 100 score and level
Put a person in the loop
Drop in the review widget and the reader sees what changed, accepts or rejects it, edits by hand, then you get the final text back. This one is live, running on sample AI copy right here in the page.
Or run it fully automated
For a pipeline with no person in it, like a news feed rewritten by AI for several social platforms, clean each item in the loop you already have. Only the safe fixes apply unattended; you can hold back anything that still reads as AI.
Backend pipeline
One line between your rewrite step and your publish step.
import { clean } from "@fetchitai/engine";
async function publishRewrite(article, platform) {
const aiPost = await rewriteWithAI(article, platform); // your AI step
const result = clean(aiPost, { mode: "auto" }); // Fetch It AI
const finalPost = result.cleaned.text; // junk removed
// optional: hold back the ones that still read as AI
if (result.aiReport.status === "ok" && result.aiReport.level === "high") {
return flagForReview(finalPost, result.flags);
}
await publishTo(platform, finalPost); // your publish step
}
What you get back
Every call returns the cleaned text plus a full, positioned record of what changed and what to review. Apply only the edits you accept, or feed the flags to your own rewrite step.
{
cleaned: { text: "..." }, // send this
edits: [ // what was fixed, and where
{ ruleId: "dash.spaced", category: "dash",
start: 42, end: 45, original: " — ", replacement: ", " }
],
flags: [ // AI-sounding wording to review
{ ruleId: "ai-wording.delve", start: 12, end: 17, text: "delve" }
],
aiReport: { score: 38, level: "moderate", signals: [ ... ] },
summary: { hidden: 1, dashes: 1, flagged: 3 }
}
License
Apache-2.0. Free for everyone, including inside a product you sell. There is nothing to buy, no key, and nothing to sign.
Free
- The engine in JavaScript and Python
- The review widget, no badge required
- Commercial use, redistribution, and white-label
- Apache-2.0, including the patent grant
Questions about using it at scale, or want a rule set tuned to your house style? Email support@fetchitai.com. There is a paid consumer tool at fetchitai.com if you want the hosted version for your own writing.