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

Legacy components are longer supported and can be removed in a future release. You can continue to use them in existing flows, but it is recommended that you replace them with supported components as soon as possible. Suggested replacements are included in the Legacy banner on components in your flows. They are also given in release notes and Langflow documentation whenever possible.

If you aren't sure how to replace a legacy component, Search for components by provider, service, or component name. The component may have been deprecated in favor of a completely new component, a similar component, or a new version of the same component in a different category.

If there is no obvious replacement, consider whether another component can be adapted to your use case. For example, many Core components provide generic functionality that can support multiple providers and use cases, such as the API Request component.

If neither of these options are viable, you could use the legacy component's code to create your own custom component, or start a discussion about the legacy component.

To discourage use of legacy components in new flows, these components are hidden by default. In the visual editor, you can click Component settings to toggle the Legacy filter.

The following LangChain components are in legacy status:

  • Conversation Chain
  • LLM Checker Chain
  • LLM Math Chain
  • Natural Language to SQL
  • Retrieval QA
  • Self Query Retriever
  • JSON Agent
  • Vector Store Info/Agent
  • VectorStoreRouterAgent

To replace these components, consider other components in the LangChain bundle or general Langflow components, such as the Agent component or the SQL Database component.

Search