brianpetro / obsidian-smart-connections

Chat with your notes & see links to related content with AI embeddings. Use local models or 100+ via APIs like Claude, Gemini, ChatGPT & Llama 3
https://smartconnections.app
GNU General Public License v3.0
2.5k stars 172 forks source link

This plug-in is freezing my obsidian #473

Open FamedBear16 opened 7 months ago

FamedBear16 commented 7 months ago

Hi,

I had to turn this off. My obsidian freezes at start up, and I don't even have many new notes. It tells me it is indexing 70 new notes, but I am sure I did not write them.

Pierpaolo

brianpetro commented 7 months ago

Hi @FamedBear16

Can you open the developer console and take a screenshot after activating Smart Connections?

Similarly, could you take a screenshot of the notification you're seeing at startup?

Thanks for your help in solving this, 🌴

FamedBear16 commented 7 months ago

Hi @brianpetro If I activate it, it freeze Obsidian and I cannot use the software anymore. I can give it a try, but I need to know how I can disable it manually before opening up the sofware, without deleting all the plugin data

FamedBear16 commented 6 months ago

image

FamedBear16 commented 6 months ago

Hi I have tested it. if freeze my obsidian for I belive 20/30 seconds. Then i can use it. However, it is not able to create smart connections. It stops at 90/224 files. Also, I ma pretty sure I have not add 224 new files to be indexed. Will you tell me if you can fix it? I am going to disable the plug in in the mean time

FamedBear16 commented 6 months ago

image

brianpetro commented 6 months ago

@FamedBear16 what are your computer specs?

I don't see any unexpected errors in the screenshot, so it could be that your computer is unable to run the local model, which is resource intensive.

If that's the case, you could switch to one of the OpenAI models. That should effect remove any issues due to resource constraints.

🌴

FamedBear16 commented 6 months ago

Hi, There are two options

  1. Notes embedding model (what is this for?)
  2. Notes emedding blocks. (what is this for?)

I switched option 2. to Open AI-3 small model. I have the same issue. The plug-in freezse at the start for a while. more than 20secs.

it shows this message "Making smart connecttion 80/234 files" and never finishes

brianpetro commented 6 months ago

For now, set option 2 to "None" and set option 1 to one of the OpenAI models.

Then restart Obsidian.

Let me know if anything changes after that.

FamedBear16 commented 6 months ago

HI @brianpetro, it works fine now. There is not delay at the start. Thanks!!! Can you give me a quick explanation of the difference between option 1) and 2) and which model should I select for Option 1)?

image

brianpetro commented 6 months ago

@FamedBear16 happy to see that you got it working 😄

Option 1, note-level embeddings processes the full note in one.

Option 2, block-level, breaks the notes into chunks and creates multiple embeddings per note.

If you're using OpenAI, which it seems like you have to because the local models are what's causing performance issues with your computer, then the model selection doesn't make a huge difference. Though, if you turn on block-level embeddings, it would make sense to use on of the OpenAI options with fewer dimensions (dims) as this will reduce the memory/storage requirements with no noticeable impact on performance.

🌴

FamedBear16 commented 6 months ago

@brianpetro ,

If I turn off Opton 1 and turn on Option 2, then I run into the issue that freeze Obsidain at the beginning for a while. if Opt 1 is on, and Opt 2 is off then it works fine.

Can I use the latter for very big notes?

FamedBear16 commented 6 months ago

@brianpetro, I just wanted to let you know that I still have the same issue. The plug-in freeze my obsidian for more than one minute oo start, while update only 1 file using the Open AI Api. I did not have this issue in the past, my only guess is that I have now included in the list some Excalidraw drawings, that I use as notes. is there any way to exclude files by tags? exclude # excalidraw Thanks Pierpaolo

MiroStW commented 6 months ago

FYI same happened to me after updating today. Fixed by setting Blocks embedding Model to none

brianpetro commented 6 months ago

@MiroStW thanks for letting me know switching off blocks helped.

