{
  "name": "HYPEAKZ \u2014 Document Summarizer (PDF/Text \u2192 Summary, 100% Local)",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "summarize",
        "responseMode": "responseNode"
      },
      "id": "node-webhook",
      "name": "Upload Trigger",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        250,
        300
      ]
    },
    {
      "parameters": {
        "operation": "extractFromFile",
        "options": {}
      },
      "id": "node-extract",
      "name": "Extract Text from PDF",
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [
        500,
        300
      ]
    },
    {
      "parameters": {
        "model": "llama3.2",
        "baseUrl": "http://ollama:11434"
      },
      "id": "node-ollama",
      "name": "Ollama Local LLM",
      "type": "@n8n/n8n-nodes-langchain.lmOllama",
      "typeVersion": 1,
      "position": [
        750,
        500
      ]
    },
    {
      "parameters": {
        "prompt": "Summarize the following document in a structured format:\n\n1. **Executive Summary** (2-3 sentences)\n2. **Key Points** (bullet list, max 7 points)\n3. **Action Items** (if any)\n4. **Important Dates/Numbers** (if any)\n\nDocument:\n{{ $json.data }}\n\nProvide the summary in the same language as the document."
      },
      "id": "node-summarize",
      "name": "Summarize Document (AI)",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.4,
      "position": [
        750,
        300
      ]
    },
    {
      "parameters": {
        "values": {
          "string": [
            {
              "name": "summary",
              "value": "={{ $json.text }}"
            },
            {
              "name": "source_file",
              "value": "={{ $('Upload Trigger').item.json.headers['content-disposition'] }}"
            },
            {
              "name": "processed_at",
              "value": "={{ $now.toISO() }}"
            },
            {
              "name": "model",
              "value": "llama3.2 (local)"
            }
          ]
        }
      },
      "id": "node-format",
      "name": "Format Output",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1000,
        300
      ]
    },
    {
      "parameters": {
        "respondWith": "json",
        "responseBody": "={{ JSON.stringify($json) }}"
      },
      "id": "node-respond",
      "name": "Return Summary",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        1250,
        300
      ]
    }
  ],
  "connections": {
    "Upload Trigger": {
      "main": [
        [
          {
            "node": "Extract Text from PDF",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Text from PDF": {
      "main": [
        [
          {
            "node": "Summarize Document (AI)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ollama Local LLM": {
      "ai_languageModel": [
        [
          {
            "node": "Summarize Document (AI)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Summarize Document (AI)": {
      "main": [
        [
          {
            "node": "Format Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Output": {
      "main": [
        [
          {
            "node": "Return Summary",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "tags": [
    {
      "name": "HYPEAKZ.IO"
    },
    {
      "name": "Self-Hosted AI"
    },
    {
      "name": "Ollama"
    },
    {
      "name": "Document Processing"
    }
  ]
}