Vision RAG and Image Embeddings using Cohere Models - n8n Workflow

Build an advanced Vision RAG solution in n8n. This n8n workflow uses Cohere Embed v4 for image embeddings and Cohere Command-A vision model to answer complex questions about graphical documents stored in Qdrant.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Data scientists and AI/ML engineers building custom RAG pipelines.

  • Technical report analysts needing to query complex charts and graphs within PDFs.

  • Developers looking for advanced n8n templates integrating multimodal AI capabilities.

  • Users seeking a powerful, production-ready n8n workflow for visual content analysis.

Overview

This sophisticated n8n workflow solves the challenge of performing Retrieval-Augmented Generation (RAG) on visual content, such as charts, tables, and graphs found in technical reports. Unlike traditional text-based RAG which often loses context when converting images to markdown, this n8n automation utilizes Cohere's multimodal capabilities.

First, it indexes document scans using the Cohere Embed v4 model, generating high-quality image embeddings that are stored in a Qdrant vector database. The second part of the n8n workflow is a dynamic AI Agent. When a user asks a question relevant to the indexed material, the agent activates a custom tool. This tool retrieves the relevant image vectors from Qdrant, fetches the corresponding images, and feeds them directly, along with the query, into the Cohere Command-A Vision model for accurate, visually-informed answers. This ensures that visual data integrity is maintained, providing a powerful enhancement over typical RAG implementations.

How it Works

This n8n workflow operates in two main phases: Indexing and Agent Query.

Phase 1: Indexing Image Embeddings


  1. Manual Start: The indexing process begins with the "When clicking ‘Execute workflow’" n8n trigger.

  2. Data Preparation: The workflow defines a set of image URLs (scans of a technology report) and uses the "Split Out Urls" n8n node to process them individually, grouped by a "Batch 5" n8n node.

  3. Download and Convert: The "Download Page" n8n node fetches the image data, and the "Convert Image to Base64" n8n node prepares the images as base64 strings.

  4. Embedding Generation: The images are sent via an HTTP Request n8n node to Cohere’s embed-v4.0 endpoint to generate 1536-dimension image embeddings.

  5. Vector Storage: The resulting vectors are structured using a "Prepare Points" n8n node and aggregated, then inserted (upserted) into the visionRagExample collection within the Qdrant vector database using the dedicated Qdrant n8n node.

Phase 2: Vision RAG Agent Query


  1. Chat Trigger: The live Q&A starts via the "When chat message received" n8n trigger.

  2. Agent Orchestration: An "AI Agent" node, powered by Cohere Command-R, receives the query. The agent is equipped with a custom "Technology Innovation Report Tool".

  3. Tool Call Check: An "If has Tool Call?" n8n node checks if the agent decided to use the report tool. If the query requires document knowledge, the RAG branch executes.

  4. Vector Retrieval: The "Get Relevant Images" n8n node uses Cohere embed-v4.0 to embed the user's query and searches the Qdrant database for matching image vectors, retrieving the relevant image URLs.

  5. Vision Model Processing: The relevant image URLs and the original query are passed to the "Image Understanding via Command-A-Vision" n8n node (using Cohere's Command-A Vision model).

  6. Final Response: The Command-A output is sent back to the user via the "Respond to Chat" n8n node, complete with clickable thumbnail sources to enhance the user experience. If no tool was called, the agent provides a standard LLM response.

Installation Guide

To deploy and utilize this advanced n8n workflow, follow these steps:


  1. Import: Copy the provided JSON data and import it directly into your n8n instance as a new n8n workflow.

  2. Cohere Credentials: You must set up a Cohere API credential. This credential is required for both the Image Embeddings with Cohere Embed 4 (indexing) and the Image Understanding via Command-A-Vision (querying) n8n node connections, as well as the embedding model used in the RAG tool.

  3. Qdrant Setup: This n8n workflow requires a running Qdrant instance. Configure a Qdrant Rest API credential. Ensure that a collection named visionRagExample is created with a vector size of 1536 (Cosine distance is standard for Cohere embeddings).

  4. Indexing: Once credentials are set, run the indexing branch of the n8n workflow by executing the "When clicking ‘Execute workflow’" n8n trigger. This will populate your Qdrant vector store.

  5. Activation: Activate the entire n8n workflow. The "When chat message received" n8n trigger is now live and ready to process chat queries.

Node Details

This n8n workflow leverages several specialized n8n node types for multimodal RAG:

Manual Trigger (When clicking ‘Execute workflow’):
Function: Acts as the initial n8n trigger to start the image indexing and vector generation process.
Set (Technology and Innovation Report 2025):
Function: Stores the list of external image URLs that represent the document scans to be indexed.
HTTP Request (Image Embeddings with Cohere Embed 4):
Function: Sends Base64 encoded images to the Cohere /v2/embed API using the embed-v4.0 model to generate image embedding vectors.
Key Configuration: Uses embed-v4.0, input_type: image, and is secured using a Cohere API credential.
Qdrant (Insert Points):
Function: Writes the prepared vector points (embedding, URL payload, and ID) into the visionRagExample collection, completing the knowledge base creation.
Chat Trigger (When chat message received):
Function: The primary n8n trigger for the agent, listening for incoming chat messages.
AI Agent (AI Agent):
Function: Orchestrates the chat flow, deciding whether to answer directly using the Command-R model or utilize the specialized RAG tool.
Tool Code (Technology Innovation Report Tool):
Function: A custom n8n node defining the logic and prompt schema for retrieving relevant image data from the vector store.
Vector Store Qdrant (Get Relevant Images):
Function: Executes the vector similarity search against the Qdrant index based on the query, retrieving the top matching image URLs.
Key Configuration: Uses Cohere embed-v4.0 via the dedicated Cohere Embeddings n8n node for query vectorization.
HTTP Request (Image Understanding via Command-A-Vision):
Function: The core component of the Vision RAG. It passes the user query and the retrieved image URLs to the Cohere command-a-vision-07-2025 model for visual interpretation and complex Q&A.
Chat (Respond to Chat):
Function: Sends the final, sourced response back to the user, incorporating the answer from the vision model and a markdown gallery of the source images using the n8n expression language.

Related n8n Workflows

Free

Nodes: 19 Nodes
Updated: December 26 2025
View all
Created by

Freelance AI Automation Engineer based in London, UK. Since 2024, my n8n templates have documented my journey into applied AI and have helped hundreds of businesses and organisations get up to speed with AI automation. Today, I continue to explore use-cases as AI evolves and occasionally upload templates which I find novel and interesting. Subscribe to the RSS Feed: https://cdn.subworkflow.ai/n8n-templates/rss.xml

Featured*