Langchain js agents list Skip to main content Newer LangChain version out! Custom LLM Agent. For a full list of packages available, see the LangChain Python docs and LangChain JS docs. The agents use LangGraph. Together: Together AI offers an API to query [50+ WebLLM: Only available in web environments. LLMにツールを与え、課題解決してもらうAgent。 つい1年くらい前はツールへのインプットが不正だったり、コンテキスト長が足りなかったり、レスポンスが遅かったりしたものですが、モデルの能力向上たるや目覚ましく、いまや安定して、なおかつ日本語でも素早い回答ができるよう langchain: Chains, agents, and retrieval strategies that make up an application's cognitive architecture. This agent works by taking in Documentation for LangChain. ToolType. Welcome to "Awesome LagnChain Agents" repository! This repository is dedicated to showcasing the most amazing, innovative, and intriguing LangChain Agents from all over the world. For more information about how to thing about these components, see our conceptual guide. LangChain. Format a list of AgentSteps into a list of BaseMessage instances for agents that use OpenAI's API. Notice that beside the list of tools, the only thing we need to pass in is a language model to use. Crucially, the Agent does not execute those actions - that is done by the AgentExecutor (next step). Explore the comprehensive list of Langchain agents, their functionalities, and use cases for enhanced automation. Streaming with agents is made more complicated by the fact that it’s not just tokens that you will want to stream, but you may also want to stream back the intermediate steps an agent takes. js for building custom agents. tsx and action. A big use case for LangChain is creating agents. This repository contains a series of agents intended to be used with the Agent Chat UI (repo). LangChain document loaders to load content from files. What is LangChain? A. js Stream all output from a runnable, as reported to the callback system. It extends the Agent class and provides additional functionality specific to the OpenAIAgent type. They use preconfigured helper functions to minimize boilerplate, but you can replace them with custom graphs as Apr 22, 2024 · はじめに. Preparing search index The search index is not available; LangChain. Jan 24, 2025 · つまり、MCPクライアントとその MCPサーバーへのアクセスをひっくるめて隠蔽し、LangChainが扱える Tool(Pythonの場合はList[BaseTool]、TypeScriptの場合はStructuredTool[])に変換します(通常1つの MCPサーバーは複数の機能を提供しているので、それぞれを個別のツール Feb 13, 2024 · Plan-and-Execute Agents. Identify and implement the best prompting strategies . Installation Install the LangGraph library and the OpenAI integration for Python and JS (we use the OpenAI integration for the code snippets below). This script implements a generative agent based on the paper Generative Agents: Interactive Simulacra of Human Behavior by Park, et. First, a list of all LCEL chain constructors. Agents: Build an agent that interacts with external tools. Different agents have different prompting styles for reasoning, different ways of encoding inputs, and different ways of parsing the output. Retrieves the schema for three tables; 3. LangGraph docs on common agent architectures; Pre-built agents in LangGraph; Legacy agent concept: AgentExecutor LangChain previously introduced the AgentExecutor as a runtime for agents. The first is we're defining our list of tools (in this case we're only using a single tool) and pulling in our prompt from the LangChain prompt hub. LangSmith Many of the applications you build with LangChain will contain multiple steps with multiple invocations of LLM calls. js MCP adapters to integrate MCP tools with LangChain. Class representing an agent for the OpenAI chat model in LangChain. js 16, you will need to follow the instructions in this section. This notebook goes through how to create your own custom LLM agent. Accelerate agent development: Quickly create agent UXs with configurable templates and LangGraph Studio for visualizing and debugging agent interactions. Customer Support. Agents: Build an agent with LangGraph. Input to this tool is a comma-separated list of tables, output is the schema and sample rows for those tables. The model, complete with stop tokens if needed (in our case, needed). It uses LangChain’s ToolCall interface to support a wider range of provider implementations, such as Anthropic, Google Gemini, and Mistral in addition to OpenAI. 37. We do not guarantee that these instructions will continue to work in the future. Important LangChain primitives like LLMs, parsers, prompts, retrievers, and agents implement the LangChain Runnable Interface. js fits perfectly with LangChain. 1. PubMed: PubMed® comprises more than 35 million citations for biomedical liter Python REPL When constructing your own agent, you will need to provide it with a list of Tools that it can use. js - v0. Creates a JSON agent using a language model, a JSON toolkit, and optional prompt arguments. To improve your LLM application development, pair LangChain with: LangSmith - Helpful for agent evals and observability. Stream all output from a runnable, as reported to the callback system. It seamlessly integrates with LangChain and LangGraph. Plan and execute agents promise faster, cheaper, and more performant task execution over previous agent designs. The results of those actions can then be fed back into the agent and it determine whether more actions are needed, or whether it is okay to finish. For a list of agent types and which ones work with more complicated inputs, please see this documentation. js. Prolog: LangChain tools that use Prolog rules to generate answers. LCEL Chains Below is a table of all LCEL chain constructors. Class that represents a toolkit for working with SQL databases. Deploy seamlessly: We handle the complexity of deploying your agent. Start the LangGraph server: You should see output similar to: Welcome to. Generative Agents. Agent for the MRKL chain. js LangGraph. If the text contains a JSON response, it returns the tool, toolInput, and log. Agents make decisions about which Actions to take, then take that Action, observe the result, and repeat until the task is complete. ts files in this direct Feb 11, 2024 · Interface. Intended Model Type. Please see list of Oct 29, 2024 · Q1. Streaming: LangChain streaming APIs for surfacing results as they are generated. list-tables-sql: Input is an empty string, output is a comma-separated list of tables in the database. While LangChain includes some prebuilt tools, it can often be more useful to use tools that use custom logic. Inherited from BaseSingleActionAgent. Concepts There are several key concepts to understand when building agents: Agents, AgentExecutor, Tools, Toolkits. js : LangGraph powers production-grade agents, trusted by Linkedin, Uber, Klarna, GitLab, and many more. Other agents are often optimized for using tools to figure out the best response, which is not ideal in a conversational setting where you may want the agent to be able to chat with the user as well. In an effort to make it as easy as possible to create custom chains, we've implemented a "Runnable" protocol that most components implement. Jan 23, 2024 · JS; In this example, multiple agents are connected, but compared to above they do NOT share a shared scratchpad. LangGraph. js documentation is currently hosted on a separate site. Learn how to build 3 types of planning agents in LangGraph in this post. These agents possess the flexibility to be configured with distinct behaviors and data sources, enabling them to undergo training for diverse language-related tasks. Here we focus on how to move from legacy LangChain agents to more flexible LangGraph agents. MCP adapters provides a simple loadMcpTools function that wraps the MCP tools and makes them compatible with Documentation for LangChain. It provides a set of optional methods that can be overridden in derived classes to handle various events during the execution of a LangChain application. It then creates a ZeroShotAgent with the prompt and the JSON tools, and returns an AgentExecutor for executing the agent with the tools. Interface defining the input for creating an agent. Runnable interface: The base abstraction that many LangChain components and the LangChain Expression Language are built on. This example goes over how to use LangChain to interact with an Ollama-run Llama 2 7b instance. query-checker Mar 3, 2025 · The combination of LangChain tools and agents opens up a world of possibilities for various industries. Agent Constructor Here, we will use the high level createOpenaiToolsAgent API to construct the agent. Arguments to create the prompt with. This is suitable for complex or long-running tasks that require maintaining long-term objectives and focus. It includes the LLMChain instance, an optional output parser, and an optional list of allowed tools. This naturally runs into the context window limitations. This covers basics like initializing an agent, creating tools, and adding memory. The agent is then able to use the result of the final query to generate an answer to the original question. Gets the agent's summary, which includes the agent's name, age, traits, and a summary of the agent's core characteristics. Oct 31, 2023 · Learn about the essential components of LangChain — agents, models, chunks, chains — and how to harness the power of LangChain in JavaScript. Second, a list of all legacy Chains. js supports the Zhipu AI family of models. Class langchain: Chains, agents, and retrieval strategies that make up an application's cognitive architecture. LangGraph Platform includes robust APIs for memory, threads, and cron jobs plus auto-scaling task queues & servers. js, making it easy to integrate with other AI tools and libraries. LangChain Expression Language (LCEL): A syntax for orchestrating LangChain components. It initializes SQL tools based on the provided SQL database. The main thing this affects is the prompting strategy used. Returns the default output parser for the ChatConversationalAgent class. If the text contains the final answer action or does not contain an action, it returns an AgentFinish with the output and log. List of tools the agent will have access to, used to format the prompt. Sep 18, 2024 · These features make LangGraph. Setup Most models that support tool calling can be used in this agent. js that interacts with external tools. Langchain Agents List Overview. This does not have access to any tools, or generative UI components. A class that extends the AgentActionOutputParser to parse the output of the ChatAgent in LangChain. For this example, let’s try out the OpenAI tools agent, which makes use of the new OpenAI tool-calling API (this is only available in the latest OpenAI models, and differs from function-calling in that This guide covers how to do routing in the LangChain Expression Language. , lists, datetime, enum, etc). Class representing a plan-and-execute agent executor. The summary is updated periodically through LangChain Libraries: The Python and JavaScript libraries. Name of tool to use to terminate the chain. Other Resources The output parser documentation includes various parser examples for specific types (e. js supports the Tencent Hunyuan family of models. By utilizing context-aware agents, businesses can provide exceptional customer support. As these applications get more and more complex, it becomes crucial to be able to inspect what exactly is going on inside your chain or agent. Contains interfaces and integrations for a myriad of components, a basic run time for combining these components into chains and agents, and off-the-shelf implementations of chains and agents. Here are a few examples of how LangChain can be applied: 1. Routing allows you to create non-deterministic chains where the output of a previous step defines the next step. Within the LangChain framework, an agent is characterized as an entity proficient in comprehending and generating text. LangSmith LangSmith allows you to closely trace, monitor and evaluate your LLM application. Here is a simple example of an agent which uses LCEL, a web search tool (Tavily) and a structured output parser to create an OpenAI functions agent that returns source chunks. This agent decides on the full sequence of actions upfront, then executes them all without updating the plan. LangSmith documentation is hosted on a separate site. Unlike in question-answering, you can't just do some semantic search hacks to only select the chunks of text most relevant to the question (because, in this case, there is no particular question - you want to summarize everything). Langchain Agents Explained Explore the functionality and architecture of Langchain agents, enhancing your understanding of this powerful tool. It also contains examples of inputs and outputs for the agent to learn from. If the agent's scratchpad is not empty, it prepends a message indicating that the agent has not seen any Apr 1, 2025 · Now that we have our MCP clients set up, we can use the LangChain. Rather, they have their own independent scratchpads, and then their final responses are appended to a global scratchpad. 利用 LangChain 框架创建的 Agent 在数据获取和响应优化上都支持“工具”的配置。请看下面的示例代码。 Head to the Guidelines page to see a list of opinionated guidelines on how to get the best performance for extraction use cases. Feb 7, 2025 · また、LangChainには詳細なAPIリファレンスがあり、LangChain JavaScriptパッケージのすべてのクラスとメソッドの完全な Jan 5, 2024 · Agents. and architectures so that your LLMs perform as intended. For more detailed information on configuration, see the Trace With LangChain guide. How to stream structured output to the client. ) as a constructor argument, eg. js : Build robust and stateful multi-actor applications with LLMs by modeling steps as edges and nodes in a graph. js Documentation for LangChain. The verbose argument is available on most objects throughout the API (Chains, Models, Tools, Agents, etc. Documentation for LangChain. Refer to the how-to guides for more detail on using all LangChain components. Note that the agent executes multiple queries until it has the information it needs: 1. Conversational. langchain: Chains, agents, and retrieval strategies that make up an application's cognitive architecture. g. Agents are systems that use an LLM as a reasoning engine to determine which actions to take and what the inputs to those actions should be. Chatbots: Build a chatbot that incorporates memory. You will have to make fetch available globally, either: LangChain comes with a number of built-in agents that are optimized for different use cases. An LLM agent consists of three parts: PromptTemplate: This is the prompt template that can be used to instruct the language model on what to do LangChain provides integrations for over 25 different embedding methods, as well as for over 50 different vector stores LangChain is essentially a library of abstractions for Python and Javascript, representing common steps and conceptsLaunched by Harrison Chase in October 2022, LangChain enjoyed a meteoric rise to prominence: as of June 2023 List of tools the agent will have access to, used to format the prompt. The agent is responsible for taking in input and deciding what actions to take. List available tables; 2. LangChain is a framework designed for building applications that integrate Large Language Models (LLMs) with various external tools and APIs, enabling developers to create intelligent agents capable of performing complex tasks. Verbose mode . It seamlessly integrates with LangChain and LangGraph, and you can use it to inspect and debug individual steps of your chains and agents as you build. js how-to guides here. Includes an LLM, tools, and prompt. This guide will walk you through how we stream agent data to the client using React Server Components inside this directory. LangChain comes with a number of built-in agents that are optimized for different use cases. Defined in langchain/src/agents/mrkl/index. The best way to do this is with LangSmith. Class that represents an agent that uses XML tags. Agents are systems that take a high-level task and use an LLM as a reasoning engine to decide what actions to take and execute those actions. After that, we're passing our LLM, tools and prompt to the createToolCallingAgent function, which will construct and return a runnable agent. This includes all inner runs of LLMs, Retrievers, Tools, etc. Parses the output text from the MRKL chain into an agent action or agent finish. Read about all the available agent types here. This notebook shows how to use agents to interact with the Polygon IO PowerBI Toolkit: This notebook showcases an agent interacting with a Power BI Dataset. Summarization. Class responsible for calling a language model and deciding an action. . Debug poor-performing LLM app runs 🤖 Agents: Agents allow an LLM autonomy over how a task is accomplished. js, and you can use it to inspect and debug individual steps of your chains as you build. If the agent's scratchpad is not empty, it prepends a message indicating that the agent has not seen any previous work. Feb 27, 2023 · 🤖 Agents: Agents allow an LLM autonomy over how a task is accomplished. The prompt in the LLMChain must include a variable called "agent_scratchpad" where the agent can put its intermediary work. stream(): a default implementation of streaming that streams the final output from the chain. In it, we leverage a time-weighted Memory object backed by a LangChain retriever. You can peruse LangGraph. LangGraph is an extension of LangChain specifically aimed at creating highly controllable and customizable agents. Importantly, the name, description, and schema (if used) are all used in the prompt. For a complete list of supported models and model variants, see the Ollama model library . About LangGraph 🤖 Agents: Agents allow an LLM autonomy over how a task is accomplished. LangChain agents (the AgentExecutor in particular) have multiple configuration parameters. Abstract base class for creating callback handlers in the LangChain framework. tip You can also access Google's gemini family of models via the LangChain VertexAI and VertexAI-web integrations. Use new agent creation methods. In addition, we report on: Chain Constructor The constructor function for this chain. For a full list of built-in agents see agent types. Agent Types There are many different types of agents to use. The @langchain/mcp-adapters package provides a simple way to load MCP tools and use them with LangChain agents. new LLMChain({ verbose: true }), and it is equivalent to passing a ConsoleCallbackHandler to the callbacks argument of that object and all child objects. Most of them use Vercel's AI SDK to stream tokens to the client and display the incoming messages. Orchestration Get started using LangGraph to assemble LangChain components into full-featured applications. You can peruse LangSmith how-to guides here, but we'll highlight a few sections that are particularly relevant to LangChain below: Evaluation Constructs the agent's scratchpad from a list of steps. Many agents will only work with tools that have a single string input. Queries multiple of the tables via a join operation. You can also build custom agents, should you need further control. js an ideal choice for developing sophisticated AI agents that can maintain context and handle complex interactions. Agent Inputs The inputs to an agent are an object. The from_texts method accepts a list Unsupported: Node. 1. This is driven by an LLMChain. To ensure the prompt we create contains the appropriate instructions and input variables, we'll create a helper function which takes in a list of input variables, and returns the final formatted prompt. The following are some prompts, and corresponding graph IDs you can use to test the agents: What can you do? - Will list all of the tools/actions it has available. This example shows how to load and use an agent with a SQL toolkit. createPrompt ([new SerpAPI (), new Calculator ()], {prefix: `Answer the following questions as best you can, but speaking as a pirate might speak. Be sure that the tables actually exist by calling list-tables-sql first! Example Input: “table1, table2, table3”. al. Layerup Documentation for LangChain. These are all methods that return LCEL runnables. langgraph : Orchestration framework for combining LangChain components into production-ready applications with persistence, streaming, and other key features. For more details, see our Installation guide. ZhipuAI: LangChain. In this notebook we will show how those parameters map to the LangGraph react agent executor using the create_react_agent prebuilt helper method. Many of the applications you build with LangChain will contain multiple steps with multiple invocations of LLM calls. See this list for the most up-to-date information. langchain-community : Third-party integrations that are community maintained. js supports integration with Gradient AI. A common use case is wanting to summarize long documents. This guide will walk you through some ways you can create custom tools. Constructs the agent's scratchpad from a list of steps. js supports calling JigsawStack Prompt Engine LLMs. This agent works by taking in Runnable interface: The base abstraction that many LangChain components and the LangChain Expression Language are built on. While the LangChain framework can be used standalone, it also integrates seamlessly with any LangChain product, giving developers a full suite of tools when building LLM applications. List of input variables the final prompt will expect. Remarks. Check out Gradien HuggingFaceInference: Here's an example of calling a HugggingFaceInference model as an LLM: IBM watsonx. What are the multiple independent agents? In this case, the independent agents are a LangChain agent. My goal is to support the LangChain community by giving these fantastic Now, we can initalize the agent with the LLM, the prompt, and the tools. This walkthrough demonstrates how to use an agent optimized for conversation. This is a standard interface with a few different methods, which make it easy to define custom chains as well as making it possible to invoke them in a standard way. Output is streamed as Log objects, which include a list of jsonpatch ops that describe how the state of the run has changed in each step, and the final state of the run. To install LangChain run: bash npm2yarn npm i langchain @langchain/core. It extends the BaseChain class, which is a generic sequence of calls to components, including other chains. The from_documents method accepts a list of LangChain’s Document class objects, which can be created using LangChain’s CharacterTextSplitter class. This is a plain chat agent, which simply passes the conversation to an LLM and generates a text response. Plans the next action or finish state of the agent based on the provided steps, inputs, and optional callback manager. langchain-anthropic; langchain-azure-openai; langchain-cloudflare; Nov 29, 2023 · 通过给这些 Agent 设置特定行为和数据源,就可以训练他们执行各种与语言相关的任务,从而使他们具备为更多的应用提供服务的能力。 创建 LangChain 的 Agent. Streaming. This interface provides two general approaches to stream content:. Whether this agent is intended for Chat Models (takes in messages, outputs message) or LLMs (takes in string, outputs string). May 2, 2023 · We are also introducing a new agent class that works well with these new types of tools. The simpler the input to a tool is, the easier it is for an LLM to be able to use it. LangGraph provides control for custom agent and multi-agent workflows, seamless human-in-the-loop interactions, and native streaming support for enhanced agent reliability and execution. Dec 3, 2023 · JS版LangChain是功能丰富的JavaScript框架,支持创建语言分析模型和Agents,提升文本处理效率。开发者可集成AI应用至Web,示例展示了Agent、模型、Embeddings等技术应用,支持多种模型与AI服务。 The first is we're defining our list of tools (in this case we're only using a single tool) and pulling in our prompt from the LangChain prompt hub. prefix?: string Documentation for LangChain. Under the hood, this agent is using the OpenAI tool-calling capabilities, so we need to use a ChatOpenAI model. Important Links: Tools list; New agent; Way back in November 2022 when we first launched LangChain, agent and tool utilization played a central role in our design. Optional args: ZeroShotCreatePromptArgs. The from_documents and from_texts methods of LangChain’s PineconeVectorStore class add records to a Pinecone index and return a PineconeVectorStore object. Params required to create the agent. Below, this is the default XML agent prompt, which includes variables for the tool list and user question. js 16, but if you still want to run LangChain on Node. . And, of course, LangGraph. Curated list of agents built on LangChain. js supports calling YandexGPT chat models. We also link to the API documentation. For an in depth explanation, please check out this conceptual guide. ai: This will help you get started with IBM [text completion models: JigsawStack Prompt Engine: LangChain. xAI: xAI is an artificial intelligence company that develops: YandexGPT: LangChain. Streaming is an important UX consideration for LLM apps, and agents are no exception. This is a very important step, because without the agent_scratchpad the agent will have no context on the previous actions it has taken. LangChain provides a standard interface for agents, along with LangGraph. It checks if the output text contains the final answer action or a JSON response, and parses it accordingly. This page contains two lists. js, LangChain's framework for building agentic workflows. js 16 We do not support Node. Implementation of a generative agent that can learn and form new memories over time. You can access Google’s gemini and gemini-vision models, as well as other generative models in LangChain through ChatGoogleGenerativeAI class in the @langchain/google-genai integration package. The code in this doc is taken from the page. While it served as an excellent starting point, its limitations became apparent when dealing with more sophisticated and customized agents. Most useful for simpler applications. This categorizes all the available agents along a few dimensions. ts:25; Optional prefix. Example const agent = new ZeroShotAgent ({llmChain: new LLMChain ({llm: new ChatOpenAI ({ temperature: 0}), prompt: ZeroShotAgent. For this example, let’s try out the OpenAI tools agent, which makes use of the new OpenAI tool-calling API (this is only available in the latest OpenAI models, and differs from function-calling in that List of tools the agent will have access to, used to format the prompt. Agent Types. It creates a prompt for the agent using the JSON tools and the provided prefix and suffix. jzvrkpqpijerskagjbnlssherxovucbdbgsxknecvxey