{
  "name": "Automated Gmail support agent with Gemini 2.5, RAG & Cohere reranking",
  "nodes": [
    {
      "id": "113d6fd7-2850-4562-adad-d664ba8dc448",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        3104,
        2080
      ]
    },
    {
      "id": "d1d4a3be-70bc-436b-a7b9-2ee00e426a55",
      "name": "Gemini 2.5",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        3312,
        2288
      ]
    },
    {
      "id": "dd551d6b-adb2-473b-8982-8ac9b3be46b3",
      "name": "Gmail Reply",
      "type": "n8n-nodes-base.gmail",
      "position": [
        3664,
        2080
      ]
    },
    {
      "id": "32c51c6d-4ba8-45c4-b689-a7906d5a66b6",
      "name": "Cohere Reranker",
      "type": "@n8n/n8n-nodes-langchain.rerankerCohere",
      "position": [
        3744,
        2448
      ]
    },
    {
      "id": "5a55a56f-07f0-4da9-b333-be81d39c49c7",
      "name": "Pinecone Retriever",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        3568,
        2288
      ]
    },
    {
      "id": "fd1413ab-433f-43f0-9dbf-6726c62fac44",
      "name": "OpenAI Embeddings",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        3568,
        2448
      ]
    },
    {
      "id": "b587ef62-ec9c-4727-ac16-6e5b2862fe78",
      "name": "Email Support Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        3312,
        2080
      ]
    },
    {
      "id": "11ccc8a7-11fb-4bbc-8593-7d203de1614e",
      "name": "Postgres Memory",
      "type": "@n8n/n8n-nodes-langchain.memoryPostgresChat",
      "position": [
        3408,
        2384
      ]
    },
    {
      "id": "e2482901-3f58-4adb-817d-cbd48f777f7b",
      "name": "Note: Pinecone",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3856,
        2128
      ],
      "parameters": {
        "width": 350,
        "height": 240,
        "content": "## 🗄️ Node: Pinecone Retriever\n\n**Purpose:** RAG tool retrieves top 10 docs from 'agency-info' index.\n\n**Key Settings:**\n- Mode: retrieve-as-tool\n- Embeddings: OpenAI text-embedding-3-large (1024 dims"
      }
    },
    {
      "id": "95398a05-9d35-4913-83ab-62bb9113594b",
      "name": "Note: Cohere",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3472,
        2592
      ],
      "parameters": {
        "width": 398,
        "height": 244,
        "content": "## 🔄 Node: Cohere Reranker\n\n**Purpose:** Semantically reorders Pinecone results for better relevance.\n\n**Key Settings:**\n- Connected to vector store\n- Improves RAG accuracy\n\n**Note:** Uses Cohere API;"
      }
    },
    {
      "id": "f578bcf8-4019-4c0e-abe3-78dc5b85c026",
      "name": "Note: Agent",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        3088,
        1792
      ],
      "parameters": {
        "width": 398,
        "height": 252,
        "content": "## 🤖 Node: Email Support Agent\n\n**Purpose:** AI agent processes email with tools/memory.\n\n**Key Settings:**\n- User Prompt: Email text\n- LLM: Gemini 2.5\n- Memory: Postgres per email ID\n\n**Note:** Outpu"
      }
    },
    {
      "id": "ab002e7f-180b-439d-a544-a9daae2d68c5",
      "name": "Overview Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2256,
        1712
      ],
      "parameters": {
        "width": 728,
        "height": 1480,
        "content": "# AI Email Support Agent with RAG & Cohere Reranking\n\n## 📋 What This Template Does\nTriggers on new Gmail emails, uses a LangChain agent with Postgres memory to retrieve from Pinecone (RAG via OpenAI e"
      }
    }
  ],
  "connections": {
    "Gemini 2.5": {
      "ai_languageModel": [
        [
          {
            "node": "Email Support Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "Email Support Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cohere Reranker": {
      "ai_reranker": [
        [
          {
            "node": "Pinecone Retriever",
            "type": "ai_reranker",
            "index": 0
          }
        ]
      ]
    },
    "Postgres Memory": {
      "ai_memory": [
        [
          {
            "node": "Email Support Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Embeddings": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Retriever",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Pinecone Retriever": {
      "ai_tool": [
        [
          {
            "node": "Email Support Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Email Support Agent": {
      "main": [
        [
          {
            "node": "Gmail Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}