[GH-ISSUE #2436] [FEAT]: Improve embed chat widget query mode backfilling for QA #1585

Closed
opened 2026-02-22 18:25:32 -05:00 by yindo · 1 comment
Owner

Originally created by @Alminc91 on GitHub (Oct 7, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2436

Originally assigned to: @shatfield4 on GitHub.

How are you running AnythingLLM?

Docker (local)

What happened?

Hi,

Problem:
The query mode inside the main application uses the chat history, but sadly the embedded widget only uses the chat history in chat mode, according to my tests.

Goal:
It would be amazing to be able to reference to previous question (at least the last one) in query mode with the widget, too! In chat mode I usually get at some point hallucinations that are not from my embedded documents with open-source LLM models. Even if I try to tune them inside the system-prompt. Therefore, for our use case we would need query mode + chat history (best if it could even incorporate the number in the main app "chat history" of previous chats).

More Information:
Under api/docs/#/Workspaces/post_v1_workspace__slug__stream_chat I also saw this comment:
Send a prompt to the workspace and the type of conversation (query or chat).
Query: Will not use LLM unless there are relevant sources from vectorDB & does not recall chat history.
Chat: Uses LLM general knowledge w/custom embeddings to produce output, uses rolling chat history.

But I am not sure if this has anything to do with the issue as it is working in the main app. Thanks and blessings!

Are there known steps to reproduce?

No response

Originally created by @Alminc91 on GitHub (Oct 7, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2436 Originally assigned to: @shatfield4 on GitHub. ### How are you running AnythingLLM? Docker (local) ### What happened? Hi, **Problem**: The query mode inside the main application uses the chat history, but sadly the embedded widget only uses the chat history in chat mode, according to my tests. **Goal**: It would be amazing to be able to reference to previous question (at least the last one) in query mode with the widget, too! In chat mode I usually get at some point hallucinations that are not from my embedded documents with open-source LLM models. Even if I try to tune them inside the system-prompt. Therefore, for our use case we would need query mode + chat history (best if it could even incorporate the number in the main app "chat history" of previous chats). **More Information**: Under api/docs/#/Workspaces/post_v1_workspace__slug__stream_chat I also saw this comment: Send a prompt to the workspace and the type of conversation (query or chat). Query: Will not use LLM unless there are relevant sources from vectorDB & does not recall chat history. Chat: Uses LLM general knowledge w/custom embeddings to produce output, uses rolling chat history. But I am not sure if this has anything to do with the issue as it is working in the main app. Thanks and blessings! ### Are there known steps to reproduce? _No response_
yindo added the enhancementfeature request labels 2026-02-22 18:25:32 -05:00
yindo closed this issue 2026-02-22 18:25:32 -05:00
Author
Owner

@timothycarambat commented on GitHub (Oct 7, 2024):

When in query mode for the chat embed history is not maintained.
https://github.com/Mintplex-Labs/anything-llm/blob/b658f5012de0658272fb0853a1c00a1fda2ccf1f/server/utils/chats/embed.js#L201

Whereas in https://github.com/Mintplex-Labs/anything-llm/blob/b658f5012de0658272fb0853a1c00a1fda2ccf1f/server/utils/chats/stream.js#L64 you can see that the chat will refuse only if the entire thread is missing citations (enabling follow up questions on found citations).

https://github.com/Mintplex-Labs/anything-llm/blob/b658f5012de0658272fb0853a1c00a1fda2ccf1f/server/utils/chats/stream.js#L181

Makes sense to enable this followup citation backfilling to occur for the embed widget as well.

@timothycarambat commented on GitHub (Oct 7, 2024): When in query mode for the chat embed history is not maintained. https://github.com/Mintplex-Labs/anything-llm/blob/b658f5012de0658272fb0853a1c00a1fda2ccf1f/server/utils/chats/embed.js#L201 Whereas in https://github.com/Mintplex-Labs/anything-llm/blob/b658f5012de0658272fb0853a1c00a1fda2ccf1f/server/utils/chats/stream.js#L64 you can see that the chat will refuse only if the _entire thread_ is missing citations (enabling follow up questions on found citations). https://github.com/Mintplex-Labs/anything-llm/blob/b658f5012de0658272fb0853a1c00a1fda2ccf1f/server/utils/chats/stream.js#L181 Makes sense to enable this followup citation backfilling to occur for the embed widget as well.
yindo changed title from [FEAT]: Improve embed chat widget `query` mode backfilling for QA to [GH-ISSUE #2436] [FEAT]: Improve embed chat widget `query` mode backfilling for QA 2026-06-05 14:41:35 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1585