change memory_bank to vector_db in notebook

This commit is contained in:
Kai Wu 2025-01-23 19:07:45 -08:00
parent 9351a4b2d7
commit 1ed0885037

View file

@ -79,6 +79,9 @@
},
"collapsed": true,
"id": "J2kGed0R5PSf",
"jupyter": {
"outputs_hidden": true
},
"outputId": "2478ea60-8d35-48a1-b011-f233831740c5"
},
"outputs": [
@ -226,6 +229,9 @@
},
"collapsed": true,
"id": "HaepEZXCDgif",
"jupyter": {
"outputs_hidden": true
},
"outputId": "9314f698-593d-4c1a-ea15-15c735dc1023"
},
"outputs": [
@ -703,6 +709,9 @@
},
"collapsed": true,
"id": "E1UFuJC570Tk",
"jupyter": {
"outputs_hidden": true
},
"outputId": "aebb69d4-c167-4de5-eb8a-dd19dd538f63"
},
"outputs": [
@ -1158,6 +1167,9 @@
},
"collapsed": true,
"id": "ruO9jQna_t_S",
"jupyter": {
"outputs_hidden": true
},
"outputId": "ab1722a7-62ab-43bb-9cab-4e45bf62068a"
},
"outputs": [
@ -1744,7 +1756,7 @@
"\n",
"Agents are characterized by having access to\n",
"\n",
"1. Memory - for RAG\n",
"1. VectorDB - for RAG\n",
"2. Tool calling - ability to call tools like search and code execution\n",
"3. Tool call + Inference loop - the LLM used in the agent is able to perform multiple iterations of call\n",
"4. Shields - for safety calls that are executed everytime the agent interacts with external systems, including user prompts"
@ -1951,7 +1963,7 @@
"\n",
"In this example, we will index some documentation and ask questions about that documentation.\n",
"\n",
"The tool we use is the memory tool. Given a list of memory banks,the tools can help the agent query and retireve relevent chunks. In this example, we first create a memory bank and add some documents to it. Then configure the agent to use the memory tool. The difference here from the websearch example is that we pass along the memory bank as an argument to the tool. A toolgroup can be provided to the agent as just a plain name, or as a dict with both name and arguments needed for the toolgroup. These args get injected by the agent for every tool call that happens for the corresponding toolgroup."
"The tool we use is the `rag_tool`. Given a list of `vector_db`,the tools can help the agent query and retireve relevent chunks. In this example, we first create a `vector_db` and add some documents to it. Then configure the agent to use the `rag_tool`. The difference here from the websearch example is that we pass along the `vector_db_ids` as an argument to the tool. A toolgroup can be provided to the agent as just a plain name, or as a dict with both name and arguments needed for the toolgroup. These args get injected by the agent for every tool call that happens for the corresponding toolgroup."
]
},
{
@ -2162,6 +2174,9 @@
},
"collapsed": true,
"id": "GvVRuhO-GOov",
"jupyter": {
"outputs_hidden": true
},
"outputId": "39395e26-bb7d-4616-d51d-036c8bf41427"
},
"outputs": [
@ -2391,7 +2406,8 @@
"Requirement already satisfied: ptyprocess~=0.7.0 in /usr/local/lib/python3.11/dist-packages (from colab-xterm) (0.7.0)\n",
"Requirement already satisfied: tornado>5.1 in /usr/local/lib/python3.11/dist-packages (from colab-xterm) (6.3.3)\n",
"Downloading colab_xterm-0.2.0-py3-none-any.whl (115 kB)\n",
"\u001b[?25l \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m0.0/115.6 kB\u001b[0m \u001b[31m?\u001b[0m eta \u001b[36m-:--:--\u001b[0m\r\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m115.6/115.6 kB\u001b[0m \u001b[31m4.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25l \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m0.0/115.6 kB\u001b[0m \u001b[31m?\u001b[0m eta \u001b[36m-:--:--\u001b[0m\r",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m115.6/115.6 kB\u001b[0m \u001b[31m4.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hInstalling collected packages: colab-xterm\n",
"Successfully installed colab-xterm-0.2.0\n"
]
@ -2764,7 +2780,19 @@
},
{
"data": {
"application/javascript": "\n (async () => {\n const url = new URL(await google.colab.kernel.proxyPort(10000, {'cache': true}));\n const iframe = document.createElement('iframe');\n iframe.src = url;\n iframe.setAttribute('width', '100%');\n iframe.setAttribute('height', '800');\n iframe.setAttribute('frameborder', 0);\n document.body.appendChild(iframe);\n })();\n ",
"application/javascript": [
"\n",
" (async () => {\n",
" const url = new URL(await google.colab.kernel.proxyPort(10000, {'cache': true}));\n",
" const iframe = document.createElement('iframe');\n",
" iframe.src = url;\n",
" iframe.setAttribute('width', '100%');\n",
" iframe.setAttribute('height', '800');\n",
" iframe.setAttribute('frameborder', 0);\n",
" document.body.appendChild(iframe);\n",
" })();\n",
" "
],
"text/plain": [
"<IPython.core.display.Javascript object>"
]
@ -3830,7 +3858,8 @@
"provenance": []
},
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
@ -3843,7 +3872,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.15"
"version": "3.10.16"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {