Production-grade RAG chatbot engine
An end-to-end retrieval-augmented generation system built in n8n. It answers questions only from an indexed document set — the demo uses a recipe book, master-food-recipe.pdf — so replies come with exact ingredient amounts and step-by-step instructions instead of guesses.
The system runs as two pipelines: one that ingests and indexes knowledge, and one that answers questions in a multi-turn chat.
- - Ingestion: a form trigger accepts a PDF, the Default Data Loader splits it into chunks, OpenAI
text-embedding-3-smallembeds them, and the vectors are stored in a Pinecone index. - - Query: a chat trigger passes the question to an AI agent that uses the Pinecone vector store as a tool to retrieve the most relevant chunks.
- - Memory: n8n Simple Memory keeps context across turns.
- - Answer: Google Gemini combines the question, retrieved chunks and chat history into a grounded reply.
Why it matters for a business: the same pattern turns policy documents, product catalogues or support FAQs into an assistant that only says what the documents say.
RAG chatbot engine
Pipeline at a glance
1 · Knowledge ingestion
2 · Conversational query