AutomationMart
Home/Browse/Build a chatbot with Reinforced Learning Human Feedback (RLHF) and RAG
n8n

Build a chatbot with Reinforced Learning Human Feedback (RLHF) and RAG

n8nn8n23 modulesv1.0
OpenAITelegram

Who is this for? This template is designed for internal support teams, product specialists, and knowledge managers who want to build an AI-powered knowledge assistant with retrieval-augmented generation (RAG) and reinforcement learning from human feedback (RLHF) via Telegram. What problem is this workflow solving? Manual knowledge management and answering support queries can be time-consuming and error-prone. This solution automates importing and indexing official documentation into Mon

At a glance

Build a chatbot with Reinforced Learning Human Feedback (RLHF) and RAG is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects OpenAI, Telegram. It's free to download. Follow the 5-step import below to go live in minutes.

Platform
n8n
Connects
OpenAI, Telegram
Modules
23
Price
Free
Version
v1.0
Build a chatbot with Reinforced Learning Human Feedback (RLHF) and RAG workflow diagram

About this workflow

Who is this for? This template is designed for internal support teams, product specialists, and knowledge managers who want to build an AI-powered knowledge assistant with retrieval-augmented generation (RAG) and reinforcement learning from human feedback (RLHF) via Telegram. What problem is this workflow solving? Manual knowledge management and answering support queries can be time-consuming and error-prone. This solution automates importing and indexing official documentation into MongoDB vector search and enhances AI responses with Telegram-based user feedback to continuously improve answer quality. What these workflows do Workflow 1: Document ingestion & indexing - Manually triggered workflow imports product documentation from Google Docs. - Documents are split into manageable chunks and embedded using OpenAI embeddings. - Embedded document chunks are stored in MongoDB Atlas vector store to enable semantic search. Workflow 2: Telegram chat with RLHF feedback loop - Listens for user messages via Telegram bot integration. - Uses vector similarity search on MongoDB to retrieve relevant documentation chunks. - Generates answers with OpenAI GPT-4o-mini model using retrieval-augmented generation. - Sends answers back via Telegram and waits for user feedback (approval or disapproval). - Captures feedback, maps it as positive or negative, and stores it with the conversation data for future model improvement. Setup Setting up vector embeddings 1. Authenticate Google Docs and connect your Google Docs URL containing the product documentation you want to index. 2. Authenticate MongoDB Atlas and connect the collection where you want to store the vector embeddings. Create a search index on this collection to support vector similarity queries. 3. Ensure the index name matches the one configured in n8n (dataindex). 4. See the example MongoDB search index template below for reference. Setting up chat with Telegram RLHF 1. Create a bot in Telegram with @botFather using the /newbot command. 2. Connect the MongoDB database and search index used for vector search in the previous workflow. Also create two new collections in MongoDB Atlas: one for feedback and one for chat history. Create a search index for feedback, copying the provided template. 3. Configure the AI system prompt in the “Knowledge Base Agent” node, making sure it references all three tools connected (productDocs, feedbackPositive, feedbackNegative) as provided in the template prompt. Make sure - Product documentation and feedback collections must connect to the same MongoDB database. - There are three distinct MongoDB collections: one for product documentation, one for feedback, and one for chat history (chat history collection can be separate). - Telegram API credentials are valid and webhook URLs are correctly set up. MongoDB Search Index Templates Documentation Collection Index { "mappings": { "dynamic": false, "fields": { "id": { "type": "string" }, "text": { "type": "string" }, "embedding": { "type": "knnVector", "dimensions": 1536, "similarity": "cosine" }, "source": { "type": "string" }, "docid": { "type": "string" } } } } Feedback Collection Index { "mappings": { "dynamic": false, "fields": { "prompt": { "type": "string" }, "response": { "type": "string" }, "text": { "type": "string" }, "embedding": { "type": "knnVector", "dimensions": 1536, "similarity": "cosine" }, "feedback": { "type": "token" } } } }

n8n

How to import this n8n workflow

  1. 1

    Download the workflow JSON file after purchase.

  2. 2

    Open n8n → click the menu → Import from File.

  3. 3

    Select the downloaded JSON and import.

  4. 4

    Set up credentials for each node that requires them.

  5. 5

    Click Execute Workflow to test, then activate.

