โจ๏ธ 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
| Archetype | Description |
|---|---|
| โก The Rapid Streamer | High WPM, high consistency, born for flow |
| ๐๏ธ The Deliberate Architect | Slow, precise, virtually error-free |
| ๐ฅ The Bursty Coder | Explosive bursts followed by deep thinking pauses |
| ๐ The Steady Workhorse | Reliable, consistent, always getting the job done |
| ๐ The Sprinter | Blazing 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
| Layer | Technology | Purpose |
|---|---|---|
| Data Generation | Python, NumPy, Faker | 1.1M synthetic sessions |
| Big Data Analytics | DuckDB, Pandas | Percentiles, trends, benchmarks |
| Machine Learning | Scikit-learn (Random Forest, K-Means) | Pause detection + archetypes |
| Backend API | FastAPI, Uvicorn | REST endpoints |
| Chrome Extension | JavaScript, Chrome APIs | Web typing tracker |
| VS Code Extension | TypeScript, VS Code API | Code editor tracker |
| Dashboard UI | HTML, CSS, Chart.js | Analytics visualisation |
| Storage | Parquet, JSON | Efficient 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
- Open Chrome โ
chrome://extensions - Enable Developer Mode
- Click Load unpacked โ select
extensions/chrome/ - 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
| Method | Endpoint | Description |
|---|---|---|
GET | /health | Server health check |
POST | /predict/pause | AI thinking-pause prediction |
GET | /benchmarks/global | Global WPM benchmarks |
POST | /benchmarks/rank | User percentile ranking |
GET | /benchmarks/hourly | Hourly typing trends |
GET | /user/archetype/{id} | User typing archetype |
POST | /session/save | Save a typing session |
๐จ UI Design โ Midnight Cyber Theme
| Token | Color | Usage |
|---|---|---|
| Background | #0A0A0A | App background |
| Cards | #1C1C1E | UI cards |
| Accent 1 | #00F5FF | WPM, active tracking |
| Accent 2 | #BF40BF | Flow state, archetypes |
| Gold | #FFD700 | Thinking pause indicator |
| Text | #F5F5F5 | Body text |
๐ ML Model Performance
| Metric | Value |
|---|---|
| Model | Random Forest (100 estimators) |
| Training samples | 160,000 |
| Test accuracy | 100% (rule-based labels) |
| Top feature | WPM (0.506 importance) |
| Classes | thinking_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
| File | What it does |
|---|---|
data/generate_dataset.py | Generates 1.1M synthetic typing sessions |
analytics/duckdb_benchmarks.py | SQL analytics + K-Means clustering |
models/thinking_pause_model.py | Trains AI pause detection model |
backend/main.py | FastAPI REST API server |
extensions/chrome/content.js | Live keystroke tracking on web pages |
extensions/chrome/popup.js | Speedometer popup logic |
extensions/chrome/dashboard.js | Full dashboard analytics |
extensions/vscode/typingflow-ai/src/extension.ts | VS Code tracking + stats panel |
๐ Acknowledgements
Built with:
๐ License
MIT License โ feel free to use, modify, and distribute.
Made with โจ๏ธ and lots of thinking pauses