Skip to content
Discussion options

You must be logged in to vote

Hi, this is not possible to do OOTB with the current implementation, but you can do some tricks to make it work.
Please keep in mind that there is usually a single SystemMessage for the entire conversation, so if you are going to put RAG content (that is retrieved before each LLM request) inside the system message, this meand that RAG content from previous iterations will be overriden. If this is intended, you can try using https://docs.langchain4j.dev/tutorials/ai-services#programmatic-chatrequest-rewriting and manipulate messages that are sent to the LLM. You could cut RAG content from UserMessage s and insert it into the SystemMessage. This will not be reflected in ChatMemory though, b…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Nicht1
Comment options

@dliubarskyi
Comment options

Answer selected by Nicht1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants