joplin-plugin-note-categorization 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2026 Harsh Gupta
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Joplin Note Categorization Plugin
|
|
2
|
+
|
|
3
|
+
An on-device AI plugin for Joplin that semantically clusters notes, suggests tags and notebook structures, and detects stale/archivable notes.
|
|
4
|
+
|
|
5
|
+
> [!NOTE]
|
|
6
|
+
> This plugin is under active development as part of GSoC 2026. The initial embedding pipeline is implemented; clustering and UI panels are upcoming features.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## What the Project is About
|
|
11
|
+
|
|
12
|
+
When note collections grow, manually organizing them into notebooks and tags becomes tedious. This plugin aims to automate organization in a **local-first and privacy-preserving** way by:
|
|
13
|
+
1. **Semantic Embeddings**: Computing dense vector representations of notes on-device.
|
|
14
|
+
2. **Clustering & Classification**: Grouping similar notes together and extracting keywords for automatic tags or notebook structures.
|
|
15
|
+
3. **Staleness Analysis**: Identifying notes that haven't been edited or linked to recently for archiving.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## How It Works (Current Pipeline)
|
|
20
|
+
|
|
21
|
+
The plugin implements a background-threaded embedding pipeline:
|
|
22
|
+
* **Token-Based Chunking**: The plugin reads notes using the Joplin Data API and splits long notes into chunks of **200 tokens** using the `js-tiktoken` tokenizer (`cl100k_base` vocabulary).
|
|
23
|
+
* **On-Device Embedding Generation**: A Web Worker uses `@huggingface/transformers` to run the **`Xenova/all-MiniLM-L6-v2`** model. No data ever leaves your machine.
|
|
24
|
+
* **Hybrid Device Execution**:
|
|
25
|
+
* **Windows & macOS**: Automatically detects WebGPU support (`navigator.gpu`) and executes the model in **`fp16`** precision (at ~43ms per note).
|
|
26
|
+
* **Linux (Fallback)**: Defaults to running on the CPU using WebAssembly (**`q8`** quantized precision, running ~2x faster than the standard `fp32` CPU baseline).
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## How to Run & Build
|
|
31
|
+
|
|
32
|
+
### Prerequisites
|
|
33
|
+
* [Node.js](https://nodejs.org/) (v16 or higher)
|
|
34
|
+
* [Joplin](https://joplinapp.org/) (for manual plugin installation)
|
|
35
|
+
|
|
36
|
+
### Installation
|
|
37
|
+
Clone the repository and install the development dependencies:
|
|
38
|
+
```bash
|
|
39
|
+
npm install
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Building the Plugin
|
|
43
|
+
To compile the source code, pack the Web Worker, and bundle the ONNX runtime WASM assets locally:
|
|
44
|
+
```bash
|
|
45
|
+
npm run dist
|
|
46
|
+
```
|
|
47
|
+
This script does the following:
|
|
48
|
+
1. Compiles TypeScript source files under `src/` via Webpack.
|
|
49
|
+
2. Compiles the Web Worker (`src/worker/embedWorker.ts`) targeting browser-compatible environments.
|
|
50
|
+
3. Runs `tools/copyAssets.js` to copy local `onnxruntime-web` WASM files into `dist/onnx-dist/` so Electron can load them offline without triggering Content Security Policy (CSP) violations.
|
|
51
|
+
4. Packages everything into a `.jpl` archive in the `publish/` directory.
|
|
52
|
+
|
|
53
|
+
### Testing the Pipeline
|
|
54
|
+
1. Open Joplin.
|
|
55
|
+
2. Go to **Settings -> Plugins -> Manage Plugins -> Install from File** and select the `.jpl` package generated in `publish/`.
|
|
56
|
+
3. Restart Joplin.
|
|
57
|
+
4. Run the debug test from **Tools -> AI Categorise: Test Embedding**. This will index your local notes, run the tokenizer chunking, and output performance metrics directly to your developer tools console.
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "joplin-plugin-note-categorization",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"dist": "webpack --env joplin-plugin-config=buildMain && webpack --env joplin-plugin-config=buildExtraScripts && npm run copyAssets && webpack --env joplin-plugin-config=createArchive",
|
|
6
|
+
"prepare": "npm run dist",
|
|
7
|
+
"copyAssets": "node tools/copyAssets.js",
|
|
8
|
+
"updateVersion": "webpack --env joplin-plugin-config=updateVersion",
|
|
9
|
+
"update": "npm install -g generator-joplin && yo joplin --node-package-manager npm --update --force",
|
|
10
|
+
"lint": "eslint \"src/**/*.{ts,tsx}\"",
|
|
11
|
+
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
|
|
12
|
+
"format:check": "prettier --check \"src/**/*.{ts,tsx}\"",
|
|
13
|
+
"ci": "npm run lint && npm run format:check && npm run dist"
|
|
14
|
+
},
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"keywords": [
|
|
17
|
+
"joplin-plugin"
|
|
18
|
+
],
|
|
19
|
+
"files": [
|
|
20
|
+
"publish"
|
|
21
|
+
],
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/node": "^18.7.13",
|
|
24
|
+
"@types/react": "^19.2.17",
|
|
25
|
+
"@types/react-dom": "^19.2.3",
|
|
26
|
+
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
27
|
+
"@typescript-eslint/parser": "^5.62.0",
|
|
28
|
+
"chalk": "^4.1.0",
|
|
29
|
+
"copy-webpack-plugin": "^11.0.0",
|
|
30
|
+
"eslint": "^8.56.0",
|
|
31
|
+
"fs-extra": "^10.1.0",
|
|
32
|
+
"glob": "^8.0.3",
|
|
33
|
+
"prettier": "^3.2.5",
|
|
34
|
+
"tar": "^6.1.11",
|
|
35
|
+
"ts-loader": "^9.3.1",
|
|
36
|
+
"typescript": "^4.8.2",
|
|
37
|
+
"webpack": "^5.74.0",
|
|
38
|
+
"webpack-cli": "^4.10.0"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"@huggingface/transformers": "^3.8.1",
|
|
42
|
+
"hdbscan-ts": "^1.0.17",
|
|
43
|
+
"js-tiktoken": "^1.0.21",
|
|
44
|
+
"react": "^19.2.7",
|
|
45
|
+
"react-dom": "^19.2.7",
|
|
46
|
+
"umap-js": "^1.4.0",
|
|
47
|
+
"vectra": "^0.12.3"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifest_version": 1,
|
|
3
|
+
"id": "com.harsh16gupta.notecategorization",
|
|
4
|
+
"app_min_version": "3.5",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"name": "Note Categorization Plugin",
|
|
7
|
+
"description": "AI-based note categorisation: clusters notes semantically, suggests tags and notebook structures, and detects stale notes.",
|
|
8
|
+
"author": "Harsh Gupta",
|
|
9
|
+
"homepage_url": "",
|
|
10
|
+
"repository_url": "https://github.com/joplin/plugin-note-categorization",
|
|
11
|
+
"keywords": [],
|
|
12
|
+
"categories": [],
|
|
13
|
+
"screenshots": [],
|
|
14
|
+
"icons": {},
|
|
15
|
+
"promo_tile": {},
|
|
16
|
+
"_publish_hash": "sha256:cec0a829facd106c3e7654dd5e41efedaa7191e133f2031198a722f158c1724b",
|
|
17
|
+
"_publish_commit": "master:96d0a7935192deac7a6fa3f618fa5c07f6c5dc3d"
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! For license information please see index.js.LICENSE.txt */
|