FR(Retool Vectors) - Insert File w Dynamic Metadata and Filter Labels


can the little fx option be added to Metadata and Filter Labels if possible?

I have a workflow that iterates over all files in a folder and checks if any are missing from a vector store. They're all PDF files however and since you can't use the Convert Document to Text AI Action in a workflow i went a head and used the (Adobe PDF Services SDK)[GitHub - adobe/pdfservices-node-sdk-samples: Samples for the Adobe Document Services PDF Tools Node SDK] to do extract text and do some post-processing to generate custom metadata and filter labels.... only after getting all that in there, I realized it isn't possible to specify dynamic values for either of those fields =/

using a function vs AI Action block in a workflow doesn't matter, those fields doesn't accept JS via {{}}... the vector action doesn't make a difference either (I tried inserting the document then using another block to update it, but ya no luck)

this is the metadata I generate:

Would anybody happen to know if inserting this information into the Document Content would be somewhat of a workaround since every document in the vector store would have this added to the end of it's content, or would the model end up consuming this data as text which could end up with queries having the model return the metadata instead of the file text?

EDIT:
@avr has a much beteter solution using Retool Agents over here, I also posted my code for extracting PDF text and generating metadata over there

2 Likes

Woot! Agents to the rescue. :+1: Thanks for sharing this update, @bobthebear. I think it would still make sense for those fields to be dynamic and will document that request internally, but I'm glad you have a good solution.