Dev.to AI πŸ€– Ai πŸ‘ 0 πŸ“– 11 min read

InkFlow: The Adaptive Writing Twin & Anti-AI-Slop Engine

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle What I Built We are living through a time when AI-generated writing is becoming increasingly common, but much of it soun

InkFlow: The Adaptive Writing Twin & Anti-AI-Slop Engine

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle

What I Built

We are living through a time when AI-generated writing is becoming increasingly common, but much of it sounds remarkably similar.

When people use generic AI assistants to polish emails, academic papers, or technical reports, their original writing style can get replaced by repetitive buzzwords, predictable sentence structures, and a uniform corporate tone.

For students, researchers, professionals, and content creators, this creates a problem: their writing can lose the personal voice and natural rhythm that make it their own.

That's why I built InkFlow: The Adaptive Writing Twin & Anti-AI-Slop Engine.

InkFlow is an adaptive writing assistant designed to help people improve their writing while preserving their individual style.

It has four core capabilities:

  • Personal Style Genome: Uses a two-minute linguistic calibration exercise to build an eight-dimensional profile of a user's writing style, including formality, sentence-length variation, vocabulary diversity, clause structure, and punctuation habits.
  • AI-Slop Detection: Identifies common synthetic writing clichΓ©s and highlights phrases that make a draft sound generic.
  • Four-Stage Rewrite Pipeline: Generates or transforms text, removes unwanted stylistic patterns, checks semantic consistency, and performs a light grammar pass designed to preserve the author's punctuation preferences.
  • Adaptive Style Learning: Tracks writing changes across sessions and incorporates recurring stylistic preferences rather than overreacting to a single edit.

InkFlow is designed for university students, academics, non-native English professionals, content creators, and technical writers who want writing assistance without losing their own voice.

The Side Hustle: Monetization

InkFlow follows a freemium model.

Free Tier: Includes 1,500 words per day, one personal Style Genome profile, AI-slop highlighting, and access to the Humanize Studio.

Pro Tier β€” β‚Ή39/month: Offers unlimited daily words, multiple writing profiles for different contexts, and priority access to higher-capacity open-weight models through an integrated Razorpay checkout supporting UPI, cards, and net banking.

The goal is to make personalized writing assistance affordable for students and independent creators.

Demo

Live Web Application: https://ink-flow-twin.vercel.app

Backend API: https://inkflow-backend-73hf.onrender.com

Demo Video:

Here are some features you can explore:

  • Humanize Studio: Paste a draft or raw bullet points, identify common AI-writing clichΓ©s, and refine the text with character-level punctuation differences.
  • Two-Minute Voice Calibration: Complete four linguistic exercises to generate a personalized Style Genome.
  • Sentence Cadence Analytics: Inspect sentence-length variation across paragraphs.
  • Direct AI Writer: Draft emails and lecture notes, then refine them through the Humanize Studio.

Code

GitHub Repository: https://github.com/SoumyaGhosh2006/InkFlow

The project uses a modular full-stack architecture.

Backend: FastAPI, Python 3.11+, Motor for asynchronous MongoDB access, Groq inference, Pydantic v2, Razorpay integration, Sentry tracing, and Pytest.

Frontend: React 19, TypeScript, Vite, Tailwind CSS, Framer Motion, Zustand, Radix UI, Lucide icons, and Firebase Authentication.

The repository includes the implementation of the writing pipeline, style calibration, authentication, and subscription workflow.

How I Built It

1. Dual-Tier Open-Weight Inference

Rather than depending on a single model, InkFlow uses a primary model and a fallback model through Groq.

  • Primary model: openai/gpt-oss-120b handles complex stylistic transformations, nuanced rewriting, and Style Genome conditioning.
  • Fallback model: openai/gpt-oss-20b provides a lighter alternative when the primary model encounters timeouts, rate limits, or latency issues.

The backend uses FastAPI to coordinate requests from the React frontend and route them through the sequential rewriting pipeline.

2. The Eight-Dimensional Style Genome

