πŸ“– Build a PDF-based RAG system with OpenAI, Pinecone and Cohere reranking

⚑ 9,671 views Β· πŸ“– Internal Wiki & Knowledge Base

Description

This workflow contains community nodes that are only compatible with the self-hosted version of n8n.

This workflow provides a complete, ready-to-use template for a Retrieval-Augmented Generation (RAG) system. It allows you to build a powerful AI chatbot that can answer questions based on the content of PDF documents you provide, using a modern and powerful stack for optimal performance.

Good to know

How it works

This workflow operates in two distinct stages:

1. Data Ingestion & Indexing:

2. Conversational AI Agent:

How to use

Using this workflow is a two-step process:

  1. Populate the Knowledge Base: First, you need to add documents. Trigger the workflow by using the Form Trigger and uploading a PDF file. Wait for the execution to complete. You can do this for multiple documents.
  2. Start Chatting: Once your data has been ingested, open the Chat Trigger’s interface and start asking questions related to the content of your uploaded documents.

The Form Trigger is just an example. Feel free to replace it with other triggers, such as a node that watches a Google Drive or Dropbox folder for new files.

Requirements

To run this workflow, you will need active accounts and API keys for the following services.

Customising this workflow

This template is a great starting point. Here are a few ways you can customize it:

πŸ”— Nodes Used

AI Agent, Embeddings OpenAI, OpenAI Chat Model, Simple Memory, Recursive Character Text Splitter, n8n Form Trigger

πŸ“₯ Import

Download workflow.json and import into n8n: Workflow menu β†’ Import from File

πŸ“– Importing guide Β· πŸ”‘ Credential setup