I think this is because it needs to read all the notes to create blocks and it there isn't a progress indicator currently for that process (it used to go really quickly)

🌴

quicly commented 4 months ago

@brianpetro

thanks for letting me know switching off blocks helped.

Do you view this as a temporary workaround? My current workflow relies on SC's ability to work with blocks. Unfortunately, using block model causes instability and freezes in Obsidian (both for local models and for openai). If you do not plan to address this freezing issue, I need to adjust my workflow to avoid dependence on this functionality. Are there technical limitations causing the block model to save slowly? If so, may I suggest making block model manually refreshable? This way, the main model could operate in real-time, while the block model updates only for the notes that have changed since the last sync.

brianpetro commented 4 months ago

@quicly should be temporary. If it's the embedding process that's slowing things down, the Smart Connect software can be downloaded for free to offload the embedding process from Obsidian which should improve performance substantially. I'll be making a video about this shortly 🌴

bbecausereasonss commented 2 months ago

This just started happening to me, triggered by going on my Mac then it started freezing. Then back on Windows I tried to redo my embeddings, it succeeded; but now each time I pull up the plugin, and click on the connections tab it just freezes my Obsidian.

richardstevenhack commented 2 months ago

I have the same problem, reported in another bug report.

This thing locks up my Obsidian and occasionally the full system.

I have a Ryzen 9 5950X with 16 cores and 32 threads and 128GB of RAM. This is a very fast system. But this app slows the entire system down, top reports it's running at 100% CPU. I can barely get the options pane open, the pane itself is slow, and then the whole system locks up. It's impossible to get a Developer's Console panel open. I barely managed to close the Smart Connections in the hope it would stop locking Obsidian but it didn't.

I've uninstalled and will ignore this app until there is a fix or some effort to debug it.

brianpetro commented 2 months ago

@bbecausereasonss a recent update normalizes note parsing across platforms, which should prevent issues changing between windows and mac.

@richardstevenhack were you using the default bge-micro-v2 embedding model? Or a different model?

Using an OpenAI embedding model should prevent any lockups during the embedding process.

For local models, the Smart Connect offloads the embedding process so that Obsidian remains usable during it. It also uses GPU if available.

The performance impact should be negligible once the embedding process is completed for the first time.

🌴

brianpetro commented 2 months ago

I should also note that if performance is an issue during the embedding process, the "pause" button on the embedding process notification is the best way to stop it while saving the progress 🌴

richardstevenhack commented 2 months ago

I was using the nomic embedding model which I installed using Ollama.

I tried using the pause, but once it locks up there is zero way to do anything but kill Obsidian from the command line. This is not a "performance" issue - it's a hard lock issue shortly after starting it.

I've basically dumped the app - it's just not working. Both Smart Connections and Smart Second Brain plugins I was testing are simply unusable. I'm waiting on a fix for System Sculpt to try that one.

Meanwhile, BMO, Co-Pilot ChatGPT Interface and Text Generator plugins do work. I suppose there could be a conflict with one of those. I've considered copying my vault data to another vault and installing Smart Connections there (no point in using the sandbox with no data) and testing it there. If I do that, I'll let you know what happens. There's always the possibility that my vault has something corrupting normal behavior.

richardstevenhack commented 2 months ago

I created a new vault with the same data and installed Smart Connections as the only community plugin in the vault.

This time it worked and indexed around 2,300 of the 3,087 files in the vault. Not sure which ones were omitted.

So this indicates to me that there is a problem with my main vault, either with vault corruption itself (which has happened before) or with a conflict with the installed plugins. Not sure how I'm going to test that, probably by disabling all the plugins and then re-enabling them one at a time and restarting Obsidian until the SC plugin fails.

So if you're getting frozen by SC during or after launch, I'd suggest doing the same. Test for plugin conflicts. If worst comes to worst, copy all your data folders to a backup, delete the vault, recreate it and then copy the data back in. This might be faster than testing the plugins, but won't fix anything if it is a plugin conflict.