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

Add full-text search in chat history #1550

Open
kadykov opened this issue Nov 1, 2024 · 3 comments
Open

Add full-text search in chat history #1550

kadykov opened this issue Nov 1, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@kadykov
Copy link

kadykov commented Nov 1, 2024

Describe your feature request

Allow users to search for specific keywords or phrases within the chat history, making it easier to find and recall previous conversations.

Screenshots (if relevant)

An example of the search bar placement could be found in #1079

Implementation idea

One possible implementation could be to use a library to index the chat history data. This would allow for efficient and scalable search functionality. The search bar could be added to the chat history interface, and when a user enters a search query, it would send a request to the search index to retrieve relevant results. The results could be displayed in a dropdown list or a separate search results page, with links to the original chat messages.

Previous proposals and why this one is different

I'm aware that a similar proposal was made in the past #243, but it was rejected in favor of using the browser's page search functionality (ctrl + F). However, I'd like to argue that page search does not provide the same functionality as a dedicated full-text search in chat history. Here's why:

  • Page search is limited to the currently loaded chat history and previous chat names, whereas a dedicated search would allow users to search across the entire conversation history, even if it's not currently loaded on the page.
  • Page search does not provide any contextual information, such as the date and time of the message, or the conversation, whereas a dedicated search could provide this information and make it easier for users to understand the context of the search results.

Given these differences, I believe that a dedicated full-text search in chat history is a valuable feature that would greatly improve the user experience, and I'd like to propose it again for consideration.

Personally, I tend to create a new chat for each small problem to keep the LLM focused on what's important. As a result, I end up with too many chats with similar names, which makes the browser page search nearly useless.

@kadykov kadykov added the enhancement New feature or request label Nov 1, 2024
@siddharthgoel88
Copy link

I second this 👍 This would be a great addition. ChatGPT also allows to search ⌘ K combination.

@kramosss
Copy link
Contributor

Hi,

I'm thinking of working on this feature if it's still available and I just wanted to confirm and check my understanding.

So far I've looked through the codebase about where this feature would be implemented and also did some research about how to get started on this feature. I think in the codebase, where the main changes would take place for this feature are in src/lib/components/chat/ChatInput.svelte.

I'm thinking to tackle this, this feature could be broken down into two parts.

-First in src/lib/components/chat/ChatInput.svelte an event similar to chatGPT's command + k would be implemented and a UI to show user input and relevant results.

-From there, I'm thinking I could use the fuzzy search algorithm based on user input to match with results from chat log stored in the database for that user and also have to make the relevant api calls.

As mentioned before, this feature would work every similar to chatGPT's command + k feature which I didn't know about, but is highly useful.

@kramosss
Copy link
Contributor

Hi @nsarrazin, would you mind taking a look at the comment I left about how I might get started on this?

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

No branches or pull requests

3 participants