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

feat: Add Dynamic RAG_K Configuration to Enhance RAG and Improve Cont… #3317

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

abdalrohman
Copy link

This pull request introduces several enhancements to the Retrieval Augmented Generation (RAG) system and the user interface. Specifically:

  • Contextual Prompts: The prompts have been modified to emphasize the utilization of information from retrieved documents for more accurate and informative answers.
  • RAG_K Parameter Update: An endpoint has been created to allow adjusting the RAG_K parameter, which controls the number of documents to retrieve for answering queries.
  • UI Integration for RAG_K: The user interface has been updated to display and control the RAG_K parameter, providing flexibility and control over the RAG behavior.

Detailed Changes:

  • createContextHandlers.js: Added instructions for the LLM to prioritize information from documents, use an unbiased tone, and handle entity disambiguation.
  • createContextHandlers.js: The RAG_K parameter is fetched from the server, allowing dynamic adjustment based on user input.
  • server/index.js & server/routes/index.js: A new route (/api/update-ragk) has been added to handle updates to the RAG_K parameter.
  • PanelTable.tsx: A slider has been added to the user interface to visualize and control the RAG_K parameter. The value is persisted in the backend and fetched upon component initialization.

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

Successfully merging this pull request may close these issues.

1 participant