[GH-ISSUE #3701] [BUG]: Agent Intermittently Fails to Trigger When Invoked via Chat Interface #2383

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

Originally created by @VENKATINDEXNINNE on GitHub (Apr 23, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3701

How are you running AnythingLLM?

AnythingLLM desktop app

What happened?

When integrating a custom RAG model with AnythingLLM using the chatbot interface, the agent sometimes fails to trigger during the initial attempts. Instead of invoking the configured agent endpoint, the chatbot immediately returns an error. After 2–3 repeated attempts, the agent begins responding as expected.
Additionally, we’ve noticed that unless the agent is explicitly mentioned by name in the query, the system occasionally defaults to web search behavior instead of strictly calling the configured RAG agent — even when web search is disabled or undesired.

https://drive.google.com/drive/folders/1e9_f8DZyGj9gwadus1KX0SmpnKaRFwIJ?usp=drive_link

Are there known steps to reproduce?

Environment

  1. WINDOWS 11
  2. OPEN - AI

Steps to Reproduce:
1)Configure a custom agent pointing to a working RAG API endpoint.
2)Launch the AnythingLLM chatbot interface.
3)Ask a question that should trigger the agent.
4)Observe that the agent is not called on the first few attempts.
5)Retry the same query 2–3 times.
6) Agent finally responds as expected.

Expectation:
1)The agent should be automatically triggered without the need to explicitly mention the agent’s name in the user query.
We've tested this by using various descriptions and keyword hints in both the Agent and Workspace configurations, explicitly mapping relevant keywords to the agent — but it still fails to route consistently.

2)The agent should be reliably invoked on the first attempt without returning an error.
Currently, the same query has to be repeated 2–3 times before the agent finally responds. This inconsistency may be related to a timeout, delayed initialization, or some internal handling issue.

https://drive.google.com/drive/folders/1e9_f8DZyGj9gwadus1KX0SmpnKaRFwIJ?usp=drive_link

Originally created by @VENKATINDEXNINNE on GitHub (Apr 23, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3701 ### How are you running AnythingLLM? AnythingLLM desktop app ### What happened? When integrating a custom RAG model with AnythingLLM using the chatbot interface, the agent sometimes fails to trigger during the initial attempts. Instead of invoking the configured agent endpoint, the chatbot immediately returns an error. After 2–3 repeated attempts, the agent begins responding as expected. Additionally, we’ve noticed that unless the agent is explicitly mentioned by name in the query, the system occasionally defaults to web search behavior instead of strictly calling the configured RAG agent — even when web search is disabled or undesired. [https://drive.google.com/drive/folders/1e9_f8DZyGj9gwadus1KX0SmpnKaRFwIJ?usp=drive_link](url) ### Are there known steps to reproduce? Environment 1) WINDOWS 11 2) OPEN - AI Steps to Reproduce: 1)Configure a custom agent pointing to a working RAG API endpoint. 2)Launch the AnythingLLM chatbot interface. 3)Ask a question that should trigger the agent. 4)Observe that the agent is not called on the first few attempts. 5)Retry the same query 2–3 times. 6) Agent finally responds as expected. Expectation: 1)The agent should be automatically triggered without the need to explicitly mention the agent’s name in the user query. We've tested this by using various descriptions and keyword hints in both the Agent and Workspace configurations, explicitly mapping relevant keywords to the agent — but it still fails to route consistently. 2)The agent should be reliably invoked on the first attempt without returning an error. Currently, the same query has to be repeated 2–3 times before the agent finally responds. This inconsistency may be related to a timeout, delayed initialization, or some internal handling issue. [https://drive.google.com/drive/folders/1e9_f8DZyGj9gwadus1KX0SmpnKaRFwIJ?usp=drive_link](url)
yindo added the possible bug label 2026-02-22 18:29:26 -05:00
yindo closed this issue 2026-02-22 18:29:26 -05:00
Author
Owner

@timothycarambat commented on GitHub (Apr 23, 2025):

Since it appears you are on Docker, what do the logs say when calling the agent?
Additionally, what model are you using for tool calling - help reference

I dont see any "thinking" results you would normally see if the agent actually called a tool. Keep in mind, the model decides when a tool call is relevant. If you ask something the model may have knowledge of inherently, it may opt to explicitly just respond since it doesn't seem to need a tool to resolve the query.

For example, the model knows what AWS is. It can just respond with no tool call and be done with that request. Whereas when you asked for something that had to do or made "sense" to use a tool (like your i9 question) you saw a tool call since in its tool selection it could predict that this is relevant for a tool call.

There is no "bug" per se with the tool calling, your model is just trying to answer queries in the least possible effort way so if it can handle a question without calling a tool - it will.

@timothycarambat commented on GitHub (Apr 23, 2025): Since it appears you are on Docker, what do the logs say when calling the agent? Additionally, what _model_ are you using for tool calling - [help reference](https://docs.anythingllm.com/agent-not-using-tools) I dont see any "thinking" results you would normally see if the agent _actually_ called a tool. Keep in mind, the _model decides_ when a tool call is relevant. If you ask something the model may have knowledge of inherently, it may opt to explicitly just respond since it doesn't seem to need a tool to resolve the query. For example, the model knows what AWS is. It can just respond with no tool call and be done with that request. Whereas when you asked for something that had to do or made "sense" to use a tool (like your i9 question) you saw a tool call since in its tool selection it could predict that this is relevant for a tool call. There is no "bug" per se with the tool calling, your model is just trying to answer queries in the least possible effort way so if it can handle a question without calling a tool - it will.
yindo changed title from [BUG]: Agent Intermittently Fails to Trigger When Invoked via Chat Interface to [GH-ISSUE #3701] [BUG]: Agent Intermittently Fails to Trigger When Invoked via Chat Interface 2026-06-05 14:46:15 -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#2383