TLDR: I find current AI-enabled editing interactions to be a bit of before-after magic. You click a button & wham: your entire text changes. I built an AI editor called Draftflow that works more like “another person in the room” in a collaborative environment. There is a video below in case you don’t want to read much.
The Problem:
Gen AI-enabled Corrections
An AI that can speak English language and respond sensibly to answers is a dream come true. It truly feels like we’re living in science fiction. We would imagine that such an AI would also be great at editing badly written text and teaching everybody a better way to write. Instead, the process has healthy doses of magic.
You click a ? wand button, and then AI gives you a before/after:

This doesn’t match the mental model of how good writing is made. There is no learning experience here, no way to understand or grok that this aspect of my writing is bad, and this is how you improve. And most importantly: this is not how writers improve text.
Writing is Rewriting
Good writing is rewriting. It’s about seeing a first draft, feeling that it’s not polished enough—that something is wrong—and then crafting words to make it better. This process is sometimes rearranging words, at times finding a more suitable one, but ultimately, it’s about clarifying ideas that are vague even in your head into a revelation when it’s finally put down on paper.
One of the best examples I’ve seen is watching Paul Graham write. Here is an accomplished writer struggling to find the right words to convey what he means. The amount of rewriting he does even for simple sentences is just crazy. I wish students of the craft knew this, knew that even the best writers struggle. And it’s the process of rewriting that makes a good text.
This is so very similar to how editors mark up documents as well. Instead of just spelling and grammar errors, it’s about rearranging words, connecting sentences, rewriting paragraphs, and moving things around to make it clearer.

This is very similar to what DP—my English teacher in school—used to do. There were even strident instructions across the margin: THIS IS NOT CLEAR.
And until it became, the work was not done.
Is there a way to replicate this with the new breed of generative AI tools that we have now?
Draftflow: A Collaborative AI that lives in your Editor
It’s an AI that lives in your editor and corrects your writing as you write it. Think of it like another person in your Google Docs shared document, except it’s an AI, and it’ll just come up behind you and make corrections and suggestions to improve your writing.
I think this replicates the experience of learning how to write from a good editor/teacher in many ways:
- You can watch live as the AI changes words. In the above example, it changed “I am going to just write” to “I will write”. Omit needless words. It’s not a before/after magic process.
- I’ve been writing using Draftflow for a bit now, and even in its early days, you pick up good tips almost by osmosis. It’s amazing how many filler words we use when we write, or how certain constructions (like the use of passive voice) can be rewritten easily.
- It doesn’t interrupt your writing flow. I’ve built a version based on the same technology that powers apps like Google Docs. So just like two writers can work on a document collaboratively, so can an AI clean up your writing after you, while you stay in the flow and continue writing.
More demos
Here’s a video of me talking about the rationale and interacting with it more:
Here’s one of me continuing to write while the AI is editing:
Technical Bits
For Draftflow, I pieced together these bits:
- The simplest OpenAI chat completion API with a custom prompt for text correction.
- Yjs for a good CRDT implementation.
- Quill as the editor, with y-quill (for speaking Yjs) and quill-cursors (for multiple cursors)
- Quill’s Delta format as the format to apply changes in.
The first thing I tried was to get AI to speak Delta natively:

The problem with this approach is that this is not how normal users would type (deleting the whole verrry
word and then replacing it with very
, instead they would just delete the 2 extra r
s). OpenAI’s newest reasoning model does much better at this, but it takes one whole minute to think:

Too slow!
Instead, I implemented a custom Delta diffing algorithm with difflib‘s output, and it works much better at the character level. So the current workflow is this:
- Send the text stream to OpenAI for correction.
- Once you receive it, convert it to a custom character-based Delta ops with many retains from the beginning of the document.
- Translate retains to selection operations as well because the cursor needs to move.
- Apply it server-side as an AI user. Make sure to use RelativePosition correctly.
- Because of the magic of Yjs, these changes will propagate down to the user who’ll see an AI editing these changes.
Limitations & Future Work
This is now Open Source, but I want to put in work to fix some of these issues soon:
- I want to refine my custom delta algorithm to make it more conflict-free. Currently it errors out at times when I keep typing and the fixes roll in. I also want to see if I can start from Delta’s own diff method, and iterate based on its output.
- The current experience does the corrections, but you can imagine a version that suggests instead with editor marks (squiggles and insertion pointers) very much similar to how an editor would do. I want to try building this as well.
Leave a Reply