{
  "name": "Mail Agend Pinecone",
  "nodes": [
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.1,
      "position": [
        0,
        0
      ],
      "id": "067287e3-4008-4280-ba26-64751de879c3",
      "name": "When chat message received",
      "webhookId": "e3978e41-4d95-4d3a-a2a1-b1f9f8c222bb"
    },
    {
      "parameters": {
        "options": {
          "systemMessage": "=# Role:  \nYou are an intelligent email agent that automatically sends personalized emails to recipients. Your task is to generate and send a clear, professional, and accurate email based on the provided names, email addresses, and desired content.  \n\n## Rules & Behavior:  \n\n# You have 2 Tools and need to use them correctly, you always use both tools, first the Vectorstore_mails after that the send_mail\n\n## Vectorstore_mails \nUse this tool to get Email adresses, you can get all mail adresses from pinecone.\narnie test = arnoldoberleiterhofer@gmail.com\n\n## send_mail\nUse this tool to send mails.\n\n### Email Format:  \n- The email must include a **subject line**.  \n- It should begin with an appropriate **salutation** (e.g., \"Hello [Name]\" or \"Dear [Name]\").  \n- The **main content** should be clear, concise, and friendly.  \n- The email should end with a **suitable closing phrase** (e.g., \"Best regards, Arnie\").  \n\n### Dynamic Personalization:  \n- Automatically replace the placeholder **[Name]** with the recipient’s actual name.  \n- If the name is missing, use a general salutation such as **\"Hello, dear team\"**.  \n\n### Review & Optimization:   \n- Avoid unnecessary **repetitions or vague wording**.  \n- If the message is **too long or unstructured, summarize it clearly**.  \n\n## Email Types (Adaptable Based on Context):  \n- Standard information email  \n- Reminder or follow-up  \n- Offer or marketing email  \n- Support or customer service request  \n\n---\n\n### Example of a Generated Email:  \n\n**Subject:** Important Information for You, [Name]  \n\n**Text:**  \nHello [Name],  \n\nI hope you are doing well. I wanted to quickly inform you about [Topic]. If you have any questions or need further information, feel free to reach out.  \n\nBest regards,  \nArnie  \n"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 1.7,
      "position": [
        220,
        0
      ],
      "id": "d5b0c8bc-31c0-408d-94cb-599d27171ee9",
      "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": [
        20,
        240
      ],
      "id": "5ed9c1d0-5500-4f71-8e1f-1600ff17c66a",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "id": "wWdCmHfuvziTkduw",
          "name": "OpenAi account 3"
        }
      }
    },
    {
      "parameters": {
        "name": "Vectorstore_mails",
        "description": "Use this Tool to get Email Information, you find all relevant mail adresses, you also give mail adresses."
      },
      "type": "@n8n/n8n-nodes-langchain.toolVectorStore",
      "typeVersion": 1,
      "position": [
        180,
        220
      ],
      "id": "75bc14a2-b6a6-4b33-9bdf-e4c000a7f5f9",
      "name": "Vectorstore Mails"
    },
    {
      "parameters": {
        "pineconeIndex": {
          "__rl": true,
          "value": "n8ndocs",
          "mode": "list",
          "cachedResultName": "n8ndocs"
        },
        "options": {
          "pineconeNamespace": "docsmail"
        }
      },
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "typeVersion": 1,
      "position": [
        160,
        340
      ],
      "id": "374a9be3-6c24-4062-a85c-09659e159c46",
      "name": "Pinecone Vector Store",
      "credentials": {
        "pineconeApi": {
          "id": "IzrLoEXorSI9T6XY",
          "name": "PineconeApi account 4"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "typeVersion": 1.2,
      "position": [
        80,
        520
      ],
      "id": "db55bf47-5ef6-4301-8b4e-721d215a16f2",
      "name": "Embeddings OpenAI",
      "credentials": {
        "openAiApi": {
          "id": "wWdCmHfuvziTkduw",
          "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": [
        480,
        360
      ],
      "id": "5b325af7-6be6-4a58-aede-9a2f2608b300",
      "name": "OpenAI Chat Model1",
      "credentials": {
        "openAiApi": {
          "id": "wWdCmHfuvziTkduw",
          "name": "OpenAi account 3"
        }
      }
    },
    {
      "parameters": {
        "name": "send_mail",
        "description": "Use this tool to send mails.",
        "workflowId": {
          "__rl": true,
          "value": "GLkrSkyYtlep3P6e",
          "mode": "list",
          "cachedResultName": "Send Mails Pinecone"
        },
        "workflowInputs": {
          "mappingMode": "defineBelow",
          "value": {},
          "matchingColumns": [],
          "schema": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        }
      },
      "type": "@n8n/n8n-nodes-langchain.toolWorkflow",
      "typeVersion": 2,
      "position": [
        600,
        200
      ],
      "id": "be0a20d5-439c-4c5d-bef8-97d6eded4fd4",
      "name": "send_mail"
    }
  ],
  "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
          }
        ]
      ]
    },
    "Vectorstore Mails": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Vector Store": {
      "ai_vectorStore": [
        [
          {
            "node": "Vectorstore Mails",
            "type": "ai_vectorStore",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Vectorstore Mails",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "send_mail": {
      "ai_tool": [
        [
          {
            "node": "AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "637e7c8c-7df4-4d46-b77c-2014b5aa6bc2",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "c0fc3202e0d7686fd80c309dae8df3a072650cceb18f2be2bb9798a3af0bf1cd"
  },
  "id": "Kf7ayGIOoCe9L1EV",
  "tags": []
}