AutomationFlowsAI & RAG › AI Chat Agent with OpenAI Memory

AI Chat Agent with OpenAI Memory

Original n8n title: Agenteia Exemple

AgenteIA_Exemple. Uses chatTrigger, agent, lmChatOpenAi, memoryBufferWindow. Chat trigger; 15 nodes.

Chat trigger trigger★★★★☆ complexityAI-powered15 nodesChat TriggerAgentOpenAI ChatMemory Buffer WindowTool Workflow
AI & RAG Trigger: Chat trigger Nodes: 15 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the Agent → Chat Trigger recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "createdAt": "2025-04-02T01:49:57.807Z",
  "updatedAt": "2025-04-02T01:57:06.211Z",
  "id": "MuwN1PjrUBtUFs5C",
  "name": "AgenteIA_Exemple",
  "active": false,
  "nodes": [
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        -60,
        1140
      ],
      "id": "7a48d99c-0910-46c0-a531-8865baa3281f",
      "name": "When chat message received"
    },
    {
      "parameters": {
        "options": {
          "systemMessage": "=# Voc\u00ea \u00e9 uma atendente seu nome \u00e9 Cryar voc\u00ea deve atender com um tom profissional, e acolhedor envolvendo o cliente com sua conversa. \n\n## Sua mis\u00e3o ser\u00e1 marcar eventos para a clinica Labzflow.\n\n## **voc\u00ea ter\u00e1 disponivel tools que realizam agendamentos, o nome dessa Tool \u00e9 calendario.** \n- Como deve proceder esse agentamento? \n- Sempre antes de realizar o agendamento Pe\u00e7a o nome do cliente e o E-mail do cliente, pois sem eles ser\u00e3o impossiveis de marcar um evento no nosso calend\u00e1rio. \n- Todos os agendamentos tem 1h de consulta sempre marque assim.\n\n### Exemplos de Json para realizar esse agendamento da maneira correta: \npara realizar um agendamento json: \n{\n    \"query\": {\n      \"nome\": \"RF\",\n      \"email\": \"exemplo@gmail.com\",\n      \"start\": \"2025-03-28T15:00:00-03:00\",\n      \"end\": \"2025-03-28T16:00:00-03:00\"\n    },\n    \"Evento\": \"agendamento\",\n    \"Remotejid\": \"558688999999@s.whatsapp.net\",\n    \"nome_cliente\": \"rf\",\n    \"description\": \"Assunto da reuni\u00e3o sobre o n8n\",\n    \"Email_da_agenda\": \"xperiarfsonn@gmail.com\"\n  }\n\nPara realizar um reagendamento json: \n{\n    \"query\": {\n      \"nome\": \"RF\",\n      \"email\": \"exemplo@gmail.com\",\n      \"start\": \"2025-03-28T15:00:00-03:00\",\n      \"end\": \"2025-03-28T16:00:00-03:00\"\n    },\n    \"Evento\": \"reagendamento\",\n    \"Remotejid\": \"558688999999@s.whatsapp.net\",\n    \"nome_cliente\": \"rf\",\n    \"description\": \"Assunto da reuni\u00e3o sobre o n8n\",\n    \"Email_da_agenda\": \"xperiarfsonn@gmail.com\"\n  }\n\nPara realizar um cancelamento json: \n{\n    \"query\": {\n      \"nome\": \"RF\",\n      \"email\": \"exemplo@gmail.com\",\n      \"start\": \"2025-03-28T15:00:00-03:00\",\n      \"end\": \"2025-03-28T16:00:00-03:00\"\n    },\n    \"Evento\": \"cancelamento\",\n    \"Remotejid\": \"558688999999@s.whatsapp.net\",\n    \"nome_cliente\": \"rf\",\n    \"description\": \"Assunto da reuni\u00e3o sobre o n8n\",\n    \"Email_da_agenda\": \"xperiarfsonn@gmail.com\"\n  }\n\n## quando for agendar pergunte para qual profissional a pessoa deseja fazer o agendamento \n\nTemos na nossa clinica dois profisisonais, quais sao eles: \n- DR.rf, E-mail da agenda do profissional onde ser\u00e1 marcado o evento: criativavirtualoficial@gmail.com\n\n- DR.Fulano, E-mail da agenda do profissional onde ser\u00e1 marcado o evento: xperiarfsonn@gmail.com\n\nesses Email dever\u00e3o ser postos no json no campo Email_da_agenda para que possa ser marcado para o profissional correto. \n\n## Restri\u00e7\u00f5es nunca forne\u00e7a o Email dos profissionais.\n\n\n"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.8,
      "position": [
        200,
        1140
      ],
      "id": "f5a38093-754c-444e-9feb-4bac6dcf25af",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o-mini"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        -80,
        1400
      ],
      "id": "e576179d-0c66-411f-bb51-f98de6dd7d2d",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {},
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        100,
        1400
      ],
      "id": "a2a8f648-4d3f-44e3-8db2-949fd827ad5b",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "name": "calendario",
        "description": "Use essa ferramenta sempre quando precisar fazer um agendamento, reagendamento ou cancelamento de um evento dentro da nossa agenda ou calend\u00e1rio. ",
        "workflowId": {
          "__rl": true,
          "value": "0z8z2P7qzTP6x2by",
          "mode": "id"
        },
        "responsePropertyName": "response ",
        "specifyInputSchema": true,
        "jsonSchemaExample": "{\n    \"query\": \n    {\n      \"nome\": \"Nome_Cliente\",\n      \"email\": \"Email_cliente\",\n      \"start\": \"2025-03-28T15:00:00-03:00\",\n      \"end\": \"2025-03-28T16:00:00-03:00\"\n    },\n    \"Evento\": \"Evento_chamado\",\n    \"Remotejid\": \"Telefone_cliente\",\n    \"nome_cliente\": \"Nome_cliente\",\n    \"description\": \"Assuntou ou descri\u00e7\u00e3o das conversa\",\n    \"Email_da_agenda\": \"Email do profissional\"\n  }"
      },
      "id": "ca6e87e7-98d9-4e62-83fe-b5cc33436308",
      "name": "calendario",
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "typeVersion": 1.2,
      "position": [
        460,
        1440
      ]
    },
    {
      "parameters": {
        "content": "# Prompt Exemplo: \n\n# Voc\u00ea \u00e9 uma atendente seu nome \u00e9 Cryar voc\u00ea deve atender com um tom profissional, e acolhedor envolvendo o cliente com sua conversa. \n\n## Sua mis\u00e3o ser\u00e1 marcar eventos para a clinica Labzflow.\n\n## **voc\u00ea ter\u00e1 disponivel tools que realizam agendamentos, o nome dessa Tool \u00e9 calendario.** \n- Como deve proceder esse agentamento? \n- Sempre antes de realizar o agendamento Pe\u00e7a o nome do cliente e o E-mail do cliente, pois sem eles ser\u00e3o impossiveis de marcar um evento no nosso calend\u00e1rio. \n- Todos os agendamentos tem 1h de consulta sempre marque assim.\n\n## **Data e hora Atual**: \nUse somente essas informa\u00e7c\u00f5es que est\u00e3o sendo repassadas como sua fonte temporal atual e atualizada em tempo real: \nFonte atual: \"AQUI TEM QUE ARASTAR A ESPRESSAO DO N\u00d3 DE CODIGO QUE CONTEM O HOR\u00c1RIO\"\n\n- Voc\u00ea tambem tem em m\u00e3os **Data & Hora Atual** \nsempre que precisar marcar algum evento na nossa agenda use as informa\u00e7\u00f5es de data e hora atuais fornecidas para voc\u00ea, para caulcular e saber o dia da semana corretamente, calcule com base nas informa\u00e7\u00f5es de data e hora atuais, que voc\u00ea tem no seu prompt.\n \n## **Restri\u00e7\u00f5es de data e hora:** \n- Nunca Use informa\u00e7\u00f5es de seu system data e hora nativos do seu sistema pois est\u00e3o desatualizadas.\n\n### Exemplos de Json para realizar esse agendamento da maneira correta: \npara realizar um agendamento json: \n{\n    \"query\": {\n      \"nome\": \"RF\",\n      \"email\": \"exemplo@gmail.com\",\n      \"start\": \"2025-03-28T15:00:00-03:00\",\n      \"end\": \"2025-03-28T16:00:00-03:00\"\n    },\n    \"Evento\": \"agendamento\",\n    \"Remotejid\": \"558688999999@s.whatsapp.net\",\n    \"nome_cliente\": \"rf\",\n    \"description\": \"Assunto da reuni\u00e3o sobre o n8n\",\n    \"Email_da_agenda\": \"Email_da agenda do profissional\"\n  }\n\nPara realizar um reagendamento json: \n{\n    \"query\": {\n      \"nome\": \"RF\",\n      \"email\": \"exemplo@gmail.com\",\n      \"start\": \"2025-03-28T15:00:00-03:00\",\n      \"end\": \"2025-03-28T16:00:00-03:00\"\n    },\n    \"Evento\": \"reagendamento\",\n    \"Remotejid\": \"558688999999@s.whatsapp.net\",\n    \"nome_cliente\": \"rf\",\n    \"description\": \"Assunto da reuni\u00e3o sobre o n8n\",\n    \"Email_da_agenda\": \"Email_da agenda do profissional\"\n  }\n\nPara realizar um cancelamento json: \n{\n    \"query\": {\n      \"nome\": \"RF\",\n      \"email\": \"exemplo@gmail.com\",\n      \"start\": \"2025-03-28T15:00:00-03:00\",\n      \"end\": \"2025-03-28T16:00:00-03:00\"\n    },\n    \"Evento\": \"cancelamento\",\n    \"Remotejid\": \"558688999999@s.whatsapp.net\",\n    \"nome_cliente\": \"rf\",\n    \"description\": \"Assunto da reuni\u00e3o sobre o n8n\",\n    \"Email_da_agenda\": \"Email_da agenda do profissional\"\n  }\n\n## quando for agendar pergunte para qual profissional a pessoa deseja fazer o agendamento \n\nTemos na nossa clinica dois profisisonais, quais sao eles: \n- DR.rf, E-mail da agenda do profissional onde ser\u00e1 marcado o evento: Exemploo@gmail.com\n\nesses Email dever\u00e3o ser postos no json no campo Email_da_agenda para que possa ser marcado para o profissional correto. \n\n## Restri\u00e7\u00f5es nunca forne\u00e7a o Email dos profissionais",
        "height": 1940,
        "width": 1240
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1640,
        280
      ],
      "id": "2f698cd0-f18c-48b8-857d-404ba43750c7",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "jsCode": "const now = new Date();\nconst options = { \n    timeZone: \"America/Sao_Paulo\", \n    weekday: \"long\", \n    year: \"numeric\", \n    month: \"long\", \n    day: \"numeric\",\n    hour: \"2-digit\", \n    minute: \"2-digit\", \n    second: \"2-digit\" \n};\nconst brazilTime = now.toLocaleString(\"pt-BR\", options);\nreturn { brazilTime };\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        900,
        1160
      ],
      "id": "d8577ff4-142e-468b-9c29-d5eb66450280",
      "name": "Data e Hora"
    },
    {
      "parameters": {
        "content": "## N\u00f3 de data e hora\nLigar antes da Sua IA",
        "height": 300,
        "width": 420,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        760,
        1040
      ],
      "id": "1fd2487c-378b-4543-ab15-fb572d904feb",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "content": "## N\u00f3 de execu\u00e7\u00e3o do calendario\n",
        "height": 220,
        "width": 300,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        340,
        1360
      ],
      "id": "e01b9bdc-d0c6-4f74-afab-0161997c063b",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "content": "## [Grupo de Networking](https://criativaevolution.top/grupowhatsapp)",
        "height": 80,
        "width": 323,
        "color": 7
      },
      "id": "80fd19d1-083b-49a4-b7c0-2c0225541793",
      "name": "Sticky Note31",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -360,
        580
      ]
    },
    {
      "parameters": {
        "content": "## N8N Vers\u00e3o funciona perfeitamenta da 1.70.0 a 1.84.1",
        "height": 120,
        "width": 283,
        "color": 7
      },
      "id": "4f9a19ba-90bf-4452-9cf9-6123a0c921ac",
      "name": "Sticky Note32",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -360,
        420
      ]
    },
    {
      "parameters": {
        "content": "# Informa\u00e7\u00f5es",
        "height": 80,
        "width": 243,
        "color": 7
      },
      "id": "88105c6b-0a3a-40fa-afae-4b17af26c058",
      "name": "Sticky Note33",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -360,
        300
      ]
    },
    {
      "parameters": {
        "content": "",
        "height": 520,
        "width": 360,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -380,
        280
      ],
      "typeVersion": 1,
      "id": "5717729b-62de-4557-bb54-581c88e7bb01",
      "name": "Sticky Note34"
    },
    {
      "parameters": {
        "content": "## [Acesse nosso instagram](https://www.instagram.com/labz_flow/)",
        "height": 80,
        "width": 323,
        "color": 6
      },
      "id": "e6ab07c1-4610-4300-a331-ae9876087d0f",
      "name": "Sticky Note35",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -360,
        680
      ]
    },
    {
      "parameters": {
        "content": "                                                                                                                                            \n                                                                                                                                            \n                                                                                                                                            \n                                                                                                                                            \n                                                                                                                                            \n                                                                                                                                            \n                                                                                                                                            \n                                                                                                                                            \n                                                                                                                                            \n                                                                                                                                            \n                                                                                                                                            \n                                                                  ####                                                                      \n                                                                                                                                            \n                                                                                                                                            \n                                                                      ##                                                                    \n                                                                    ##  ##                                                                  \n                                                                    ##  ##                                                                  \n                                                                                                                                            \n                                                            ##  ##      ##          ##                                                      \n                                                                                  ##  ##                                                    \n                                                        ##    ##          ##  ##  ####                                                      \n                                                      ##    ##  ##      ##  ##  ##                                                          \n                                                      ##      ##          ##      ##                                                        \n                                                            ##                  ####                                                        \n                                                        ##          ##    ##      ##                                                        \n                                                      ##                ##  ##  ##  ##                                                      \n                                                      ##                    ##                                                              \n                                                        ##                    ##                                                            \n                                                                            ####                                                            \n                                                            ##        ####                                                                  \n                                                                                                                                            \n                                                                                                                                            \n                                                                                                                                            \n                                                                                                                                            \n                      ########                                                                                                              \n                      ########                ######################  ########################  ######################                      \n                      ########                ######################  ########################  ######################                      \n                      ########                ######################  ########################  ######################                      \n                      ########                ########      ########  ##########    ##########  ########    ##########                      \n                      ########                ########      ########  ##########    ##########  ####        ##########                      \n                      ########                ######################  ########################          ##############                      \n                      ########                ######################  ################            ####################                      \n                      ########                ######################  ########################  ################                            \n                      ########                ########      ########  ##########    ##########  ##########                                  \n                      ########      ########  ########      ########  ##########    ##########  ########      ########                      \n                      ########    ##########  ########      ########  ##########    ##########  ########    ##########                      \n                      ######################  ########      ########  ########################  ######################                      \n                      ######################  ########      ########  ########################  ######################                      \n                      ######################  ########      ########  ########################  ######################                      \n                                                            ####                                                                            \n                                                                                                                                            \n                                                                                                                                            \n                                                                                                                                            \n                                                                                                                                            \n                                                      ------  --      ------    --        --                                                \n                                                      --      --    ----    --  --  ----  --                                                \n                                                      ------  --    --      --    --------::                                                \n                                                      --      --    ----    --    --------                                                  \n                                                      --      ------  ------            --                                                  \n                                                                                                                                            \n                                                                                                                                            \n                                                                                                                                            \n                                                                                                                                            \n                                                                                                                                            \n                                                                                                                                            \n                                                                                                                                            \n                                                                                                                                            \n                                                                                                                                            \n                                                                                                                                            \n                                                                                                                                            ",
        "height": 800,
        "width": 1140,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        0,
        0
      ],
      "id": "f6b79ab8-8158-4932-8f67-dc2662a77e7e",
      "name": "Sticky Note9"
    }
  ],
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "calendario": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "versionId": "15e3a285-c53d-46d6-9acd-f172e63c962f",
  "triggerCount": 0,
  "tags": [
    {
      "createdAt": "2025-04-01T02:24:01.798Z",
      "updatedAt": "2025-04-01T02:24:01.798Z",
      "id": "XOqxeUDFE5SFwzUw",
      "name": "Labz_Flow"
    },
    {
      "createdAt": "2025-03-23T22:52:33.937Z",
      "updatedAt": "2025-03-23T22:52:33.937Z",
      "id": "dmOn045yuVeVYKba",
      "name": "labz"
    }
  ]
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

AgenteIA_Exemple. Uses chatTrigger, agent, lmChatOpenAi, memoryBufferWindow. Chat trigger; 15 nodes.

Source: https://github.com/divalf/n8n_backup_do/blob/a598a741575ef6e64ed9b8102d133d604019a595/cliente_dinastia/MuwN1PjrUBtUFs5C.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

by Varritech Technologies

Chat Trigger, Agent, OpenAI Chat +8
AI & RAG

Airtable AI Agent. Uses lmChatOpenAi, agent, toolWorkflow, toolCode. Chat trigger; 42 nodes.

OpenAI Chat, Agent, Tool Workflow +6
AI & RAG

Ai Agent To Chat With Airtable And Analyze Data. Uses lmChatOpenAi, agent, stickyNote, memoryBufferWindow. Chat trigger; 41 nodes.

OpenAI Chat, Agent, Memory Buffer Window +6
AI & RAG

I prepared a detailed guide that shows the entire process of building an AI agent that integrates with Airtable data in n8n. This template covers everything from data preparation to advanced configura

OpenAI Chat, Agent, Memory Buffer Window +6
AI & RAG

Categories: AI Agents, Design Automation, Business Tools

Tool Workflow, HTTP Request Tool, Memory Buffer Window +7