Closed flowingblaze closed 8 months ago
It only responds with that emoji, thats the core issue
That's unfortunate! It'd be great if you can share more details on how you setup Khoj in Obsidian.
The emoji is a placeholder, which you see while waiting to get a response from the Khoj server. It should ideally be replaced by the actual response by Khoj. It disappears as it's a temporary placeholder for the response. The actual chat query and response shouldn't disappear on reopening the Khoj Chat modal.
I got the api key from app.khoj.dev, I have windows 10 and I did the steps in the docs.
I looked at my Files section on khoj and I saw "No documents synced with Khoj" even after a whole night trying to force sync with khoj-I think this is the issue
The link you provided does not currently give any information about how to set up the Khoj backend. I did find information here which OP may not yet be aware of.
Hey @edbock, the instructions you saw in that Obsidian forum post I made is for self-hosting the Khoj server but those self-hosting instructions are now stale/incomplete. These docs have the latest instructions for self-hosting. OP is trying to use the Khoj Obsidian plugin with the Khoj cloud service. For that the self-hosting steps are not required
@flowingblaze, What do you see when you open Developer Tools in your Obsidian and then try Khoj chat? Any Khoj related errors in the console logs there may provide more clues.
To open Developer Tools: Go to the "View" menubar and Click "Toggle Developer Tools" in your Obsidian (or try Ctrl-Shift-I or Win-Shift-I keyboard shortcuts to open it)
I looked at my Files section on khoj and I saw "No documents synced with Khoj" even after a whole night trying to force sync with khoj-I think this is the issue
Yeah, I think the main issue is that you aren't able to connect to Khoj cloud from your Obsidian plugin for some reason. This is why files are not getting syncing either. Files don't necessarily need to be synced to chat with Khoj as it can work as a generic chatbot as well without context about your files, if required.
Thank you for the clarification. The reason I encountered the error is because I was trying to work around an error in Obsidian.
In settings I have https://app.khoj.dev as the "Khoj backend," and I used the API key I created at https://app.khoj.dev/config.
However, the top of the window says, "Disconnected from Khoj backend. Ensure Khoj backend is running and Khoj URL is correctly set"
I found this page and assumed I needed to follow those directions in order to get the backend working.
BTW Here are my relevant Developer Tools Console logs:
Khoj: Updating Khoj content index... app.khoj.dev/api/v1/index/update?force=true&client=obsidian:1 Failed to load resource: the server responded with a status of 400 () plugin:khoj:4436 Khoj: Updating Khoj content index... plugin:khoj:4455 Uncaught (in promise) TypeError: Failed to fetch at updateContentIndex (plugin:khoj:4455:26) at async eval (plugin:khoj:6274:41)
Thank you for the clarification. The reason I encountered the error is because I was trying to work around an error in Obsidian.
However, the top of the window says, "Disconnected from Khoj backend. Ensure Khoj backend is running and Khoj URL is correctly set"
I see. This error is a bit lagging/confusing. If you still see the error on restarting obsidian then it means it's an actual issue connection to the Khoj backend. I'm working on a fix for the confusion on my end as well
BTW Here are my relevant Developer Tools Console logs:
Khoj: Updating Khoj content index... app.khoj.dev/api/v1/index/update?force=true&client=obsidian:1 Failed to load resource: the server responded with a status of 400 () plugin:khoj:4436 Khoj: Updating Khoj content index... plugin:khoj:4455 Uncaught (in promise) TypeError: Failed to fetch at updateContentIndex (plugin:khoj:4455:26) at async eval (plugin:khoj:6274:41)
Thanks for sharing the error logs. Let me try reproduce the issue on my end. (I haven't been able to trigger this error for myself yet)
Restarting Obsidian: Hmm, why are some of the easiest things so hard to remember?
Now the error in the settings dialog is gone, replaced by the message "Connected to Khoj backend." That's a good sign.
Unfortunately I'm still getting the 400 errors. Here's my most recent logs:
Khoj: Updating Khoj content index... app.khoj.dev/api/v1/index/update?force=true&client=obsidian:1 Failed to load resource: the server responded with a status of 400 () plugin:khoj:4436 Khoj: Updating Khoj content index... plugin:khoj:4455 POST https://app.khoj.dev/api/v1/index/update?force=true&client=obsidian 400 updateContentIndex @ plugin:khoj:4455 await in updateContentIndex (async) eval @ plugin:khoj:4562 (anonymous) @ app.js:1
Thank you very much for the incredibly responsive support. This is a fantastic service, well worth doing some troubleshooting to get working.
Restarting Obsidian: Hmm, why are some of the easiest things so hard to remember?
Now the error in the settings dialog is gone, replaced by the message "Connected to Khoj backend." That's a good sign.
Great to hear that plugin is showing connected to the Khoj server after restart!
Unfortunately I'm still getting the 400 errors. Here's my most recent logs:
Thank you very much for the incredibly responsive support. This is a fantastic service, well worth doing some troubleshooting to get working.
Thanks for the kind words!
Yes, I do have many 1000s of files. I would be happy to help with testing this in any way I can.
The inference endpoints option sounds exciting.
Thanks a ton for helping investigate this issue. This issue was affecting folks using Khoj from Obsidian with the Dataview plugin installed. It's been fixed in #619. So you should be able to use Khoj chat from Obsidian (even with the dataview plugin enabled) by the next release of Khoj, which should be out today
I tried to use Khoj again, and I ended up being able to put my khoj api key into obsidian and It said that it's connected to the khoj backend after I disabed and renabled the plugin. I then attempted to chat with it and I got a message similar to this that dissapears as soon as the window is closed.