RAG Document Chat Not Working with Agents #4992
-
What happened?When using agents with RAG (Retrieval-Augmented Generation), the AI chat doesn't receive the file content when asking questions, even though document upload works successfully. This is due to a conditional check in the code that prevents context handlers from being created when using agents. Steps to ReproduceSteps to Reproduce:
Expected behavior:The agent should be able to access and utilize the content from uploaded documents when responding to questions, similar to how it works with non-agent endpoints. Actual behavior:The agent cannot access the document content due to the Code location:LibreChat/api/server/controllers/agents/client.js Lines 280 to 285 in f150355 Workaround:Remove the if (this.message_file_map) {
this.contextHandlers = createContextHandlers(
this.options.req,
orderedMessages[orderedMessages.length - 1].text,
);
}
Thanks for checking 🙏 What browsers are you seeing the problem on?Chrome Relevant log outputNo response ScreenshotsNo response Code of Conduct
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
For agents, it is intended to utilize the RAG API with the File Search capability: https://www.librechat.ai/docs/features/agents#file-search |
Beta Was this translation helpful? Give feedback.
Yes, that will allow the user to upload files, for which the agent will be aware of them if uploaded correctly: