Process a PDF using an LLM

I want to process a PDF using an LLM.

For example, creating a prompt saying that I am going to upload a PDF (binary or base64) and I want to extract all the information (graph, tables, etc.) and then process the information.

The PDF to Text component doesn’t help because I don’t want to remove just the text, I want an LLM to interpret graphics, tables, etc.

The knowledge base doesn’t help in this case because I want to do some processing on the file before putting it somewhere.

Share the output returned by the last node

The output can be a structured json or a simple text containing all the content “interpreted” by an LLM

Information on your n8n setup

  • n8n version: 1.78.0
  • Database (default: SQLite): SqlLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system: linux

You can turn the PDF into images before processing it with an AI.

Here are two workflows from @jimleuk that shows exactly how to achieve that:

In the first one he loads the image directly.

In the second one he uses a third-party API to turn the PDF pages into images and then loads the binary file into the AI node

:muscle: If my reply answers your question, please remember to mark it as a solution.

1 Like

I had found another solution, including following the worflow below:

However, your solution allows for greater flexibility. Thanks

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.