-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Description
Question Validation
- I have searched both the documentation and discord for an answer.
Question
Hi,
I am using a workflow-based ReActAgent with multiple RAG tools (more than 5), for example: info, data, market, brand, history, specs.
Each tool is implemented using a CitationQueryEngine because I need citations in the final response.
However, I’m running into several issues with how the ReActAgent behaves:
1. ReActAgent Often Responds Without Using Any Tool
In many cases, the agent ignores the tools completely and generates a direct LLM response — which leads to poor-quality answers.
I want the agent to always use tools, especially the first tool (info), because that tool contains the most critical context.
Even after updating the prompt to instruct the agent to use tools, the majority of responses still come directly from the LLM.
Here is the snippet:
agent = ReActAgent(
llm=Settings.llm,
tools=tools_list,
max_iterations=5,
)
# Update prompts
react_system_prompt = PromptTemplate(system_prompt)
agent.update_prompts({"react_header": react_system_prompt})
# Create context
ctx = Context(agent)
# Run agent
handler = agent.run(user_message, ctx=ctx, memory=chat_memory)
Question:
How can I force (or strongly encourage) the ReActAgent to always call at least one tool, ideally starting with info?
2. ReActAgent Uses Only One Tool Even When Multiple Tools Are Needed
In cases where multiple tools need to be combined for a high–quality answer, the agent usually stops after using just one tool.
It rarely chains multiple tool calls (which ReAct theoretically supports).
Question:
How can I improve multi-tool reasoning so the agent uses more than one tool when required?
3. Are There Better Approaches or Recommended Prompt Templates?
Since ReActAgent behavior is inconsistent, I’m wondering:
Is there a better agent architecture for chaining multiple RAG tools?
Are there recommended prompt templates specifically for ReActAgent to enforce tool usage?
Is there any way to enable strict tool-calling mode?
Environment
LlamaIndex version: 0.12.52
I do not have LlamaIndex source files locally (installed via pip)