I’m using an AI Agent with three different tools:http request,code,vector store
Describe the problem/error/question
Sometimes the agent chooses the HTTP Request tool when the answer already exists in the vector database.The tool description seems clear but the selection still feels inconsistent. Has anyone experienced this before
What is the error message (if any)?
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
I’ve encountered this before, and it’s usually less about the tool itself and more about how much the descriptions overlap.
If two tools appear capable of answering similar questions, the model has to decide which one to call. Making the descriptions more explicit
For example, "Only use this tool when live API data is required"often improves tool selection.
I’d also avoid giving multiple tools broad descriptions like “Retrieve information.” The more specific each tool’s purpose is, the fewer unnecessary tool calls you’ll see.
@Fatoki_Alfred What vector store provider are you using? Rather than http requests if your using pinecone or supabase you can use those tools.
You can also change the model or upgrade prompting to where it only uses the HTTP request as a last resort. - You can see an example of this in the JSON above
Hi @Fatoki_Alfred Welcome!
Tool selection is a fresh model decision on every turn, so it stays probabilistic by design. If the knowledge base should always be consulted, take that decision away from the model: put the Vector Store node in the normal flow ahead of the agent, set its mode to Get Many with the user question as the Prompt, and pass the returned documents into the agent’s prompt as context.
Retrieval then runs on every request, and the agent is left deciding one thing only, whether the context it already holds answers the question or the HTTP Request tool is needed.
I’d treat this as a routing problem more than a tool problem.
The first thing I would check is whether the HTTP tool and vector store tool have any overlap in their descriptions. If both sound like they can “retrieve information,” the agent may choose either one even when the vector store is the better fit.
A pattern that usually helps is:
1. Make the vector store the default source for known/internal answers.
2. Describe the HTTP Request tool as “only use this when live or external data is required.”
3. Add a short instruction in the agent prompt like: “Search the vector store first. Only call HTTP Request if the answer is missing, stale, or requires live data.”
4. If needed, split the decision before the agent with a simple classifier/IF step: known knowledge question → vector store, live lookup/action → HTTP.
If it still behaves inconsistently after that, I’d inspect the exact tool input/output from a few executions. Sometimes the agent is choosing correctly, but one tool returns vague results and the model falls back to another tool.
Good architectural suggestions above. One thing none of them fully covers: how do you actually verify the fix worked?
LLM tool selection is non-deterministic. It might look correct in 10 test runs and still drift in production. A few things that help:
**1. Log which tool actually gets called**
Add a Set node after the AI Agent and capture `{{ $json.intermediateSteps }}` — this exposes every tool call the agent made and the model’s reasoning for each. Without this, you’re guessing whether your description changes are working.
**2. Test with adversarial prompts before shipping**
After any architecture change, run a batch of test queries you *know* should hit the vector store — including ones that superficially sound like they need live data. Check the tool log for each. This is the only way to catch the 1-in-10 failure before it hits a real user.
**3. One edge case with the pre-retrieve approach**
@Anshul_Namdev’s suggestion (pre-retrieve, pass results as context) is the most reliable. Watch for this though: if the vector store returns *empty* results (a question outside the knowledge base), the agent still receives a context block — just an empty one. Your system prompt needs to explicitly handle this: *“If no context was retrieved, use the HTTP Request tool.”* Otherwise the agent may hallucinate instead of falling back correctly.
If this is powering a production-facing agent and the inconsistency keeps coming back, that’s usually a sign the overall architecture needs a closer review. Happy to help think through it.