A generic instruction such as "rewrite this in my tone" often produces an exaggerated imitation rather than a useful representation of someone's writing style.

InkFlow instead uses a short linguistic calibration exercise to capture different aspects of how a person writes.

The eight dimensions are:

  • Formality: The balance between academic language and conversational expression.
  • Syntactic Density: How frequently subordinate clauses appear in sentences.
  • Lexical Entropy: Vocabulary diversity and variation.
  • Burstiness Variance: Variation in sentence length, from short statements to longer, more complex sentences.
  • Punctuation Signature: The author's use of em-dashes, semicolons, commas, and other punctuation.
  • Clause Chaining: How the author connects related ideas.
  • Contraction Ratio: The frequency of forms such as "don't" and "it's."
  • Tone Affinity: Whether the writing tends to be assertive, exploratory, analytical, or pragmatic.

Together, these dimensions provide a more structured starting point for adapting the writing process to individual preferences.

3. The Four-Stage Sequential Rewrite Pipeline

InkFlow processes writing through four stages.

Stage 1 β€” Base Draft Generation: Expands raw bullet points or creates a first draft while preserving the original assertions.

Stage 2 β€” Style Transformation and Slop Removal: Applies the user's Style Genome and removes common synthetic clichΓ©s.

Stage 3 β€” Semantic Fidelity Check: Checks whether the transformed text retains the source's meaning and triggers a retry when significant semantic drift is detected.

Stage 4 β€” Quirk-Preserving Grammar Pass: Corrects errors while attempting to preserve characteristic punctuation choices and deliberate stylistic patterns.

The final result includes character-level differences so users can inspect the changes instead of blindly accepting a rewritten draft.

4. Engineering Challenges and Solutions

Challenge 1: Preserving Personal Punctuation

Conventional grammar correction can remove em-dashes, semicolons, and other punctuation habits that are part of someone's writing style.

InkFlow separates grammar correction into its own stage and uses deterministic checks to help protect those preferences.

Challenge 2: Preventing Semantic Drift

Aggressive clichΓ© removal can accidentally remove important context, numbers, or factual claims.

InkFlow includes a semantic verification stage designed to detect meaningful divergence and retry when the rewritten text no longer adequately reflects the source.

Challenge 3: Improving the Mobile Writing Experience

A side-by-side editing layout can become difficult to use on smaller screens.

The mobile interface uses a segmented switcher between the source draft and the humanized result, a compact warning strip for detected phrases, and an automatic transition to the result after rewriting.

Challenge 4: Strengthening Authentication

During development, mock authentication tokens created the risk of visitors inheriting a test session instead of signing in with their own accounts.

The production implementation rejects mock tokens, removes frontend fallback tokens, uses Firebase browser-session persistence, and includes an inactivity-based logout policy. The application also allows users to explore drafting features while prompting them to sign in for protected operations.

5. Subscription and Reliability

InkFlow combines Firebase Authentication with a Razorpay-based subscription workflow. Its backend also includes Pydantic request validation, Sentry tracing, and automated tests.

The primary and fallback model arrangement is designed to improve resilience when the primary inference service experiences problems.

These components support the project's broader goal of making personalized writing assistance practical and affordable.

Why Does Open Innovation Matter?

Open innovation matters because writing is personal. People should have more control over how AI transforms their words instead of being forced into a single model's default writing style.

Greater control over writing style: Open-weight models give developers more flexibility to experiment with prompts, model selection, and style-conditioning techniques. This makes it possible to build a writing assistant around individual preferences rather than a generic corporate voice.

More flexible inference: InkFlow uses a primary and fallback model, helping the application respond to model availability and latency problems without relying entirely on one model configuration.

Affordable access: The project combines open-weight inference with a low-cost subscription model intended for students and independent creators.

A focus on authorship: The goal is not to replace a person's ideas with machine-generated prose. It is to help people express their existing ideas more clearly while retaining the characteristics that make their writing recognizable.

InkFlow is an exploration of how open-weight AI can support a more personalized writing experience.

My Agent Session

Architecting InkFlow: The Adaptive Writing Twin, Anti-AI-Slop Engine & Psycholinguistic Genome
You

