AI Agents

Email with semantic and structured RAG, using Telegram and

20 nodes 197 129 Automatic trigger
Download

Workflow Description

Advanced automation that receives Telegram messages and processes them using an intelligent agent powered by semantic and structured RAG technology, with vector storage and dynamic context management through memory operations.

How it works

  1. 1.Receive incoming message from Telegram via direct trigger
  2. 2.Split large data into efficient processing batches
  3. 3.Generate semantic vector embeddings using Ollama model
  4. 4.Perform semantic search across PGVector store
  5. 5.Pass context and retrieved results to OpenAI intelligent agent
  6. 6.Send enhanced response back to user via Telegram

Use cases

  • Process complex search queries from Telegram messages in real-time
  • Build smart customer support system that understands deep contextual meaning of questions
  • Automatically analyze large documents and retrieve relevant information on demand

Requirements

  • Active OpenAI account with valid API key
  • PostgreSQL database with pgvector extension enabled
  • Running Ollama server with embedding model installed
  • Configured Telegram bot with access token

Service Value

Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.

Apps Used

Telegram Split In Batches Chat Trigger Vector Store Tool Embeddings Memory AI Agent OpenAI

Details

Trigger Automatic trigger
Nodes 20
Apps 9
Views 197
Downloads 129

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (20)

/

Telegram Trigger

Set

#1

Loop Over Items

Split In Batches

#2

Came from Telegram?

If

#3

When chat message received

Chat Trigger

#4

Postgres PGVector Store

Vector Store P G Vector

#5

Call the SQL composer Workflow

Tool Workflow

#6

Embeddings Ollama

Embeddings Ollama

#7

Beautify chat response

Set

#8

Split text into chunks

Code

#9

Respond on Telegram in batches

Set

#10

Escape Markdown

Code

#11

No Operation, do nothing

No Op

#12

Sticky Note

Sticky Note

#13

Sticky Note1

Sticky Note

#14

Sticky Note2

Sticky Note

#15

Sticky Note3

Sticky Note

#16

Simple Memory

Memory Buffer Window

#17

AI Agent

Agent

#18

OpenAI Chat Model

OpenAI

#19

Generate session id

Set

#20