2022-11-22 14:16:26 +00:00
|
|
|
# Agents
|
|
|
|
|
2022-11-23 05:04:26 +00:00
|
|
|
Agents use an LLM to determine which actions to take and in what order.
|
2023-02-27 22:40:43 +00:00
|
|
|
An action can either be using a tool and observing its output, or returning a response to the user.
|
2022-12-19 02:51:23 +00:00
|
|
|
For a list of easily loadable tools, see [here](tools.md).
|
2022-11-23 02:02:20 +00:00
|
|
|
Here are the agents available in LangChain.
|
2022-11-22 14:16:26 +00:00
|
|
|
|
Docs refactor (#480)
Big docs refactor! Motivation is to make it easier for people to find
resources they are looking for. To accomplish this, there are now three
main sections:
- Getting Started: steps for getting started, walking through most core
functionality
- Modules: these are different modules of functionality that langchain
provides. Each part here has a "getting started", "how to", "key
concepts" and "reference" section (except in a few select cases where it
didnt easily fit).
- Use Cases: this is to separate use cases (like summarization, question
answering, evaluation, etc) from the modules, and provide a different
entry point to the code base.
There is also a full reference section, as well as extra resources
(glossary, gallery, etc)
Co-authored-by: Shreya Rajpal <ShreyaR@users.noreply.github.com>
2023-01-02 16:24:09 +00:00
|
|
|
For a tutorial on how to load agents, see [here](getting_started.ipynb).
|
2022-11-22 14:16:26 +00:00
|
|
|
|
Docs refactor (#480)
Big docs refactor! Motivation is to make it easier for people to find
resources they are looking for. To accomplish this, there are now three
main sections:
- Getting Started: steps for getting started, walking through most core
functionality
- Modules: these are different modules of functionality that langchain
provides. Each part here has a "getting started", "how to", "key
concepts" and "reference" section (except in a few select cases where it
didnt easily fit).
- Use Cases: this is to separate use cases (like summarization, question
answering, evaluation, etc) from the modules, and provide a different
entry point to the code base.
There is also a full reference section, as well as extra resources
(glossary, gallery, etc)
Co-authored-by: Shreya Rajpal <ShreyaR@users.noreply.github.com>
2023-01-02 16:24:09 +00:00
|
|
|
## `zero-shot-react-description`
|
2022-11-22 14:16:26 +00:00
|
|
|
|
|
|
|
This agent uses the ReAct framework to determine which tool to use
|
|
|
|
based solely on the tool's description. Any number of tools can be provided.
|
|
|
|
This agent requires that a description is provided for each tool.
|
|
|
|
|
Docs refactor (#480)
Big docs refactor! Motivation is to make it easier for people to find
resources they are looking for. To accomplish this, there are now three
main sections:
- Getting Started: steps for getting started, walking through most core
functionality
- Modules: these are different modules of functionality that langchain
provides. Each part here has a "getting started", "how to", "key
concepts" and "reference" section (except in a few select cases where it
didnt easily fit).
- Use Cases: this is to separate use cases (like summarization, question
answering, evaluation, etc) from the modules, and provide a different
entry point to the code base.
There is also a full reference section, as well as extra resources
(glossary, gallery, etc)
Co-authored-by: Shreya Rajpal <ShreyaR@users.noreply.github.com>
2023-01-02 16:24:09 +00:00
|
|
|
## `react-docstore`
|
2022-11-22 14:16:26 +00:00
|
|
|
|
|
|
|
This agent uses the ReAct framework to interact with a docstore. Two tools must
|
|
|
|
be provided: a `Search` tool and a `Lookup` tool (they must be named exactly as so).
|
|
|
|
The `Search` tool should search for a document, while the `Lookup` tool should lookup
|
|
|
|
a term in the most recently found document.
|
|
|
|
This agent is equivalent to the
|
|
|
|
original [ReAct paper](https://arxiv.org/pdf/2210.03629.pdf), specifically the Wikipedia example.
|
|
|
|
|
Docs refactor (#480)
Big docs refactor! Motivation is to make it easier for people to find
resources they are looking for. To accomplish this, there are now three
main sections:
- Getting Started: steps for getting started, walking through most core
functionality
- Modules: these are different modules of functionality that langchain
provides. Each part here has a "getting started", "how to", "key
concepts" and "reference" section (except in a few select cases where it
didnt easily fit).
- Use Cases: this is to separate use cases (like summarization, question
answering, evaluation, etc) from the modules, and provide a different
entry point to the code base.
There is also a full reference section, as well as extra resources
(glossary, gallery, etc)
Co-authored-by: Shreya Rajpal <ShreyaR@users.noreply.github.com>
2023-01-02 16:24:09 +00:00
|
|
|
## `self-ask-with-search`
|
2022-11-22 14:16:26 +00:00
|
|
|
|
|
|
|
This agent utilizes a single tool that should be named `Intermediate Answer`.
|
|
|
|
This tool should be able to lookup factual answers to questions. This agent
|
|
|
|
is equivalent to the original [self ask with search paper](https://ofir.io/self-ask.pdf),
|
|
|
|
where a Google search API was provided as the tool.
|
2023-01-06 15:25:55 +00:00
|
|
|
|
|
|
|
### `conversational-react-description`
|
|
|
|
|
|
|
|
This agent is designed to be used in conversational settings.
|
|
|
|
The prompt is designed to make the agent helpful and conversational.
|
|
|
|
It uses the ReAct framework to decide which tool to use, and uses memory to remember the previous conversation interactions.
|