Setup guide

Setup guide included

Purchase to unlock the full step-by-step guide

Related N8n workflows

Send automated email responses using ChatGPT and trigger new emails (seconds delay included)

Automatically respond to emails using ChatGPT and trigger new emails. Enhance communication by sending AI-generated responses and initiating follow-up emails. Ensures the ChatGPT process completes before replying.

Free

Automatic news summarization & email digest with GPT-4, NewsAPI and Gmail

AI News Digest Agent: Auto News Summarizer & Email Newsletter Create an intelligent news curation system that automatically fetches breaking headlines, generates AI-powered summaries, and delivers personalized news digests to your subscriber list. Perfect for newsletter creators, team leaders, and content curators who want to keep their audience informed without the manual effort of news monitoring and summarization. 🔄 How It Works This streamlined 5-step automation delivers fresh news insights

Free

Transcribe audio files using OpenAI and send messages with Z-API

Get your audio files transcribed and send messages using ChatGPT and Z-API. Triggered by A Custom WebHook, retrieve files with HTTP, transcribe with ChatGPT, and message via Z-API.

Free

Google Play review intelligence with Bright Data & Telegram alerts

Google Play Review Intelligence with Bright Data & Telegram Alerts Overview This n8n workflow automates the process of scraping Google Play Store reviews, analyzing app performance, and sending alerts for low-rated applications. It integrates with Bright Data for web scraping, Google Sheets for data storage, and Telegram for notifications. Workflow Components 1. ✅ Trigger Input Form - Type: Form Trigger - Purpose: Initiates the workflow with user input - Input Fields: - URL (Google Play Store a

Free

Summarise MS Teams channel activity for weekly reports with AI

This n8n template lets you summarize individual team member activity on MS Teams for the past week and generates a report. For remote teams, chat is a crucial communication tool to ensure work gets done but with so many conversations happening at once and in multiple threads, ideas, information and decisions usually live in the moment and get lost just as quickly - and all together forgotten by the weekend! Using this template, this doesn't have to be the case. Have AI crawl through last week's

Free

AI-powered lead scoring with Salesforce, GPT-4o, and Slack with data masking

Boost your sales team’s efficiency with an end-to-end, privacy-first lead-scoring engine—ready to drop straight into your n8n instance. 🔹 What it does Salesforce Trigger watches for new or updated Leads every hour. HTTP Request fetches the full record so you never miss a field. Mask Data (JS Code) automatically tokenises PII (name, email, address, etc.) before any external call—ideal for GDPR/SOC 2 compliance. OpenAI (GPT-4o) scores each lead 0-100, assigns a grade A-F, lists key reasons, recomm

Free

Query and monitor Shopify orders via Telegram bot commands

This n8n workflow integrates Shopify order management with Telegram, allowing you to query open orders and order details directly through Telegram chat commands. It provides an interactive way to monitor your Shopify store orders using Telegram as an interface. Key Features 1. Telegram Trigger: Listens for messages and callback queries from your Telegram bot. 2. Switch Node: Routes incoming Telegram messages to different flows based on message content: - /orders command to fetch all open orders

Free

Competitor LinkedIn monitor with Airtop

Automating LinkedIn Competitive Monitoring Use Case Automatically track and summarize LinkedIn posts from key executives at competitor companies. This agent provides structured insights into hiring trends, product announcements, strategic shifts, and thought leadership, helping teams stay informed and responsive without manual monitoring. What This Automation Does This automation monitors and summarizes LinkedIn posts from competitor profiles and shares the results on Slack. It uses the followin

Free

Reviews

No reviews yet

Be the first to buy and share your experience.

Leave a review

Sign in to share your experience with this workflow.

Log in to review
Free
No ratings yet

Create a free account to purchase workflows.

  • JSON blueprint — instant download
  • Setup guide PDF included
  • 5 downloads · valid 30 days
  • Works with n8n

Need help setting this up?

Book a 3-hour live setup session with an Agility consultant.

₹2,499/ session
3 hrs · video call
  • Configure live on Google Meet / Zoom
  • Free follow-up if workflow has defects
  • Platform expert assigned to you
Book installation session
Free