[GH-ISSUE #3503] [BUG]: Workspace Chat mode Chat/Query Switch doesn't seems to be working by api #2258

Closed
opened 2026-02-22 18:28:52 -05:00 by yindo · 4 comments
Owner

Originally created by @LuGuangguang on GitHub (Mar 20, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3503

How are you running AnythingLLM?

Docker (local)

What happened?

When I test AnythingLLM Developer API,I find that Workspace Chat mode Chat/Query Switch doesn't seems to be working.

Image

Image

When I test it on webclient,it work well.

Image

Are there known steps to reproduce?

No response

Originally created by @LuGuangguang on GitHub (Mar 20, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3503 ### How are you running AnythingLLM? Docker (local) ### What happened? When I test AnythingLLM Developer API,I find that Workspace Chat mode Chat/Query Switch doesn't seems to be working. ![Image](https://github.com/user-attachments/assets/d6adfec8-f130-4b07-9f71-daf1556f7ea0) ![Image](https://github.com/user-attachments/assets/8a40b822-5098-4a3c-a6f6-8b104dfeb63a) When I test it on webclient,it work well. ![Image](https://github.com/user-attachments/assets/ce366446-c68d-4ec2-9ba8-4370fbc6ab7d) ### Are there known steps to reproduce? _No response_
yindo added the possible bug label 2026-02-22 18:28:52 -05:00
yindo closed this issue 2026-02-22 18:28:52 -05:00
Author
Owner

@timothycarambat commented on GitHub (Mar 20, 2025):

That endpoint sends a totally independent chat request to the workspace via the API, it does not modify the workspace itself.

That endpoint basically allows you to a send a chat atomically to that workspace and you can specify for a specific request to use chat or query.

If you want to update the workspaces default setting so it applies in the UI you should be using
POST /v1/workspace/{slug}/update
body:

{
"chatMode": "chat", // or "query"
}
@timothycarambat commented on GitHub (Mar 20, 2025): That endpoint sends a totally independent chat request to the workspace via the API, it does not _modify_ the workspace itself. That endpoint basically allows you to a send a chat atomically to that workspace and you can specify for a specific request to use `chat` or `query`. If you want to update the workspaces default setting so it applies in the UI you should be using POST `/v1/workspace/{slug}/update` body: ```js { "chatMode": "chat", // or "query" } ```
Author
Owner

@LuGuangguang commented on GitHub (Mar 20, 2025):

That endpoint sends a totally independent chat request to the workspace via the API, it does not modify the workspace itself.

That endpoint basically allows you to a send a chat atomically to that workspace and you can specify for a specific request to use chat or query.

If you want to update the workspaces default setting so it applies in the UI you should be using

{
"chatMode": "chat", // or "query"
}

I think there might be a misunderstanding. What I meant is: I sent a single chat request (explicitly as 'chat'), but the LLM actually responded by searching the local database in 'query' mode. Additionally, the entire workspace is already configured to 'chat' mode.

Image

@LuGuangguang commented on GitHub (Mar 20, 2025): > That endpoint sends a totally independent chat request to the workspace via the API, it does not _modify_ the workspace itself. > > That endpoint basically allows you to a send a chat atomically to that workspace and you can specify for a specific request to use `chat` or `query`. > > If you want to update the workspaces default setting so it applies in the UI you should be using > > { > "chatMode": "chat", // or "query" > } I think there might be a misunderstanding. What I meant is: I sent a single chat request (explicitly as 'chat'), but the LLM actually responded by searching the local database in 'query' mode. Additionally, the entire workspace is already configured to 'chat' mode. ![Image](https://github.com/user-attachments/assets/47fe1044-dd51-453b-83d9-fc90e35ac776)
Author
Owner

@timothycarambat commented on GitHub (Mar 21, 2025):

Chat Model = Documents + General knowledge
Query = Model only will respond unless a citation was used in response. This can be referenced from an earlier chat citation or the current chat citation results.

Secondly, the workspaces setting for Chat mode ≠ the API chatMode. The API chat mode can function totally independent of the workspaces current setting. The toggle in the workspace UI controls chats in app, not via API. Whatever you specify in the API request is the mode that will be used at that time and will not modify the underlying workspace setting in the UI.

I sent a single chat request (explicitly as 'chat'), but the LLM actually responded by searching the local database in 'query' mode.

This would be expected since a chat uses general knowledge + documents 👍

@timothycarambat commented on GitHub (Mar 21, 2025): Chat Model = Documents + General knowledge Query = Model _only will respond_ unless a citation was used in response. This can be referenced from an earlier chat citation or the current chat citation results. Secondly, the _workspaces_ setting for Chat mode ≠ the API chatMode. The API chat mode can function totally independent of the workspaces current setting. The toggle in the workspace UI controls chats _in app_, not via API. Whatever you specify in the API request is the mode that will be used at that time and will not modify the underlying workspace setting in the UI. > I sent a single chat request (explicitly as 'chat'), but the LLM actually responded by searching the local database in 'query' mode. This would be expected since a chat uses general knowledge + documents 👍
Author
Owner

@ROlwig commented on GitHub (Jun 8, 2025):

I have a similar issue where I have payload = {"message": message, "userId": user_id, "chatMode": "chat"} and the response can randomly return the message I have in the workspace for query mode. thanks.

@ROlwig commented on GitHub (Jun 8, 2025): I have a similar issue where I have payload = {"message": message, "userId": user_id, "chatMode": "chat"} and the response can randomly return the message I have in the workspace for query mode. thanks.
yindo changed title from [BUG]: Workspace Chat mode Chat/Query Switch doesn't seems to be working by api to [GH-ISSUE #3503] [BUG]: Workspace Chat mode Chat/Query Switch doesn't seems to be working by api 2026-06-05 14:45:30 -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#2258