Build Custom AI Agent with LangChain & Gemini (Self-Hosted) — Flujo de trabajo n8n

Baja complejidad Disparador4 nodos🏷️ Miscellaneous👁 4,410 vistaspor shepard

Descripción general

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

Nodos utilizados

LangChain CodeSimple MemoryGoogle Gemini Chat Model

Vista previa del flujo de trabajo

👇 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

Cómo funciona

  1. 1

    Disparador

    El flujo de trabajo comienza con un disparador disparador.

  2. 2

    Procesamiento

    Los datos fluyen a través de 4 nodos, connecting chattrigger, code, lmchatgooglegemini.

  3. 3

    Salida

    El flujo de trabajo completa su automatización y entrega el resultado al destino configurado.

Detalles de nodos (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

Cómo importar este flujo de trabajo

  1. 1Haz clic en el botón Descargar JSON a la derecha para guardar el archivo del flujo de trabajo.
  2. 2Abre tu instancia de n8n. Ve a Flujos de trabajo → Nuevo → Importar desde archivo.
  3. 3Selecciona el archivo build-custom-ai-agent-with-langchain-gemini-self-hosted descargado y haz clic en Importar.
  4. 4Configura las credenciales para cada nodo de servicio (claves API, OAuth, etc.).
  5. 5Haz clic en Probar flujo de trabajo para verificar que todo funcione, luego actívalo.

O pega directamente en n8n → Importar desde JSON:

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

Integraciones

chattriggercodelmchatgooglegeminimemorybufferwindow

Obtener este flujo de trabajo

Descarga e importa con un solo clic

Descargar JSONVer en n8n.io
Nodos4
Complejidadlow
Disparadortrigger
Vistas4,410
CategoríaMiscellaneous

Creado por

shepard

shepard

@shepard

Etiquetas

chattriggercodelmchatgooglegeminimemorybufferwindow

¿Nuevo en n8n?

n8n es una herramienta de automatización de flujos de trabajo gratuita y de código abierto. Alójala tú mismo o usa la versión en la nube.

Obtener n8n gratis →

Related Miscellaneous Workflows