Build Custom AI Agent with LangChain & Gemini (Self-Hosted) — Workflow n8n

Niska złożoność Wyzwalacz4 węzłów🏷️ Miscellaneous👁 4,410 wyświetleńautor: shepard

Przegląd

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

Użyte węzły

LangChain CodeSimple MemoryGoogle Gemini Chat Model

Podgląd workflow

👇 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

Jak to działa

  1. 1

    Wyzwalacz

    Workflow uruchamia się wyzwalaczem wyzwalacz.

  2. 2

    Przetwarzanie

    Dane przepływają przez 4 węzłów, connecting chattrigger, code, lmchatgooglegemini.

  3. 3

    Wyjście

    Workflow kończy automatyzację i dostarcza wynik do skonfigurowanego miejsca docelowego.

Szczegóły węzłów (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

Jak zaimportować ten workflow

  1. 1Kliknij przycisk Pobierz JSON po prawej stronie, aby zapisać plik workflow.
  2. 2Otwórz swoją instancję n8n. Przejdź do Workflow → Nowy → Importuj z pliku.
  3. 3Wybierz pobrany plik build-custom-ai-agent-with-langchain-gemini-self-hosted i kliknij Importuj.
  4. 4Skonfiguruj dane uwierzytelniające dla każdego węzła usługi (klucze API, OAuth itp.).
  5. 5Kliknij Testuj workflow, aby sprawdzić, czy wszystko działa, a następnie aktywuj go.

Lub wklej bezpośrednio w n8n → Importuj z JSON:

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

Integracje

chattriggercodelmchatgooglegeminimemorybufferwindow

Pobierz ten workflow

Pobierz i zaimportuj jednym kliknięciem

Pobierz JSONZobacz na n8n.io
Węzły4
Złożonośćlow
Wyzwalacztrigger
Wyświetlenia4,410
KategoriaMiscellaneous

Autor

shepard

shepard

@shepard

Tagi

chattriggercodelmchatgooglegeminimemorybufferwindow

Nowy w n8n?

n8n to darmowe narzędzie open-source do automatyzacji workflow. Hostuj samodzielnie lub użyj wersji chmurowej.

Pobierz n8n za darmo →

Related Miscellaneous Workflows