โŒจ๏ธ TypingFlow AI

March 13, 2026 ยท View on GitHub

The Intelligent Behavioral Analytics & Real-Time Performance Benchmarking Suite


๐Ÿง  What is TypingFlow AI?

TypingFlow AI is a dual-platform analytical suite (Chrome Extension + VS Code Extension) that goes far beyond standard WPM trackers. It uses Big Data Analytics and Machine Learning to understand how you type not just how fast.

Most typing trackers treat every pause the same. TypingFlow AI doesn't. Its core AI engine distinguishes between a "productive thinking pause" (you're mentally composing your next sentence or debugging a function) and genuine idle time so your performance stats are always accurate and meaningful.


โ— Problem Statement

Standard typing trackers fail in two key ways:

  • Skewed averages โ€” A hard-coded 3-second idle reset penalises deep thinkers and complex coders unfairly
  • No context awareness โ€” Typing speed while coding Python is very different from typing in a WhatsApp chat, yet most tools treat them identically

TypingFlow AI solves both problems with ML and Big Data.


โœจ Key Features

๐Ÿค– AI Thinking-Pause Engine

  • A Random Forest model trained on 200,000 labelled sessions predicts whether a pause is productive thinking or genuine idle time
  • Contextual awareness โ€” longer pauses are allowed in VS Code coding sessions than in chat windows
  • Real-time prediction via REST API with confidence scores

๐Ÿ“Š Global Benchmarking (Big Data)

  • Individual sessions benchmarked against a 1.1 million+ session data lake
  • Real-time percentile ranking: "Your Python coding speed is in the top 5% globally!"
  • K-Means Clustering assigns every user one of 5 Typing Archetypes

๐ŸŽญ Typing Archetypes

ArchetypeDescription
โšก The Rapid StreamerHigh WPM, high consistency, born for flow
๐Ÿ›๏ธ The Deliberate ArchitectSlow, precise, virtually error-free
๐Ÿ’ฅ The Bursty CoderExplosive bursts followed by deep thinking pauses
๐Ÿ‚ The Steady WorkhorseReliable, consistent, always getting the job done
๐Ÿš€ The SprinterBlazing fast with corrections to match

๐Ÿ“ˆ Advanced Metrics

  • Consistency Score โ€” standard deviation of keystroke intervals
  • Burst WPM โ€” peak speed during flow state periods
  • Error Recovery Rate โ€” backspace ratio vs WPM
  • Hourly Trends โ€” when do you type fastest during the day?

๐Ÿ—๏ธ System Architecture

TypingFlow/
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ generate_dataset.py       # Generates 1.1M synthetic sessions
โ”‚   โ””โ”€โ”€ typing_sessions.parquet   # Compressed dataset (~60MB)
โ”œโ”€โ”€ analytics/
โ”‚   โ”œโ”€โ”€ duckdb_benchmarks.py      # DuckDB SQL analytics + K-Means
โ”‚   โ””โ”€โ”€ benchmarks/               # 5 JSON benchmark files
โ”‚       โ”œโ”€โ”€ global_benchmarks.json
โ”‚       โ”œโ”€โ”€ hourly_trends.json
โ”‚       โ”œโ”€โ”€ top_performer_thresholds.json
โ”‚       โ”œโ”€โ”€ archetype_profiles.json
โ”‚       โ””โ”€โ”€ user_archetypes.json
โ”œโ”€โ”€ models/
โ”‚   โ”œโ”€โ”€ thinking_pause_model.py   # Random Forest trainer
โ”‚   โ”œโ”€โ”€ thinking_pause_model.pkl  # Trained model
โ”‚   โ”œโ”€โ”€ platform_encoder.pkl      # Label encoders
โ”‚   โ””โ”€โ”€ model_metrics.json        # Accuracy + feature importance
โ”œโ”€โ”€ backend/
โ”‚   โ””โ”€โ”€ main.py                   # FastAPI server (7 endpoints)
โ””โ”€โ”€ extensions/
    โ”œโ”€โ”€ chrome/                   # Chrome Extension
    โ”‚   โ”œโ”€โ”€ manifest.json
    โ”‚   โ”œโ”€โ”€ content.js            # Keystroke listener
    โ”‚   โ”œโ”€โ”€ background.js
    โ”‚   โ”œโ”€โ”€ popup.html            # Speedometer UI
    โ”‚   โ”œโ”€โ”€ popup.js
    โ”‚   โ”œโ”€โ”€ dashboard.html        # Full analytics dashboard
    โ”‚   โ”œโ”€โ”€ dashboard.js
    โ”‚   โ””โ”€โ”€ icons/
    โ””โ”€โ”€ vscode/                   # VS Code Extension
        โ””โ”€โ”€ typingflow-ai/
            โ”œโ”€โ”€ src/
            โ”‚   โ””โ”€โ”€ extension.ts  # Main tracking logic
            โ””โ”€โ”€ package.json

