Skip to content

Why Archytas over LangChain

David-Andrew Samson edited this page Apr 26, 2023 · 15 revisions

Why Archytas over LangChain

Langchain's ReAct process does not work reliably with GPT-4

langchain defaults to GPT-3 (Davinci), but GPT-3 has limited planning capacity and frequently fails to accomplish mildly complex tasks. GPT-4 is much more capable, and quite necessary to have a chance at doing most of the things that are useful but complex

langchain supports the GPT-3.5/GPT-4 chat-style API interface, but the prompting is not good enough. Frequently both to get the llm output to conform to the langchain interface

Archytas has better tool ergonomics

Tools created in langchain must be a function that take a single string as input, and then return a single string as output. If the tool wants to use a different type or have multiple inputs, it must explicitly handle parsing the input string into the desired shape. And same for any output which must be manually converted to a string format so the LLM can understand it. Additionally, it is up to the tool developer to explain to the LLM any expectations for the input so that it can be parsed accordingly. This is pretty ad-hoc if you're doing anything more complex than string in, string out.

Archytas has a consistent interface for all tools it presents to the LLM: JSON values. Tools can take any number of arguments, that may be any valid python-equivalent of JSON blob objects.

Archytas can automatically parse the LLM string input into the correct types for any valid tool

Archytas can automatically handle tools with inputs that are any python-equivalent of json types:

  • dict
  • list
  • int/float
  • bool
  • str
  • None

Additionally Archytas can automatically handle multi-argument functions that use any of these types (as well as zero-argument functions).

Archytas can handle Class tools/toolsets, i.e. tools that maintain some sort of internal state.

Archytas generates better prompts

(in langchain, when making a tool, you had to explain in detail how your tool worked so the llm could use it. but it wasn't really obvious how to explain the precise format that inputs/outputs should take.)(archytas has a very clear paradigm that is responses are parsed as json, tool input arguments are extracted from fields in the json. prompt for this is generated automatically assuming the tool is type annotated and has a matching docstring)

Archytas is simpler+easier to peek inside

Clone this wiki locally