What an AI writing assistant is
An AI writing assistant is, at its core, an LLM call with a well-crafted prompt wrapped in a responsive editor. The user types or pastes text, picks what they want — fix grammar, rewrite the tone, tighten for clarity, or get suggestions — and the model returns the result, ideally streamed into the editor in real time. Tools like Grammarly and Notion AI are elaborate versions of exactly this. The hard part is not the API call; it is writing prompts precise enough that each mode does only what it should. The builder below generates those prompts for you, scoped per mode.
How it works
The architecture is small. A mode maps to a system prompt that defines the task and its constraints. The user’s text becomes the user message. The model’s reply is streamed back token by token and rendered into a preview pane, so edits appear as they generate rather than after a long pause. The key engineering insight is that the constraints matter as much as the task: a grammar mode must be told to change only grammar, spelling, and punctuation and to preserve the author’s voice — otherwise the model “helpfully” rewrites sentences nobody asked it to touch. A rewrite mode, by contrast, needs a target tone and a length instruction. The builder above encodes these scoped prompts for each mode.
Tips and modes
Use the builder to produce a system-and-user prompt pair, then drop it into a chat completions call with streaming enabled. A few patterns worth shipping: a grammar mode locked to mechanical corrections only; a tone mode with a selectable target voice and a preserve-length option; a clarity mode that tightens wordy sentences; and a suggestions mode that returns each change as an edit-and-reason pair so users can accept or reject individually — ask the model for structured output so your UI can render each suggestion separately. Note the limits: a model cannot reliably detect true plagiarism, which needs a corpus comparison, though it can flag clichéd or templated phrasing. To make your first underlying API call, start with the ChatGPT API beginner’s guide.