๐Ÿ› ๏ธ Tech Stack

LayerTechnologyPurpose
Data GenerationPython, NumPy, Faker1.1M synthetic sessions
Big Data AnalyticsDuckDB, PandasPercentiles, trends, benchmarks
Machine LearningScikit-learn (Random Forest, K-Means)Pause detection + archetypes
Backend APIFastAPI, UvicornREST endpoints
Chrome ExtensionJavaScript, Chrome APIsWeb typing tracker
VS Code ExtensionTypeScript, VS Code APICode editor tracker
Dashboard UIHTML, CSS, Chart.jsAnalytics visualisation
StorageParquet, JSONEfficient data storage

๐Ÿš€ Getting Started

Prerequisites

  • Python 3.10+
  • Node.js 18+
  • Google Chrome

1. Clone the Repository

git clone https://github.com/zujajahbatool/TypingFlow.git
cd TypingFlow

2. Install Python Dependencies

pip install pandas numpy scikit-learn faker duckdb fastapi uvicorn

3. Generate the Dataset

python data/generate_dataset.py

This generates 1.1M typing sessions (~60MB parquet file) in ~30 seconds.

4. Run Analytics + Clustering

python analytics/duckdb_benchmarks.py

Computes global benchmarks and K-Means archetypes. Saves 5 JSON files.

5. Train the AI Model

python models/thinking_pause_model.py

Trains the Random Forest model. Saves .pkl files.

6. Start the Backend

uvicorn backend.main:app --reload --port 8000

API available at http://127.0.0.1:8000 Interactive docs at http://127.0.0.1:8000/docs

7. Load the Chrome Extension

  1. Open Chrome โ†’ chrome://extensions
  2. Enable Developer Mode
  3. Click Load unpacked โ†’ select extensions/chrome/
  4. Click the TypingFlow AI icon in your toolbar

8. Run the VS Code Extension

cd extensions/vscode/typingflow-ai
npm install
npm run compile

Press F5 in VS Code to launch the Extension Development Host.


๐Ÿ”Œ API Endpoints

MethodEndpointDescription
GET/healthServer health check
POST/predict/pauseAI thinking-pause prediction
GET/benchmarks/globalGlobal WPM benchmarks
POST/benchmarks/rankUser percentile ranking
GET/benchmarks/hourlyHourly typing trends
GET/user/archetype/{id}User typing archetype
POST/session/saveSave a typing session

๐ŸŽจ UI Design โ€” Midnight Cyber Theme

TokenColorUsage
Background#0A0A0AApp background
Cards#1C1C1EUI cards
Accent 1#00F5FFWPM, active tracking
Accent 2#BF40BFFlow state, archetypes
Gold#FFD700Thinking pause indicator
Text#F5F5F5Body text

๐Ÿ“Š ML Model Performance

MetricValue
ModelRandom Forest (100 estimators)
Training samples160,000
Test accuracy100% (rule-based labels)
Top featureWPM (0.506 importance)
Classesthinking_pause, idle

๐Ÿ”’ Privacy

No actual text is ever recorded. TypingFlow AI only tracks:

  • Keystroke timestamps
  • Character counts
  • Word boundary counts (spaces/enters)

Your actual words, sentences, and content are never captured, stored, or transmitted.


๐Ÿ“ Key Files Reference

FileWhat it does
data/generate_dataset.pyGenerates 1.1M synthetic typing sessions
analytics/duckdb_benchmarks.pySQL analytics + K-Means clustering
models/thinking_pause_model.pyTrains AI pause detection model
backend/main.pyFastAPI REST API server
extensions/chrome/content.jsLive keystroke tracking on web pages
extensions/chrome/popup.jsSpeedometer popup logic
extensions/chrome/dashboard.jsFull dashboard analytics
extensions/vscode/typingflow-ai/src/extension.tsVS Code tracking + stats panel

๐Ÿ™ Acknowledgements

Built with:


๐Ÿ“„ License

MIT License โ€” feel free to use, modify, and distribute.


Made with โŒจ๏ธ and lots of thinking pauses