Skip to main content

Process voice, images & documents with GPT-4o, MongoDB & Gmail tools

Workflow preview

Workflow preview
100%
Process voice, images & documents with GPT-4o, MongoDB & Gmail tools preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

What it does This n8n workflow creates a cutting edge, multi modal AI Memory Assistant designed to capture, understand, and intelligently recall your personal or business information from diverse s...

Best for

  • Personal Productivity automation workflows
  • AI RAG automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.telegramtrigger, n8n-nodes-base.switch, @n8n/n8n-nodes-langchain.openai, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai, n8n-nodes-base.telegram, @n8n/n8n-nodes-langchain.memorymongodbchat, n8n-nodes-base.httprequest

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by NanaB.

Original n8n.io source

1.1 Workflow description

Title
Process voice, images & documents with GPT-4o, MongoDB & Gmail tools
Workflow name
Process voice, images & documents with GPT-4o, MongoDB & Gmail tools

What it does

This n8n workflow creates a cutting-edge, multi-modal AI Memory Assistant designed to capture, understand, and intelligently recall your personal or business information from diverse sources. It automatically processes voice notes, images, documents (like PDFs), and text messages sent via Telegram. Leveraging GPT-4o for advanced AI processing (including visual analysis, document parsing, transcription, and semantic understanding) and MongoDB Atlas Vector Search for persistent and lightning-fast recall, this assistant acts as an external brain. Furthermore, it integrates with Gmail, allowing the AI to send and search emails as part of its memory and response capabilities. This end-to-end solution blurprint provides a powerful starting point for personal knowledge management and intelligent automation.

How it works

1. Multi-Modal Input Ingestion ๐Ÿ—ฃ๏ธ๐Ÿ“ธ๐Ÿ“„๐Ÿ’ฌ

Your memories begin when you send a voice note, an image, a document (e.g., PDF), or a text message to your Telegram bot. The workflow immediately identifies the input type.

2. Advanced AI Content Processing ๐Ÿง โœจ

Each input type undergoes specialized AI processing by GPT-4o:

  1. Voice notes are transcribed into text using OpenAI Whisper.

  2. Images are visually analyzed by GPT-4o Vision, generating detailed textual descriptions.

  3. Documents (PDFs) are processed for text extraction, leveraging GPT-4o for robust parsing and understanding of content and structure. Unsupported document types are gracefully handled with a user notification.

  4. Text messages are directly forwarded for further processing.

This phase transforms all disparate input formats into a unified, rich textual representation.

3. Intelligent Memory Chunking & Vectorization โœ‚๏ธ๐Ÿท๏ธโžก๏ธ๐Ÿ”ข

The processed content (transcriptions, image descriptions, extracted document text, or direct text) is then fed back into GPT-4o. The AI intelligently chunks the information into smaller, semantically coherent pieces, extracts relevant keywords and tags, and generates concise summaries. Each of these enhanced memory chunks is then converted into a high-dimensional vector embedding using OpenAI Embeddings.

4. Persistent Storage & Recall (MongoDB Atlas Vector Search) ๐Ÿ’พ๐Ÿ”

These vector embeddings, along with their original content, metadata, and tags, are stored in your MongoDB Atlas cluster, which is configured with Atlas Vector Search. This allows for highly efficient and semantically relevant retrieval of memories based on user queries, forming the core of your "smart recall" system.

5. AI Agent & External Tools (Gmail Integration) ๐Ÿค–๐Ÿ› ๏ธ

When you ask a question, the AI Agent (powered by GPT-4o) acts as the central intelligence. It uses the MongoDB Chat Memory to maintain conversational context and, crucially, queries the MongoDB Atlas Vector Search store to retrieve relevant past memories. The agent also has access to Gmail tools, enabling it to send emails on your behalf or search your past emails to find information or context that might not be in your personal memory store.

6. Smart Response Generation & Delivery ๐Ÿ’ฌโžก๏ธ๐Ÿ“ฑ

Finally, using the retrieved context from MongoDB and the conversational history, GPT-4o synthesizes a concise, accurate, and contextually aware answer. This response is then delivered back to you via your Telegram bot.

How to set it up (~20 Minutes)

Getting this powerful workflow running requires a few key configurations and external service dependencies.

Telegram Bot Setup:

  1. Use BotFather in Telegram to create a new bot and obtain its API Token.

  2. In your n8n instance, add a new Telegram API credential. Give it a clear name (e.g., "My AI Memory Bot") and paste your API Token.

OpenAI API Key Setup:

  1. Log in to your OpenAI account and generate a new API key.

  2. Within n8n, create a new OpenAI API credential. Name it appropriately (e.g., "My OpenAI Key for GPT-4o") and paste your API key. This credential will be used by the OpenAI Chat Model (GPT-4o for processing, chunking, and RAG), Analyze Image, and Transcribe Audio nodes.

