Agent Types
This categorizes all the available agents along a few dimensions.
Intended Model Type
Whether this agent is intended for Chat Models (takes in messages, outputs message) or LLMs (takes in string, outputs string). The main thing this affects is the prompting strategy used. You can use an agent with a different type of model than it is intended for, but it likely won't produce results of the same quality.
Supports Chat History
Whether or not these agent types support chat history. If it does, that means it can be used as a chatbot. If it does not, then that means it's more suited for single tasks. Supporting chat history generally requires better models, so earlier agent types aimed at worse models may not support it.
Supports Multi-Input Tools
Whether or not these agent types support tools with multiple inputs. If a tool only requires a single input, it is generally easier for an LLM to know how to invoke it. Therefore, several earlier agent types aimed at worse models may not support them.
Supports Parallel Function Calling
Having an LLM call multiple tools at the same time can greatly speed up agents whether there are tasks that are assisted by doing so. However, it is much more challenging for LLMs to do this, so some agent types do not support this.
Required Model Params
Whether this agent requires the model to support any additional parameters. Some agent types take advantage of things like OpenAI function calling, which require other model parameters. If none are required, then that means that everything is done via prompting
When to Use
Our commentary on when you should consider using this agent type.
Agent Type | Intended Model Type | Supports Chat History | Supports Multi-Input Tools | Supports Parallel Function Calling | Required Model Params | When to Use | API |
---|---|---|---|---|---|---|---|
Tool Calling | Chat | ✅ | ✅ | ✅ | tools | If you are using a tool-calling model | Ref |
OpenAI Tools | Chat | ✅ | ✅ | ✅ | tools | [Legacy] If you are using a recent OpenAI model (1106 onwards). Generic Tool Calling agent recommended instead. | Ref |
OpenAI Functions | Chat | ✅ | ✅ | functions | [Legacy] If you are using an OpenAI model, or an open-source model that has been finetuned for function calling and exposes the same functions parameters as OpenAI. Generic Tool Calling agent recommended instead | Ref | |
XML | LLM | ✅ | If you are using Anthropic models, or other models good at XML | Ref | |||
Structured Chat | Chat | ✅ | ✅ | If you need to support tools with multiple inputs | Ref | ||
JSON Chat | Chat | ✅ | If you are using a model good at JSON | Ref | |||
ReAct | LLM | ✅ | If you are using a simple model | Ref | |||
Self Ask With Search | LLM | If you are using a simple model and only have one search tool | Ref |