{
  "nodes": [
    {
      "parameters": {
        "options": {}
      },
      "id": "eec0141f-8c3b-4171-a4fa-38debc21bf2e",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        240,
        340
      ],
      "typeVersion": 1.1
    },
    {
      "parameters": {
        "modelName": "models/gemini-3-flash-preview",
        "options": {
          "systemMessage": "You are an advanced AI Agent specialized in Internet Security research and academic document analysis.\n\nSYSTEM CONTEXT:\nYou operate within a Retrieval-Augmented Generation (RAG) system.\nAll answers MUST be strictly based on the retrieved documents provided in the context.\nDo not use external knowledge, assumptions, or prior training data.\n\nCORE RESPONSIBILITIES:\n1. Analyze scientific documents related to Internet Security and Cybersecurity.\n2. Extract key concepts, definitions, methodologies, experimental results, and research gaps.\n3. Summarize academic content clearly and precisely.\n4. Compare methods, frameworks, and security approaches when relevant.\n5. Provide structured and academically rigorous responses.\n\nSTRICT KNOWLEDGE BOUNDARY:\n- Only answer using information explicitly found in the retrieved documents.\n- If the answer is not present in the retrieved context, respond with:\n  English: \"The answer is not available in the provided documents.\"\n  Indonesian: \"Jawaban tidak tersedia dalam dokumen yang diberikan.\"\n\nLANGUAGE ADAPTATION RULE:\n- If the user asks in English, respond entirely in English.\n- If the user asks in Indonesian, respond entirely in Indonesian.\n- Maintain formal academic tone in both languages."
        }
      },
      "id": "2d1f4d99-9b57-41a9-b3a6-578fb7e0d37e",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        360,
        540
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "model": "nomic-embed-text:latest"
      },
      "id": "90d6350d-d32e-41d3-a5c9-94b6de843195",
      "name": "Embeddings Ollama",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOllama",
      "position": [
        480,
        740
      ],
      "typeVersion": 1
    },
    {
      "parameters": {
        "mode": "retrieve",
        "qdrantCollection": {
          "value": "Skripsi-RAG",
          "mode": "list"
        },
        "topK": 7,
        "options": {}
      },
      "id": "673f3248-18e0-47cb-b40b-741c8f1e62eb",
      "name": "Qdrant Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreQdrant",
      "position": [
        480,
        580
      ],
      "typeVersion": 1.3
    },
    {
      "parameters": {
        "returnSourceDocuments": true,
        "options": {}
      },
      "id": "fbc81d6f-79df-4c28-9a4c-d9f2c3a51f8a",
      "name": "Retrieval QA Chain",
      "type": "@n8n/n8n-nodes-langchain.chainRetrievalQa",
      "position": [
        480,
        340
      ],
      "typeVersion": 1.4
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://bc0e-103-163-240-34.ngrok-free.app/rag_evaluation",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "question",
              "value": "={{ $item(\"0\").$node[\"When chat message received\"].json[\"chatInput\"] }}"
            },
            {
              "name": "answer",
              "value": "={{ $json.text }}"
            },
            {
              "name": "retrieved_contexts",
              "value": "={{ $json.sourceDocuments }}"
            }
          ]
        },
        "options": {}
      },
      "id": "c76f2d65-f12a-4a25-ae4e-fb0b1a03e1cb",
      "name": "RAG Evaluation Webhook",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        820,
        340
      ],
      "typeVersion": 4.2
    },
    {
      "id": "933088e2-4a80-5b2a-8c2f-357f73d63391",
      "name": "Publication · Overview and setup",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -800,
        0
      ],
      "parameters": {
        "content": "# receive chat events and qdrant vector store and retrieval qa chain\n\n## Purpose and structure\nThis folder contains the **receive chat events and qdrant vector store and retrieval qa chain** workflow. Its executable nodes use `chainRetrievalQa`, `chatTrigger`, `embeddingsOllama`, `httpRequest`, `lmChatGoogleGemini`, `vectorStoreQdrant`. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.\n\n## Setup\nImport inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.\n\n## Entry points\nWhen chat message received\n\n## Verification\nSanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.\n\n## Attribution\nhttps://github.com/algonacci/rag-evaluation/blob/5a0256acc2f538259f7ec60a71f6991a0365fb41/anjay.json\nMIT; preserve source notices.",
        "width": 700,
        "height": 800,
        "color": 1
      }
    }
  ],
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "Retrieval QA Chain",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Retrieval QA Chain",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings Ollama": {
      "ai_embedding": [
        [
          {
            "node": "Qdrant Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Qdrant Vector Store": {
      "ai_retriever": [
        [
          {
            "node": "Retrieval QA Chain",
            "type": "ai_retriever",
            "index": 0
          }
        ]
      ]
    },
    "Retrieval QA Chain": {
      "main": [
        [
          {
            "node": "RAG Evaluation Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false
}
