8
n8n 한국어amn8n.com

PDF 벡터, GPT-4, Neo4j를 사용하여 학술 지식 그래프를 구축

중급

이것은AI RAG, Multimodal AI분야의자동화 워크플로우로, 10개의 노드를 포함합니다.주로 Code, Neo4j, OpenAi, Postgres, PdfVector 등의 노드를 사용하며. 사용PDF向量、GPT-4및Neo4j에서研究论文构建学术知识图谱

사전 요구사항
  • OpenAI API Key
  • PostgreSQL 데이터베이스 연결 정보
워크플로우 미리보기
노드 연결 관계를 시각적으로 표시하며, 확대/축소 및 이동을 지원합니다
워크플로우 내보내기
다음 JSON 구성을 복사하여 n8n에 가져오면 이 워크플로우를 사용할 수 있습니다
{
  "meta": {
    "instanceId": "placeholder"
  },
  "nodes": [
    {
      "id": "kb-info",
      "name": "지식 베이스 정보",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        250,
        150
      ],
      "parameters": {
        "content": "## Knowledge Base Builder\n\nExtracts and connects:\n- Concepts & Keywords\n- Authors & Institutions\n- Methods & Datasets\n- Citations & References\n\nBuilds searchable knowledge graph"
      },
      "typeVersion": 1
    },
    {
      "id": "daily-update",
      "name": "일일 KB 업데이트",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        450,
        300
      ],
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "days",
              "daysInterval": 1
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "fetch-papers",
      "name": "PDF 벡터 - 논문 수집",
      "type": "n8n-nodes-pdfvector.pdfVector",
      "position": [
        650,
        300
      ],
      "parameters": {
        "limit": 20,
        "query": "={{ $json.domain || 'artificial intelligence' }}",
        "fields": [
          "title",
          "authors",
          "abstract",
          "year",
          "doi",
          "pdfUrl",
          "totalCitations"
        ],
        "resource": "academic",
        "yearFrom": "={{ new Date().getFullYear() }}",
        "operation": "search",
        "providers": [
          "semantic_scholar",
          "arxiv"
        ]
      },
      "typeVersion": 1
    },
    {
      "id": "parse-papers",
      "name": "PDF 벡터 - 논문 파싱",
      "type": "n8n-nodes-pdfvector.pdfVector",
      "position": [
        850,
        300
      ],
      "parameters": {
        "useLlm": "always",
        "resource": "document",
        "operation": "parse",
        "documentUrl": "={{ $json.pdfUrl }}"
      },
      "typeVersion": 1
    },
    {
      "id": "extract-entities",
      "name": "엔티티 추출",
      "type": "n8n-nodes-base.openAi",
      "position": [
        1050,
        300
      ],
      "parameters": {
        "model": "gpt-4",
        "options": {
          "responseFormat": {
            "type": "json_object"
          }
        },
        "messages": {
          "values": [
            {
              "content": "Extract knowledge graph entities from this paper:\n\nTitle: {{ $json.title }}\nContent: {{ $json.content }}\n\nExtract:\n1. Key concepts (5-10 main ideas)\n2. Methods used\n3. Datasets mentioned\n4. Research questions\n5. Key findings\n6. Future directions\n\nAlso identify relationships between these entities.\n\nReturn as structured JSON with entities and relationships arrays."
            }
          ]
        }
      },
      "typeVersion": 1
    },
    {
      "id": "build-graph",
      "name": "그래프 구조 구축",
      "type": "n8n-nodes-base.code",
      "position": [
        1250,
        300
      ],
      "parameters": {
        "functionCode": "const extraction = JSON.parse($json.content);\nconst paper = $node['PDF Vector - Fetch Papers'].json;\n\n// Create nodes for Neo4j\nconst nodes = [];\n\n// Paper node\nnodes.push({\n  label: 'Paper',\n  properties: {\n    id: paper.doi || paper.title.replace(/[^a-zA-Z0-9]/g, ''),\n    title: paper.title,\n    year: paper.year,\n    authors: paper.authors.join('; '),\n    citations: paper.totalCitations\n  }\n});\n\n// Author nodes\npaper.authors.forEach(author => {\n  nodes.push({\n    label: 'Author',\n    properties: {\n      name: author\n    }\n  });\n});\n\n// Concept nodes\nextraction.concepts?.forEach(concept => {\n  nodes.push({\n    label: 'Concept',\n    properties: {\n      name: concept\n    }\n  });\n});\n\n// Method nodes\nextraction.methods?.forEach(method => {\n  nodes.push({\n    label: 'Method',\n    properties: {\n      name: method\n    }\n  });\n});\n\n// Create relationships\nconst relationships = [];\n\n// Paper-Author relationships\npaper.authors.forEach(author => {\n  relationships.push({\n    from: paper.doi || paper.title,\n    to: author,\n    type: 'AUTHORED_BY'\n  });\n});\n\n// Paper-Concept relationships\nextraction.concepts?.forEach(concept => {\n  relationships.push({\n    from: paper.doi || paper.title,\n    to: concept,\n    type: 'DISCUSSES'\n  });\n});\n\n// Paper-Method relationships\nextraction.methods?.forEach(method => {\n  relationships.push({\n    from: paper.doi || paper.title,\n    to: method,\n    type: 'USES'\n  });\n});\n\nreturn { nodes, relationships };"
      },
      "typeVersion": 1
    },
    {
      "id": "create-nodes",
      "name": "그래프 노드 생성",
      "type": "n8n-nodes-base.neo4j",
      "position": [
        1450,
        250
      ],
      "parameters": {
        "query": "=UNWIND $nodes AS node\nMERGE (n:Node {id: node.properties.id})\nSET n += node.properties\nSET n:${node.label}",
        "operation": "create",
        "parameters": "={{ { nodes: $json.nodes } }}"
      },
      "typeVersion": 1
    },
    {
      "id": "create-relationships",
      "name": "관계 생성",
      "type": "n8n-nodes-base.neo4j",
      "position": [
        1450,
        350
      ],
      "parameters": {
        "query": "=UNWIND $relationships AS rel\nMATCH (a {id: rel.from})\nMATCH (b {id: rel.to})\nMERGE (a)-[r:${rel.type}]->(b)",
        "operation": "create",
        "parameters": "={{ { relationships: $json.relationships } }}"
      },
      "typeVersion": 1
    },
    {
      "id": "kb-stats",
      "name": "KB 통계",
      "type": "n8n-nodes-base.code",
      "position": [
        1650,
        300
      ],
      "parameters": {
        "functionCode": "// Generate knowledge base statistics\nconst stats = {\n  papersProcessed: $items().length,\n  conceptsExtracted: $json.nodes.filter(n => n.label === 'Concept').length,\n  authorsAdded: $json.nodes.filter(n => n.label === 'Author').length,\n  methodsIdentified: $json.nodes.filter(n => n.label === 'Method').length,\n  timestamp: new Date().toISOString()\n};\n\nreturn stats;"
      },
      "typeVersion": 1
    },
    {
      "id": "log-update",
      "name": "KB 업데이트 로깅",
      "type": "n8n-nodes-base.postgres",
      "position": [
        1850,
        300
      ],
      "parameters": {
        "table": "kb_updates",
        "columns": "papers_processed,concepts,authors,methods,updated_at",
        "operation": "insert"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "kb-stats": {
      "main": [
        [
          {
            "node": "log-update",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "daily-update": {
      "main": [
        [
          {
            "node": "fetch-papers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "extract-entities": {
      "main": [
        [
          {
            "node": "build-graph",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "create-nodes": {
      "main": [
        [
          {
            "node": "kb-stats",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "create-relationships": {
      "main": [
        [
          {
            "node": "kb-stats",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "build-graph": {
      "main": [
        [
          {
            "node": "create-nodes",
            "type": "main",
            "index": 0
          },
          {
            "node": "create-relationships",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "fetch-papers": {
      "main": [
        [
          {
            "node": "parse-papers",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "parse-papers": {
      "main": [
        [
          {
            "node": "extract-entities",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
자주 묻는 질문

이 워크플로우를 어떻게 사용하나요?

위의 JSON 구성 코드를 복사하여 n8n 인스턴스에서 새 워크플로우를 생성하고 "JSON에서 가져오기"를 선택한 후, 구성을 붙여넣고 필요에 따라 인증 설정을 수정하세요.

이 워크플로우는 어떤 시나리오에 적합한가요?

중급 - AI RAG, 멀티모달 AI

유료인가요?

이 워크플로우는 완전히 무료이며 직접 가져와 사용할 수 있습니다. 다만, 워크플로우에서 사용하는 타사 서비스(예: OpenAI API)는 사용자 직접 비용을 지불해야 할 수 있습니다.

워크플로우 정보
난이도
중급
노드 수10
카테고리2
노드 유형7
난이도 설명

일정 경험을 가진 사용자를 위한 6-15개 노드의 중간 복잡도 워크플로우

저자
PDF Vector

PDF Vector

@pdfvector

A fully featured PDF APIs for developers - Parse any PDF or Word document, extract structured data, and access millions of academic papers - all through simple APIs.

외부 링크
n8n.io에서 보기

이 워크플로우 공유

카테고리

카테고리: 34