diff --git a/examples/lats/img/lats.png b/examples/lats/img/lats.png new file mode 100644 index 000000000..79e96a304 Binary files /dev/null and b/examples/lats/img/lats.png differ diff --git a/examples/lats/lats.ipynb b/examples/lats/lats.ipynb index 00519b368..54f42b86d 100644 --- a/examples/lats/lats.ipynb +++ b/examples/lats/lats.ipynb @@ -9,11 +9,14 @@ "\n", "[Language Agent Tree Search](https://andyz245.github.io/LanguageAgentTreeSearch/) (LATS), by Zhou, et. al, is a general LLM agent frameowrk that combines reflection/evaluation and search (specifically monte-carlo trees search) to get achieve better overall task performance compared to similar techniques like ReACT, Reflexion, or Tree of Thoughts.\n", "\n", + "![LATS diagram](./img/lats.png)\n", + "\n", "It has four main steps:\n", - "1. Expand and simulate: select the \"best\" 5 potential actions to take and execute them in parallel.\n", - "2. Reflect + Evaluate: observe the outcomes of these actions and score the decisions based on reflection (and possibly external feedback)\n", - "3. Backpropagate: update the scores of the root trajectories based on the outcomes.\n", - "4. Select: pick the best next actions based on the aggreate rewards from step (2). Either respond (if a solution is found or the max search depth is reached) or continue searching." + "\n", + "1. Select: pick the best next actions based on the aggreate rewards from step (2). Either respond (if a solution is found or the max search depth is reached) or continue searching.\n", + "2. Expand and simulate: select the \"best\" 5 potential actions to take and execute them in parallel.\n", + "3. Reflect + Evaluate: observe the outcomes of these actions and score the decisions based on reflection (and possibly external feedback)\n", + "4. Backpropagate: update the scores of the root trajectories based on the outcomes." ] }, { @@ -285,6 +288,7 @@ "source": [ "from langchain_community.tools.tavily_search import TavilySearchResults\n", "from langchain_community.utilities.tavily_search import TavilySearchAPIWrapper\n", + "\n", "from langgraph.prebuilt.tool_executor import ToolExecutor, ToolInvocation\n", "\n", "search = TavilySearchAPIWrapper()\n",