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

Feature/multi rag #745

Open
wants to merge 7 commits into
base: chatPDF
Choose a base branch
from
Open

Conversation

zzen0008
Copy link

Extend RAG Contexts to Support PDF and WebSearch Simultaneously

Enhanced the RAG context to support both PDF and web search in parallel. Here are the main changes made:

  1. Refactor buildPrompt function: Refactored the buildPrompt function and its implementations to support multiple RAG contexts. Specifically adjusted for web search and PDF chat. Accommodates more than one RAG context.

  2. Update conversation endpoints: Updated the conversation endpoints in the server to match the refactored buildPrompt function, replacing ragContext with ragContexts. This ensures that the conversation can handle these two types of contexts.

  3. Update rag.ts: Updated rag.ts to export webSearch and pdfChat separately from the RAGs namespace. This makes their usage in the code more explicit.

  4. Alter Message type: Altered the Message type to include ragContexts which will hold the webSearch and pdfChat contexts.

  5. Adapt POST method: Adapted the POST method in routes/conversation/[id]/+server.ts to make use of the new ragContexts. Consequently, whichever context is retrieved, it is set in the relevant field of the last message in the conversation.

@nsarrazin nsarrazin added enhancement New feature or request back This issue is related to the Svelte backend or the DB websearch labels Jan 29, 2024
@itaybar
Copy link
Contributor

itaybar commented Feb 4, 2024

I realy appreciate this PR, I think this is a great one. I Wrote one comment that I think will be realy major to make this feature WAY more generic and scaleable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back This issue is related to the Svelte backend or the DB enhancement New feature or request websearch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants