Skip to main content

Agent components in Langflow

Agent components define the behavior and capabilities of AI agents in your flow.

Agents use LLMs as a reasoning engine to decide which of the connected tool components to use to solve a problem.

Tools in agentic functions are, essentially, functions that the agent can call to perform tasks or access external resources. A function is wrapped as a Tool object, with a common interface the agent understands. Agents become aware of tools through tool registration, where the agent is provided a list of available tools, typically at agent initialization. The Tool object's description tells the agent what the tool can do.

The agent then uses a connected LLM to reason through the problem to decide which tool is best for the job.

Use an agent in a flow​

The simple agent starter project uses an agent component connected to URL and Calculator tools to answer a user's questions. The OpenAI LLM acts as a brain for the agent to decide which tool to use. Tools are connected to agent components at the Tools port.

Simple agent starter flow

For a multi-agent example, see Create a problem-solving agent.

Agent component​

This component creates an agent that can use tools to answer questions and perform tasks based on given instructions.

The component includes an LLM model integration, a system message prompt, and a Tools port to connect tools to extend its capabilities.

For more information on this component, see the tool calling agent documentation.

Inputs​

NameTypeDescription
agent_llmDropdownThe provider of the language model that the agent will use to generate responses.
system_promptStringInitial instructions and context provided to guide the agent's behavior.
toolsListList of tools available for the agent to use.
input_valueStringThe input task or question for the agent to process.
add_current_date_toolBooleanIf true, adds a tool to the agent that returns the current date.

Outputs​

NameTypeDescription
responseMessageThe agent's response to the given input task.

CSV Agent​

This component creates a CSV agent from a CSV file and LLM.

Inputs​

NameTypeDescription
llmLanguageModelLanguage model to use for the agent
pathFilePath to the CSV file
agent_typeStringType of agent to create (zero-shot-react-description, openai-functions, or openai-tools)

Outputs​

NameTypeDescription
agentAgentExecutorCSV agent instance

CrewAI Agent​

This component represents an Agent of CrewAI, allowing for the creation of specialized AI agents with defined roles, goals, and capabilities within a crew.

For more information, see the CrewAI documentation.

Inputs​

NameDisplay NameInfo
roleRoleThe role of the agent
goalGoalThe objective of the agent
backstoryBackstoryThe backstory of the agent
toolsToolsTools at agent's disposal
llmLanguage ModelLanguage model that will run the agent
memoryMemoryWhether the agent should have memory or not
verboseVerboseEnables verbose output
allow_delegationAllow DelegationWhether the agent is allowed to delegate tasks to other agents
allow_code_executionAllow Code ExecutionWhether the agent is allowed to execute code
kwargskwargsAdditional keyword arguments for the agent

Outputs​

NameDisplay NameInfo
outputAgentThe constructed CrewAI Agent object

Hierarchical Crew​

This component represents a group of agents, managing how they should collaborate and the tasks they should perform in a hierarchical structure. This component allows for the creation of a crew with a manager overseeing the task execution.

For more information, see the CrewAI documentation.

Inputs​

NameDisplay NameInfo
agentsAgentsList of Agent objects representing the crew members
tasksTasksList of HierarchicalTask objects representing the tasks to be executed
manager_llmManager LLMLanguage model for the manager agent (optional)
manager_agentManager AgentSpecific agent to act as the manager (optional)
verboseVerboseEnables verbose output for detailed logging
memoryMemorySpecifies the memory configuration for the crew
use_cacheUse CacheEnables caching of results
max_rpmMax RPMSets the maximum requests per minute
share_crewShare CrewDetermines if the crew information is shared among agents
function_calling_llmFunction Calling LLMSpecifies the language model for function calling

Outputs​

NameDisplay NameInfo
crewCrewThe constructed Crew object with hierarchical task execution

JSON Agent​

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

Inputs​

NameTypeDescription
llmLanguageModelLanguage model to use for the agent
pathFilePath to the JSON or YAML file

Outputs​

NameTypeDescription
agentAgentExecutorJSON agent instance

OpenAI Tools Agent​

This component creates an OpenAI Tools Agent using LangChain.

For more information, see the LangChain documentation.

Inputs​

NameTypeDescription
llmLanguageModelLanguage model to use for the agent (must be tool-enabled)
system_promptStringSystem prompt for the agent
user_promptStringUser prompt template (must contain 'input' key)
chat_historyList[Data]Optional chat history for the agent
toolsList[Tool]List of tools available to the agent

