{
  "name": "Medical Q&A chatbot for urology using RAG with Pinecone and GPT-4o",
  "nodes": [
    {
      "id": "58bf7bd0-00c7-4d7a-98f3-e18d053afa9f",
      "name": "When chat message received",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        100,
        -20
      ]
    },
    {
      "id": "6f689a95-9b4b-45c1-b407-023b05610ed9",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        540,
        -20
      ]
    },
    {
      "id": "8e0a08fa-9063-4cce-b982-650d54b1dd68",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        460,
        200
      ]
    },
    {
      "id": "d9399f27-3fa5-499a-89d2-d3b3aa8ff467",
      "name": "Simple Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
      "position": [
        620,
        200
      ]
    },
    {
      "id": "6af61985-4453-48ac-9e5a-ea7e5482374a",
      "name": "OpenAI Chat Model1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        1100,
        480
      ]
    },
    {
      "id": "034fea52-646f-4146-908c-e6128d1f764f",
      "name": "Answer questions with a vector store",
      "type": "@n8n/n8n-nodes-langchain.toolVectorStore",
      "position": [
        900,
        220
      ]
    },
    {
      "id": "4ab86662-617a-4592-b008-062ca5f9cfa7",
      "name": "Pinecone Vector Store",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        700,
        380
      ]
    },
    {
      "id": "6e14d1c6-7615-4f2c-84e5-67b94d37d8c9",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        720,
        640
      ]
    },
    {
      "id": "06831eef-7986-4b56-8eef-94180cfe9a57",
      "name": "🟢 Trigger",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -200,
        -20
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "🟢 Trigger: Activated when a user sends a new message to the chatbot.\n"
      }
    },
    {
      "id": "671e8c95-1585-42cb-9fb7-046266b1eef9",
      "name": "🧠 AI Agent Logic",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        420,
        -120
      ],
      "parameters": {
        "width": 500,
        "height": 260,
        "content": "🧠 Main AI logic: Receives user input, gathers context, and generates a friendly response.\n"
      }
    },
    {
      "id": "dc0ddbe5-0025-4998-99a8-4d67c954b6da",
      "name": "🤖 GPT-4o Model",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        160,
        200
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "🤖 Uses GPT-4o-mini to understand and generate conversation based on context.\n"
      }
    },
    {
      "id": "a58774f9-9b3c-4e8d-b829-77f1ba8763bf",
      "name": "🧠 Session Memory",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1000,
        360
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "💬 Renders final answer using GPT-4o-mini based on retrieved knowledge.\n"
      }
    },
    {
      "id": "2be54256-0caf-4fe5-9dbc-5ac0db5223bc",
      "name": "📚 Vector Store Search",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        560,
        160
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "🧠 Stores user session context to support multi-turn dialogue.\n"
      }
    },
    {
      "id": "87e3319f-a466-4e04-942f-bf32d681f32b",
      "name": "🧩 Pinecone Search",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        440,
        380
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "📚 Connects to the medical vector database (RAG) to search for relevant documents.\n"
      }
    },
    {
      "id": "fc8c0d2d-9975-41b0-9732-42660e648610",
      "name": "🧬 Embeddings",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        440,
        620
      ],
      "parameters": {
        "width": null,
        "height": null,
        "content": "🧬 Transforms input into embeddings for Pinecone to use in vector search.\n"
      }
    }
  ],
  "connections": {
    "Simple Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Answer questions with a vector store",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Vector Store": {
      "ai_vectorStore": [
        [
          {
            "node": "Answer questions with a vector store",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Answer questions with a vector store": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}