Describe the problem/error/question
I’m using n8n AI Agent with Pinecone Vector Store as a Tool for a RAG workflow.
What I am experiencing is very strange and seems opposite to how RAG should work.
Here is the exact sequence I observe from the logs (using “Return Intermediate Steps”):
-
The LLM reads the news article input
-
The LLM starts generating an answer and even says something like “no relevant past records found”
-
Only after that, the Pinecone Vector Store tool is called
So the order is effectively:
Generate → then Search
instead of:
Search → then Generate
Because of this, the LLM makes a decision without having seen the Pinecone search results.
The logs clearly show:
-
First, the model produces reasoning/output
-
Then the tool call to Pinecone happens
-
The search result comes too late to influence the decision
This makes the RAG workflow unreliable, since the vector search is not used during the reasoning step.
I expected the AI Agent to:
-
Call Pinecone first
-
Use the retrieved context
-
Then generate the decision
But the actual behavior is the opposite.
Is this expected behavior of AI Agent + Vector Store Tool?
Or am I missing some configuration that forces the Agent to use the vector search before generating?
Would appreciate any clarification.
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.)
Share the output returned by the last node
Information on your n8n setup
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system: