mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-22 01:22:00 -05:00
[GH-ISSUE #7679] Feature Request: Per-Knowledge-Base RAG Prompt Management #30368
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Maralai on GitHub (Dec 7, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/7679
Feature Request
I'm requesting a feature to manage multiple RAG models/prompts and assign them at the knowledge base level. Currently, I find myself constantly editing the RAG prompt to optimize for different knowledge bases. This new feature would significantly improve the precision and efficiency of knowledge retrieval.
Problem:
Different knowledge bases require different prompting strategies to yield optimal results. Currently, users have to manually adjust the RAG prompt every time they switch between knowledge bases. Experimenting with the current system is time-consuming and prone to error. It also makes maintaining consistent results across different sessions challenging when switching contexts. For optimal dedicated knowledge retrieval, a separately maintained open-webui is often required.
Proposed Solution:
Implement a system for managing multiple RAG models/prompts and associating them with specific knowledge bases. This could involve:
{{knowledge_base_name}}). This could enable even more tailored prompting strategies.Benefits:
Example Use Case:
Let's say I have two knowledge bases: one for technical documentation and another for customer support interactions. The technical documentation requires a more precise, technical prompt, while the customer support knowledge base benefits from a more conversational and empathetic prompt. With this feature, I could create two separate prompts, "Technical Documentation Prompt" and "Customer Support Prompt," and assign them to the respective knowledge bases. This would streamline my workflow and improve the accuracy of responses from each knowledge base.
This feature would significantly improve the usability and effectiveness of RAG within open-webui. Thank you for considering this request.
@Simon-Stone commented on GitHub (Dec 7, 2024):
I love this idea. Tailoring the context injection prompt to the knowledge base can drastically increase the quality and alignment of the generated answer.
@oatmealm commented on GitHub (Dec 7, 2024):
Currently I create custom models with one or more knowledge collections, so I can choose the model, parameters and system prompt per topic domain. Works quite well and possibly more useful than per knowledge base prompt, if you tend to break knowledge into distinct topics that might overlap.
@Maralai commented on GitHub (Dec 8, 2024):
I also have similar setups; however, I have more success further customizing the RAG prompt on approaching serving the knowledge.
Take your understanding of system prompts and look over the default RAG prompt; now imagine the specificity of your model via the system prompt and its usage and how you can enhance the retrieval of the knowledge by modifying the prompt.
@oatmealm commented on GitHub (Dec 8, 2024):
Absolutely. It was just by way of a workaround.
@flefevre commented on GitHub (Dec 10, 2024):
Perhaps you need could be integrated in the future prompt management system https://github.com/open-webui/open-webui/issues/5962 ?
@Classic298 commented on GitHub (Apr 15, 2026):
Given that default function calling is now considered legacy and that native function calling does not make use of a RAG prompt anymore, i think this can be considered solved/closed.
You can create a custom system prompt in a custom model and tell it HOW to query for the knowledge base - since the model itself will do the query creation when querying a knowledge base using native tool calling now