Below is a summary of the issue and some troubleshooting suggestions:
Description of the Issue
You have a workflow where the AI Agent is supposed to answer only if the queried information is available in your tool (for example, from the document). However, when you ask about another company that isn’t present in your file, the agent still returns an answer that includes details about a specific company from that file. In other words, the agent isn’t correctly restricting its answers to the provided content, instead pulling in additional (or inferred) information.
What Might Be Happening
-
Prompt Configuration:
The agent’s prompt may not be set up with clear instructions to limit its responses strictly to the data within the tool. When the prompt is configured to “take from previous node automatically,” it might be passing all available context to the model and allowing it to source extra information if it deems it relevant.
-
Fallback Behavior:
If the tool is expected to detect that your file does not contain information about the queried company, you likely need to use a fallback mechanism (for example, using a secondary node like a “Not sure?” tool) that instructs the agent to generate a generic answer when the requested info is unavailable.
Troubleshooting and Suggestions
-
Review and Adjust the Prompt:
Ensure that the prompt you provide to the AI Agent includes explicit instructions similar to:
“Only provide answers based on the information in the provided document. If the asked company is not mentioned in the document, respond with a message stating that no information is available on that company.”
You can do this by choosing Define below for the Prompt setting in the AI Agent node and then referencing the output from your tool nodes as needed.
-
Check Your Nodes’ Configuration:
- If you’re using a tool or custom workflow node to check for company information, verify that it is correctly isolating content relevant to your company query.
- Consider adding conditional nodes (using an If node) before triggering the AI Agent, which can check the output of your file-parsing functionality. If the searched company isn’t found in your incoming data, trigger a generic response (either via a code node or a dedicated fallback tool).
-
Use the Fallback Tool Effectively:
In some documented workflows (such as the human fallback workflow), there is a design where a tool step (e.g., “Not sure?” node) is used to catch cases where the AI does not have relevant info. You might want to incorporate or tune a similar setup so that when the company isn’t found, the agent calls the fallback mechanism:
- The agent should pass control to a fallback node that returns a message like: “I’m sorry, I don’t have information regarding that company. Here’s what I do know…”
-
Test Step-by-Step:
- Make sure that your input data is correctly formatted and that no null values (which could be interpreted as missing data) are interfering with the process.
- Test your prompt with both existing and non-existing companies to see if the expected flow is maintained.
Final Notes
This type of issue generally stems from how the prompt and tool fallback logic are configured, causing the language model to produce an answer even when the context shouldn’t allow for it. Adjusting the prompt instructions and adding explicit control logic for handling cases with no available data should help resolve the problem.
If you continue to experience issues, ensure that your node configurations are using valid input values (without nulls) and update any sub-nodes (like the memory nodes) to their latest versions if you are using older instances.
By refining the prompt and the associated fallback logic, you should be able to limit responses so that the agent only returns information available in the document, or otherwise clearly states that no such information is available.