PromptTemplatePath

The path to the RAG prompt template file. This parameter applies only when Type is set to RAG.

The RAG system sends a prompt to send to the LLM with the original user question and the context documents from your IDOL index. The prompt template is a text file that defines the format of this prompt. In the template, you must use the token {{question}}, which Answer Server replaces with the user question, and the token {{context}}, which Answer Server replaces with relevant text from the candidate documents.

For example:

Provide an answer for {{question}} based on the following text: {{context}}

For each question that you ask the RAG system, Answer Server substitutes the question and context documents, and sends the result to the configure LLM to generate an answer.

CAUTION: Answer Server substitutes user-supplied input, in the form of the question text, into the template before it passes the resulting text to the LLM.

You must design your prompt templates to mitigate against prompt engineering attacks, where malicious users create input that changes the LLM behavior. The best practice varies according to the model that you use, so you must consult the recommendations for your chosen model.

Type: String
Default:  
Required: No
Configuration Section: MySystem
Example: PromptTemplatePath=./rag/prompts/rag_prompt.txt
See Also: