Create an AI knowledge base assistant using Ollama, PGVector and Telegram
Ready for 3.0What this workflow does
This AI workflow has 22 nodes and runs on Telegram events (message) (plus 1 other trigger). Along the way it connects Postgres PGVector Store, Embeddings Ollama, Ollama Chat Model and Telegram.
How it runs
Trigger: On Telegram events (message) (plus 1 other trigger).
- Question and Answer Chain: answers questions over your documents (RAG), with model: Ollama Chat Model; retriever: Vector Store Retriever
- If: checks a condition and branches into true / false
- Send a text message (Telegram): uses Telegram
- Form (n8n Form): shows the next form page
- Form (n8n Form): shows the next form page
- Switch: routes items into 5 branches
- Postgres PGVector Store: stores documents in the Postgres PGVector Store vector store, with embeddings: Embeddings Ollama; document loader: Default Data Loader
- Extract from File: extracts data from a file (pdf)
- Extract from File: extracts data from a file (xls)
- Extract from File: extracts data from a file (xlsx)
…plus 2 more steps. See the full node list below.
Services it uses
Other Telegram + PostgreSQL templates (70) · Other Ollama + PostgreSQL templates (20) · Other Ollama + Telegram templates (17)
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (14)
- n8n Form Trigger
n8n-nodes-base.formTrigger - Postgres PGVector Store
@n8n/n8n-nodes-langchain.vectorStorePGVector - Embeddings Ollama
@n8n/n8n-nodes-langchain.embeddingsOllama - Default Data Loader
@n8n/n8n-nodes-langchain.documentDefaultDataLoader - Question and Answer Chain
@n8n/n8n-nodes-langchain.chainRetrievalQa - Ollama Chat Model
@n8n/n8n-nodes-langchain.lmChatOllama - Vector Store Retriever
@n8n/n8n-nodes-langchain.retrieverVectorStore - Extract from File
n8n-nodes-base.extractFromFile - If
n8n-nodes-base.if - n8n Form
n8n-nodes-base.form - Switch
n8n-nodes-base.switch - No Operation, do nothing
n8n-nodes-base.noOp - Telegram Trigger
n8n-nodes-base.telegramTrigger - Telegram
n8n-nodes-base.telegram
From the author
This workflow automatically converts uploaded documents and text into an AI-powered searchable knowledge base using semantic vector embeddings and Retrieval-Augmented Generation (RAG). Users can upload PDFs, JSON, CSV, XLS, XLSX, or raw text files, which are…