From cb66b31286fb990c35b5c2ca8129c91011241e6d Mon Sep 17 00:00:00 2001 From: Lance Martin Date: Thu, 28 Mar 2024 12:03:52 -0700 Subject: [PATCH] Finalize ntbk --- examples/rag/adaptive_rag.ipynb | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/rag/adaptive_rag.ipynb b/examples/rag/adaptive_rag.ipynb index 2d89fa88d..d39df157d 100644 --- a/examples/rag/adaptive_rag.ipynb +++ b/examples/rag/adaptive_rag.ipynb @@ -243,7 +243,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "The design of generative agents combines LLM with memory, planning, and reflection mechanisms to enable agents to behave conditioned on past experience and interact with other agents. Memory stream is a long-term memory module that records agents' experiences in natural language. The retrieval model surfaces context to inform the agent's behavior based on relevance, recency, and importance.\n" + "The agent's memory module is a long-term memory database that records the agent's experiences in natural language. It includes observations and events provided by the agent, which can trigger new natural language statements. The memory module is used in conjunction with other mechanisms like planning, reflection, and retrieval to inform the agent's behavior.\n" ] } ], @@ -406,7 +406,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 10, "id": "01d829bb-1074-4976-b650-ead41dcb9788", "metadata": {}, "outputs": [], @@ -414,7 +414,7 @@ "### Search\n", "\n", "from langchain_community.tools.tavily_search import TavilySearchResults\n", - "web_search_tool = TavilySearchResults()" + "web_search_tool = TavilySearchResults(k=3)" ] }, { @@ -431,7 +431,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 11, "id": "e723fcdb-06e6-402d-912e-899795b78408", "metadata": {}, "outputs": [], @@ -463,7 +463,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 12, "id": "b76b5ec3-0720-443d-85b1-c0e79659ca0a", "metadata": {}, "outputs": [], @@ -668,12 +668,12 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 13, "id": "67854e07-9293-4c3c-bf9a-bc9a605570ee", "metadata": {}, "outputs": [], "source": [ - "import pprint\n", + "from pprint import pprint\n", "\n", "from langgraph.graph import END, StateGraph\n", "\n", @@ -756,13 +756,13 @@ "for output in app.stream(inputs):\n", " for key, value in output.items():\n", " # Node\n", - " pprint.pprint(f\"Node '{key}':\")\n", + " pprint(f\"Node '{key}':\")\n", " # Optional: print full state at each node\n", " # pprint.pprint(value[\"keys\"], indent=2, width=80, depth=None)\n", - " pprint.pprint(\"\\n---\\n\")\n", + " pprint(\"\\n---\\n\")\n", "\n", "# Final generation\n", - "pprint.pprint(value[\"generation\"])" + "pprint(value[\"generation\"])" ] }, { @@ -824,13 +824,13 @@ "for output in app.stream(inputs):\n", " for key, value in output.items():\n", " # Node\n", - " pprint.pprint(f\"Node '{key}':\")\n", + " pprint(f\"Node '{key}':\")\n", " # Optional: print full state at each node\n", " # pprint.pprint(value[\"keys\"], indent=2, width=80, depth=None)\n", - " pprint.pprint(\"\\n---\\n\")\n", + " pprint(\"\\n---\\n\")\n", "\n", "# Final generation\n", - "pprint.pprint(value [\"generation\"])" + "pprint(value [\"generation\"])" ] }, {