I like to use the OpenAI SDK and I used to have multiple system prompts in my chat history, the first one was the main system prompt, and whenever I did RAG and needed to inject some context in the middle of the conversation, I would use the system role, and it worked well. Now I’m noticing that only the latest system prompt is being used as the system prompt, the model forgets all previous system prompts, even the first one.
@MasihS ,
welcome to the community.
have you considered describing your approach of “injecting Retrieval chunks as context” in the initial system prompt?
every time you inject the chunk, you can add somthing like “context: xxxx” into the user prompt itself.
this approach. might be better, as having multiple system prompts , the later one might have a higher weightage in genaral for any llm