From db3a7b6ec2dee82df74fa055ab83b5a140cf49f0 Mon Sep 17 00:00:00 2001 From: sigoden Date: Thu, 17 Oct 2024 19:36:00 +0800 Subject: refactor: improve RAG search (#931) --- config.example.yaml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'config.example.yaml') diff --git a/config.example.yaml b/config.example.yaml index 9ca6692..c46fbf0 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -44,19 +44,25 @@ rag_min_score_vector_search: 0 # Specifies the minimum relevance sc rag_min_score_keyword_search: 0 # Specifies the minimum relevance score for keyword-based searching # Defines the query structure using variables like __CONTEXT__ and __INPUT__ to tailor searches to specific needs rag_template: | - Use the following context as your learned knowledge, inside XML tags. + Answer the query based on the context while respecting the rules. (user query, some textual context and rules, all inside xml tags) + __CONTEXT__ - When answer to user: - - If you don't know, just say that you don't know. - - If you don't know when you are not sure, ask for clarification. - Avoid mentioning that you obtained the information from the context. - And answer according to the language of the user's question. + + - If you don't know, just say so. + - If you are not sure, ask for clarification. + - Answer in the same language as the user query. + - If the context appears unreadable or of poor quality, tell the user then answer as best as you can. + - If the answer is not in the context but you think you know the answer, explain that to the user then answer with your own knowledge. + - Answer directly and without using xml tags. + + + + __INPUT__ + - Given the context information, answer the query. - Query: __INPUT__ # Define document loaders to control how RAG and `.file`/`--file` load files of specific formats. document_loaders: # You can add custom loaders using the following syntax: -- cgit v1.2.3