Let's build InkFlow: an adaptive personal writing twin and anti-AI-slop assistant for university students and professionals. Commercial AI writing tools sanitize and homogenize text with robotic clichΓ©s ('delve into the tapestry', 'crucial testament'). We need: 1) A resilient 2-tier open-weight inference engine (Groq openai/gpt-oss-120b primary, 20b fallback), 2) A 4-stage sequential rewrite pipeline that purges slop but strictly preserves personal punctuation quirks (em-dashes, semicolons, conversational comma splices), 3) A 2-minute psycholinguistic Voice Calibration Drill (Pennebaker & King 1999 + Boston Cookie Theft), and 4) Daily/weekly word quota tracking.

Show more
Agent

I will architect InkFlow with a FastAPI backend and React 19 / TypeScript frontend adhering to a 4-Stage Sequential Rewrite Pipeline and an 8-Dimensional Psycholinguistic Style Genome extractor:
1. backend/services/providers.py: Configured resilient 2-tier Groq inference (openai/gpt-oss-120b primary with connect=2.5s / read=9.0s timeouts, auto-failover to openai/gpt-oss-20b within 800ms).
2. backend/services/pipeline.py: Implemented Stage 1 (Generate), Stage 2 (Tone & Slop Purge), Stage 3 (Semantic Meaning Check with reason-aware retry on >15% drift), and Stage 4 (Non-Destructive Light Grammar Pass preserving human punctuation quirks).
3. backend/services/grill.py & DrillCard.tsx: Engineered the 2-Minute Voice Calibration Drill mapping uninhibited writing to 8 psycholinguistic parameters (Formality, Syntactic Density, Lexical Entropy, Burstiness Variance, Punctuation Signature, Clause Chaining, Tone, Contractions).
4. backend/services/quota.py: Enforced lazy weekly/daily quota resets with 1,500 words/day on the Free tier.

Show more
β–Έ write_to_file backend/app/services/pipeline.py
Input
backend/app/services/pipeline.py
Output
Created 4-stage sequential transformation pipeline with reason-aware semantic retry and punctuation protection gates.
β–Έ write_to_file backend/app/services/providers.py
Input
backend/app/services/providers.py
Output
Implemented dual-tier Groq LPU provider failover (120B primary -> 20B fallback) with granular connection timeouts.
β–Έ run_command pytest tests -q
Input
$ pytest tests -q
Output
39 passed, 0 failures. Verified provider failover, 4-stage retry gate, punctuation preservation, and quota resets.
You

Integrate Razorpay Standard Web Checkout for the Pro subscription tier. We need: 1) Backend endpoint to create orders (POST /api/v1/payments/create-order) with HMAC-SHA256 signature verification (POST /api/v1/payments/verify), 2) Frontend checkout modal with UPI/Card/Netbanking support, and 3) Set the Pro plan to β‚Ή39/month (democratized student pricing) instead of β‚Ή499.

Agent

I have implemented Razorpay standard checkout for the β‚Ή39/mo (3,900 paise) Pro subscription tier:
1. backend/app/api/v1/payments.py: Created POST /create-order and POST /verify endpoints with cryptographic HMAC-SHA256 signature validation.
2. frontend/src/components/payments/UpgradeModal.tsx: Integrated Razorpay Checkout SDK (checkout.js) supporting UPI, card, and netbanking, with confetti celebrations on upgrade and automatic tier elevation to 'pro'.
3. Set default order amount to 3900 paise (β‚Ή39) across backend services, frontend API, and test suites.

β–Έ replace_file_content backend/app/api/v1/payments.py
Input
backend/app/api/v1/payments.py
Output
Configured Razorpay order creation and signature verification with default amount 3900 paise (β‚Ή39).
β–Έ replace_file_content frontend/src/components/payments/UpgradeModal.tsx
Input
frontend/src/components/payments/UpgradeModal.tsx
Output
Updated Pro subscription UI and checkout payload to β‚Ή39/mo.
You

