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

Laag complexiteit Trigger4 knooppunten🏷️ Miscellaneous👁 4,410 weergavendoor shepard

Overzicht

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

Gebruikte knooppunten

LangChain CodeSimple MemoryGoogle Gemini Chat Model

Workflow-voorvertoning

👇 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

Hoe het werkt

  1. 1

    Trigger

    De workflow start met een trigger-trigger.

  2. 2

    Verwerking

    Gegevens stromen door 4 knooppunten, connecting chattrigger, code, lmchatgooglegemini.

  3. 3

    Uitvoer

    De workflow voltooit zijn automatisering en levert het resultaat aan de geconfigureerde bestemming.

Knooppuntdetails (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

Hoe deze workflow te importeren

  1. 1Klik op de knop JSON downloaden rechts om het workflowbestand op te slaan.
  2. 2Open uw n8n-instantie. Ga naar Workflows → Nieuw → Importeren uit bestand.
  3. 3Selecteer het gedownloade bestand build-custom-ai-agent-with-langchain-gemini-self-hosted en klik op Importeren.
  4. 4Stel inloggegevens in voor elk serviceknooppunt (API-sleutels, OAuth, enz.).
  5. 5Klik op Workflow testen om te controleren of alles werkt, activeer het vervolgens.

Of plak rechtstreeks in n8n → Importeren uit JSON:

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

Integraties

chattriggercodelmchatgooglegeminimemorybufferwindow

Haal deze workflow op

Download en importeer met één klik

JSON downloadenBekijken op n8n.io
Knooppunten4
Complexiteitlow
Triggertrigger
Weergaven4,410
CategorieMiscellaneous

Gemaakt door

shepard

shepard

@shepard

Tags

chattriggercodelmchatgooglegeminimemorybufferwindow

Nieuw bij n8n?

n8n is een gratis open-source workflow-automatiseringstool. Host het zelf of gebruik de cloudversie.

n8n gratis ophalen →

Related Miscellaneous Workflows