What is the difference between an AI Agent node and Question & Answer node when being used for Q&A?

Describe the problem/error/question

I did search for forum and docs but was not able to find related information. I would like to know what is the difference when using AI Agent and the Question & Answer node for Q&A using RAG DB. My understanding is that AI Agent can attach additional Memory sub-node, and the rest are semantically the same to me.

My questions are:

  1. Is there any key difference I am not aware of?
  2. For building a chat bot with RAG and session-based memory, it looks that I should use the AI Agent node as it can attach a Memory sub-node. Am I right on this statement?

Please share your workflow

Information on your n8n setup

  • n8n version: 1.115.3

Hi @Victor_Tseng

Behind the scene it is still LangChain node but with other configuration (smaller amount of options on Question & Answer node). In your case when you are using Redis Chat Memory or any other Memory it will be better to work with AI Agent node

Below exported JSON of both elements.

  "nodes": [
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 3,
      "position": [
        16,
        -48
      ],
      "id": "c24063ea-e7b9-462e-b3e2-73400248a8d4",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chainRetrievalQa",
      "typeVersion": 1.6,
      "position": [
        16,
        176
      ],
      "id": "ef3aa5f3-6036-4fac-a7fe-317c4e73450b",
      "name": "Question and Answer Chain"
    }
  ],