When opening on a phone, the mobile view is severely broken. The textarea is cramped to 2 lines, output is pushed off-screen, and a wall of 9 slop chips plus docks cover the screen. Also, whenever I open on my phone or incognito, I am automatically logged in as 'Test User' with a dev token. Please fix the mobile layout so it's clean and easy to write, and fix the auto-login security bug.

Agent

Diagnosed and resolved both issues:
1. Mobile Layout Redesign (TransformationStudio.tsx): Replaced the squeezed dual-pane vertical stack on phones (< lg) with a mobile-segmented switcher: [ Source Draft ] vs. [ Humanized Result ]. When on Source Draft, the textarea gets the full phone viewport height. Replaced the 200px slop chip cloud with a compact 1-line amber alert banner. Tapping 'Humanize Draft' automatically slides the view to the Humanized Result tab with streaming diffs and action docks.
2. Auth Security Hardening (security.py & api.ts): Discovered the frontend was falling back to 'test-token' for unauthenticated users, which backend resolved to 'Test User'. Removed the fallback token and locked mock tokens strictly to DEBUG mode. In production, unauthenticated requests are properly treated as anonymous.

Show more
β–Έ replace_file_content frontend/src/components/studio/TransformationStudio.tsx
Input
frontend/src/components/studio/TransformationStudio.tsx
Output
Implemented responsive segmented view switcher (Source Draft vs Humanized Result) for mobile screens.
β–Έ replace_file_content backend/app/core/security.py
Input
backend/app/core/security.py
Output
Locked mock test tokens strictly to non-production environments with HTTP 401 enforcement.
You

Let users browse and use the tool without signing in (drafting, exploring tabs), but if they try to do ANY active operation like humanizing text or training the model, notify them with a sign-in modal, and block them until they sign in. After signing in with Google, keep them logged in permanently unless they click logout or remain inactive for 1 week. Also audit Razorpay environment variables.

Agent

Implemented the full unauthenticated exploration + action gating system and permanent session lifecycle:
1. AuthModal (frontend/src/components/auth/AuthModal.tsx): Created an interactive Google sign-in modal that triggers whenever an unauthenticated visitor attempts active features: Humanize Draft (useStudioStore), Voice Calibration Drill (DrillCard), AI Chat composition (ChatWriterView), or Writing Adaptations (ActionDock).
2. Permanent Session & 1-Week Inactivity Policy (firebase.ts & App.tsx): Configured Firebase browserLocalPersistence so logged-in users remain permanently signed in across browser restarts. Added throttled user activity tracking (inkflow_last_activity) with automatic logout after 7 consecutive days of zero interaction.
3. Razorpay Env Security Audit: Verified RAZORPAY_KEY_SECRET is strictly confined to backend code and purged an unnecessary secret copy from frontend/.env, ensuring checkout uses only public key IDs.

Show more
β–Έ write_to_file frontend/src/components/auth/AuthModal.tsx
Input
frontend/src/components/auth/AuthModal.tsx
Output
Created accessible AuthModal with Google authentication, value highlights, and activity gating.
β–Έ replace_file_content frontend/src/lib/firebase.ts
Input
frontend/src/lib/firebase.ts
Output
Configured browserLocalPersistence, 1-week inactivity timeout limit, and throttled activity tracking.
β–Έ run_command npm run build && pytest tests -q
Input
$ npm run build && pytest tests -q
Output
Frontend built in 2.37s with 0 errors. All 39 backend tests passed.
8 of 8 messages

Direct Session Link: View full agentic session transcript on DEV

My First User

what my first customer said

Prize Categories

Based on the project description, these are the partner categories to consider. Include only those for which you can demonstrate the required integration.

  • Best Use of Render: The FastAPI backend is deployed on Render.

  • Best Use of Sentry Agent Tracing:

Team Submissions

@aishani_3009 was in my team, help me to develop this product.

My aim with InkFlow is to build writing assistance that adapts to people rather than making people adapt to AI.

Better writing should still sound like you.

Hacktoberfest #DEVChallenge #HF26Challenge #SideHustle #AI #OpenSource #WritingTools

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.