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など)は別途料金が発生する場合があります。
関連ワークフロー
GPT-4と複数のデータベース検索を使った学術文献综述の自動化
GPT-4と複数のデータベース検索を使った学術文献レビューの自動化
If
Set
Code
+
If
Set
Code
13 ノードPDF Vector
文書抽出
自動化学術論文モニタリング(PDFベクトル化、GPT-3.5、Slack通知付き)
論文監視の自動化(PDFベクトル+GPT-3.5+Slackアラート)
Set
Code
Slack
+
Set
Code
Slack
10 ノードPDF Vector
個人の生産性
PDFベクトル、Google Drive、データベースを使用した領秤データの抽出と保存
PDFベクトル、Google Drive、データベースを使って領収書データを抽出・保存する
If
Code
Slack
+
If
Code
Slack
26 ノードPDF Vector
請求書処理
GPT-4、PDFVector、PostgreSQLエクスポートを使用して文書からデータを抽出
ドキュメントからデータをGPT-4、PDFVector、PostgreSQLで出力する
Code
Open Ai
Switch
+
Code
Open Ai
Switch
9 ノードPDF Vector
文書抽出
五つのデータベースをまたいだ学术研究検索、PDFベクターと複数エクスポート
五つのデータベースを横断した学术研究検索、PDFベクターおよび複数のエクスポート
Set
Code
Pdf Vector
+
Set
Code
Pdf Vector
9 ノードPDF Vector
AI RAG検索拡張
PDFベクトルとWebhooksを使ってドキュメントQ&A APIを構築する
PDFベクトルとWebhookを使ったドキュメントQA APIの構築
If
Code
Webhook
+
If
Code
Webhook
11 ノードPDF Vector
内部Wiki
ワークフロー情報
難易度
中級
ノード数10
カテゴリー2
ノードタイプ7
作成者
PDF Vector
@pdfvectorA 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で表示 →
このワークフローを共有