Skip to content

That's just a taste — their profile full of gems!

Visit profile
User avatar
Kenneth Mendoza
September 21885

Multimodal RAG in n8n

I’m bullish on multimodal RAG because plain-text retrieval leaves too much value on the table.

A lot of the documents people actually care about—manuals, reports, product docs, scanned PDFs—aren’t just text. They’re full of screenshots, diagrams, charts, tables, and weird formatting. If my agent only embeds the raw text, it misses the stuff humans usually rely on most.

So the build I like here is simple:

Take a dense PDF, run it through OCR that returns LLM-friendly markdown, extract the images, annotate those images with a vision model, upload the files to storage, and then send the enriched markdown into a vector store.

That one change makes the agent way more useful.

Instead of answering from text alone, it can respond with:

  • the relevant explanation
  • the table context
  • the actual image URL
  • and enough visual understanding to know why that image matters

That’s the difference between a chatbot that “kind of knows the document” and one that feels like it actually read it.

What I especially like is the workflow shape inside n8n.

You can keep it very practical:

  • fetch the PDF
  • send it to OCR
  • get back pages, markdown, images, and annotations
  • split the arrays into workable items
  • inject image annotations inline into the markdown
  • chunk + embed
  • store in Supabase
  • retrieve with an AI agent
  • render images back in the final answer

That’s a real builder workflow. No magic, no giant architecture diagram, just nodes doing useful work.

A detail I’d absolutely keep: merge the image understanding directly into the markdown before embedding.

That part is sneaky important.

If the markdown only says image0.jpeg, that’s basically dead weight in retrieval. But if I replace that with the actual image reference plus a short annotation of what’s in the image, now the chunk carries meaning. Suddenly the vector search has something semantic to work with.

So when a user asks, “Why is my washing machine noisy?” the agent doesn’t just retrieve a paragraph. It can also pull the relevant setup diagram and explain it in context.

That’s the kind of UX jump people notice immediately.

I also like the storage pattern: put the extracted files in Supabase Storage, keep the content in Supabase Vector Store, and pass the image URLs back through the retrieved chunks. Clean, practical, and easy to extend.

If I were implementing this myself, I’d keep the first version intentionally lean: OCR → annotations → storage → enriched markdown → embeddings → retrieval.

Then I’d layer on the fancy stuff later: hybrid search, reranking, caching, better ingestion pipelines, persistent memory.

That’s usually the right order. Get the retrieval quality right first. Then optimize.

Another good reminder here: prompt the agent to say “I don’t know” when the vector store doesn’t return enough. Sounds basic, but it’s still one of the easiest wins in RAG. Most bad agent demos fall apart because the model is allowed to freestyle.

My main takeaway: if you’re building AI agents in n8n and you’re still treating PDFs as text-only, you’re probably leaving a lot of accuracy on the floor.

Images and tables aren’t edge cases. In many document workflows, they are the useful part.

I’m always chasing the version of automation that feels elegant instead of overengineered, and this is one of those patterns that earns its complexity. You’re not adding multimodal steps for the sake of it. You’re making the agent meaningfully better at retrieval and far more helpful in the final response.

That’s the kind of upgrade I’ll take every time.

#automation#llm#ocr#multimodal#aiagents#n8n#rag#supabase#vectorsearch
Like
Dislike

89

17

Add a comment...