RAG with Spring AI and custom name?
Hi guys,
I'm a bit stuck, I'm currently playing around with building a RAG using spring ai, the RAG itself works great, my issue is, that I want to give the system a bit more meta-info, I'd like it to give customized responses for stuff like "what is your name?".
But I seem to only have 2 modes, either the answer is "it is ABC" (correct) or it is "cannot find the name in the documents" (wrong).
When the name is correct it is open for all questions, also for "give me 5 random pirate names" so stuff that is not in my documents, and that should not be possible in my use case.
If I add
to the system prompt then I do not have the name in the answer any more.
I understand that this is coming from the concept of the RAG itself, it's ignoring all knowledge that is not in the documents, but is there a way around this? I also would be fine with creating a document for this, but how do I format the content of it?
I feel like missing something obvious, but cannot find it, does anyone have an idea?
2 Replies
You can try adding the name to your prompt...
Byeond that you can add personality traits to the prompt as well...
This isn't specific to Sping AI, but in general its how I get things like name and personality across.
Yes and no, my issue with adding that sentence to the user prompt and not to the system prompt is, that it then can considered as user input from the llm and it does things like "you asked for XYZ and said that your name is ABC" even if it is clearly not the user's name.