n8n Telegram AI Support Agent with pgvector & OpenRouter
n8n Telegram AI Support Agent with pgvector & OpenRouter
Regular price
£16.99
Regular price
£16.99
Sale price
Unit price
/
per
⬇
Instant Digital Download
∞
Unlimited Downloads
★
Lifetime Access in Your Account
Couldn't load pickup availability
🔥
128+ Sold
Popular with n8n builders
⚡
23 people viewing
High interest right now
✅
9 added today
Fast-moving digital product
n8n Telegram AI Support Agent with pgvector & OpenRouter
Regular price
£16.99
Regular price
£16.99
Sale price
Unit price
/
per
Turn Your Telegram Bot Into an AI Support Agent Powered by pgvector + OpenRouter
This n8n workflow automatically handles incoming customer messages in Telegram, retrieves answers from your Postgres pgvector knowledge base, and uses an OpenRouter chat model to respond—while cleanly escalating to a human support chat when confidence is low or retrieval fails.
What this workflow does
- Listens for new Telegram messages sent to your bot.
- Searches your Postgres pgvector knowledge base using OpenAI embeddings and selects the best match using a minimum similarity threshold.
- If retrieval is confident, calls an OpenRouter chat model using Postgres chat memory plus a pgvector search tool to answer strictly from your documents.
- Verifies response quality: if the agent reply is not empty and not “HANDOFF,” it sends the answer back to the customer in Telegram.
- Hands off to humans when needed: if retrieval or the agent is not confident, the workflow informs the customer and forwards the question to your Telegram support chat with a “Respond” button.
- Captures human resolution: if the support team replies within 24 hours, forwards the human answer to the customer and saves the Q&A as a new embedded FAQ entry in pgvector.
- Logs results: stores answered/unanswered Q&A in Postgres and records workflow errors in a Postgres error table with an alert to the support chat.
Use cases
- Customer support for SaaS FAQs where answers must come from your knowledge base.
- Reducing support load by automating first-response handling in Telegram.
- Continuous improvement: turning resolved human answers into new pgvector entries.
Technical details
- Integrations/Nodes: Telegram, Postgres (with pgvector), OpenRouter (via chat model), plus n8n nodes such as if, set, code, and sticky note.
- Core features: pgvector retrieval with similarity threshold, OpenAI embeddings, Postgres chat memory, confidence-based “HANDOFF,” Q&A logging, and error recording to a Postgres error table.
Setup: create and connect a Telegram bot, add it to your support group, and configure supportChatId. Ensure Postgres is set up with pgvector and the required tables/structures.
