Build Custom AI Agent with LangChain & Gemini (Self-Hosted) — n8n ワークフロー

複雑度 トリガー4個のノード🏷️ Miscellaneous👁 4,410回閲覧作成者:shepard

概要

Overview
This workflow leverages the LangChain code node to implement a fully customizable conversational agent. Ideal for users who need granular control over their agent's prompts while reducing unnecessary token consumption from reserved tool-calling functionality (compared to n8n's built-in Conversation Agent).

Setup Instructions
Configure Gemini Credentials: Set up your Google Gemini API key (Get API key here if needed). Alternatively, you may use other AI provider nodes.
Interacti

使用ノード

LangChain CodeSimple MemoryGoogle Gemini Chat Model

ワークフロープレビュー

👇 Prompt Engineering
- Define agent personality and conversation structur
- ⚠️ Template must preserve `{chat_history}` and
Setup Instructions
1. Configure Gemini Credentials: Set up your Google Gem
👆 Interface Settings
Configure chat UI elements (e.g., title) in the `When C
👆 Model Selection
Swap language models through the `language model` input
👆 Memory Control
Adjust conversation history length in the `Store Conver
modelmemorymemory
W
When chat message received
Google Gemini Chat Model
Store conversation history
Construct & Execute LLM …
4 nodes4 edges

仕組み

  1. 1

    トリガー

    このワークフローは トリガー トリガーで開始します。

  2. 2

    処理

    データは 4 個のノードを流れます, connecting chattrigger, code, lmchatgooglegemini。

  3. 3

    出力

    ワークフローは自動化を完了し、設定された宛先に結果を配信します。

ノード詳細 (4)

LA

LangChain Code

n8n-nodes-langchain.code

#1
SI

Simple Memory

n8n-nodes-langchain.memoryBufferWindow

#2
GO

Google Gemini Chat Model

n8n-nodes-langchain.lmChatGoogleGemini

#3

このワークフローのインポート方法

  1. 1右側の JSONをダウンロード ボタンをクリックしてワークフローファイルを保存します。
  2. 2n8nインスタンスを開き、ワークフロー → 新規 → ファイルからインポート に進みます。
  3. 3ダウンロードした build-custom-ai-agent-with-langchain-gemini-self-hosted ファイルを選択し、インポートをクリックします。
  4. 4各サービスノードの 認証情報(APIキー、OAuthなど)を設定します。
  5. 5ワークフローをテスト をクリックして動作確認し、有効化します。

またはn8nの JSONからインポート に直接貼り付け:

{ "name": "Build Custom AI Agent with LangChain & Gemini (Self-Hosted)", "nodes": [...], ...}

インテグレーション

chattriggercodelmchatgooglegeminimemorybufferwindow

このワークフローを取得

ワンクリックでダウンロード&インポート

JSONをダウンロードn8n.ioで見る
ノード4
複雑度low
トリガーtrigger
閲覧数4,410
カテゴリMiscellaneous

作成者

shepard

shepard

@shepard

タグ

chattriggercodelmchatgooglegeminimemorybufferwindow

n8n初めてですか?

n8nは無料のオープンソースワークフロー自動化ツールです。セルフホストまたはクラウド版をご利用いただけます。

n8nを無料で始める →

Related Miscellaneous Workflows