khoj-ai / khoj

Your AI second brain. Self-hostable. Get answers from the web or your docs. Build custom agents, schedule automations, do deep research. Turn any online or local LLM into your personal, autonomous AI (e.g gpt, claude, gemini, llama, qwen, mistral).
https://khoj.dev
GNU Affero General Public License v3.0
16.55k stars 806 forks source link

[FIX] Lag in Loading Conversation History with Images #661

Closed tichondrius808 closed 9 months ago

tichondrius808 commented 9 months ago

Describe the bug

Khoj plugin inside obsidian literally freezes the whole thing to the point that i have to get out. Desktop app is better, but still lags a lot. web version takes a lot of time to do responses.

Also either the sync is failing or something else, but try to test just a simple question about a note title, many times in the past days khoj literally writes about a 3th or less of the info of the specific note, and says it does not know any more info. Many times i check and the references are wrong.

To Reproduce

It started to do this after i generated many images with it. I dont know if this is the cause.

Screenshots

If applicable, add screenshots to help explain your problem.

Platform

Additional context

I did tried reinitialize , and still same, i cannot even check console when it happens inside obsidian.

sabaimran commented 9 months ago

Hi @tichondrius808! I do think the lagging/perf degradation is because of image generation. It puts a lot of strain on the client and increases the size of your chat history.

We do plan to upload the generated images in S3 and serve them via URLs, which should improve the performance, but it might be a bit limited for now.

The best thing to do would be to save any data you want from the chat and then clear the chat history. You should be able to keep generating & saving images as you go along, but you may just have to clear out the history until we make a few improvements 🙂!

tichondrius808 commented 9 months ago

Yea it seems fix with new version^^ will keep trying.Its just for now is kind of dificult to manage the different conversations and what memory is using from each of them. But lag is gone with new version i didnt even had to delete some of older chats.