Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making smart connections... #13

Closed
billpetro opened this issue Jan 10, 2023 · 57 comments
Closed

Making smart connections... #13

billpetro opened this issue Jan 10, 2023 · 57 comments

Comments

@billpetro
Copy link

Brian,

After installing via BRAT and adding my OpenAI token several days ago, I'm still getting:

Making smart connections...

I have only 4K files.

Is there a log I could check?

Thanks,

Bill Petro
billpetro.com

@aikruger
Copy link

Same problem here

@brianpetro
Copy link
Owner

Thanks for the report! And yes, you can check the "console log," you can learn how to access it here https://forum.obsidian.md/t/how-to-access-the-console/16703

This issue shows an example of what it looks like #12

If you could also let me know which patch version you're using, that could be helpful in helping me figure this out.

The patch version is the last number in the green circle in this screenshot:
community-plugins-smart-connections-version

Thanks @billpetro & @aikruger

@billpetro
Copy link
Author

billpetro commented Jan 10, 2023

Brian,

Smart Connections:

Version: 1.0.26

Obsidian:

On macOS, version 1.1.9

On iOS/iPadOS, version 1.4.1 (83) API v1.0.3...

But: I installed Smart Connections with BRAT (Beta Reviewers Auto-update Tool) and it throws this error on my mobile devices:

IMG_0372

[Obsidiann version of the app needs to be 1.1.0, but this installation of Obsidian is 1.0.3]

@billpetro
Copy link
Author

Brian,

I uninstalled the plugin, and re-installed it fresh. I'm now on Version: 1.0.30

@brianpetro
Copy link
Owner

Thanks for following-up @billpetro

And great, 1.0.30 should work as expected on the desktop.

Mobile compatibility is in the works, but it isn't available right now. The app manifest is currently set to isDesktopOnly, this tells Obsidian that the plugin should not be available on mobile.

Are you having any issues with the desktop version?

@billpetro
Copy link
Author

No joy. Still "Making smart connections..."

Desktop: v1.1.11 (Installer: v1.1.9)
Smart Connections: v1.0.35

@brianpetro
Copy link
Owner

Can you check the "console log" for me to see if there are errors? You can learn how to access it here https://forum.obsidian.md/t/how-to-access-the-console/16703

This issue shows an example of what an error might look like #12

Then I can better debug from there.

@Eleksar387
Copy link

Version 1.0.35

image

@brianpetro
Copy link
Owner

Thanks @Eleksar387

The 429 suggests that your notes aren't yet fully embedded, so the OpenAI API returns 429 for too many requests too quickly. This isn't concerning unless it happens continuously. And it will happen more at the beginning for larger vaults.

The following error was a bug that occurred because only partial data was stored after requesting the embeddings from OpenAI. The vectors that are used in the calculation failed to be stored. So I added a check to make sure they are present before continuing.

1.0.36 introduces some additional checks to prevent the error from occurring. Let me know if this helps, you get more errors, or if you continue to get 429 errors.

@mattgrieser
Copy link

I'm using Smart Connections 1.0.36 on Obsidian 1.1.11 on macOS and I'm getting the same "Making smart connections …" message.

@brianpetro
Copy link
Owner

Hey Matt,

Can you check the "console log" for me to see if there are errors? You can learn how to access it here https://forum.obsidian.md/t/how-to-access-the-console/16703

You can see the above comments for what an error might look like.

Thanks for your help.

@mattgrieser
Copy link

Brian,
I'm not seeing any errors in the console. I have a .smart-connections folder with an embeddings file, but nothing else.

Screen Shot 2023-01-11 at 11 50 05 AM

@brianpetro
Copy link
Owner

That's helpful. I'm going to see what I can do to reproduce the issue. There's also a couple toggle options in the settings that send more info to the console log, which may have some hints into what's happening. If you turn those on and see something let me know. Thanks

@mattgrieser
Copy link

Screen Shot 2023-01-11 at 11 57 04 AM
I've got those on, but I'm still not seeing any activity in the console log. Can I filter the console to just show this plugin?

@brianpetro
Copy link
Owner

