khoj-ai / khoj

Your AI second brain. Get answers to your questions, whether they be online or in your own notes. Use online AI models (e.g gpt4) or private, local LLMs (e.g llama3). Self-host locally or use our cloud instance. Access from Obsidian, Emacs, Desktop app, Web or Whatsapp.
https://khoj.dev
GNU Affero General Public License v3.0
12.63k stars 640 forks source link

[IDEA] Obisidan UX feature improvements #819

Open sabaimran opened 3 months ago

sabaimran commented 3 months ago

Add support for limiting conversation to current file

We have file filters in the web UI that allow us to easily limit a specific conversation to a set of files. It would be useful if I could easily limit my chat in Obsidian to that specific file.

Add recursive re-chat to the chat window

You should be able to cycle through past messages easily, the way we've just added to the khoj web view with #804 .

shantanuSakpal commented 2 months ago

hey, this is an interesting idea that i would like to work on. I have a few doubts, you said "...could easily limit my chat in Obsidian to that specific file." -- what do you mean by "that file", do you mean the file that i uploaded or the file/note i am currently editing in obsidian i think, having option of limiting the conversation to the file i am currently editing in obsidian would be a good option, as obsidian has the feature to drag and drop files in the editor, so if its possible then we can use that to extract text and do further operations on extracted text. this might save storage

Problem: currently web version supports pdf and images, but obsidian supports more types of files, Solution: thought i am yet to see how exactly the file summaize function of khoj works, but it seems to only extract visible text from the doc/image, like tesseract, so i assume it should work on any file with text in it.

problem: however when the user switches the note, the context for khoj will also change solution: we can store the extracted text , so that we can work with that untill user uses /summarize again in new note

sabaimran commented 2 months ago

Hey @shantanuSakpal , glad you're excited about it!

you said "...could easily limit my chat in Obsidian to that specific file." -- what do you mean by "that file", do you mean the file that i uploaded or the file/note i am currently editing in obsidian

Your intuition is correct, I was imagining it'd be useful to limit context to the file you're currently editing.

To store the context, as you're suggesting, one potential remedy is that a call to /summarize would keep that metadata in the chat history, but it would have to be limited to that chat then.

When a file is indexed by Khoj, it extracts & stores all the text. The summaries are generated based on a file's raw text.