From eed704d23bc53e5d0359072e5e2134b469ae2eef Mon Sep 17 00:00:00 2001 From: Michael Peter Christen Date: Sat, 6 Dec 2025 19:21:57 +0100 Subject: added RAG configuration page --- defaults/yacy.init | 20 ++++--- htroot/AILab.html | 2 +- htroot/RAGConfig_p.html | 61 ++++++++++++++++++++++ htroot/env/templates/submenuAI.template | 1 + htroot/yacychat.html | 2 +- source/net/yacy/htroot/AILab.java | 4 +- source/net/yacy/htroot/RAGConfig_p.java | 36 +++++++++++++ source/net/yacy/htroot/yacychat.java | 38 ++++++++------ source/net/yacy/http/servlets/RAGProxyServlet.java | 24 +++++---- 9 files changed, 150 insertions(+), 38 deletions(-) create mode 100644 htroot/RAGConfig_p.html create mode 100644 source/net/yacy/htroot/RAGConfig_p.java diff --git a/defaults/yacy.init b/defaults/yacy.init index d61ddafe8..306ab5969 100644 --- a/defaults/yacy.init +++ b/defaults/yacy.init @@ -1416,11 +1416,15 @@ crawler.userAgent.clienttimeout = 10000 # experiments with timeout requests timeoutrequests = true -# interface decorations -decoration.audio = false -decoration.grafics.linkstructure = true -decoration.hostanalysis = false -decoration.simpleheadernavbar = navbar-default - -# ai settings -ai.production_models = {} \ No newline at end of file +# interface decorations +decoration.audio = false +decoration.grafics.linkstructure = true +decoration.hostanalysis = false +decoration.simpleheadernavbar = navbar-default + +# ai settings +ai.production_models = {} +ai.system-prompt = You are a smart and helpful chatbot. If possible, use friendly emojies. +ai.llm-system-prefix = \n\nYou may receive additional expert knowledge in the user prompt after a 'Additional Information' headline to enhance your knowledge. Use it only if applicable. +ai.llm-user-prefix = \n\nAdditional Information:\n\nbelow you find a collection of texts that might be useful to generate a response. Do not discuss these documents, just use them to answer the question above.\n\n +ai.llm-query-generator-prefix = Make a list of search words with low document frequency for the following prompt; use a JSON Array: diff --git a/htroot/AILab.html b/htroot/AILab.html index 09f007ba4..cbf330393 100644 --- a/htroot/AILab.html +++ b/htroot/AILab.html @@ -299,7 +299,7 @@ RAG configuration
- Configure RAG roles + Wire RAG prompts Test in Chat
Set the search-query and qapairs columns to connect retrieval to your chat flow.
diff --git a/htroot/RAGConfig_p.html b/htroot/RAGConfig_p.html new file mode 100644 index 000000000..51317e78d --- /dev/null +++ b/htroot/RAGConfig_p.html @@ -0,0 +1,61 @@ + + + + YaCy '#[clientname]#': Wire RAG Retrieval + #%env/templates/metas.template%# + + + + #%env/templates/header.template%# + #%env/templates/submenuAI.template%# + +

Wire RAG Retrieval

+

Tune how YaCy constructs prompts and search queries for Retrieval Augmented Generation.

+ +
+
+

System Prompt

+

This is sent as the system message for chats. Keep it concise and friendly.

+ +
+ +
+

User Retrieval Prefix

+

Prepended before attached search snippets in RAG mode to tell the LLM how to use them.

+ +
+ +
+

Query Generator Prefix

+

Prompt given to the model that generates search queries from user requests.

+ +
+ + +
+ + #%env/templates/footer.template%# + + diff --git a/htroot/env/templates/submenuAI.template b/htroot/env/templates/submenuAI.template index a5badb975..614dff4a1 100644 --- a/htroot/env/templates/submenuAI.template +++ b/htroot/env/templates/submenuAI.template @@ -3,6 +3,7 @@ diff --git a/htroot/yacychat.html b/htroot/yacychat.html index d8fc210dc..26ee71cd1 100644 --- a/htroot/yacychat.html +++ b/htroot/yacychat.html @@ -601,7 +601,7 @@