Answer HR policy questions in Telegram with Groq, Gemini and Google Drive

Go to Workflow
0 views
Built by Zivojin Perovic Zivojin Perovic
Created on October 13, 2026

Description

Quick overview
This workflow indexes an HR policy PDF from Google Drive into an in-memory vector store using Google Gemini embeddings, then answers employee questions sent via Telegram using a Groq chat model with retrieval-augmented generation.

How it works
Manually runs to download the HR policy PDF from Google Drive.
Splits and loads the PDF content, generates embeddings with Google Gemini, and inserts the chunks into an in-memory vector store.
Triggers when a new Telegram message is received by your bot.
Uses a Groq chat model with per-chat conversation memory and a vector-store search tool to retrieve relevant HR policy passages and generate a grounded response.
Sends the generated answer back to the originating Telegram chat.

Setup
Create a Telegram bot with @BotFather and add your bot token as Telegram credentials in n8n.
Add Google Drive OAuth credentials and select the HR policy PDF file to download.
Add a Google Gemini API key for embeddings and a Groq API key for the chat model.
Run the manual “Load knowledge base” trigger once to index the PDF, and re-run it whenever the document changes or n8n restarts (the in-memory store resets).

Requirements
• Telegram bot token (from @BotFather)
• Google Drive account with your HR policy PDF
• Google Gemini API key (embeddings)
• Groq API key (chat model)

Customization
• Edit the system message in the “HR Policy Agent” node to change the tone, language or word limit.
• Replace the PDF with any other document, such as an employee handbook, IT FAQ or product documentation.
• Swap the Groq model for OpenAI, Anthropic or any other chat model node.
• Replace the in-memory vector store with Pinecone, Qdrant, Supabase or PGVector for persistent production use.

Additional info
The in-memory vector store is cleared when n8n restarts. Re-run the “Load knowledge base” trigger after a restart, or switch to a persistent vector store. Use the same embedding model for inserting and retrieving documents.

This workflow was created by Zivojin Perovic and shared publicly on the n8n community template library. n8nFind indexes it for discovery — the workflow remains the property of its original creator.

Nodes Used (8)

AI Agent
@n8n/n8n-nodes-langchain.agent
Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader
Embeddings Google Gemini
@n8n/n8n-nodes-langchain.embeddingsGoogleGemini
Google Drive
n8n-nodes-base.googleDrive
Groq Chat Model
@n8n/n8n-nodes-langchain.lmChatGroq
Simple Memory
@n8n/n8n-nodes-langchain.memoryBufferWindow
Simple Vector Store
@n8n/n8n-nodes-langchain.vectorStoreInMemory
Telegram
n8n-nodes-base.telegram