There should be a "clear console" (circle with slash) button at the top of the console to clear the logs.

Then go-to the community plugins section and deactivate then active the plugin.

After that, run the "Find Smart Connections" command using the Obsidian command palette. You'll need to have a note "active" (click on and in view) for this command to appear.

That should cause an error to appear in the console.

If there are a lot of other things in the console during this process, that may also be interesting to know in case there is some sort of interference happening.

Thanks for your help with this!

@mattgrieser
Copy link

mattgrieser commented Jan 11, 2023

I was getting a ton of log info from the kindle highlights plugin, so I uninstalled that. It looks like I'm just getting the 429 message. So, maybe it's still chewing on them.
Screen Shot 2023-01-11 at 12 27 07 PM

@brianpetro
Copy link
Owner

Thanks for sharing that log. It does look OK.

If you don't mind sharing, how many total notes are in your vault?

Also, if any folders have a lot of notes that aren't high-priority for you right now, you can exclude those using the file or folder exclusion settings. That may speed things up.

Lastly, I'm making note of a feature that would bring more visibility into the initial embedding process. Something like "Initial Processing: Currently completed X/Y000 embeddings..."

@mattgrieser
Copy link

2904 files in 274 folders. Thanks for the tips. I'll keep an eye on things!

@brianpetro
Copy link
Owner

My vault has 1,500 files and embeds fully in less than a minute. And another user has a working vault size >20K. So your vault size shouldn't be the issue.

Are there files with a disproportionate amount of content and, more specifically, many headings? This could explain the excessive 429s, which could be causing other things to act unexpectedly and halt the entire process.

Try excluding those files first to see if that allows the embeddings to complete.

Another possible features note:

  1. optimizing block embedding batching (currently, piggy-backing file-batching which could create excessive batch sizes, and thus 429s, under certain conditions)
  2. a manual override to disable note-block parsing, which embeds partial notes for more granular matching.
  3. better queuing during the initial/bulk processing to prioritize a first pass-through of all the notes before embedding with more granularity.

@Eleksar387
Copy link

My vault has just 178 files but I also do get 429s and no results after updating to 1.0.36
I have a handfull of images in it as well. Could this be a problem?

image

@brianpetro
Copy link
Owner

Hi @Eleksar387

In 1.0.37 the max possible number of simultaneous HTTP requests, the cause of 429s, was reduced from 40 to 20.

Do some of those 178 files have a lot of content, particularly with many headings? If so, then this should help.

Images should not be a problem. I also have many images in my vault.

And thanks for the screenshot!

@Eleksar387
Copy link

I am now on 1.0.38. I do not have any overly large files with lots of headings. Rather short and simple. Unfortunately I still see just "Making smart Connections...". Even after hours.

But there is a new error:

image

@brianpetro
Copy link
Owner

@Eleksar387 I fixed that error (a function scoping bug/oversight) in 1.0.39.

Also, I added the skip_sections feature/flag in 1.0.40.

Toggled on, skip_sections will limit the max simultaneous API requests to 4, which should altogether remove 429 errors.

While I don't recommend using this feature, as it significantly limits the plugin's capabilities, it may help us debug your issue. For example, if you turn it on and it completes making the connections, we can infer that the problem you're encountering is somewhere within the code that breaks notes into sections.

@Eleksar387
Copy link

After updating to latest version. I get new kind of errors:
image

@brianpetro
Copy link
Owner

Does that happen even with the skip_sections flag on?

@quangnd159
Copy link

Sorry for digging this up but the same problem is happening to me: retrying request (429) in 1 second...
I'm on macOS Ventura, Obsidian 1.1.12. Tried different API keys but still got the same message. And on the sidebar it only says "Making Smart Connections..."

@brianpetro
Copy link
Owner

@quangnd159
Can you toggle on render logs and render logs files? #13 (comment)

Then disable and re-enable the plugin.

Are there any logs or errors in the console log? #13 (comment)

And thanks for letting me know about this!

@quangnd159
Copy link

Followed your instruction but the problem persists. This is all there is in the console log 👇
CleanShot 2023-01-15 at 22 45 42@2x

@brianpetro
Copy link
Owner

