{
  "id": "hWRV5DnuYJoVsW0k",
  "meta": {
    "templateId": "5148",
    "templateCredsSetupCompleted": true
  },
  "name": "ServiceNow Knowledge Chatbot",
  "tags": [],
  "nodes": [
    {
      "id": "1218186e-a93e-4e05-b47e-a395f28cf5f9",
      "name": "Qdrant Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        816,
        352
      ],
      "parameters": {
        "mode": "insert",
        "options": {},
        "qdrantCollection": {
          "__rl": true,
          "mode": "id",
          "value": "rag_collection"
        }
      },
      "credentials": {
        "qdrantApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2,
      "alwaysOutputData": true
    },
    {
      "id": "af14443b-ae01-48dc-8552-5ded7a27fce2",
      "name": "Default Data Loader",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        832,
        640
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "660380c5-63da-4404-98e6-f9c0ee9aaa90",
      "name": "Recursive Character Text Splitter",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        976,
        784
      ],
      "parameters": {
        "options": {},
        "chunkSize": 500,
        "chunkOverlap": 50
      },
      "typeVersion": 1
    },
    {
      "id": "49dbe387-751f-4a2e-8803-290bc2c06ec5",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        368,
        240
      ],
      "parameters": {
        "color": 3,
        "width": 840,
        "height": 700,
        "content": "## Data Ingestion\n**Add data to the semantic database"
      },
      "typeVersion": 1
    },
    {
      "id": "45683271-af59-41d0-9e69-af721d566661",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        1456,
        320
      ],
      "parameters": {
        "mode": "webhook",
        "public": true,
        "options": {},
        "authentication": "basicAuth"
      },
      "credentials": {
        "httpBasicAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "af562588-2e8c-4c0b-b041-d6fc8c0affd0",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1936,
        320
      ],
      "parameters": {
        "options": {
          "systemMessage": "You are a helpful assistant. You have access to a tool to retrieve data from a semantic database to answer questions. Always provide arguments when you execute the tool. Always use tools for retrieval of the data from the semantic database first and then provide the answer. Answer must be specific and grounded in the articles provided. Always add the reference to the articles and Its Number"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "de87b7bb-6fec-4d8f-a77a-25bc3a30a038",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        1984,
        560
      ],
      "parameters": {},
      "typeVersion": 1.3
    },
    {
      "id": "16261539-5218-4df1-8b14-915dd3377167",
      "name": "Qdrant Vector Store1",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        2256,
        592
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "topK": 10,
        "options": {},
        "toolName": "retriever",
        "toolDescription": "Retrieve data from a semantic database to answer questions",
        "qdrantCollection": {
          "__rl": true,
          "mode": "list",
          "value": "rag_collection",
          "cachedResultName": "rag_collection"
        }
      },
      "credentials": {
        "qdrantApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "5919cc58-05f4-42c8-aada-3782a16574d9",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1248,
        240
      ],
      "parameters": {
        "color": 4,
        "width": 1200,
        "height": 700,
        "content": "## RAG Chatbot\n**Chat with your data"
      },
      "typeVersion": 1
    },
    {
      "id": "3a3a2203-95ec-47f2-9dc9-ef651a6ab87a",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        576,
        640
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "0e2f5f1e-7447-419b-854b-47ba008b36a7",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1808,
        528
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4.1-mini"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "8d7912e1-2050-4fb6-a646-017457f24de8",
      "name": "Embeddings OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        2352,
        800
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "add35fa0-dc1b-4c3e-af98-5144b1efec7b",
      "name": "Get many table records",
      "type": "n8n-nodes-base.serviceNow",
      "position": [
        656,
        352
      ],
      "parameters": {
        "options": {
          "sysparm_fields": [
            "number",
            "short_description",
            "text"
          ],
          "sysparm_exclude_reference_link": true
        },
        "resource": "tableRecord",
        "operation": "getAll",
        "returnAll": true,
        "tableName": "kb_knowledge",
        "authentication": "basicAuth"
      },
      "credentials": {
        "serviceNowBasicApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3bbd4aa4-965e-4f8b-a47c-983fc2980e15",
      "name": "When clicking \u2018Execute workflow\u2019",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        464,
        352
      ],
      "parameters": {},
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "callerPolicy": "workflowsFromSameOwner",
    "executionOrder": "v1",
    "executionTimeout": -1
  },
  "versionId": "71ece873-347c-4e5c-a457-30957c143a51",
  "connections": {
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI1": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store1",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "Qdrant Vector Store1": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Get many table records": {
      "main": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    },
    "When clicking \u2018Execute workflow\u2019": {
      "main": [
        [
          {
            "node": "Get many table records",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}