I’d support that as well. I currently have workflows using a second tool-node for fetching the metadata from the vector-storage but it feels crippled and massively slows down the workflow (which is the biggest drawback)
being able to access (and use) metadata coming from the vector-storage would be a huge plus, especially since the data is already there when looking at the outputs:
I saw your post about using the workflowGetMetadata . I’m dealing with the same issue and would love to know how you set it up. Any chance you could share how you got it working?
sure, I use a code-node after the Agent-Node which looks for available metadata in the Agents intermediate steps. if is is available I parse in the metadata needed for example to create a Link to the source documents.
As already mentioned, this approach is just a nasty workaround since it involves using an Agent-Tool to call for the metadata which consumes additional time and tokens.
here’s the JavaScript I coded with Claude to achieve this:
// First check if we can access the last input
const lastInput = $input.last();
if (!lastInput?.json?.intermediateSteps) {
return {
json: {
output: $input.last().json.output
}
};
}
// Check if intermediateSteps is an array and has elements
const intermediateSteps = lastInput.json.intermediateSteps;
if (!Array.isArray(intermediateSteps) || intermediateSteps.length === 0) {
return {
json: {
output: $input.last().json.output
}
};
}
// Now safely get the observation from the last step
const observation = intermediateSteps[intermediateSteps.length - 1]?.observation;
let sourceLink = '';
if (observation) {
try {
const parsedData = JSON.parse(observation);
if (parsedData?.document?.metadata?.file_url) {
sourceLink = `[Quelle](https://www.yourdomai.com${parsedData.document.metadata.file_url})`;
}
} catch (error) {
// If parsing fails, keep sourceLink empty
}
}
return {
json: {
output: $input.last().json.output,
source: sourceLink
}
};
If we would have a possibility to access metadata directly in the Agent-Node and use it in instructions, this would really be a game-changer.