How many files are in your vault? And are there any with a disproportionate amount of headings? I've put measures in place to handle these, as we have users with 20k notes and I personally have long notes with many headings. But it would still be worth noting.

With that many 429s, it seems like every call to the OpenAI API is failing. So I'm wondering if not the API key then what else. Maybe you could check to make sure there aren't any preceding or trailing space characters in your API key input, which is something I'm now noting to do automatically in a future update.

You can send me your vault (minus any sensitive files) and I can try to debug it from there. My email is brian@plexm.com (but ping me here if/when you send it).

And thanks again for your help figuring this out. The plugin is supposed to work out of the box for anyone, so solving the edge cases is important to me!

@brianpetro
Copy link
Owner

I'll also be shipping a "test API key" button shortly. Which should help us rule that out easier.

brianpetro added a commit that referenced this issue Jan 15, 2023
@brianpetro
Copy link
Owner

@quangnd159 just pushed an update with the test API key button in the settings

@OntologicallyUnstable
Copy link

Hey Brian, same problem here. Vault with 1175 notes; tested yesterday with a fresh re-install without plugins, and just now with the "test API key" function.
image

@brianpetro
Copy link
Owner

This from OpenAI seems to imply varying rate limits between accounts.

So I think next step would be to implement exponential back off, as recommended, and see if that helps with moving through these 429s.

@OntologicallyUnstable
Copy link

I'll be glad to make another attempt as soon as you pull another update!

brianpetro added a commit that referenced this issue Jan 15, 2023
@brianpetro
Copy link
Owner

@OntologicallyUnstable latest update handles errors much better. Also skips previously failed files until retried from the settings

@quangnd159
Copy link

@quangnd159 just pushed an update with the test API key button in the settings

Same problem so far. And when I hit Test API Key, it indeeds says the key "is not working as expected".

@brianpetro
Copy link
Owner

@quangnd159 if you see that, then your API key isn't working and the plugin will not work for you. You will have to contact OpenAI to figure out why.

@OntologicallyUnstable
Copy link

@brianpetro Success! Now it worked. Took almost 20 minutes and the log is full of errors, but it worked indeed. Do you know if it's possible to use this tool to automatically update the content of a set of notes, like a series of MOCs or indexes?

@quangnd159
Copy link

@brianpetro Thanks a lot. I'll wait and check back at some point.

@brianpetro
Copy link
Owner

@OntologicallyUnstable happy to hear it!

Are you looking for something like in this request #17 (comment) ? If so, add your input to give it some priority.

Currently, you can "drag and drop" the links onto the page. But otherwise the links aren't saved permanently anywhere right now.

@OntologicallyUnstable
Copy link

@brianpetro thanks, I'll stay tuned for future updates and provide data in case of new bugs. Keep up the good work, this plugin definitely has a lot of potential!

@billpetro
Copy link
Author

Brian,

I'm getting this long list of errors when I open Obsidian:

SmartConnections

@brianpetro
Copy link
Owner

@billpetro thanks for letting me know. This was fixed in the latest update #39

@billpetro
Copy link
Author

I am running Version: 1.1.18. I still see the same errors, but they scroll off after 3-4 seconds, then clear the screen. The plugin does work.

@brianpetro
Copy link
Owner

Thanks for the update @billpetro . I think I know what's happening. You may need to use the "retry failed Embeddings" feature in the settings to make this notification stop appearing.

I'm going to open a new issue to improve this experience in the future.

@ShravanSunder
Copy link

ShravanSunder commented Feb 17, 2023

@brianpetro I'm getting the same issue with a new install. The api key doesn't work with this extension, but works with others.

Its a 409 when i use the test api button

2023-02-17 0243 Obsidian README - shravan-pkm - Obsidian v1 1 14

@drnola
Copy link

drnola commented Feb 19, 2023

I too am getting the long list of errors when opening Obsidian. I tried the "retry failed embeddings" but did not solve the issue.

@pinuke
Copy link
Contributor

pinuke commented Mar 20, 2023

To: @ShravanSunder @drnola
Subject: Make sure you guys are checking your rate limits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

11 participants