n8n 2.0 ships with 70+ dedicated AI nodes organized within
the @n8n/n8n-nodes-langchain package, spanning Chat Models,
Embeddings, Vector Stores, Tools, Memory, Chains, Agents, Document Loaders,
Text Splitters, and Output Parsers. This architecture mirrors LangChain’s
conceptual model while providing a visual, no‑code orchestration layer:
the AI Agent node serves as the central reasoning engine,
using LangChain‑powered decision logic to determine which tools to call
based on user input, and connecting to LLM providers—OpenAI (GPT‑4o),
Anthropic (Claude 3.5 Sonnet), Google Gemini, and over 130 specialized
nodes in total.
[1]
[2]
How does the AI Agent node orchestrate tools, memory, and LLM reasoning in n8n?
The AI Agent node is the central orchestrator—it connects to a Language Model sub‑node (OpenAI, Anthropic, Gemini) for reasoning, to Tool sub‑nodes (HTTP Request, Code, sub‑workflows) for executing actions, and to Memory sub‑nodes (Buffer Window, Postgres Chat, Redis) for maintaining conversation context across exchanges. The agent uses LangChain‑powered reasoning to decide which tool to call, in what order, based on the user’s query and the tool descriptions provided. [4] [6]
The node accepts five connection types: Language Model for the primary LLM, Memory for conversation history storage, Tool for external APIs the agent can invoke, Output Parser for structured response formatting, and Text Splitter for document chunking. The maxIterations parameter (recommended range: 5–8) prevents infinite loops when the agent gets stuck; the system prompt should include explicit guardrails like “Do not invent information. If uncertain, say so and offer to escalate.” For multi‑agent patterns, a gatekeeper agent routes queries to specialized sub‑agents, each with its own tool set. For the complete RAG pipeline pattern that loads documents, chunks text, embeds vectors, stores in Pinecone, and retrieves via the AI Agent, see the n8n Vector Store Integration guide.
What LangChain node categories and execution patterns does n8n 2.0 provide?
The @n8n/n8n-nodes-langchain package organizes 130+ specialized
nodes into ten categories: Agents (Agent, OpenAiAssistant),
Chains (ChainLLM, ChainRetrievalQA, SentimentAnalysis),
Chat Models (LmChatOpenAi, LmChatAnthropic, LmChatGoogleGemini),
Embeddings (EmbeddingsOpenAi, EmbeddingsCohere), and Vector
Stores (VectorStorePinecone, VectorStoreQdrant, VectorStorePGVector).
[1]
[3]
The remaining categories include Tools (ToolCode, ToolHttpRequest, ToolWorkflow, ToolCalculator), Memory (MemoryBufferWindow, MemoryRedisChat, MemoryPostgresChat), Document Loaders (DocumentDefaultDataLoader, DocumentGithubLoader), Text Splitters (TextSplitterRecursiveCharacterTextSplitter, TextSplitterTokenSplitter), Output Parsers (OutputParserStructured, OutputParserItemList), Retrievers (RetrieverVectorStore, RetrieverWorkflow), and Vendors (Anthropic, GoogleGemini, OpenAi). Two execution patterns govern these nodes: supplyData() for configuration nodes that create LangChain instances, and execute() for processing nodes that consume those instances. For practical implementation patterns, see the OpenAI GPT‑4o prompt chain tutorial.
| Category | Directory | Example Nodes | Execution Pattern |
|---|---|---|---|
| Agents | nodes/agents/ |
Agent, OpenAiAssistant, AgentTool | execute() |
| Chains | nodes/chains/ |
ChainLLM, ChainRetrievalQA, SentimentAnalysis | execute() |
| Chat Models | nodes/llms/ |
LmChatOpenAi, LmChatAnthropic, LmChatGoogleGemini | supplyData() |
| Embeddings | nodes/embeddings/ |
EmbeddingsOpenAi, EmbeddingsCohere, EmbeddingsGoogleGemini | supplyData() |
| Vector Stores | nodes/vector_store/ |
VectorStorePinecone, VectorStoreQdrant, VectorStorePGVector | supplyData() |
| Tools | nodes/tools/ |
ToolCode, ToolHttpRequest, ToolWorkflow | supplyData() |
| Memory | nodes/memory/ |
MemoryBufferWindow, MemoryRedisChat, MemoryPostgresChat | supplyData() |
How do you configure the OpenAI Chat Model node and select the right model for your task?
The OpenAI Chat Model sub‑node (LmChatOpenAi) connects to the AI Agent and provides access to GPT‑4o, GPT‑4o‑mini, and other OpenAI models. You authenticate via an API key stored in n8n’s encrypted credential system, then configure Temperature (0–2, default 1: use 0.1–0.3 for factual support agents and 0.7–0.9 for creative writing), Max Tokens (capped at model maximum), and a System Prompt that defines assistant behavior. [7]
The model selector dynamically loads models available to your API account. For
high‑volume classification tasks, use gpt-4o-mini to cut costs
by 60–80% compared to full GPT‑4o; for customer‑facing support where quality
matters, default to GPT‑4o. The AI Agent node can also route simple queries to
cheaper models and complex ones to more capable models: a Switch node checks the
input complexity and directs the request accordingly. For Azure OpenAI users, the
community node n8n-nodes-azure-openai-ms-oauth2 supports Microsoft
OAuth2 authentication with GPT‑4o, GPT‑4.1, o1, and embedding models. For the
complete prompt‑chaining pattern, see the
OpenAI prompt chain tutorial.
How does the Anthropic Claude node integrate with n8n’s AI Agent for autonomous tool use?
The Anthropic Chat Model sub‑node (LmChatAnthropic) connects Claude 3.5 Sonnet or Claude 3.5 Haiku to the AI Agent through the same Language Model connection type. You create API credentials from the Anthropic Console and configure model selection, temperature, and max tokens through the standard parameter panel. Claude models excel at complex multi‑step reasoning and tool‑calling scenarios where cost‑efficient, accurate execution matters. [8]
Two community Claude agent nodes extend this further: the
n8n-nodes-claude-chat node enables multi‑turn conversations with
skill‑based personalities and budget management, while
@landreville/n8n-nodes-claude-agent brings the Claude Agent SDK
directly into n8n for autonomous tool use without the AI Agent wrapper. For
complex, high‑volume deployments, the recommended routing pattern sends simple
queries to gpt‑4o-mini ($0.15/1M input) and complex reasoning to Claude 3.5
Sonnet, which can cut aggregate agent costs by 60% or more
[6].
For multi‑model orchestration patterns with AI Agents, see the
n8n AI Agents & LLM Orchestration guide.
What vector store nodes does n8n provide, and how do they support RAG workflows?
n8n supports seven vector database integrations natively: Pinecone, Supabase (pgvector‑backed), Qdrant, PGVector (PostgreSQL with pgvector extension), Milvus, MongoDB Atlas, and an in‑memory vector store for development and testing. Each vector store node supports four operation modes: Get Many, Insert Documents, Retrieve Documents (As Vector Store for Chain/Tool), and Retrieve Documents (As Tool for AI Agent). [5]
All vector store nodes follow the supplyData() execution pattern: they create a
LangChain vector store instance that other nodes consume for semantic search.
Five projection types—list, slice, object, flatten, and filter—enable complex
nested JSON querying without custom code. For the search, each vector store
supports semantic (embedding‑based), lexical (keyword‑based), or hybrid search.
For production, match the embedding dimensions exactly: text-embedding-
3-small generates 1,536‑dimensional vectors, while text-
embedding-3-large generates 3,072 dimensions. For self‑hosted pgvector,
set chunk_size: 1000 and chunk_overlap: 200 as flexible
starting points, then create an HNSW index for cosine similarity over millions of
vectors. For the complete ingestion‑to‑retrieval pipeline, see the
Vector Store Integration guide.
| Vector Store | Hosting | Ideal Scale | Key Advantage | Operation Modes |
|---|---|---|---|---|
| Pinecone | Cloud‑managed | 1M–100M+ vectors | Hands‑off ops, serverless, hybrid search | Get Many, Insert, Retrieve (Chain/Tool), Retrieve (Agent Tool), Update |
| PGVector | Self‑hosted (PostgreSQL) | <1M vectors | Zero new infra; existing Postgres + SQL backups | Get Many, Insert, Retrieve (Chain/Tool), Retrieve (Agent Tool) |
| Qdrant | Cloud or Self‑hosted | 1M–50M+ vectors | Production‑grade, multi‑tenant collections | Get Many, Insert, Retrieve (Chain/Tool), Retrieve (Agent Tool) |
| Supabase | Cloud or Self‑hosted | <1M vectors | Managed pgvector with native n8n integration | Get Many, Insert, Retrieve (Chain/Tool), Retrieve (Agent Tool), Update |
How do you build a complete RAG pipeline with n8n’s AI nodes—from document ingestion to citation?
A complete n8n RAG pipeline follows six stages: (1) Ingest—
Default Data Loader reads PDFs, HTML, or JSON from Google Drive, HTTP, or manual
upload. (2) Chunk—Recursive Character Text Splitter with
chunk_size: 1000 and chunk_overlap: 200. (3)
Embed—Embeddings OpenAI (text-embedding-3-small, 1,536 dims)
or Cohere. (4) Store—Pinecone, Qdrant, or PGVector in Insert
mode. (5) Retrieve—Vector Store in Retrieve Documents (As Tool
for AI Agent) mode. (6) Answer—LLM generates a grounded response
with source citations.
[9]
[10]
For each incoming query, the pipeline generates a query embedding, runs a similarity search (top_k: 5–10 with a relevance threshold), and maps results into a context string. An IF node checks when no results exceed the similarity threshold and branches to a fallback answer. Store index or collection names as workflow variables, and log the document IDs returned by retrieval for debugging. To implement productive guardrails, validate JSON schema with an IF node and fallback to a secondary LLM pass if malformed; capture errors in an Error Workflow. For multimodal RAG with image analysis, use GPT‑4o’s vision capability through the OpenAI Chat Model node. For the complete production‑grade RAG blueprint that works across Pinecone, Weaviate, and pgvector, see the Vector Store Integration guide.
References
- DeepWiki — AI and LangChain Nodes: package architecture, 10 categories, supplyData() vs execute() patterns, AI Agent connection types
- Finbyz Tech — Building Agentic Workflows with n8n 2.0 & LangChain: native LangChain integration, Tool node, persistent memory (Jan 2026)
- DeepWiki — AI & LangChain Integration: node categories, $fromAI function, node-to-tool conversion, vector store integrations
- Strapi — How to Build AI Agents with n8n: Complete 2026 Guide: agent architecture, memory management, tool-calling, Docker Compose deployment
- DeepWiki — AI Capabilities: vector store providers, operation modes, agents vs chains, supported LLM providers
- dev.to — n8n 2.0 AI Agents: core node architecture, Model/Memory/Tool/Vector Store, memory types, production patterns (2026)
- n8n Documentation — OpenAI Chat Model node: authentication, model selection, temperature, max tokens, system prompt
- n8n Documentation — Anthropic Chat Model node: API credentials, model selection, Claude 3.5 Sonnet & Haiku, tool-calling
- Skywork.ai — n8n AI Agents Tutorial: 70+ AI nodes, RAG pipeline, vector store setup, guardrails & testing (Oct 2025)
- Dino Cajic — RAG the Easy Way in n8n: ingestion, chunking, embedding, retrieval, Pinecone/Weaviate/Qdrant, Supabase vector store

