GLPI Knowledge Base RAG Pipeline with Gemini and PostgreSQL - n8n Workflow

Use this powerful n8n workflow to build a custom RAG (Retrieval-Augmented Generation) agent powered by Google Gemini and private knowledge stored in PostgreSQL vector databases (GLPI, Confluence).

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

AI Automation Developers: Those building complex, production-ready RAG pipelines using n8n.
IT Operations & Support Teams: Organizations needing fast, accurate AI retrieval from internal knowledge bases like GLPI or Confluence.
Technical Users of n8n: Individuals looking for advanced examples combining LangChain n8n node components with external vector databases.
Data Engineers: Professionals aiming to integrate structured internal data sources into conversational AI experiences using an n8n workflow.

Overview

Modern organizations rely on accurate information, often buried within service desks (like GLPI) or documentation platforms (like Confluence). This highly technical n8n workflow addresses the challenge of making that internal knowledge accessible via conversational AI. It implements a robust Retrieval-Augmented Generation (RAG) architecture.

When a user submits a query via the initial n8n trigger, the AI Agent uses the Google Gemini Chat Model, but restricts its knowledge retrieval to two dedicated PostgreSQL vector stores, ensuring answers are grounded in proprietary GLPI IT knowledge and Confluence documentation. This advanced n8n automation provides highly contextualized, real-time responses, significantly improving support efficiency and information retrieval accuracy. This n8n template serves as an excellent foundation for secure, private knowledge AI assistants.

How it Works

The entire process is initiated by a conversational event via a dedicated n8n trigger, specifically the LangChain When chat message received n8n node.


  1. Trigger and Input: The workflow starts when a new chat message is received by the When chat message received n8n trigger.

  2. Orchestration: The request is passed to the AI Agent n8n node. This agent decides the best course of action—either answering directly using its conversational memory or retrieving data from its available tools.

  3. Language Model and Memory: The agent uses the Google Gemini Chat Model for reasoning and generation, while the Simple Memory n8n node maintains the context of the current conversation session.

  4. Knowledge Retrieval (RAG): The core intelligence comes from the tools linked to the agent: CONHECIMENTOTIGLPI and CONFLUENCETICONFLUENCESGUGPL. These are both PostgreSQL Vector Stores.

  5. Embedding Service: The vector stores rely on the Embeddings Google Gemini n8n node components to generate numerical representations of the input query for performing similarity searches against the pre-indexed GLPI and Confluence knowledge.

  6. Final Output: The agent retrieves the relevant documents, synthesizes the answer using the Gemini model, and sends the final, context-aware response back through the initial n8n trigger.

Installation Guide

To deploy and use this powerful n8n workflow, follow these steps:


  1. Import the n8n template: Copy the provided JSON data and paste it directly into your n8n instance's workflow editor (File > Import from JSON).

  2. LangChain Credential Setup: You must configure credentials for all LangChain-related n8n node components, including the Google Gemini API key and credentials for the PostgreSQL database.

  3. PostgreSQL Vector Stores: Ensure your PostgreSQL instance is running the pgvector extension and contains the embedded data derived from your GLPI and Confluence knowledge bases.

  4. Set up the n8n Trigger: The When chat message received n8n trigger must be configured to receive input from your desired chat front-end (e.g., a custom UI or communication platform).

  5. Activate: Save the n8n workflow and toggle the "Active" switch to enable the RAG pipeline.

Node Details

This n8n workflow utilizes several specialized LangChain n8n node components:

When chat message received (n8n trigger): This serves as the primary n8n trigger, listening for incoming conversational inputs that initiate the RAG process.
Google Gemini Chat Model: Provides the large language model capabilities required for reasoning, natural language understanding, and response generation.
AI Agent (n8n node): The central orchestrator that manages the flow, utilizing the connected memory and vector store tools to form complex responses.
Simple Memory (n8n node): Maintains the chat history (Buffer Window Memory) so the agent can reference previous turns in the conversation.
CONHECIMENTOTIGLPI (VectorStorePGVector): A PostgreSQL vector store connection acting as the knowledge source for GLPI data. The agent queries this tool for factual retrieval.
CONFLUENCETICONFLUENCESGUGPL (VectorStorePGVector): A second PostgreSQL vector store connection, providing supplemental knowledge from Confluence documentation.


  • Embeddings Google Gemini (n8n node): Used to generate high-quality vector embeddings for input queries, enabling effective semantic search within the PostgreSQL vector databases connected to this n8n workflow.

Related n8n Workflows

Paid

Nodes: 7 Nodes
Updated: December 26 2025
View all
Created by
Thiago Vazzoler Loureiro
Thiago Vazzoler Loureiro

Building Custom Automations with n8n | Node.js Developer | Integration Specialist | Open Source Contributor If you need help with n8n workflows, API integrations, or custom nodes, feel free to connect on LinkedIn: http://linkedin.com/in/thiago-vazzoler-loureiro-24056227

Featured*