mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-21 09:01:47 -05:00
[GH-ISSUE #12204] feat: RAG Prompt for Knowledge #16505
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 @etlweather on GitHub (Mar 31, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/12204
Check Existing Issues
Problem Description
Currently, there is a system-wide prompt for RAG with Knowledge. It would be of great use to be able to have a prompt per knowledge.
Desired Solution you'd like
A system-wide prompt
Usage example:
Generally, I like the RAG prompt. "If there is nothing in the knowledge, say so." But I have a knowledge which isn't the absolute. And even if there is no knowledge, it does not need to say that it does not have the answer.
Alternatives Considered
No response
Additional Context
No response
@mahenning commented on GitHub (Mar 31, 2025):
Do you mean the "RAG_TEMPLATE" (link), the one you set in the admin document settings? If yes, I'm not sure it is that easy to set it per knowledge base. What if the model has multiple knowledge bases? As the template is used in the last step to generate an answer in the chat, it would be very convoluted (if not impossible) to use different templates for different knowledge bases and merge them into one coherent answer.
A per-model knowledge base RAG template would be possible in my opinion, like the model system prompt.
@etlweather commented on GitHub (Mar 31, 2025):
Yes, I mean RAG_TEMPLATE and I agree, as part of the Model make a lot more sense than in the Knowledge for the reasons you said.
@mrudat commented on GitHub (Apr 28, 2025):
See also #7679, which appears to be a similar, but broader request.
@silentoplayz commented on GitHub (Dec 19, 2025):
Closing this as a duplicate of #7679.
Issue #7679 ("Per-Knowledge-Base RAG Prompt Management") covers the same requirement for overriding RAG prompts at the knowledge base level and contains a more detailed implementation proposal. Please follow the discussion there.