{
  "name": "First RAG Agent",
  "nodes": [
    {
      "parameters": {
        "public": true,
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        0,
        0
      ],
      "id": "b98ed7ba-77b2-40f8-95df-bb76b33fd30c",
      "name": "When chat message received",
      "webhookId": "8e87d7ca-2ad8-46a2-87c1-fc66da68d82a"
    },
    {
      "parameters": {
        "options": {
          "systemMessage": "=#Role\nYou are an AI assistant trained to answer questions specifically based on the iOS 18 feature documents stored in the connected vector database.\n\n#Objective\nYour job is to help users clearly understand the new features, settings, and changes introduced in iOS 18 — by retrieving and referencing only the information available in the documents stored in the vector store.\n\nIf a user asks something that’s not included in the uploaded content, or if the answer isn’t clear from the available data, let them know that the information isn't currently available.\n\n#Rules\n\n- Be clear and direct — avoid over-explaining.(Use 2-5 sentences)\n\n- Use bullet points or short paragraphs when listing multiple features.\n\n- Never guess or assume — stick strictly to what’s inside the vector database content.\n\nYour main objective: Deliver helpful, accurate, and easy-to-understand answers using only the documents available in the vector store — no speculation, no extra assumptions, and no external sources.\n\n"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.8,
      "position": [
        220,
        0
      ],
      "id": "138e6255-58ce-4d6f-9acf-dcb5083c24f2",
      "name": "AI Agent"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4o",
          "mode": "list",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        80,
        240
      ],
      "id": "91c46d9f-057a-4901-9fc7-df1a188b809a",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "LSihAOI8NTU3m5ce",
          "name": "OpenAi account 3"
        }
      }
    },
    {
      "parameters": {
        "contextWindowLength": 10
      },
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "typeVersion": 1.3,
      "position": [
        300,
        240
      ],
      "id": "8480bedf-7106-4f8f-b81a-4f610b97509d",
      "name": "Simple Memory"
    },
    {
      "parameters": {
        "pineconeIndex": {
          "__rl": true,
          "value": "n8nragagent",
          "mode": "list",
          "cachedResultName": "n8nragagent"
        },
        "options": {
          "pineconeNamespace": "ragagent"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "typeVersion": 1.1,
      "position": [
        300,
        480
      ],
      "id": "53ffcb41-7f55-4639-8632-fd4004a137fd",
      "name": "Pinecone Vector Store",
      "credentials": {
        "pineconeApi": {
          "id": "4k7uLBMP6I3s4bOf",
          "name": "PineconeApi account 4"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "typeVersion": 1.2,
      "position": [
        400,
        700
      ],
      "id": "3945ec94-ddda-4f2c-9efd-0cfbdc9e1f5e",
      "name": "Embeddings OpenAI",
      "credentials": {
        "openAiApi": {
          "id": "LSihAOI8NTU3m5ce",
          "name": "OpenAi account 3"
        }
      }
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4o",
          "mode": "list",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        660,
        500
      ],
      "id": "623b4344-a156-4da4-a25a-1f7b716c3aa8",
      "name": "OpenAI Chat Model1",
      "credentials": {
        "openAiApi": {
          "id": "LSihAOI8NTU3m5ce",
          "name": "OpenAi account 3"
        }
      }
    },
    {
      "parameters": {
        "name": "IOS_18",
        "description": "=Useful for when you need to answer questions about iOS 18. It finds and returns the most relevant information from the documents in the vector database — like feature updates, settings, or changes in the new iOS version. Whenever you need information about iOS 18, you should ALWAYS use this."
      },
      "type": "@n8n/n8n-nodes-langchain.toolVectorStore",
      "typeVersion": 1,
      "position": [
        520,
        280
      ],
      "id": "cadcbf6d-09ef-4b0d-b584-8ca3bd49f1a0",
      "name": "IOS_18"
    }
  ],
  "pinData": {},
  "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
          }
        ]
      ]
    },
    "Pinecone Vector Store": {
      "ai_vectorStore": [
        [
          {
            "node": "IOS_18",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "IOS_18",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "IOS_18": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "ef60d316-95a7-4f96-b03e-25bb6d4dcde5",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "ae59e6b831344dba624c99cbe778a4bc47150f8e64de86a8011d15bac8e58c21"
  },
  "id": "eB4Z3NzsQwZrDdvt",
  "tags": []
}