旅行助手Agent

中级

这是一个Other、AI领域的自动化工作流,包含 14 个节点。主要使用 Webhook、Agent、ChatTrigger、EmbeddingsOpenAi、MemoryMongoDbChat 等节点,结合人工智能技术实现智能自动化。 使用MongoDB Atlas、Gemini LLM和向量搜索的旅行规划助手

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • OpenAI API Key
  • MongoDB 连接字符串
  • Google Gemini API Key

分类

工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "znRwva47HzXesOYk",
  "meta": {
    "instanceId": "3be30861c4ebf6c36b608a223df086e2f2ea418bc2f7f7a746319c3c22897aa9",
    "templateCredsSetupCompleted": true
  },
  "name": "旅行助手Agent",
  "tags": [],
  "nodes": [
    {
      "id": "3742b914-9f9d-4c6e-bfdf-f494295182a3",
      "name": "当收到聊天消息时",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        0,
        0
      ],
      "webhookId": "c9b390dc-3f6a-475c-b168-28f3accd20a7",
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "5b7fcae2-78ab-45f7-933b-3acf993832e6",
      "name": "MongoDB 聊天记忆",
      "type": "@n8n/n8n-nodes-langchain.memoryMongoDbChat",
      "position": [
        320,
        220
      ],
      "parameters": {
        "databaseName": "test"
      },
      "credentials": {
        "mongoDb": {
          "id": "aEhI0wdmVEJ8c82Z",
          "name": "MongoDB account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "eaba53fd-fc1c-404f-8720-eeea6cde088e",
      "name": "Google Gemini 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        180,
        240
      ],
      "parameters": {
        "options": {},
        "modelName": "models/gemini-2.0-flash"
      },
      "credentials": {
        "googlePalmApi": {
          "id": "7DECNCZTsje1tSvf",
          "name": "Google Gemini(PaLM) Api account"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "af440c3f-e81f-4e40-a349-6272c3b23517",
      "name": "MongoDB Atlas 向量存储",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreMongoDBAtlas",
      "position": [
        480,
        280
      ],
      "parameters": {
        "mode": "retrieve-as-tool",
        "topK": 10,
        "options": {},
        "toolName": "PointofinterestKB",
        "metadata_field": "description",
        "mongoCollection": {
          "__rl": true,
          "mode": "list",
          "value": "points_of_interest",
          "cachedResultName": "points_of_interest"
        },
        "toolDescription": "The list of Points of Interest from the database.",
        "vectorIndexName": "vector_index"
      },
      "credentials": {
        "mongoDb": {
          "id": "aEhI0wdmVEJ8c82Z",
          "name": "MongoDB account"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "17f2e6f3-d79c-4588-b4ee-bbfff61bc38d",
      "name": "Embeddings OpenAI",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        580,
        500
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "z5h5wLH9yHstZl24",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "fc7ab263-9b1c-4e98-ae51-74248b91fe82",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        780,
        -420
      ],
      "parameters": {
        "width": 900,
        "height": 960,
        "content": "## 基于 MongoDB Atlas 实现记忆和向量搜索的 AI 旅行助手"
      },
      "typeVersion": 1
    },
    {
      "id": "5a0353d2-410a-4059-8dc1-56a438e22cea",
      "name": "AI 旅行规划助手",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        220,
        0
      ],
      "parameters": {
        "options": {
          "maxIterations": 10,
          "systemMessage": "You are a helpful assistant for a trip planner. You have a vector search capability to locate points of interest, Use it and don't invent much."
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "e4c2c92d-6291-42c8-9d03-5abfe1a85a83",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        420,
        760
      ],
      "webhookId": "a48d5121-b453-4b5e-aa30-88ba3e16b931",
      "parameters": {
        "path": "ingestData",
        "options": {
          "rawBody": true
        },
        "httpMethod": "POST"
      },
      "typeVersion": 2
    },
    {
      "id": "8ec1fa93-3eea-44e2-a66d-7f1e961cfa94",
      "name": "默认数据加载器",
      "type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
      "position": [
        520,
        1200
      ],
      "parameters": {
        "options": {},
        "jsonData": "={{ $json.body.raw_body.point_of_interest.title }} - {{ $json.body.raw_body.point_of_interest.description }}",
        "jsonMode": "expressionData"
      },
      "typeVersion": 1
    },
    {
      "id": "f723cca8-7bf4-4c93-932f-b558d21e8a4d",
      "name": "递归字符文本分割器",
      "type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
      "position": [
        1060,
        1400
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 1
    },
    {
      "id": "c4a5f12e-de9b-44d0-93b2-a06cb56a1a91",
      "name": "MongoDB Atlas 向量存储1",
      "type": "@n8n/n8n-nodes-langchain.vectorStoreMongoDBAtlas",
      "position": [
        740,
        880
      ],
      "parameters": {
        "mode": "insert",
        "options": {},
        "metadata_field": "description",
        "mongoCollection": {
          "__rl": true,
          "mode": "list",
          "value": "points_of_interest",
          "cachedResultName": "points_of_interest"
        },
        "vectorIndexName": "vector_index",
        "embeddingBatchSize": 1
      },
      "credentials": {
        "mongoDb": {
          "id": "aEhI0wdmVEJ8c82Z",
          "name": "MongoDB account"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "cf3b0e71-73d5-4a54-bb64-a2d951cd7726",
      "name": "OpenAI 嵌入1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        800,
        1100
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "z5h5wLH9yHstZl24",
          "name": "OpenAi account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "386538c3-81e7-4797-a4b6-81dea83fa778",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -440,
        940
      ],
      "parameters": {
        "width": 720,
        "height": 360,
        "content": "## 用于数据摄取的 CURL 命令"
      },
      "typeVersion": 1
    },
    {
      "id": "0aa2676e-9f93-4b71-bd69-a4a8b2069496",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1040,
        620
      ],
      "parameters": {
        "width": 720,
        "height": 360,
        "content": "## 向量搜索数据摄取"
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "4600a0b5-b04c-4bd7-9a71-66b498cf1cbb",
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "MongoDB Atlas Vector Store1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI": {
      "ai_embedding": [
        [
          {
            "node": "MongoDB Atlas Vector Store",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI1": {
      "ai_embedding": [
        [
          {
            "node": "MongoDB Atlas Vector Store1",
            "type": "ai_embedding",
            "index": 0
          }
        ]
      ]
    },
    "Default Data Loader": {
      "ai_document": [
        [
          {
            "node": "MongoDB Atlas Vector Store1",
            "type": "ai_document",
            "index": 0
          }
        ]
      ]
    },
    "MongoDB Chat Memory": {
      "ai_memory": [
        [
          {
            "node": "AI Traveling Planner Agent",
            "type": "ai_memory",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Traveling Planner Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "MongoDB Atlas Vector Store": {
      "ai_tool": [
        [
          {
            "node": "AI Traveling Planner Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "AI Traveling Planner Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Recursive Character Text Splitter": {
      "ai_textSplitter": [
        [
          {
            "node": "Default Data Loader",
            "type": "ai_textSplitter",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

这是一个中级难度的工作流,适用于Other、AI等场景。适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量14
分类2
节点类型10
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Pavel Duchovny

Pavel Duchovny

@pash

Developer imagination == Innovation ✓ Experienced DBA & DevOps engineer & Web Developer. Develop and deploy automation of servers, infrastructure and security to the cloud. Scaling, upgrading and designing Big scaled systems and databases . Specializing in designing and building big data solutions in both RDBMS and NoSql echosystems. Hardworking and innovative personality.

外部链接
在 n8n.io 上查看 →

分享此工作流