使用OpenAI和Milvus向量数据库创建Paul Graham文章问答系统
高级
这是一个AI领域的自动化工作流,包含 22 个节点。主要使用 Html, Limit, SplitOut, HttpRequest, ManualTrigger 等节点,结合人工智能技术实现智能自动化。 使用OpenAI和Milvus向量数据库创建Paul Graham文章问答系统
前置要求
- •可能需要目标 API 的认证凭证
- •OpenAI API Key
使用的节点 (22)
分类
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
"meta": {
"instanceId": "89c9c2dbc29ad74e9e02caaf3e27ce718c567278274962e355a9a9679d5f3af7"
},
"nodes": [
{
"id": "33e94ee1-4244-4075-bb4b-93a99a2cacd9",
"name": "OpenAI 聊天模型",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
20,
560
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {}
},
"typeVersion": 1.2
},
{
"id": "dd97266d-a039-4d8f-bc7d-fb439ad5a6d7",
"name": "当点击\"执行工作流\"时",
"type": "n8n-nodes-base.manualTrigger",
"position": [
-180,
0
],
"parameters": {},
"typeVersion": 1
},
{
"id": "c4d4a979-3182-46c9-b145-fa4e6ba57011",
"name": "获取文章列表",
"type": "n8n-nodes-base.httpRequest",
"position": [
80,
0
],
"parameters": {
"url": "http://www.paulgraham.com/articles.html",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "2e2913f9-d01a-41e8-b1b8-9a981910db7b",
"name": "提取文章名称",
"type": "n8n-nodes-base.html",
"position": [
280,
0
],
"parameters": {
"options": {},
"operation": "extractHtmlContent",
"extractionValues": {
"values": [
{
"key": "essay",
"attribute": "href",
"cssSelector": "table table a",
"returnArray": true,
"returnValue": "attribute"
}
]
}
},
"typeVersion": 1.2
},
{
"id": "c121dc65-37e3-49d4-b449-f28491e19a6f",
"name": "拆分为单独项",
"type": "n8n-nodes-base.splitOut",
"position": [
480,
0
],
"parameters": {
"options": {},
"fieldToSplitOut": "essay"
},
"typeVersion": 1
},
{
"id": "5644c48d-62b6-4e2d-ad25-013b55f5ec71",
"name": "获取文章文本",
"type": "n8n-nodes-base.httpRequest",
"position": [
880,
0
],
"parameters": {
"url": "=http://www.paulgraham.com/{{ $json.essay }}",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "cd84596e-4046-4d33-9f43-cf464e5c5c01",
"name": "限制为前3个",
"type": "n8n-nodes-base.limit",
"position": [
680,
0
],
"parameters": {
"maxItems": 3
},
"typeVersion": 1
},
{
"id": "318aeeed-fcce-4de2-aa04-92033ef01f28",
"name": "仅提取文本",
"type": "n8n-nodes-base.html",
"position": [
1200,
0
],
"parameters": {
"options": {},
"operation": "extractHtmlContent",
"extractionValues": {
"values": [
{
"key": "data",
"cssSelector": "body",
"skipSelectors": "img,nav"
}
]
}
},
"typeVersion": 1.2
},
{
"id": "0668851e-a31f-4e6e-8966-4544092e318e",
"name": "便签3",
"type": "n8n-nodes-base.stickyNote",
"position": [
0,
-120
],
"parameters": {
"width": 1071.752021563343,
"height": 285.66037735849045,
"content": "## 抓取最新的Paul Graham文章"
},
"typeVersion": 1
},
{
"id": "cf9af24c-9e08-4f27-ad4e-509f72e54a9b",
"name": "便签5",
"type": "n8n-nodes-base.stickyNote",
"position": [
1120,
-120
],
"parameters": {
"width": 625,
"height": 607,
"content": "## 加载到Milvus向量存储"
},
"typeVersion": 1
},
{
"id": "95e9a59d-1832-4eb7-b58d-ba391c1acb1c",
"name": "当收到聊天消息时",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
-200,
380
],
"webhookId": "cd2703a7-f912-46fe-8787-3fb83ea116ab",
"parameters": {
"options": {}
},
"typeVersion": 1.1
},
{
"id": "0076ea3d-e667-4df2-83c3-9de0d3de0498",
"name": "便签",
"type": "n8n-nodes-base.stickyNote",
"position": [
-380,
-160
],
"parameters": {
"width": 280,
"height": 180,
"content": "## 步骤1"
},
"typeVersion": 1
},
{
"id": "e90a069e-cfd8-49f1-8fe6-a334bb920027",
"name": "Milvus向量存储",
"type": "@n8n/n8n-nodes-langchain.vectorStoreMilvus",
"position": [
1420,
0
],
"parameters": {
"mode": "insert",
"options": {
"clearCollection": true
},
"milvusCollection": {
"__rl": true,
"mode": "list",
"value": "my_collection",
"cachedResultName": "my_collection"
}
},
"typeVersion": 1.1
},
{
"id": "d786c471-d564-4f25-beab-f1c7f4559f7a",
"name": "默认数据加载器",
"type": "@n8n/n8n-nodes-langchain.documentDefaultDataLoader",
"position": [
1460,
220
],
"parameters": {
"options": {},
"jsonData": "={{ $('Extract Text Only').item.json.data }}",
"jsonMode": "expressionData"
},
"typeVersion": 1
},
{
"id": "26730b7b-2bb9-46f8-83c3-3d4ffdfdef57",
"name": "OpenAI 嵌入",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
1320,
240
],
"parameters": {
"options": {}
},
"typeVersion": 1.2
},
{
"id": "de836110-4073-44d5-bbf3-d57f57525f69",
"name": "递归字符文本分割器",
"type": "@n8n/n8n-nodes-langchain.textSplitterRecursiveCharacterTextSplitter",
"position": [
1540,
340
],
"parameters": {
"options": {},
"chunkSize": 6000
},
"typeVersion": 1
},
{
"id": "ddaa936e-416a-40e4-adf6-cf7ebfb8b094",
"name": "便签1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-380,
280
],
"parameters": {
"width": 280,
"height": 120,
"content": "## 步骤2"
},
"typeVersion": 1
},
{
"id": "f5b7410f-37c7-40ff-b841-12ed04252317",
"name": "Embeddings OpenAI1",
"type": "@n8n/n8n-nodes-langchain.embeddingsOpenAi",
"position": [
80,
860
],
"parameters": {
"options": {}
},
"typeVersion": 1.2
},
{
"id": "7a5d1b3f-9b2c-4943-9b40-2a213e30159c",
"name": "Milvus向量存储1",
"type": "@n8n/n8n-nodes-langchain.vectorStoreMilvus",
"position": [
120,
720
],
"parameters": {
"milvusCollection": {
"__rl": true,
"mode": "list",
"value": "my_collection",
"cachedResultName": "my_collection"
}
},
"typeVersion": 1.1
},
{
"id": "2402387f-e147-4239-9128-34af296e0012",
"name": "便签2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-20,
360
],
"parameters": {
"color": 7,
"width": 574,
"height": 629,
"content": ""
},
"typeVersion": 1
},
{
"id": "3665ef25-e464-496a-84d6-980b96e78e9a",
"name": "从Milvus检索并回答问题的问答链",
"type": "@n8n/n8n-nodes-langchain.chainRetrievalQa",
"position": [
120,
380
],
"parameters": {
"options": {}
},
"typeVersion": 1.5
},
{
"id": "10bf4a2c-ee2b-4185-b1e5-29b8664078fb",
"name": "Milvus向量存储检索器",
"type": "@n8n/n8n-nodes-langchain.retrieverVectorStore",
"position": [
260,
580
],
"parameters": {},
"typeVersion": 1
}
],
"pinData": {},
"connections": {
"Fetch Essay List": {
"main": [
[
{
"node": "Extract essay names",
"type": "main",
"index": 0
}
]
]
},
"Limit to first 3": {
"main": [
[
{
"node": "Fetch essay texts",
"type": "main",
"index": 0
}
]
]
},
"Embeddings OpenAI": {
"ai_embedding": [
[
{
"node": "Milvus Vector Store",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Extract Text Only": {
"main": [
[
{
"node": "Milvus Vector Store",
"type": "main",
"index": 0
}
]
]
},
"Fetch essay texts": {
"main": [
[
{
"node": "Extract Text Only",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Q&A Chain to Retrieve from Milvus and Answer Question",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Embeddings OpenAI1": {
"ai_embedding": [
[
{
"node": "Milvus Vector Store1",
"type": "ai_embedding",
"index": 0
}
]
]
},
"Default Data Loader": {
"ai_document": [
[
{
"node": "Milvus Vector Store",
"type": "ai_document",
"index": 0
}
]
]
},
"Extract essay names": {
"main": [
[
{
"node": "Split out into items",
"type": "main",
"index": 0
}
]
]
},
"Milvus Vector Store1": {
"ai_vectorStore": [
[
{
"node": "Milvus Vector Store Retriever",
"type": "ai_vectorStore",
"index": 0
}
]
]
},
"Split out into items": {
"main": [
[
{
"node": "Limit to first 3",
"type": "main",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "Q&A Chain to Retrieve from Milvus and Answer Question",
"type": "main",
"index": 0
}
]
]
},
"Milvus Vector Store Retriever": {
"ai_retriever": [
[
{
"node": "Q&A Chain to Retrieve from Milvus and Answer Question",
"type": "ai_retriever",
"index": 0
}
]
]
},
"When clicking \"Execute Workflow\"": {
"main": [
[
{
"node": "Fetch Essay List",
"type": "main",
"index": 0
}
]
]
},
"Recursive Character Text Splitter": {
"ai_textSplitter": [
[
{
"node": "Default Data Loader",
"type": "ai_textSplitter",
"index": 0
}
]
]
}
}
}常见问题
如何使用这个工作流?
复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。
这个工作流适合什么场景?
高级 - 人工智能
需要付费吗?
本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。
相关工作流推荐
插入和检索文档
使用Paul Essays、Milvus和OpenAI构建带引用的RAG问答系统
Set
Code
Html
+12
25 节点Cheney Zhang
人工智能
Agent Milvus工具
使用Milvus向量数据库进行Paul Graham文章搜索与聊天
Html
Limit
Split Out
+10
21 节点Cheney Zhang
其他
在可视化参考库中探索n8n节点
在可视化参考库中探索n8n节点
If
Ftp
Set
+93
113 节点I versus AI
其他
高级AI演示(在AI开发者第14次聚会中展示)
高级AI演示(在AI开发者第14次聚会中展示)
If
Code
Gmail
+19
39 节点Max Tkacz
构建模块
使用 Qdrant 的完整 RAG 系统,带自动来源引用
使用Qdrant、Gemini和OpenAI构建带自动引用的RAG系统
Set
Code
Wait
+15
29 节点Davide
人工智能
启用RAG中文档的更新功能
使用Google Drive、Qdrant和Gemini Chat构建和更新RAG系统
Set
Wait
Google Drive
+12
29 节点Davide
人工智能
工作流信息
难度等级
高级
节点数量22
分类1
节点类型14
作者
Cheney Zhang
@zc277584121Algorithm engineer at Zilliz, dedicating to the application of vector databases in the AI ecosystem.
外部链接
在 n8n.io 查看 →
分享此工作流