Attempting to append document source paths to the chat response, an additional value retrieved from the vector store

Hello n8n Community,
I have a tricky (to me) one that should hopefully have an easy response, but it has eluded me scouring the online docs, working on it with my ai friends, etc.

I have a simple AI Agent setup receives a prompt, queries a Supabase vector store and produces a response.

I have added a webhook, response to webhook and format final response in hopes I can append the source docs used to generate the response. Each document in Supabase knowledge has the URL assigned as the file_id. So when the vector is retrieved it includes the path(s) I need to display / append at the end of the response.

{
"pageContent": 
"24 HUMAN RESOURCES * About Human Resources [/hr/about-hr] * Open Voice [/hr/open-voice] * Benefits [/hr/benefits] * Employee Relations [/hr/employee-relations] * ...  Midpoint Drive, Suite 100Fort Collins, ColoradoPhone: (970) 980-2425Fax: (970) 980-2430Website: my.marathon-health.com [http://my.marathon-health.com/]CLINIC HOURS * Mondays, Wednesdays, Fridays 7:00am - 4:00pm Closed 12:00-1:00pm * Tuesdays, Thursdays 8:30am - 5:30pm Closed 1:00-2:00pm",
"metadata": 
{
"loc": 
{
"lines": 
{
"to": 
1,
"from": 
1
}
},
"source": 
"blob",
"file_id": 
"https://www.larimer.gov/hr/benefits/wellness-clinic/fitness-center/hours-operation ",
"blobType": 
"text/plain"
}
},

As noted I have struck out in routing or storing the file_id(s) in order to append them in the format_final_chat_response node.

Any help is greatly appreciated.
~Gregg

Here is my actual design I am enquiring about - sorry for leaving it off before

1 Like