Outputs​

NameTypeDescription
agentAgentExecutorOpenAI Tools Agent instance

OpenAPI Agent​

This component creates an OpenAPI Agent to interact with APIs defined by OpenAPI specifications.

For more information, see the LangChain documentation on OpenAPI Agents.

Inputs​

NameTypeDescription
llmLanguageModelLanguage model to use for the agent
pathFilePath to the OpenAPI specification file (JSON or YAML)
allow_dangerous_requestsBooleanWhether to allow potentially dangerous API requests

Outputs​

NameTypeDescription
agentAgentExecutorOpenAPI Agent instance

SQL Agent​

This component creates a SQL Agent to interact with SQL databases.

Inputs​

NameTypeDescription
llmLanguageModelLanguage model to use for the agent
database_uriStringURI of the SQL database to connect to
extra_toolsList[Tool]Additional tools to provide to the agent (optional)

Outputs​

NameTypeDescription
agentAgentExecutorSQL Agent instance

Sequential Crew​

This component represents a group of agents with tasks that are executed sequentially. This component allows for the creation of a crew that performs tasks in a specific order.

For more information, see the CrewAI documentation.

Inputs​

NameDisplay NameInfo
tasksTasksList of SequentialTask objects representing the tasks to be executed
verboseVerboseEnables verbose output for detailed logging
memoryMemorySpecifies the memory configuration for the crew
use_cacheUse CacheEnables caching of results
max_rpmMax RPMSets the maximum requests per minute
share_crewShare CrewDetermines if the crew information is shared among agents
function_calling_llmFunction Calling LLMSpecifies the language model for function calling

Outputs​

NameDisplay NameInfo
crewCrewThe constructed Crew object with sequential task execution

Sequential task agent​

This component creates a CrewAI Task and its associated Agent, allowing for the definition of sequential tasks with specific agent roles and capabilities.

For more information, see the CrewAI documentation.

Inputs​

NameDisplay NameInfo
roleRoleThe role of the agent
goalGoalThe objective of the agent
backstoryBackstoryThe backstory of the agent
toolsToolsTools at agent's disposal
llmLanguage ModelLanguage model that will run the agent
memoryMemoryWhether the agent should have memory or not
verboseVerboseEnables verbose output
allow_delegationAllow DelegationWhether the agent is allowed to delegate tasks to other agents
allow_code_executionAllow Code ExecutionWhether the agent is allowed to execute code
agent_kwargsAgent kwargsAdditional kwargs for the agent
task_descriptionTask DescriptionDescriptive text detailing task's purpose and execution
expected_outputExpected Task OutputClear definition of expected task outcome
async_executionAsync ExecutionBoolean flag indicating asynchronous task execution
previous_taskPrevious TaskThe previous task in the sequence (for chaining)

Outputs​

NameDisplay NameInfo
task_outputSequential TaskList of SequentialTask objects representing the created task(s)

Tool Calling Agent​

This component creates a Tool Calling Agent using LangChain.

Inputs​

NameTypeDescription
llmLanguageModelLanguage model to use for the agent
system_promptStringSystem prompt for the agent
user_promptStringUser prompt template (must contain 'input' key)
chat_historyList[Data]Optional chat history for the agent
toolsList[Tool]List of tools available to the agent

Outputs​

NameTypeDescription
agentAgentExecutorTool Calling Agent instance

Vector Store Agent​

This component creates a Vector Store Agent using LangChain.

Inputs​

NameTypeDescription
llmLanguageModelLanguage model to use for the agent
vectorstoreVectorStoreInfoVector store information for the agent to use

Outputs​

NameTypeDescription
agentAgentExecutorVector Store Agent instance

Vector Store Router Agent​

This component creates a Vector Store Router Agent using LangChain.

Inputs​

NameTypeDescription
llmLanguageModelLanguage model to use for the agent
vectorstoresList[VectorStoreInfo]List of vector store information for the agent to route between

Outputs​

NameTypeDescription
agentAgentExecutorVector Store Router Agent instance

XML Agent​

This component creates an XML Agent using LangChain.

The agent uses XML formatting for tool instructions to the Language Model.

Inputs​

NameTypeDescription
llmLanguageModelLanguage model to use for the agent
user_promptStringCustom prompt template for the agent (includes XML formatting instructions)
toolsList[Tool]List of tools available to the agent

Outputs​

NameTypeDescription
agentAgentExecutorXML Agent instance

Hi, how can I help you?