Email with semantic and structured RAG, using Telegram and
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.Receive incoming message from Telegram via direct trigger
- 2.Split large data into efficient processing batches
- 3.Generate semantic vector embeddings using Ollama model
- 4.Perform semantic search across PGVector store
- 5.Pass context and retrieved results to OpenAI intelligent agent
- 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
Details
How to Use
- 1.Click "Download Template"
- 2.Open your n8n dashboard
- 3.Go to Workflows > Import from File
- 4.Select downloaded file and configure credentials
Nodes Used (20)
Telegram Trigger
Set
Loop Over Items
Split In Batches
Came from Telegram?
If
When chat message received
Chat Trigger
Postgres PGVector Store
Vector Store P G Vector
Call the SQL composer Workflow
Tool Workflow
Embeddings Ollama
Embeddings Ollama
Beautify chat response
Set
Split text into chunks
Code
Respond on Telegram in batches
Set
Escape Markdown
Code
No Operation, do nothing
No Op
Sticky Note
Sticky Note
Sticky Note1
Sticky Note
Sticky Note2
Sticky Note
Sticky Note3
Sticky Note
Simple Memory
Memory Buffer Window
AI Agent
Agent
OpenAI Chat Model
OpenAI
Generate session id
Set