Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Question and Answer Chain

ai.chain_retrieval_qa · version 1.5 · AI

Answers questions from documents found by a retriever.

Ports

PortKindLabelRequiredMax connections
input 0main
input 1ai_languageModelyes1
input 2ai_retrieveryes1
output 0main

Credentials

This node uses no credentials.

Parameters

NameTypeDefaultRequiredShown whenDescription
promptTypeoptions"auto"Prompt Source. One of auto, define.
textstringpromptType = defineQuestion.
optionscollection
options.systemPromptTemplatestring"Answer the user's question using only the context below. If the context does not contain the answer, say that you don't know instead of guessing.\n\nContext:\n{context}"System Prompt. {context} is replaced with the retrieved documents.

Import

Exported workflows that use these node types import to this node. Unverified ranges import with a parameter warning until parity fixtures confirm them; see Migrating.

Source typeVersion rangeStatusFixtures
@n8n/n8n-nodes-langchain.chainRetrievalQa1unverified