I’m trying to get the AI Agent to determine the variable in the Vector Store’s metadata filter.
So for example, when i ask the question “Can you tell me about calculus from the file math2023”, the metadata for file should be “math2023”.
I made a code tool which can pick out the file name as expected. If I can pass that into the metadata for the vector store that would work but I’m not seeing the output from the code tool as an input option.
Hey @Ariya
Unfortunately, I don’t think vector store tool passes anything other than the user’s query to the vector store.
However, here are 2 possible approaches which might work.
1. Extract the metadata pre-agent
Pros: works in n8n cloud, uses built-in nodes
Cons: extra call to LLM, looks odd (subjective)
2. BYO vector store tool using Langchain Code node
Pros: Be the master your own destiny
Cons: Doesn’t work in n8n cloud
Note: you’ll need to add NODE_FUNCTION_ALLOW_EXTERNAL=zod to your environment variables.