General knowledge AND custom trained knowledge

I can’t tell you what LangChain is doing under the hood, so I don’t know what you implemented.

However, if you used the API directly, you would use your knowledgbase to retrieve information, then insert what’s retrieved as context in the system prompt when generating an output. At the time of the generation, unless you explicitly instructed the model to do otherwise within the system prompt, the model will respond based on both the context retrieved from the knowledgbase and the base knowledge of the model itself.