8
n8n 中文网amn8n.com

使用 AI 和 Lovable 及 n8n 的 Web UI 进行个性化旅游套餐推荐

中级

这是一个Support Chatbot, AI RAG领域的自动化工作流,包含 11 个节点。主要使用 Webhook, Agent, RespondToWebhook, LmChatOpenAi, ToolVectorStore 等节点。 使用 GPT-4o、Pinecone 和 Lovable UI 的个性化旅游套餐推荐

前置要求
  • HTTP Webhook 端点(n8n 会自动生成)
  • OpenAI API Key
  • Pinecone API Key
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "Zm7fHD5Vfez5iDTE",
  "meta": {
    "instanceId": "92e36925b2d06addd7a010605535ce53ac105737436355f7e52e2980c726ed3d"
  },
  "name": "使用 AI 和 Lovable 及 n8n 的 Web UI 进行个性化旅游套餐推荐",
  "tags": [],
  "nodes": [
    {
      "id": "77fc80a1-747c-4f8e-935d-c89a6a6a8954",
      "name": "OpenAI 聊天模型",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        360,
        200
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {
          "responseFormat": "json_object"
        }
      },
      "credentials": {
        "openAiApi": {
          "id": "id",
          "name": "OpenAi account 5"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "4fa9b2dd-4dc6-48ab-b7bb-634258afd6d4",
      "name": "使用向量存储回答问题",
      "type": "@n8n/n8n-nodes-langchain.toolVectorStore",
      "position": [
        660,
        180
      ],
      "parameters": {
        "description": "#角色#"
      },
      "typeVersion": 1.1
    },
    {
      "id": "75f1df83-5a62-4e4a-8b4a-f182f598548f",
      "name": "Pinecone 向量存储",
      "type": "@n8n/n8n-nodes-langchain.vectorStorePinecone",
      "position": [
        480,
        360
      ],
      "parameters": {
        "options": {},
        "pineconeIndex": {
          "__rl": true,
          "mode": "list",
          "value": "tourpackagerecommendation",
          "cachedResultName": "tourpackagerecommendation"
        }
      },
      "credentials": {
        "pineconeApi": {
          "id": "id",
          "name": "PineconeApi account 2"
        }
      },
      "typeVersion": 1.1
    },
    {
      "id": "37560b3e-ade2-42b6-a772-f7064ecab69f",
      "name": "嵌入 OpenAI1",
      "type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
      "position": [
        500,
        520
      ],
      "parameters": {
        "model": "text-embedding-ada-002",
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "id",
          "name": "OpenAi account 5"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "946396d9-316c-4803-98fd-6a67927e24bf",
      "name": "OpenAI 聊天模型1",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "position": [
        820,
        400
      ],
      "parameters": {
        "model": {
          "__rl": true,
          "mode": "list",
          "value": "gpt-4o",
          "cachedResultName": "gpt-4o"
        },
        "options": {}
      },
      "credentials": {
        "openAiApi": {
          "id": "id",
          "name": "OpenAi account 5"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "f03c9e90-2e92-4dca-ba02-f2420a1b0f17",
      "name": "旅游推荐 AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        420,
        -20
      ],
      "parameters": {
        "text": "={{ $json.body.destination }}",
        "options": {
          "systemMessage": "You are an experienced tours and Packages travel agent who build tour packages for customers as per the request you receive. \nYour source for tours is from the pinecone vector databse, and you smartly analyse and combine the tours and activities and recommend to the customers acordingly. \noutput the format as per the Structured Output Parser response"
        },
        "promptType": "define",
        "hasOutputParser": true
      },
      "typeVersion": 1.9
    },
    {
      "id": "a5559a97-15e4-4a42-952e-c4159d6ee33d",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -60,
        -120
      ],
      "parameters": {
        "width": 1300,
        "height": 820,
        "content": "## 连接到 Lovable UI 的个性化旅游套餐推荐"
      },
      "typeVersion": 1
    },
    {
      "id": "31d1d77e-b856-43ef-8a9e-43e16d690ba7",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "position": [
        40,
        -20
      ],
      "webhookId": "12b44ee5-c43e-430c-a1d4-4fc5ff5e45c4",
      "parameters": {
        "path": "12b44ee5-c43e-430c-a1d4-4fc5ff5e45c4",
        "options": {},
        "httpMethod": "POST",
        "responseMode": "responseNode"
      },
      "typeVersion": 2
    },
    {
      "id": "812d0fe7-a0fd-4bf0-85c6-f890910b3a7d",
      "name": "响应 Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        920,
        -20
      ],
      "parameters": {
        "options": {},
        "respondWith": "json",
        "responseBody": "={{ $json.output }}"
      },
      "typeVersion": 1.4
    },
    {
      "id": "cefe0e7e-7325-48e6-8e84-ee7ea87f9626",
      "name": "便签5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -760,
        -120
      ],
      "parameters": {
        "color": 4,
        "width": 680,
        "height": 820,
        "content": "前提条件:"
      },
      "typeVersion": 1
    },
    {
      "id": "19f49652-ce2a-478c-b655-0d896456ddea",
      "name": "结构化输出解析器",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "position": [
        960,
        180
      ],
      "parameters": {
        "jsonSchemaExample": "{\n  \"totalDays\": 3,\n  \"itinerary\": [\n    {\n      \"dayNumber\": 1,\n      \"date\": \"2024-07-15\",\n      \"activities\": [\n        {\n          \"id\": \"1\",\n          \"title\": \"Kuala Lumpur International Airport\",\n          \"description\": \"Arrival at KLIA\",\n          \"duration\": \"1 hour\",\n          \"location\": \"KLIA\",\n          \"type\": \"transport\"\n        },\n        {\n          \"id\": \"2\",\n          \"title\": \"Petronas Twin Towers\",\n          \"description\": \"Visit the iconic twin towers\",\n          \"duration\": \"2 hours\",\n          \"location\": \"KLCC\",\n          \"type\": \"attraction\"\n        }\n      ]\n    },\n    {\n      \"dayNumber\": 2,\n      \"date\": \"2024-07-16\",\n      \"activities\": [\n        {\n          \"id\": \"3\",\n          \"title\": \"Batu Caves\",\n          \"description\": \"Explore the limestone caves and Hindu temples\",\n          \"duration\": \"3 hours\",\n          \"location\": \"Batu Caves\",\n          \"type\": \"attraction\"\n        }\n      ]\n    },\n    {\n      \"dayNumber\": 3,\n      \"date\": \"2024-07-17\",\n      \"activities\": [\n        {\n          \"id\": \"4\",\n          \"title\": \"Central Market\",\n          \"description\": \"Shopping and local crafts\",\n          \"duration\": \"2 hours\",\n          \"location\": \"Central Market\",\n          \"type\": \"activity\"\n        }\n      ]\n    }\n  ]\n}"
      },
      "typeVersion": 1.3
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "9356fae8-6b64-4adf-8b83-352ab0ed3a92",
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Tour Recommendation AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "Tour Recommendation AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Embeddings OpenAI1": {
      "ai_embedding": [
        [
          {
            "node": "Pinecone Vector Store",
            "type": "ai_embedding",
            "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
          }
        ]
      ]
    },
    "Structured Output Parser": {
      "ai_outputParser": [
        [
          {
            "node": "Tour Recommendation AI Agent",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "Tour Recommendation AI Agent": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Answer questions with a vector store": {
      "ai_tool": [
        [
          {
            "node": "Tour Recommendation AI Agent",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 客服机器人, AI RAG 检索增强

需要付费吗?

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

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

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

作者
Mohan Gopal

Mohan Gopal

@mohan

B2B and B2C Travel App Consultant. Building AI Agent for Travel Solution.

外部链接
在 n8n.io 查看

分享此工作流