I am ready to deploy my first n8n built AI assistant. This assistant will be embedded into a CRM application and I need to be able to pass context from the CRM contact record into the AI agent so that when my user is communicating with the AI agent, the AI agent already has an understanding as to which record the user is communicating about, and the agent can use the data fields from that record to make decisions
If your workflow is trigggered from the CRM (for exampe via webhook or API call) and you already havve the contact record, fetch some data about that contact(email, name etc)before the Ai Agnt node.
In the AI Agents human/system prompt, you could add context like :
Use this information when answering questions and making decisions.
User message: {{ $json.userMessage }}
Or if using the Chat Trigger node (embebdded chat) you can:
Chat triggger thenuse a node (HTTP Request / DB / CRM node) to load the contact reccord based on some identiier passsed from your CRm and add feed this to prompts …
Thank you for the feedback @Parintele_Damaskin. Since we will be embedding the chat panel directly into the CRM record, I was looking to pass the CRM record data either as a URL parameter to the chat widget URL or pass some metadata to the workflow with each chat.
This can be done with N8nChatUI, but we want to test with the standard n8n UI.