8
n8n 中文网amn8n.com

使用知识图谱本体专家增强您的提示

中级

这是一个Internal Wiki, AI RAG领域的自动化工作流,包含 7 个节点。主要使用 HttpRequest, ChatTrigger 等节点。 通过InfraNodus知识图谱推理和GraphRAG增强AI聊天机器人响应

前置要求
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "MqHZXsobgwvx8B1f",
  "meta": {
    "instanceId": "334f4f928505fa56392672dcbddf0c1a39709717127e8d60d133a12f8f82b3b4",
    "templateCredsSetupCompleted": true
  },
  "name": "使用知识图谱本体专家增强您的提示",
  "tags": [
    {
      "id": "2Q64isOPYcTslspA",
      "name": "AI",
      "createdAt": "2025-08-02T13:39:06.091Z",
      "updatedAt": "2025-08-02T13:39:06.091Z"
    },
    {
      "id": "pZUWchtD7Jo42VrS",
      "name": "AI Chatbot",
      "createdAt": "2025-08-02T13:39:11.275Z",
      "updatedAt": "2025-08-02T13:39:11.275Z"
    },
    {
      "id": "MNbFLjKxPdVAYXIC",
      "name": "AI Rag",
      "createdAt": "2025-08-02T13:39:08.349Z",
      "updatedAt": "2025-08-02T13:39:08.349Z"
    }
  ],
  "nodes": [
    {
      "id": "2568cca8-643d-48cd-969a-eccf267dd000",
      "name": "当收到聊天消息时",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        -512,
        0
      ],
      "webhookId": "26592391-6f28-4740-8caa-79ce80b582d0",
      "parameters": {
        "public": true,
        "options": {}
      },
      "typeVersion": 1.1
    },
    {
      "id": "92d3bec1-b54d-43c8-8ac2-1e11d92135cb",
      "name": "通过推理本体增强的提示",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -16,
        0
      ],
      "parameters": {
        "url": "https://infranodus.com/api/v1/graphAndAdvice?doNotSave=true&addStats=true&optimize=develop&includeStatements=true&includeGraphSummary=true&includeGraph=false",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "name",
              "value": "eightos_system"
            },
            {
              "name": "requestMode",
              "value": "reprompt"
            },
            {
              "name": "aiTopics",
              "value": "true"
            },
            {
              "name": "prompt",
              "value": "={{ $json.chatInput }}"
            },
            {
              "name": "systemPrompt",
              "value": "Your task is to reformulate the original query of a user using the context provided"
            }
          ]
        },
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "C3Li2OwYebUs6Dmg",
          "name": "InfraNodus Expert"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "cb908d48-e575-4844-a026-aa95d0655935",
      "name": "查询知识库",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        608,
        0
      ],
      "parameters": {
        "url": "https://infranodus.com/api/v1/graphAndAdvice?doNotSave=true&addStats=true&optimize=develop&includeStatements=true&includeGraphSummary=true&includeGraph=false",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "authentication": "genericCredentialType",
        "bodyParameters": {
          "parameters": [
            {
              "name": "name",
              "value": "eightos_system"
            },
            {
              "name": "requestMode",
              "value": "response"
            },
            {
              "name": "aiTopics",
              "value": "true"
            },
            {
              "name": "prompt",
              "value": "={{ $json.aiAdvice[0].text }}"
            },
            {
              "name": "systemPrompt",
              "value": "Use the context you are provided as a logic to use when providing a response to the user query, not as the content you should be providing. IT IS IMPERATIVE THAT YOU DO NOT EXTRACT THE CONTENT FROM THE CONTEXT PROVIDED FOR YOUR ANSWER BUT USE IT AS A REASONING LOGIC TO PROVIDE YOUR ANSWER."
            }
          ]
        },
        "genericAuthType": "httpBearerAuth"
      },
      "credentials": {
        "httpBearerAuth": {
          "id": "C3Li2OwYebUs6Dmg",
          "name": "InfraNodus Expert"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "401b9dc0-c51e-4fe9-87cd-be393c5bd66e",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2592,
        -976
      ],
      "parameters": {
        "color": 6,
        "width": 540,
        "height": 760,
        "content": "## 配备专家的AI聊天机器人代理"
      },
      "typeVersion": 1
    },
    {
      "id": "8f70c71d-84bc-43cd-a13c-550ca6da336a",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -224,
        -32
      ],
      "parameters": {
        "width": 520,
        "height": 1220,
        "content": ""
      },
      "typeVersion": 1
    },
    {
      "id": "c6d16d77-1aed-4fa8-a7aa-fb7fc6974469",
      "name": "便签9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        -32
      ],
      "parameters": {
        "width": 520,
        "height": 1216,
        "content": "## 2. 推理专家重新表述用户查询"
      },
      "typeVersion": 1
    },
    {
      "id": "3d1fe3e7-dbd5-4b13-a62c-97ee5fa42046",
      "name": "便签2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -576,
        -48
      ],
      "parameters": {
        "height": 768,
        "content": "## 3. 增强后的查询发送到知识库并使用GraphRAG检索响应"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "2bb0a437-1815-4bff-bdd4-600faa19b456",
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "Prompt Augmented with Reasoning Ontology",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prompt Augmented with Reasoning Ontology": {
      "main": [
        [
          {
            "node": "Ask the Knowledge Base",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

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

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

中级 - 内部知识库, AI RAG 检索增强

需要付费吗?

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

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

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

作者
InfraNodus

InfraNodus

@infranodus

I'm Dmitry, the founder of InfraNodus — an AI text network analysis tool. I'm passionate about networks and data visualization and its ability to reveal what everyone else is missing and to highlight different perspectives. I'm sharing the n8n templates that make use of this unique capability of InfraNodus for multiple scenarios.

外部链接
在 n8n.io 查看

分享此工作流