Plugin: Semantically Similar Notes (beta)

Maybe related to this bug? When using `joplin.data.post(['notes'], null, item)` to insert a large number of notes, it will eventually get stuck · Issue #5443 · laurent22/joplin · GitHub

Not sure, that bug doesn't mention high CPU usage. I could barely move the mouse pointer.

@whitewall excellent! a cutoff like you describe could be implemented, but I've actually found that sometimes the top similar notes are only like 60% and it's still a good suggestion. maybe it would be better for a user setting to configure how many of the top scored entries to display (eg top 10). I don't think there's any harm in showing all the notes other than visual clutter, right? Well there might be some potential performance improvement to be had, but it seems a bit complicated (recalculating only some of the note similarity scores, vs all of them).

@roman_r_m hmm that's a bummer to hear. when I run it on an intel 4690k, I see cpu usage mostly around 50% with infrequent spikes to 100%. this is with backend set to cpu and batch size 10. on a windows tablet (surface go 2), I see cpu mostly at 30% during the embedding process with the same settings. do you mind sharing what hardware+system you're running on?

I'm trying to think how else I could throttle. maybe adding a sleep between batches (as long as I can do this w/o blocking the UI)? I tried looking to see if tfjs supported setting an upper limit of % cpu/gpu to use, and although such a thing exists for other tensorflow libraries, I could not find it for tfjs (granted after only looking for an hour or so).

do you think you might somehow be able to navigate through the settings to set batch size to 10 and restart? or is the system hang not responsive enough? I could alternatively publish a new version that sets batch size to 10 by default if you are unable to do it from your side.

full-disclosure: I'm not actually fetching 100 notes at a time via the joplin api. I individually fetch batch_size # of notes by id and then call model.embed() on that batch, and repeat for all unencoded notes. I thought this might be less efficient during the initial embedding, but way more efficient during regular usage thereafter. I think choosing which algorithm to use for batching could be conditioned on the remaining % of notes w/o embeddings (if it's meaningfully less efficient)

It does take a few seconds for the list to load, so I thought perhaps limiting it to the top x might help.

Thanks for the plugin, very useful. :slight_smile:

I think it would be easier to work with if there was a way of hiding the panel when not needed and also changing the style of the links in the plugin settings. I find the blue color is not very visible in most dark UI styles. I haven't found the best way of custom styling these things myself yet...

edit: I think also for me it's causing a big delay to syncing recent files from another PC, if I turn it off the plugin syncing happens as normal. Would be good if there was a button on the plugin toolbar for disabling and enabling it, not just in plugin options.

The link color issue has its own Github issue. Commenting over there may help gain the plugin author's attention. It also includes an apparent start to a fix if anyone is capable of continuing it.

Creating a Github issue for toggling plugin computing and panel visibility may also be more effective.

It sounds nice. But I wish it didn't limit itself to English.

For multilingual support check out the Jarvis plugin. You can setup the AI model you wish to index your notes with. Some models support dozens of languages. Additional information appears in the readme and guide.

Thank you. A small addition... I had used the Jarvis plugin. But to use the plugin with ChatGPT, the premium version of ChatGPT is required.

Indeed, for ChatGPT you would. But note that we recently added instructions for setting up other multilingual models (such as this one), that you can run locally on your laptop.