Better alternatives than LLM?

I’m currently using the AI Agent node with an LLM to extract the mileage from fuel receipts. It basically works, but the number is often recognized incorrectly.

Is there any reliable alternative to using an LLM for this?

Does n8n have a dedicated OCR node, or can you recommend a setup that works better for this kind of task?

Hey @Tentordev LLMs are awesome at understanding context, but they’re not always the best at precise, literal number extraction from images. For this specific task, there are some much more reliable alternatives.

Dedicated OCR Services
These are specialized services that are designed specifically for extracting text (including numbers) from images with high accuracy.

  • Google Document AI: This is a great option for structured documents like receipts. It has pre-trained models that can identify fields like total_amount, date, and mileage. You can use the “Google Document AI” node in n8n to set it up.
  • AWS Textract: Another excellent OCR service that’s great at tables, forms, and handwritten text. You can use the “AWS Textract” node in n8n.
  • Microsoft Azure Form Recognizer: Similar to Google Document AI, with pre-built receipt models.

Open Source OCR Engines
If you prefer self-hosted solutions, you can use Tesseract OCR. It’s free and powerful, and you can use the “Execute Command” node in n8n to run it.

Hybrid Approach
You can also combine OCR with LLM for validation. This way, you can use the OCR service to extract the mileage, and then use the LLM to validate and format the result.

Why This Works Better Than LLM Alone
Using a dedicated OCR service or a hybrid approach can give you much higher accuracy and speed than relying solely on an LLM. Plus, it’s often more cost-effective.
Hope this helps and kindly mark as solution to help others.

I do not think that n8n has a built-in OCR node. Yet there are a lot of external API’s that you could send a request to from your workflow. Or you can use a community node as an alternative if you are familiar with community node installation:

n8n-nodes-tesseractjs