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

Explore using RAG in ChatCraft #337

Closed
humphd opened this issue Jan 14, 2024 · 6 comments
Closed

Explore using RAG in ChatCraft #337

humphd opened this issue Jan 14, 2024 · 6 comments

Comments

@humphd
Copy link
Collaborator

humphd commented Jan 14, 2024

As we start to consider adding the ability to attach files to a chat (see #325), we're going to run into cases where the context window of the chat is not enough to fit everything we have. Consider a PDF of a paper, or a zip file with a bunch of files and code that you want to ask questions about.

RAG (Retrieval Augmentation Generation) is a way to use a large piece of context (e.g., a big document, a database, etc.) to "retrieve" relevant chunks of context, then include those along with your prompt. For example, if I had a zip file of a source code project, I might only need to include 5 or 6 chunks of code with my question vs. the whole thing. RAG techniques allow you to find chunks of text that are similar to what you are talking about within a larger document/database.

I was reminded of this reading Twitter today:

Screenshot 2024-01-14 at 8 59 07 AM

It's possible to generate embeddings in a browser (free), or have OpenAI ($$$) do it for you:

RAG probably isn't the main way we'd use ChatCraft; but given that we have a database of all chats, and the ability to include files, we should probably explore whether we can leverage this for our use cases.

@tarasglek
Copy link
Owner

I would actually start with RAG for code. Eg teach chatcraft to use code indexers ala https://tabby.tabbyml.com/docs/configuration/

The search/embedding makes more sense to me as an external web service for chatcraft to invoke.

@humphd
Copy link
Collaborator Author

humphd commented Jan 21, 2024

Looking at the tabby code, it seems like they run a server on port 8080, and they have an agent JS lib at https://github.com/TabbyML/tabby/tree/main/clients/tabby-agent. Maybe we could use that?

We'd have to include a way to point ChatCraft at a server running somewhere (local docker container, remote...) via settings or something.

Someone should investigate if this is doable and worth doing.

@rjwignar
Copy link
Collaborator

I'd be willing to work on parts of this

@Amnish04
Copy link
Collaborator

I would like to try contributing to this

@WangGithub0
Copy link
Collaborator

try to use built in openAI

@Amnish04 Amnish04 removed their assignment Apr 10, 2024
@humphd
Copy link
Collaborator Author

humphd commented Jan 27, 2025

Closing in favour of #803

@humphd humphd closed this as completed Jan 27, 2025
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

5 participants