Skip to main content

LangChain

Bundles contain custom components that support specific third-party integrations with Langflow.

This page describes the components that are available in the LangChain bundle.

CSV Agent

This component is based on the Agent core component.

This component creates a CSV agent from a CSV file and LLM. For more information, see the LangChain CSV agent documentation.

CSV Agent parameters

NameTypeDescription
llmLanguageModelInput parameter. The language model to use for the agent.
pathFileInput parameter. The path to the CSV file.
agent_typeStringInput parameter. The type of agent to create.
agentAgentExecutorOutput parameter. The CSV agent instance.

OpenAI Tools Agent

This component is based on the Agent core component.

This component creates an OpenAI Tools Agent. For more information, see the LangChain OpenAI agent documentation.

OpenAI Tools Agent parameters

NameTypeDescription
llmLanguageModelInput parameter. The language model to use.
toolsList of ToolsInput parameter. The tools to give the agent access to.
system_promptStringInput parameter. The system prompt to provide context to the agent.
input_valueStringInput parameter. The user's input to the agent.
memoryMemoryInput parameter. The memory for the agent to use for context persistence.
max_iterationsIntegerInput parameter. The maximum number of iterations to allow the agent to execute.
verboseBooleanInput parameter. This determines whether to print out the agent's intermediate steps.
handle_parsing_errorsBooleanInput parameter. This determines whether to handle parsing errors in the agent.
agentAgentExecutorOutput parameter. The OpenAI Tools agent instance.
outputStringOutput parameter. The output from executing the agent on the input.

OpenAPI Agent

This component is based on the Agent core component.

This component creates an agent for interacting with OpenAPI services. For more information, see the LangChain OpenAPI toolkit documentation.

OpenAPI Agent parameters

NameTypeDescription
llmLanguageModelInput parameter. The language model to use.
openapi_specStringInput parameter. The OpenAPI specification for the service.
base_urlStringInput parameter. The base URL for the API.
headersDictInput parameter. The optional headers for API requests.
agent_executor_kwargsDictInput parameter. The optional parameters for the agent executor.
agentAgentExecutorOutput parameter.The OpenAPI agent instance.

Prompt Hub

This component fetches prompts from the LangChain Hub.

Like the Prompt Template core component, additional fields are added to the component for each variable in the prompt. For example, the default prompt efriis/my-first-prompt adds fields for profession and question.

Prompt Hub parameters

NameDisplay NameDescription
langchain_api_keyYour LangChain API KeyInput parameter. The LangChain API Key to use.
langchain_hub_promptLangChain Hub PromptInput parameter. The LangChain Hub prompt to use.
promptBuild PromptOutput parameter. The built prompt message returned by the build_prompt method.

SQL Agent

This component is based on the Agent core component.

This component creates an agent for interacting with SQL databases. For more information, see the LangChain SQL agent documentation.

SQL Agent parameters

NameTypeDescription
llmLanguageModelInput parameter. The language model to use.
databaseDatabaseInput parameter. The SQL database connection.
top_kIntegerInput parameter. The number of results to return from a SELECT query.
use_toolsBooleanInput parameter. This determines whether to use tools for query execution.
return_intermediate_stepsBooleanInput parameter. This determines whether to return the agent's intermediate steps.
max_iterationsIntegerInput parameter. The maximum number of iterations to run the agent.
max_execution_timeIntegerInput parameter. The maximum execution time in seconds.
early_stopping_methodStringInput parameter. The method to use for early stopping.
verboseBooleanInput parameter. This determines whether to print the agent's thoughts.
agentAgentExecutorOutput parameter. The SQL agent instance.

SQL Database

The LangChain SQL Database component establishes a connection to an SQL database.

This component is different from the SQL Database core component, which executes SQL queries on SQLAlchemy-compatible databases.

Text Splitters

The LangChain bundle includes the following text splitter components:

  • Character Text Splitter
  • Language Recursive Text Splitter
  • Natural Language Text Splitter
  • Recursive Character Text Splitter
  • Semantic Text Splitter

Tool Calling Agent

This component is based on the Agent core component.

This component creates an agent for structured tool calling with various language models. For more information, see the LangChain tool calling documentation.

Tool Calling Agent parameters

NameTypeDescription
llmLanguageModelInput parameter. The language model to use.
toolsList[Tool]Input parameter. The list of tools available to the agent.
system_messageStringInput parameter. The system message to use for the agent.
return_intermediate_stepsBooleanInput parameter. This determines whether to return the agent's intermediate steps.
max_iterationsIntegerInput parameter. The maximum number of iterations to run the agent.
max_execution_timeIntegerInput parameter. The maximum execution time in seconds.
early_stopping_methodStringInput parameter. The method to use for early stopping.
verboseBooleanInput parameter. This determines whether to print the agent's thoughts.
agentAgentExecutorOutput parameter. The tool calling agent instance.

XML Agent

This component is based on the Agent core component.

This component creates an XML Agent using LangChain. The agent uses XML formatting for tool instructions to the LLM. For more information, see the LangChain XML Agent documentation.

XML Agent parameters

NameTypeDescription
llmLanguageModelInput parameter. The language model to use for the agent.
user_promptStringInput parameter. The custom prompt template for the agent with XML formatting instructions.
toolsList[Tool]Input parameter. The list of tools available to the agent.
agentAgentExecutorOutput parameter. The XML Agent instance.

Other LangChain components

Other components in the LangChain bundle include the following:

  • Fake Embeddings
  • HTML Link Extractor
  • Runnable Executor
  • Spider Web Crawler & Scraper

Legacy LangChain components

The following LangChain components are considered legacy. You can still use these components in your flows, but they are no longer maintained and they can be removed in future releases.

  • Conversation Chain
  • LLM Checker Chain
  • LLM Math Chain
  • Natural Language to SQL
  • Retrieval QA
  • Self Query Retriever
JSON Agent

This component creates a JSON agent from a JSON or YAML file and an LLM.

It accepts the following parameters:

NameTypeDescription
llmLanguageModelInput parameter. The language model to use for the agent.
pathFileInput parameter. The path to the JSON or YAML file.
agentAgentExecutorOutput parameter. The JSON agent instance.
Vector Store Info/Agent

This component creates a Vector Store Agent using LangChain.

It accepts the following parameters:

NameTypeDescription
llmLanguageModelInput parameter. The language model to use for the agent.
vectorstoreVectorStoreInfoInput parameter. The vector store information for the agent to use.
agentAgentExecutorOutput parameter. The Vector Store Agent instance.
VectorStoreRouterAgent

This component creates a Vector Store Router Agent using LangChain.

It accepts the following parameters:

NameTypeDescription
llmLanguageModelInput parameter. The language model to use for the agent.
vectorstoresList[VectorStoreInfo]Input parameter. The list of vector store information for the agent to route between.
agentAgentExecutorOutput parameter. The Vector Store Router Agent instance.
Search