ES | EN
AI

Custom LangChain agent written in JavaScript

AI AgentOpenAI ChatGPTTool Code
Nodes 4
Complexity Intermediate
Category AI
n8n popularity 13,815 views in n8n library

This workflow has multiple functionalities. It starts with a manual trigger, "When clicking 'Execute Workflow'", that activates two separate paths. The first path takes a preset string "Tell me a joke" and processes it through a custom Language Learning Model (LLM) chain node. This node interacts with an OpenAI node for query processing. The second path takes another preset string "What year was Einstein born?" and passes it to an "Agent" node. This agent further interacts with a Chat OpenAI node and a custom Wikipedia node to produce the required information. The workflow uses both built-in and custom nodes, and integrates with OpenAI for both paths. It's built for experimenting with language models, specifically in the context of conversational agents and information retrieval. Note that to use this template, you need to be on n8n version 1.19.4 or later.

Apps and nodes included

Step-by-Step Implementation Guide

Agente LangChain en JS

Procesa strings con LLMs personalizadas usando OpenAI y Wikipedia.

Nodos Utilizados

  • Agent: Para interactuar con OpenAI y Wikipedia.
  • Code: Para la manipulación de datos y personalización.
  • LM Chat OpenAI: Para la generación de texto.
  • Tool Code: Para ejecutar código y ampliar la funcionalidad del agente.

Pasos de Configuración

  • Paso 1: Configura las credenciales de OpenAI.
  • Paso 2: Define la lógica de los dos caminos (LLM personalizado y Agente).
  • Paso 3: Personaliza los prompts y la interacción con los nodos.
⚡ Open and edit in Scriflow ← Browse all n8n templates

Scriflow builds and adapts n8n workflows with AI. Open this template in the editor to get the import-ready JSON.