MongoDB Atlas Setup:

  1. If you don't have one, create a free-tier or paid cluster on MongoDB Atlas.

  2. Create a database and a collection within your cluster to store your memory chunks and their vector embeddings.

  3. Crucially, configure an Atlas Vector Search index on your chosen collection. This index will be on the field containing your embeddings (e.g., embedding field, type knnVector). Refer to MongoDB Atlas documentation for detailed instructions on creating vector search indexes.

  4. In n8n, add a new MongoDB credential. Provide your MongoDB Atlas connection string (ensure it includes your username, password, and database name), and give it a clear name (e.g., "My Atlas DB"). This credential will be used by the MongoDB Chat Memory node and for any custom HTTP requests you might use for Atlas Vector Search insertion/querying.

Gmail Account Setup:

  1. Go to Google Cloud Console, enable the Gmail API for your project, and configure your OAuth consent screen.

  2. Create an OAuth 2.0 Client ID for a Desktop app (or Web application, depending on your n8n setup and redirect URI). Download the JSON credentials.

  3. In n8n, add a new Gmail OAuth2 API credential. Follow the n8n instructions to configure it using your Google Client ID and Client Secret, and authenticate with your Gmail account, ensuring it has sufficient permissions to send and search emails.

External API Services:

  1. If your Extract from File node relies on an external service for robust PDF/DocX text extraction, ensure you have an API key and the service is operational. The current flow uses ConvertAPI.

  2. Add the necessary credential (e.g., ConvertAPI) in n8n.

How you could enhance it โœจ

This workflow offers numerous avenues for advanced customization and expansion:

  1. Expanded Document Type Support: Enhance the "Document Processing" section to handle a wider range of document types beyond just PDFs (e.g., .docx, .xlsx, .pptx, markdown, CSV) by integrating additional conversion APIs or specialized parsing libraries (e.g., using a custom code node or dedicated third-party services like Apache Tika, Unstructured.io).

  2. Fine-tuned Memory Chunks & Metadata: Implement more sophisticated chunking strategies for very long documents, perhaps based on semantic breaks or document structure (headings, sections), to improve recall accuracy. Add more metadata fields (e.g., original author, document date, custom categories) to your MongoDB entries for richer filtering and context.

  3. Advanced AI Prompting: Allow users to dynamically set parameters for their memory inputs (e.g., "This is a high-priority meeting note," "This image contains sensitive information") which can influence how GPT-4o processes, tags, and stores the memory, or how it's retrieved later.

  4. n8n Tool Expansion for Proactive Actions: Significantly expand the AI Agent's capabilities by providing it with access to a wider range of n8n tools, moving beyond just information retrieval and email

  5. External Data Source Integration (APIs): Expand the AI Agent's tools to query other external APIs (e.g., weather, stock prices, news, CRM systems) so it can provide real-time information relevant to your memories.

Getting Assistance & More Resources

Need assistance setting this up, adapting it to a unique use case, or exploring more advanced customizations? Don't hesitate to reach out! You can contact me directly at [email protected]. Also, feel free to check out my Youtube Channel where I discuss other n8n templates, as well as Innovation and automation solutions.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Telegram Trigger

Type / Role
n8n-nodes-base.telegramTrigger - telegramTrigger
Config choices
Version 1.2

Block 2 - Switch

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 3 - Transcribe a recording

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 4 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2

Block 5 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 6 - Respond

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 7 - MongoDB Chat Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryMongoDbChat - memoryMongoDbChat
Config choices
Version 1

Block 8 - ConvertAPI HTTP Request

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 9 - Get audio file

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 10 - Get photo file

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 11 - Analyze image

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.8

Block 12 - Get text from Image

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 13 - Get text from Audio

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 14 - Get a file

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 15 - If

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 16 - Extract from File

Type / Role
n8n-nodes-base.extractFromFile - extractFromFile
Config choices
Version 1

Block 17 - Get text from PDF

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 18 - Unsupported Input

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 19 - Get text from Message

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 20 - Send a message in Gmail

Type / Role
n8n-nodes-base.gmailTool - gmailTool
Config choices
Version 2.1

Block 21 - Search for a messages in Gmail

Type / Role
n8n-nodes-base.gmailTool - gmailTool
Config choices
Version 2.1

Block 22 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Showing the first 24 of 26 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Process voice, images & documents with GPT-4o, MongoDB & Gmail tools
Complexity advanced
Nodes 26
Categories Personal Productivity, AI RAG
Author NanaB
Published 21 Jul 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/6211/6211.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Process voice, images & documents with GPT-4o, MongoDB & Gmail tools do?

What it does This n8n workflow creates a cutting edge, multi modal AI Memory Assistant designed to capture, understand, and intelligently recall your personal or business information from diverse s...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Personal Productivity, AI RAG use case.