diff --git a/404.html b/404.html index 8c5bac4ca9..6eb819fabd 100644 --- a/404.html +++ b/404.html @@ -10,7 +10,7 @@ - +
diff --git a/Components/components-memories.html b/Components/components-memories.html index 1765938a43..1a7f2da9c8 100644 --- a/Components/components-memories.html +++ b/Components/components-memories.html @@ -10,7 +10,7 @@ - + diff --git a/Components/components-tools.html b/Components/components-tools.html index 683440196a..98858c9921 100644 --- a/Components/components-tools.html +++ b/Components/components-tools.html @@ -10,7 +10,7 @@ - + diff --git a/Configuration/configuration-custom-database.html b/Configuration/configuration-custom-database.html index 179d97348c..9377acf4f2 100644 --- a/Configuration/configuration-custom-database.html +++ b/Configuration/configuration-custom-database.html @@ -10,7 +10,7 @@ - + diff --git a/agents-overview.html b/agents-overview.html index 242b0205f9..2d17ee36f1 100644 --- a/agents-overview.html +++ b/agents-overview.html @@ -10,7 +10,7 @@ - + diff --git a/agents-tool-calling-agent-component.html b/agents-tool-calling-agent-component.html index 5256c8575f..11310d4629 100644 --- a/agents-tool-calling-agent-component.html +++ b/agents-tool-calling-agent-component.html @@ -10,7 +10,7 @@ - + diff --git a/api.html b/api.html index 4bb6628c03..6cc81f2201 100644 --- a/api.html +++ b/api.html @@ -10,7 +10,7 @@ - + diff --git a/api/add-user.html b/api/add-user.html index 24a6e12a3a..20bd77575d 100644 --- a/api/add-user.html +++ b/api/add-user.html @@ -10,7 +10,7 @@ - + diff --git a/api/auto-login.html b/api/auto-login.html index f866923ee1..1d07539791 100644 --- a/api/auto-login.html +++ b/api/auto-login.html @@ -10,7 +10,7 @@ - + diff --git a/api/build-flow.html b/api/build-flow.html index 38a3dcdb15..31ce31bbfe 100644 --- a/api/build-flow.html +++ b/api/build-flow.html @@ -10,7 +10,7 @@ - + diff --git a/api/build-vertex-stream.html b/api/build-vertex-stream.html index 847e61a655..d86a4c5370 100644 --- a/api/build-vertex-stream.html +++ b/api/build-vertex-stream.html @@ -10,7 +10,7 @@ - + diff --git a/api/build-vertex.html b/api/build-vertex.html index ea389a5013..6ada64b357 100644 --- a/api/build-vertex.html +++ b/api/build-vertex.html @@ -10,7 +10,7 @@ - + diff --git a/api/check-if-store-has-api-key.html b/api/check-if-store-has-api-key.html index b373f3accf..6f14d51177 100644 --- a/api/check-if-store-has-api-key.html +++ b/api/check-if-store-has-api-key.html @@ -10,7 +10,7 @@ - + diff --git a/api/check-if-store-is-enabled.html b/api/check-if-store-is-enabled.html index 9a12258a61..5bd2ff9ecf 100644 --- a/api/check-if-store-is-enabled.html +++ b/api/check-if-store-is-enabled.html @@ -10,7 +10,7 @@ - + diff --git a/api/create-api-key-route.html b/api/create-api-key-route.html index a637a1c76e..6093b73c3e 100644 --- a/api/create-api-key-route.html +++ b/api/create-api-key-route.html @@ -10,7 +10,7 @@ - + diff --git a/api/create-flow.html b/api/create-flow.html index b2dc095c3c..86328b5729 100644 --- a/api/create-flow.html +++ b/api/create-flow.html @@ -10,7 +10,7 @@ - + diff --git a/api/create-flows.html b/api/create-flows.html index efde4d7529..192e59d86e 100644 --- a/api/create-flows.html +++ b/api/create-flows.html @@ -10,7 +10,7 @@ - + diff --git a/api/create-folder.html b/api/create-folder.html index 57889922b4..fb585efaf8 100644 --- a/api/create-folder.html +++ b/api/create-folder.html @@ -10,7 +10,7 @@ - + diff --git a/api/create-upload-file.html b/api/create-upload-file.html index 1512b2636e..b16ac64c2c 100644 --- a/api/create-upload-file.html +++ b/api/create-upload-file.html @@ -10,7 +10,7 @@ - + diff --git a/api/create-variable.html b/api/create-variable.html index 7cd0a8346d..1bef394b05 100644 --- a/api/create-variable.html +++ b/api/create-variable.html @@ -10,7 +10,7 @@ - + diff --git a/api/custom-component-update.html b/api/custom-component-update.html index e69b8f36d1..b8b5e12c02 100644 --- a/api/custom-component-update.html +++ b/api/custom-component-update.html @@ -10,7 +10,7 @@ - + diff --git a/api/custom-component.html b/api/custom-component.html index 4d5f8fd94a..e1702fe937 100644 --- a/api/custom-component.html +++ b/api/custom-component.html @@ -10,7 +10,7 @@ - + diff --git a/api/delete-api-key-route.html b/api/delete-api-key-route.html index a0cf457f63..754bef9e21 100644 --- a/api/delete-api-key-route.html +++ b/api/delete-api-key-route.html @@ -10,7 +10,7 @@ - + diff --git a/api/delete-file.html b/api/delete-file.html index f37d6a6c84..73195d9ded 100644 --- a/api/delete-file.html +++ b/api/delete-file.html @@ -10,7 +10,7 @@ - + diff --git a/api/delete-flow.html b/api/delete-flow.html index 58079fa420..dbf7d6166a 100644 --- a/api/delete-flow.html +++ b/api/delete-flow.html @@ -10,7 +10,7 @@ - + diff --git a/api/delete-folder.html b/api/delete-folder.html index 32e43e3e3c..8c8a48ad15 100644 --- a/api/delete-folder.html +++ b/api/delete-folder.html @@ -10,7 +10,7 @@ - + diff --git a/api/delete-messages-session.html b/api/delete-messages-session.html index 2307d94b86..d5bdc2a088 100644 --- a/api/delete-messages-session.html +++ b/api/delete-messages-session.html @@ -10,7 +10,7 @@ - + diff --git a/api/delete-messages.html b/api/delete-messages.html index 25ed653cb7..9c3e4628b4 100644 --- a/api/delete-messages.html +++ b/api/delete-messages.html @@ -10,7 +10,7 @@ - + diff --git a/api/delete-multiple-flows.html b/api/delete-multiple-flows.html index 07c114fbb1..dbe71962d0 100644 --- a/api/delete-multiple-flows.html +++ b/api/delete-multiple-flows.html @@ -10,7 +10,7 @@ - + diff --git a/api/delete-user.html b/api/delete-user.html index 8a776c1d6b..bc7052b2be 100644 --- a/api/delete-user.html +++ b/api/delete-user.html @@ -10,7 +10,7 @@ - + diff --git a/api/delete-variable.html b/api/delete-variable.html index 0c38c7dc24..316fd1d995 100644 --- a/api/delete-variable.html +++ b/api/delete-variable.html @@ -10,7 +10,7 @@ - + diff --git a/api/delete-vertex-builds.html b/api/delete-vertex-builds.html index 2798a78e91..23668bbb19 100644 --- a/api/delete-vertex-builds.html +++ b/api/delete-vertex-builds.html @@ -10,7 +10,7 @@ - + diff --git a/api/download-component.html b/api/download-component.html index d7e38ff7b4..77bc01403e 100644 --- a/api/download-component.html +++ b/api/download-component.html @@ -10,7 +10,7 @@ - + diff --git a/api/download-file-1.html b/api/download-file-1.html index f425c1992f..15b1dbe666 100644 --- a/api/download-file-1.html +++ b/api/download-file-1.html @@ -10,7 +10,7 @@ - + diff --git a/api/download-file.html b/api/download-file.html index e5294f372e..91215a6937 100644 --- a/api/download-file.html +++ b/api/download-file.html @@ -10,7 +10,7 @@ - + diff --git a/api/download-image.html b/api/download-image.html index 7fa55fff49..4444ccab95 100644 --- a/api/download-image.html +++ b/api/download-image.html @@ -10,7 +10,7 @@ - + diff --git a/api/download-multiple-file.html b/api/download-multiple-file.html index 173877bb45..7f3b8630c8 100644 --- a/api/download-multiple-file.html +++ b/api/download-multiple-file.html @@ -10,7 +10,7 @@ - + diff --git a/api/download-profile-picture.html b/api/download-profile-picture.html index 7691d355ed..eb58e26a91 100644 --- a/api/download-profile-picture.html +++ b/api/download-profile-picture.html @@ -10,7 +10,7 @@ - + diff --git a/api/experimental-run-flow.html b/api/experimental-run-flow.html index 8f96dfcf32..2a0b8770ce 100644 --- a/api/experimental-run-flow.html +++ b/api/experimental-run-flow.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-all.html b/api/get-all.html index b5e2fff4ae..d742b8a7d6 100644 --- a/api/get-all.html +++ b/api/get-all.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-api-keys-route.html b/api/get-api-keys-route.html index 898b70b28e..0e5bd420ce 100644 --- a/api/get-api-keys-route.html +++ b/api/get-api-keys-route.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-components.html b/api/get-components.html index dd99b98116..d6b4443d7c 100644 --- a/api/get-components.html +++ b/api/get-components.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-config.html b/api/get-config.html index d25f81c9f7..9b3156ec78 100644 --- a/api/get-config.html +++ b/api/get-config.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-list-of-components-liked-by-user.html b/api/get-list-of-components-liked-by-user.html index a2d8f90b3a..4736316012 100644 --- a/api/get-list-of-components-liked-by-user.html +++ b/api/get-list-of-components-liked-by-user.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-messages.html b/api/get-messages.html index 9caf376eb7..398e633439 100644 --- a/api/get-messages.html +++ b/api/get-messages.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-starter-projects.html b/api/get-starter-projects.html index 2e47adab00..394a59caba 100644 --- a/api/get-starter-projects.html +++ b/api/get-starter-projects.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-tags.html b/api/get-tags.html index 726944efe2..9c72fc7165 100644 --- a/api/get-tags.html +++ b/api/get-tags.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-task-status.html b/api/get-task-status.html index 8691019209..3992cb6d16 100644 --- a/api/get-task-status.html +++ b/api/get-task-status.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-transactions.html b/api/get-transactions.html index bcbfd5b8ef..a992ca4a93 100644 --- a/api/get-transactions.html +++ b/api/get-transactions.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-version.html b/api/get-version.html index 2da99f9629..d38582f1f4 100644 --- a/api/get-version.html +++ b/api/get-version.html @@ -10,7 +10,7 @@ - + diff --git a/api/get-vertex-builds.html b/api/get-vertex-builds.html index 6eaad52aa5..2392d1bd51 100644 --- a/api/get-vertex-builds.html +++ b/api/get-vertex-builds.html @@ -10,7 +10,7 @@ - + diff --git a/api/health-check.html b/api/health-check.html index a74fe04b6a..c25ad7e128 100644 --- a/api/health-check.html +++ b/api/health-check.html @@ -10,7 +10,7 @@ - + diff --git a/api/health.html b/api/health.html index c46202db72..0395d401d9 100644 --- a/api/health.html +++ b/api/health.html @@ -10,7 +10,7 @@ - + diff --git a/api/like-component.html b/api/like-component.html index 3795575189..829bc1f8af 100644 --- a/api/like-component.html +++ b/api/like-component.html @@ -10,7 +10,7 @@ - + diff --git a/api/list-files.html b/api/list-files.html index afb61bebfb..26d2743ac4 100644 --- a/api/list-files.html +++ b/api/list-files.html @@ -10,7 +10,7 @@ - + diff --git a/api/list-profile-pictures.html b/api/list-profile-pictures.html index 1135f6d48f..3ae907dfe9 100644 --- a/api/list-profile-pictures.html +++ b/api/list-profile-pictures.html @@ -10,7 +10,7 @@ - + diff --git a/api/login-to-get-access-token.html b/api/login-to-get-access-token.html index e1e1081e85..fb3e89891d 100644 --- a/api/login-to-get-access-token.html +++ b/api/login-to-get-access-token.html @@ -10,7 +10,7 @@ - + diff --git a/api/logout.html b/api/logout.html index de01ec4bb4..4c6dea1f4e 100644 --- a/api/logout.html +++ b/api/logout.html @@ -10,7 +10,7 @@ - + diff --git a/api/logs.html b/api/logs.html index 0891054417..e54f5a0b1c 100644 --- a/api/logs.html +++ b/api/logs.html @@ -10,7 +10,7 @@ - + diff --git a/api/patch-user.html b/api/patch-user.html index 329e1dba56..6a32fc21ef 100644 --- a/api/patch-user.html +++ b/api/patch-user.html @@ -10,7 +10,7 @@ - + diff --git a/api/post-validate-code.html b/api/post-validate-code.html index 32cff2885e..16a07c929a 100644 --- a/api/post-validate-code.html +++ b/api/post-validate-code.html @@ -10,7 +10,7 @@ - + diff --git a/api/post-validate-prompt.html b/api/post-validate-prompt.html index ed9c05952c..91dc8dbd79 100644 --- a/api/post-validate-prompt.html +++ b/api/post-validate-prompt.html @@ -10,7 +10,7 @@ - + diff --git a/api/process-1.html b/api/process-1.html index 49b11ad66c..2cd26aacd0 100644 --- a/api/process-1.html +++ b/api/process-1.html @@ -10,7 +10,7 @@ - + diff --git a/api/process.html b/api/process.html index 0e395202d8..b76ba12e0b 100644 --- a/api/process.html +++ b/api/process.html @@ -10,7 +10,7 @@ - + diff --git a/api/read-all-users.html b/api/read-all-users.html index 328194db31..29f1ab18dd 100644 --- a/api/read-all-users.html +++ b/api/read-all-users.html @@ -10,7 +10,7 @@ - + diff --git a/api/read-basic-examples.html b/api/read-basic-examples.html index 8c10f258b8..a1beeb6e39 100644 --- a/api/read-basic-examples.html +++ b/api/read-basic-examples.html @@ -10,7 +10,7 @@ - + diff --git a/api/read-current-user.html b/api/read-current-user.html index 13dc081a05..bab9a6932e 100644 --- a/api/read-current-user.html +++ b/api/read-current-user.html @@ -10,7 +10,7 @@ - + diff --git a/api/read-flow.html b/api/read-flow.html index 7430752a59..98be0861d4 100644 --- a/api/read-flow.html +++ b/api/read-flow.html @@ -10,7 +10,7 @@ - + diff --git a/api/read-flows.html b/api/read-flows.html index 73e08ffdc4..5adbf33109 100644 --- a/api/read-flows.html +++ b/api/read-flows.html @@ -10,7 +10,7 @@ - + diff --git a/api/read-folder.html b/api/read-folder.html index 2e69e4bde0..8421e9319a 100644 --- a/api/read-folder.html +++ b/api/read-folder.html @@ -10,7 +10,7 @@ - + diff --git a/api/read-folders.html b/api/read-folders.html index ac90518107..f7aba20db7 100644 --- a/api/read-folders.html +++ b/api/read-folders.html @@ -10,7 +10,7 @@ - + diff --git a/api/read-variables.html b/api/read-variables.html index 556361bd36..1f90d7e005 100644 --- a/api/read-variables.html +++ b/api/read-variables.html @@ -10,7 +10,7 @@ - + diff --git a/api/refresh-token.html b/api/refresh-token.html index 1ed2fc78fc..95a585e648 100644 --- a/api/refresh-token.html +++ b/api/refresh-token.html @@ -10,7 +10,7 @@ - + diff --git a/api/reset-password.html b/api/reset-password.html index f7dc5021a4..ae04792747 100644 --- a/api/reset-password.html +++ b/api/reset-password.html @@ -10,7 +10,7 @@ - + diff --git a/api/retrieve-vertices-order.html b/api/retrieve-vertices-order.html index 4e7c435333..6317338efe 100644 --- a/api/retrieve-vertices-order.html +++ b/api/retrieve-vertices-order.html @@ -10,7 +10,7 @@ - + diff --git a/api/save-store-api-key.html b/api/save-store-api-key.html index d2d223c5c3..15e4261200 100644 --- a/api/save-store-api-key.html +++ b/api/save-store-api-key.html @@ -10,7 +10,7 @@ - + diff --git a/api/share-component.html b/api/share-component.html index 6e6d3b0ec5..35e15da9fe 100644 --- a/api/share-component.html +++ b/api/share-component.html @@ -10,7 +10,7 @@ - + diff --git a/api/simplified-run-flow.html b/api/simplified-run-flow.html index e5ee192d11..73913086fe 100644 --- a/api/simplified-run-flow.html +++ b/api/simplified-run-flow.html @@ -10,7 +10,7 @@ - + diff --git a/api/stream-logs.html b/api/stream-logs.html index a0d78f964b..fb35b6fc2a 100644 --- a/api/stream-logs.html +++ b/api/stream-logs.html @@ -10,7 +10,7 @@ - + diff --git a/api/update-flow.html b/api/update-flow.html index 13935c63f2..9a230e2ebb 100644 --- a/api/update-flow.html +++ b/api/update-flow.html @@ -10,7 +10,7 @@ - + diff --git a/api/update-folder.html b/api/update-folder.html index 785e458817..447072ea2f 100644 --- a/api/update-folder.html +++ b/api/update-folder.html @@ -10,7 +10,7 @@ - + diff --git a/api/update-message.html b/api/update-message.html index 11bf6bd2b6..a9a75e1a8c 100644 --- a/api/update-message.html +++ b/api/update-message.html @@ -10,7 +10,7 @@ - + diff --git a/api/update-session-id.html b/api/update-session-id.html index 349171a633..fd52c4ed8b 100644 --- a/api/update-session-id.html +++ b/api/update-session-id.html @@ -10,7 +10,7 @@ - + diff --git a/api/update-shared-component.html b/api/update-shared-component.html index 7c789cfca0..c1e1eab5e9 100644 --- a/api/update-shared-component.html +++ b/api/update-shared-component.html @@ -10,7 +10,7 @@ - + diff --git a/api/update-variable.html b/api/update-variable.html index 5724aa22f6..14610a4aff 100644 --- a/api/update-variable.html +++ b/api/update-variable.html @@ -10,7 +10,7 @@ - + diff --git a/api/upload-file-1.html b/api/upload-file-1.html index 6227bc341c..9156782fcc 100644 --- a/api/upload-file-1.html +++ b/api/upload-file-1.html @@ -10,7 +10,7 @@ - + diff --git a/api/upload-file-2.html b/api/upload-file-2.html index 1278ecfefe..892ed3acaa 100644 --- a/api/upload-file-2.html +++ b/api/upload-file-2.html @@ -10,7 +10,7 @@ - + diff --git a/api/upload-file.html b/api/upload-file.html index 6acea50f63..930d475cce 100644 --- a/api/upload-file.html +++ b/api/upload-file.html @@ -10,7 +10,7 @@ - + diff --git a/api/webhook-run-flow.html b/api/webhook-run-flow.html index d90855219c..efe14bdd22 100644 --- a/api/webhook-run-flow.html +++ b/api/webhook-run-flow.html @@ -10,7 +10,7 @@ - + diff --git a/assets/images/astra_db_chat_memory_rounded-9746ca2bb69d3b07ac0a071f4b9471b3.png b/assets/images/astra_db_chat_memory_rounded-9746ca2bb69d3b07ac0a071f4b9471b3.png new file mode 100644 index 0000000000..630e74bc0a Binary files /dev/null and b/assets/images/astra_db_chat_memory_rounded-9746ca2bb69d3b07ac0a071f4b9471b3.png differ diff --git a/assets/js/16d61ab3.69fae80f.js b/assets/js/16d61ab3.69fae80f.js new file mode 100644 index 0000000000..3a4323da19 --- /dev/null +++ b/assets/js/16d61ab3.69fae80f.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[1039],{98724:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>d,frontMatter:()=>r,metadata:()=>a,toc:()=>h});var s=n(74848),o=n(28453);const r={title:"Memory Chatbot",sidebar_position:3,slug:"/starter-projects-memory-chatbot"},i=void 0,a={id:"Starter-Projects/starter-projects-memory-chatbot",title:"Memory Chatbot",description:"This flow extends the\xa0basic prompting\xa0flow to include a chat memory. This makes the AI remember previous user inputs.",source:"@site/docs/Starter-Projects/starter-projects-memory-chatbot.md",sourceDirName:"Starter-Projects",slug:"/starter-projects-memory-chatbot",permalink:"/starter-projects-memory-chatbot",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:3,frontMatter:{title:"Memory Chatbot",sidebar_position:3,slug:"/starter-projects-memory-chatbot"},sidebar:"docs",previous:{title:"Document QA",permalink:"/starter-projects-document-qa"},next:{title:"Simple agent",permalink:"/starter-projects-simple-agent"}},c={},h=[{value:"Prerequisites",id:"a71d73e99b1543bbba827207503cf31f",level:2},{value:"Create the memory chatbot flow",id:"create-the-memory-chatbot-flow",level:2},{value:"Run the memory chatbot flow",id:"run-the-memory-chatbot-flow",level:2},{value:"Use Session ID with the memory chatbot flow",id:"4e68c3c0750942f98c45c1c45d7ffbbe",level:2}];function l(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",hr:"hr",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:["This flow extends the\xa0",(0,s.jsx)(t.a,{href:"/starter-projects-basic-prompting",children:"basic prompting"}),"\xa0flow to include a chat memory. This makes the AI remember previous user inputs."]}),"\n",(0,s.jsx)(t.h2,{id:"a71d73e99b1543bbba827207503cf31f",children:"Prerequisites"}),"\n",(0,s.jsx)(t.hr,{}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.a,{href:"/get-started-installation",children:"Langflow installed and running"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.a,{href:"https://platform.openai.com/",children:"OpenAI API key created"})}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"create-the-memory-chatbot-flow",children:"Create the memory chatbot flow"}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["From the Langflow dashboard, click\xa0",(0,s.jsx)(t.strong,{children:"New Flow"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:["Select\xa0",(0,s.jsx)(t.strong,{children:"Memory Chatbot"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:["The\xa0",(0,s.jsx)(t.strong,{children:"Memory Chatbot"}),"\xa0flow is created."]}),"\n"]}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{src:n(97829).A+"",width:"2978",height:"1056"})}),"\n",(0,s.jsxs)(t.p,{children:["This flow uses the same components as the Basic Prompting one, but extends it with a\xa0",(0,s.jsx)(t.strong,{children:"Chat Memory"}),"\xa0component. This component retrieves previous messages and sends them to the\xa0",(0,s.jsx)(t.strong,{children:"Prompt"}),"\xa0component to fill a part of the\xa0",(0,s.jsx)(t.strong,{children:"Template"}),"\xa0with context."]}),"\n",(0,s.jsx)(t.p,{children:"By clicking the template, you'll see the prompt editor like below:"}),"\n",(0,s.jsxs)(t.p,{children:["This gives the\xa0",(0,s.jsx)(t.strong,{children:"OpenAI"}),"\xa0component a memory of previous chat messages."]}),"\n",(0,s.jsx)(t.h2,{id:"run-the-memory-chatbot-flow",children:"Run the memory chatbot flow"}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsx)(t.li,{children:"Open the Playground."}),"\n",(0,s.jsxs)(t.li,{children:["Type multiple questions. In the\xa0",(0,s.jsx)(t.strong,{children:"Memories"}),"\xa0tab, your queries are logged in order. Up to 100 queries are stored by default. Try telling the AI your name and asking\xa0",(0,s.jsx)(t.code,{children:"What is my name?"})," on a second message, or\xa0",(0,s.jsx)(t.code,{children:"What is the first subject I asked you about?"}),"\xa0to validate that previous knowledge is taking effect."]}),"\n"]}),"\n",(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsxs)(t.p,{children:["Check and adjust advanced parameters by opening the Advanced Settings of the\xa0",(0,s.jsx)(t.strong,{children:"Chat Memory"}),"\xa0component."]})}),"\n",(0,s.jsx)(t.h2,{id:"4e68c3c0750942f98c45c1c45d7ffbbe",children:"Use Session ID with the memory chatbot flow"}),"\n",(0,s.jsx)(t.hr,{}),"\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.code,{children:"SessionID"}),"\xa0is a unique identifier in Langflow that stores conversation sessions between the AI and a user. A\xa0",(0,s.jsx)(t.code,{children:"SessionID"}),"\xa0is created when a conversation is initiated, and then associated with all subsequent messages during that session."]}),"\n",(0,s.jsxs)(t.p,{children:["In the\xa0",(0,s.jsx)(t.strong,{children:"Memory Chatbot"}),"\xa0flow you created, the\xa0",(0,s.jsx)(t.strong,{children:"Chat Memory"}),"\xa0component references past interactions by\xa0",(0,s.jsx)(t.strong,{children:"Session ID"}),". You can demonstrate this by modifying the\xa0",(0,s.jsx)(t.strong,{children:"Session ID"}),"\xa0value to switch between conversation histories."]}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["In the\xa0",(0,s.jsx)(t.strong,{children:"Session ID"}),"\xa0field of the\xa0",(0,s.jsx)(t.strong,{children:"Chat Memory"}),"\xa0and\xa0",(0,s.jsx)(t.strong,{children:"Chat Input"}),"\xa0components, add a\xa0",(0,s.jsx)(t.strong,{children:"Session ID"}),"\xa0value like\xa0",(0,s.jsx)(t.code,{children:"MySessionID"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:["Now, once you send a new message the\xa0",(0,s.jsx)(t.strong,{children:"Playground"}),", you should have a new memory created on the\xa0",(0,s.jsx)(t.strong,{children:"Memories"}),"\xa0tab."]}),"\n",(0,s.jsx)(t.li,{children:"Notice how your conversation is being stored in different memory sessions."}),"\n"]}),"\n",(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsxs)(t.p,{children:["Every\xa0chat\xa0component in Langflow comes with a\xa0",(0,s.jsx)(t.code,{children:"SessionID"}),". It defaults to the flow ID. Explore how changing it affects what the AI remembers."]})}),"\n",(0,s.jsxs)(t.p,{children:["Learn more about memories in the ",(0,s.jsx)(t.a,{href:"/guides-chat-memory",children:"Chat Memory"})," section."]})]})}function d(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(l,{...e})}):l(e)}},97829:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/starter-flow-memory-chatbot-e2582e60e66da0086d957faa300f569e.png"},28453:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>a});var s=n(96540);const o={},r=s.createContext(o);function i(e){const t=s.useContext(r);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:i(e.components),s.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/16d61ab3.6e5a6695.js b/assets/js/16d61ab3.6e5a6695.js deleted file mode 100644 index d0d1bc2247..0000000000 --- a/assets/js/16d61ab3.6e5a6695.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[1039],{98724:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>c,contentTitle:()=>i,default:()=>d,frontMatter:()=>r,metadata:()=>a,toc:()=>h});var s=n(74848),o=n(28453);const r={title:"Memory Chatbot",sidebar_position:3,slug:"/starter-projects-memory-chatbot"},i=void 0,a={id:"Starter-Projects/starter-projects-memory-chatbot",title:"Memory Chatbot",description:"This flow extends the\xa0basic prompting\xa0flow to include a chat memory. This makes the AI remember previous user inputs.",source:"@site/docs/Starter-Projects/starter-projects-memory-chatbot.md",sourceDirName:"Starter-Projects",slug:"/starter-projects-memory-chatbot",permalink:"/starter-projects-memory-chatbot",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:3,frontMatter:{title:"Memory Chatbot",sidebar_position:3,slug:"/starter-projects-memory-chatbot"},sidebar:"docs",previous:{title:"Document QA",permalink:"/starter-projects-document-qa"},next:{title:"Simple agent",permalink:"/starter-projects-simple-agent"}},c={},h=[{value:"Prerequisites",id:"a71d73e99b1543bbba827207503cf31f",level:2},{value:"Create the memory chatbot flow",id:"create-the-memory-chatbot-flow",level:2},{value:"Run the memory chatbot flow",id:"run-the-memory-chatbot-flow",level:2},{value:"Use Session ID in with the memory chatbot flow",id:"4e68c3c0750942f98c45c1c45d7ffbbe",level:2}];function l(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",hr:"hr",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:["This flow extends the\xa0",(0,s.jsx)(t.a,{href:"/starter-projects-basic-prompting",children:"basic prompting"}),"\xa0flow to include a chat memory. This makes the AI remember previous user inputs."]}),"\n",(0,s.jsx)(t.h2,{id:"a71d73e99b1543bbba827207503cf31f",children:"Prerequisites"}),"\n",(0,s.jsx)(t.hr,{}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.a,{href:"/get-started-installation",children:"Langflow installed and running"})}),"\n",(0,s.jsx)(t.li,{children:(0,s.jsx)(t.a,{href:"https://platform.openai.com/",children:"OpenAI API key created"})}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"create-the-memory-chatbot-flow",children:"Create the memory chatbot flow"}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["From the Langflow dashboard, click\xa0",(0,s.jsx)(t.strong,{children:"New Flow"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:["Select\xa0",(0,s.jsx)(t.strong,{children:"Memory Chatbot"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:["The\xa0",(0,s.jsx)(t.strong,{children:"Memory Chatbot"}),"\xa0flow is created."]}),"\n"]}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.img,{src:n(97829).A+"",width:"2978",height:"1056"})}),"\n",(0,s.jsxs)(t.p,{children:["This flow uses the same components as the Basic Prompting one, but extends it with a\xa0",(0,s.jsx)(t.strong,{children:"Chat Memory"}),"\xa0component. This component retrieves previous messages and sends them to the\xa0",(0,s.jsx)(t.strong,{children:"Prompt"}),"\xa0component to fill a part of the\xa0",(0,s.jsx)(t.strong,{children:"Template"}),"\xa0with context."]}),"\n",(0,s.jsx)(t.p,{children:"By clicking the template, you'll see the prompt editor like below:"}),"\n",(0,s.jsxs)(t.p,{children:["This gives the\xa0",(0,s.jsx)(t.strong,{children:"OpenAI"}),"\xa0component a memory of previous chat messages."]}),"\n",(0,s.jsx)(t.h2,{id:"run-the-memory-chatbot-flow",children:"Run the memory chatbot flow"}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsx)(t.li,{children:"Open the Playground."}),"\n",(0,s.jsxs)(t.li,{children:["Type multiple questions. In the\xa0",(0,s.jsx)(t.strong,{children:"Memories"}),"\xa0tab, your queries are logged in order. Up to 100 queries are stored by default. Try telling the AI your name and asking\xa0",(0,s.jsx)(t.code,{children:"What is my name?"})," on a second message, or\xa0",(0,s.jsx)(t.code,{children:"What is the first subject I asked you about?"}),"\xa0to validate that previous knowledge is taking effect."]}),"\n"]}),"\n",(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsxs)(t.p,{children:["Check and adjust advanced parameters by opening the Advanced Settings of the\xa0",(0,s.jsx)(t.strong,{children:"Chat Memory"}),"\xa0component."]})}),"\n",(0,s.jsx)(t.h2,{id:"4e68c3c0750942f98c45c1c45d7ffbbe",children:"Use Session ID in with the memory chatbot flow"}),"\n",(0,s.jsx)(t.hr,{}),"\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.code,{children:"SessionID"}),"\xa0is a unique identifier in Langflow that stores conversation sessions between the AI and a user. A\xa0",(0,s.jsx)(t.code,{children:"SessionID"}),"\xa0is created when a conversation is initiated, and then associated with all subsequent messages during that session."]}),"\n",(0,s.jsxs)(t.p,{children:["In the\xa0",(0,s.jsx)(t.strong,{children:"Memory Chatbot"}),"\xa0flow you created, the\xa0",(0,s.jsx)(t.strong,{children:"Chat Memory"}),"\xa0component references past interactions by\xa0",(0,s.jsx)(t.strong,{children:"Session ID"}),". You can demonstrate this by modifying the\xa0",(0,s.jsx)(t.strong,{children:"Session ID"}),"\xa0value to switch between conversation histories."]}),"\n",(0,s.jsxs)(t.ol,{children:["\n",(0,s.jsxs)(t.li,{children:["In the\xa0",(0,s.jsx)(t.strong,{children:"Session ID"}),"\xa0field of the\xa0",(0,s.jsx)(t.strong,{children:"Chat Memory"}),"\xa0and\xa0",(0,s.jsx)(t.strong,{children:"Chat Input"}),"\xa0components, add a\xa0",(0,s.jsx)(t.strong,{children:"Session ID"}),"\xa0value like\xa0",(0,s.jsx)(t.code,{children:"MySessionID"}),"."]}),"\n",(0,s.jsxs)(t.li,{children:["Now, once you send a new message the\xa0",(0,s.jsx)(t.strong,{children:"Playground"}),", you should have a new memory created on the\xa0",(0,s.jsx)(t.strong,{children:"Memories"}),"\xa0tab."]}),"\n",(0,s.jsx)(t.li,{children:"Notice how your conversation is being stored in different memory sessions."}),"\n"]}),"\n",(0,s.jsx)(t.admonition,{type:"tip",children:(0,s.jsxs)(t.p,{children:["Every\xa0chat\xa0component in Langflow comes with a\xa0",(0,s.jsx)(t.code,{children:"SessionID"}),". It defaults to the flow ID. Explore how changing it affects what the AI remembers."]})}),"\n",(0,s.jsxs)(t.p,{children:["Learn more about memories in the ",(0,s.jsx)(t.a,{href:"/guides-chat-memory",children:"Chat Memory"})," section."]})]})}function d(e={}){const{wrapper:t}={...(0,o.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(l,{...e})}):l(e)}},97829:(e,t,n)=>{n.d(t,{A:()=>s});const s=n.p+"assets/images/starter-flow-memory-chatbot-e2582e60e66da0086d957faa300f569e.png"},28453:(e,t,n)=>{n.d(t,{R:()=>i,x:()=>a});var s=n(96540);const o={},r=s.createContext(o);function i(e){const t=s.useContext(r);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:i(e.components),s.createElement(r.Provider,{value:t},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/c329cc2b.31372bf9.js b/assets/js/c329cc2b.31372bf9.js new file mode 100644 index 0000000000..ffbd259fa2 --- /dev/null +++ b/assets/js/c329cc2b.31372bf9.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[9304],{24905:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>a,default:()=>d,frontMatter:()=>r,metadata:()=>i,toc:()=>h});var n=t(74848),o=t(28453);const r={title:"Chat Memory",sidebar_position:1,slug:"/guides-chat-memory"},a=void 0,i={id:"Guides/guides-chat-memory",title:"Chat Memory",description:"Langflow allows every chat message to be stored, and a single flow can have multiple memory sessions. This enables you to create separate memories for agents to store and recall information as needed.",source:"@site/docs/Guides/guides-chat-memory.md",sourceDirName:"Guides",slug:"/guides-chat-memory",permalink:"/guides-chat-memory",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:1,frontMatter:{title:"Chat Memory",sidebar_position:1,slug:"/guides-chat-memory"},sidebar:"docs",previous:{title:"Vector Stores",permalink:"/components-vector-stores"},next:{title:"Data & Message",permalink:"/guides-data-message"}},c={},h=[{value:"Session ID",id:"4ee86e27d1004e8288a72c633c323703",level:2},{value:"Store chat memory in an external database",id:"store-chat-memory-in-an-external-database",level:2},{value:"Prerequisites",id:"prerequisites",level:3},{value:"Connect the chat memory component to an external database",id:"connect-the-chat-memory-component-to-an-external-database",level:3}];function l(e){const s={a:"a",code:"code",em:"em",h2:"h2",h3:"h3",hr:"hr",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,o.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(s.p,{children:["Langflow allows every chat message to be stored, and a single flow can have multiple memory sessions. This enables you to create separate ",(0,n.jsx)(s.em,{children:"memories"})," for agents to store and recall information as needed."]}),"\n",(0,n.jsxs)(s.p,{children:["In any project, as long as there are ",(0,n.jsx)(s.a,{href:"/components-io",children:(0,n.jsx)(s.strong,{children:"Chat"})})," being used, memories are always being stored by default. These are messages from a user to the AI or vice-versa."]}),"\n",(0,n.jsxs)(s.p,{children:["To see and access this history of messages, Langflow features a component called ",(0,n.jsx)(s.strong,{children:"Chat Memory"}),". It retrieves previous messages and outputs them in structured format or parsed."]}),"\n",(0,n.jsxs)(s.p,{children:["To learn the basics about memory in Langflow, check out the ",(0,n.jsx)(s.a,{href:"/starter-projects-memory-chatbot",children:"Memory Chatbot"})," starter example."]}),"\n",(0,n.jsxs)(s.p,{children:["Memories can be visualized and managed directly from the ",(0,n.jsx)(s.strong,{children:"Playground"}),". You can edit and remove previous messages to inspect and validate the AI\u2019s response behavior. You can remove or edit previous messages to get your models acting just right."]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{src:t(75918).A+"",width:"3244",height:"1776"})}),"\n",(0,n.jsx)(s.p,{children:"Modifying these memories will influence the behavior of the chatbot responses, as long as an agent uses them. Here you have the ability to remove or edit previous messages, allowing them to manipulate and explore how these changes affect model responses."}),"\n",(0,n.jsxs)(s.p,{children:["To modify chat memories, from the playground, click the ",(0,n.jsx)(s.strong,{children:"Options"})," menu of any session, and then select ",(0,n.jsx)(s.strong,{children:"Message Logs"}),"."]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{src:t(77232).A+"",width:"3278",height:"1884"})}),"\n",(0,n.jsx)(s.h2,{id:"4ee86e27d1004e8288a72c633c323703",children:"Session ID"}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsxs)(s.p,{children:["Chat conversations store messages categorized by a ",(0,n.jsx)(s.code,{children:"Session ID"}),". A a single flow can host multiple session IDs, and different flows can also share the same one."]}),"\n",(0,n.jsxs)(s.p,{children:["The ",(0,n.jsx)(s.strong,{children:"Chat Memory"})," component also retrieves message histories by ",(0,n.jsx)(s.code,{children:"Session ID"}),", which users can change in the component's ",(0,n.jsx)(s.strong,{children:"Controls"})," pane."]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{src:t(86190).A+"",width:"3246",height:"1772"})}),"\n",(0,n.jsxs)(s.p,{children:["By default, if the ",(0,n.jsx)(s.code,{children:"Session ID"})," value is empty, it is set to the same value as ",(0,n.jsx)(s.code,{children:"Flow ID"}),"."]}),"\n",(0,n.jsxs)(s.p,{children:["You can also display all messages stored across every flow and session by going to\xa0",(0,n.jsx)(s.strong,{children:"Settings"}),"\xa0>\xa0",(0,n.jsx)(s.strong,{children:"Messages"}),"."]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{src:t(25381).A+"",width:"2910",height:"1686"})}),"\n",(0,n.jsx)(s.h2,{id:"store-chat-memory-in-an-external-database",children:"Store chat memory in an external database"}),"\n",(0,n.jsxs)(s.p,{children:["Chat memory is retrieved from an external database or vector store using the ",(0,n.jsx)(s.a,{href:"/components-helpers#chat-memory",children:(0,n.jsx)(s.strong,{children:"Chat Memory"})})," component."]}),"\n",(0,n.jsxs)(s.p,{children:["Chat memory is stored to an external database or vector store using the ",(0,n.jsx)(s.a,{href:"/components-helpers#store-message",children:"Store Message"})," component."]}),"\n",(0,n.jsxs)(s.p,{children:["The ",(0,n.jsx)(s.a,{href:"/Components/components-memories",children:(0,n.jsx)(s.strong,{children:"Chat Memories"})})," components provide access to their respective external databases ",(0,n.jsx)(s.strong,{children:"as memory"}),". This allows AIs to access external memory for persistence and context retention. For example, connect the ",(0,n.jsx)(s.strong,{children:"Chat Memory"})," component to an ",(0,n.jsx)(s.strong,{children:"AstraDBChatMemory"}),"* component to store the message history in an external Astra DB database."]}),"\n",(0,n.jsxs)(s.p,{children:["This example stores and retrieves chat history from an ",(0,n.jsx)(s.a,{href:"/Components/components-memories#astradbchatmemory-component",children:"AstraDBChatMemory"})," component with ",(0,n.jsx)(s.strong,{children:"Store Message"})," and ",(0,n.jsx)(s.strong,{children:"Chat Memory"})," components."]}),"\n",(0,n.jsx)(s.h3,{id:"prerequisites",children:"Prerequisites"}),"\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"https://platform.openai.com/",children:"An OpenAI API key"})}),"\n",(0,n.jsxs)(s.li,{children:[(0,n.jsx)(s.a,{href:"https://docs.datastax.com/en/astra-db-serverless/get-started/quickstart.html",children:"An Astra DB vector database"}),"\xa0with:","\n",(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:"Application Token"}),"\n",(0,n.jsx)(s.li,{children:"API Endpoint"}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(s.h3,{id:"connect-the-chat-memory-component-to-an-external-database",children:"Connect the chat memory component to an external database"}),"\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:["Load the ",(0,n.jsx)(s.a,{href:"/starter-projects-memory-chatbot",children:"Memory Chatbot"})," starter project.\nThis starter project extends the basic prompting flow to include a chat memory component."]}),"\n",(0,n.jsxs)(s.li,{children:["Add the ",(0,n.jsx)(s.a,{href:"/components-helpers#store-message",children:"Store Message"})," component to the flow.\nThe ",(0,n.jsx)(s.strong,{children:"Store message"})," component stores messages in the external database."]}),"\n",(0,n.jsxs)(s.li,{children:["Add the ",(0,n.jsx)(s.a,{href:"/Components/components-memories#astradbchatmemory-component",children:"AstraDBChatMemory Component"})," to the flow.\nThe ",(0,n.jsx)(s.strong,{children:"Astra DB Chat Memory"})," component stores and retrieves messages from ",(0,n.jsx)(s.strong,{children:"Astra DB"}),"."]}),"\n",(0,n.jsxs)(s.li,{children:["Configure the ",(0,n.jsx)(s.strong,{children:"AstraDBChatMemory"})," component with your AstraDB instance details.","\n",(0,n.jsxs)(s.ol,{children:["\n",(0,n.jsxs)(s.li,{children:["In the ",(0,n.jsx)(s.strong,{children:"Astra DB Application Token"})," field, add your Astra token. (",(0,n.jsx)(s.code,{children:"AstraCS:..."}),")"]}),"\n",(0,n.jsxs)(s.li,{children:["In the ",(0,n.jsx)(s.strong,{children:"API Endpoint"})," field, add your Astra database's endpoint. (for example, ",(0,n.jsx)(s.code,{children:"https://12adb-bc-5378c845f05a6-e0a12-bd889b4-us-east-2.apps.astra.datastax.com"}),")"]}),"\n"]}),"\n"]}),"\n",(0,n.jsxs)(s.li,{children:["Connect the ",(0,n.jsx)(s.strong,{children:"AstraDBChatMemory"})," component output to the external memory inputs of the ",(0,n.jsx)(s.a,{href:"/components-helpers#chat-memory",children:"Chat Memory"})," and ",(0,n.jsx)(s.a,{href:"/components-helpers#store-message",children:"Store Message"})," components."]}),"\n",(0,n.jsxs)(s.li,{children:["Link the ",(0,n.jsx)(s.a,{href:"/components-io#chat-output",children:"Chat Output"})," component to the input of the ",(0,n.jsx)(s.a,{href:"/components-helpers#store-message",children:"Store Message"})," component."]}),"\n"]}),"\n",(0,n.jsx)(s.p,{children:"Your completed flow should look like this:"}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{alt:"Sample Flow storing Chat Memory in AstraDB",src:t(72654).A+"",width:"3178",height:"1228"})}),"\n",(0,n.jsxs)(s.ol,{start:"7",children:["\n",(0,n.jsx)(s.li,{children:"In Langflow, create message traffic by running a flow."}),"\n",(0,n.jsx)(s.li,{children:"Inspect your Astra database's tables and activity.\nYou will see new tables and traffic created."}),"\n"]})]})}function d(e={}){const{wrapper:s}={...(0,o.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(l,{...e})}):l(e)}},72654:(e,s,t)=>{t.d(s,{A:()=>n});const n=t.p+"assets/images/astra_db_chat_memory_rounded-9746ca2bb69d3b07ac0a071f4b9471b3.png"},86190:(e,s,t)=>{t.d(s,{A:()=>n});const n=t.p+"assets/images/chat-input-controls-pane-b60b21c923aa47a2265ae1775e693cb0.png"},77232:(e,s,t)=>{t.d(s,{A:()=>n});const n=t.p+"assets/images/logs-7deb7c1a822f826469d17856b9dcebb5.png"},75918:(e,s,t)=>{t.d(s,{A:()=>n});const n=t.p+"assets/images/playground-b2c623fb6849024570bc9bd5285309f5.png"},25381:(e,s,t)=>{t.d(s,{A:()=>n});const n=t.p+"assets/images/settings-messages-d0ad3a8e3bea5f8896565c041946a919.png"},28453:(e,s,t)=>{t.d(s,{R:()=>a,x:()=>i});var n=t(96540);const o={},r=n.createContext(o);function a(e){const s=n.useContext(r);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function i(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:a(e.components),n.createElement(r.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/c329cc2b.46ee1117.js b/assets/js/c329cc2b.46ee1117.js deleted file mode 100644 index 74a258243f..0000000000 --- a/assets/js/c329cc2b.46ee1117.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[9304],{24905:(e,s,t)=>{t.r(s),t.d(s,{assets:()=>c,contentTitle:()=>r,default:()=>h,frontMatter:()=>a,metadata:()=>i,toc:()=>d});var n=t(74848),o=t(28453);const a={title:"Chat Memory",sidebar_position:1,slug:"/guides-chat-memory"},r=void 0,i={id:"Guides/guides-chat-memory",title:"Chat Memory",description:"Langflow allows every chat message to be stored, and a single flow can have multiple memory sessions. This enables you to create separate memories for agents to store and recall information as needed.",source:"@site/docs/Guides/guides-chat-memory.md",sourceDirName:"Guides",slug:"/guides-chat-memory",permalink:"/guides-chat-memory",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:1,frontMatter:{title:"Chat Memory",sidebar_position:1,slug:"/guides-chat-memory"},sidebar:"docs",previous:{title:"Vector Stores",permalink:"/components-vector-stores"},next:{title:"Data & Message",permalink:"/guides-data-message"}},c={},d=[{value:"Session ID",id:"4ee86e27d1004e8288a72c633c323703",level:2}];function l(e){const s={a:"a",code:"code",em:"em",h2:"h2",hr:"hr",img:"img",p:"p",strong:"strong",...(0,o.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(s.p,{children:["Langflow allows every chat message to be stored, and a single flow can have multiple memory sessions. This enables you to create separate ",(0,n.jsx)(s.em,{children:"memories"})," for agents to store and recall information as needed."]}),"\n",(0,n.jsxs)(s.p,{children:["In any project, as long as there are ",(0,n.jsx)(s.a,{href:"/components-io",children:(0,n.jsx)(s.strong,{children:"Chat"})})," being used, memories are always being stored by default. These are messages from a user to the AI or vice-versa."]}),"\n",(0,n.jsxs)(s.p,{children:["To see and access this history of messages, Langflow features a component called ",(0,n.jsx)(s.strong,{children:"Chat Memory"}),". It retrieves previous messages and outputs them in structured format or parsed."]}),"\n",(0,n.jsxs)(s.p,{children:["To learn the basics about memory in Langflow, check out the ",(0,n.jsx)(s.a,{href:"/starter-projects-memory-chatbot",children:"Memory Chatbot"})," starter example."]}),"\n",(0,n.jsxs)(s.p,{children:["Memories can be visualized and managed directly from the ",(0,n.jsx)(s.strong,{children:"Playground"}),". You can edit and remove previous messages to inspect and validate the AI\u2019s response behavior. You can remove or edit previous messages to get your models acting just right."]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{src:t(75918).A+"",width:"3244",height:"1776"})}),"\n",(0,n.jsx)(s.p,{children:"Modifying these memories will influence the behavior of the chatbot responses, as long as an agent uses them. Here you have the ability to remove or edit previous messages, allowing them to manipulate and explore how these changes affect model responses."}),"\n",(0,n.jsxs)(s.p,{children:["To modify chat memories, from the playground, click the ",(0,n.jsx)(s.strong,{children:"Options"})," menu of any session, and then select ",(0,n.jsx)(s.strong,{children:"Message Logs"}),"."]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{src:t(77232).A+"",width:"3278",height:"1884"})}),"\n",(0,n.jsx)(s.h2,{id:"4ee86e27d1004e8288a72c633c323703",children:"Session ID"}),"\n",(0,n.jsx)(s.hr,{}),"\n",(0,n.jsxs)(s.p,{children:["Chat conversations store messages categorized by a ",(0,n.jsx)(s.code,{children:"Session ID"}),". A a single flow can host multiple session IDs, and different flows can also share the same one."]}),"\n",(0,n.jsxs)(s.p,{children:["The ",(0,n.jsx)(s.strong,{children:"Chat Memory"})," component also retrieves message histories by ",(0,n.jsx)(s.code,{children:"Session ID"}),", which users can change in the component's ",(0,n.jsx)(s.strong,{children:"Controls"})," pane."]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{src:t(86190).A+"",width:"3246",height:"1772"})}),"\n",(0,n.jsxs)(s.p,{children:["By default, if the ",(0,n.jsx)(s.code,{children:"Session ID"})," value is empty, it is set to the same value as ",(0,n.jsx)(s.code,{children:"Flow ID"}),"."]}),"\n",(0,n.jsxs)(s.p,{children:["You can also display all messages stored across every flow and session by going to\xa0",(0,n.jsx)(s.strong,{children:"Settings"}),"\xa0>\xa0",(0,n.jsx)(s.strong,{children:"Messages"}),"."]}),"\n",(0,n.jsx)(s.p,{children:(0,n.jsx)(s.img,{src:t(25381).A+"",width:"2910",height:"1686"})})]})}function h(e={}){const{wrapper:s}={...(0,o.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(l,{...e})}):l(e)}},86190:(e,s,t)=>{t.d(s,{A:()=>n});const n=t.p+"assets/images/chat-input-controls-pane-b60b21c923aa47a2265ae1775e693cb0.png"},77232:(e,s,t)=>{t.d(s,{A:()=>n});const n=t.p+"assets/images/logs-7deb7c1a822f826469d17856b9dcebb5.png"},75918:(e,s,t)=>{t.d(s,{A:()=>n});const n=t.p+"assets/images/playground-b2c623fb6849024570bc9bd5285309f5.png"},25381:(e,s,t)=>{t.d(s,{A:()=>n});const n=t.p+"assets/images/settings-messages-d0ad3a8e3bea5f8896565c041946a919.png"},28453:(e,s,t)=>{t.d(s,{R:()=>r,x:()=>i});var n=t(96540);const o={},a=n.createContext(o);function r(e){const s=n.useContext(a);return n.useMemo((function(){return"function"==typeof e?e(s):{...s,...e}}),[s,e])}function i(e){let s;return s=e.disableParentContext?"function"==typeof e.components?e.components(o):e.components||o:r(e.components),n.createElement(a.Provider,{value:s},e.children)}}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.54bedb52.js b/assets/js/runtime~main.f2445227.js similarity index 82% rename from assets/js/runtime~main.54bedb52.js rename to assets/js/runtime~main.f2445227.js index f1be4b042c..9577f0a8cb 100644 --- a/assets/js/runtime~main.54bedb52.js +++ b/assets/js/runtime~main.f2445227.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,c,f,d,b={},t={};function r(e){var a=t[e];if(void 0!==a)return a.exports;var c=t[e]={id:e,loaded:!1,exports:{}};return b[e].call(c.exports,c,c.exports,r),c.loaded=!0,c.exports}r.m=b,r.c=t,e=[],r.O=(a,c,f,d)=>{if(!c){var b=1/0;for(i=0;i
By default, if the Session ID value is empty, it is set to the same value as Flow ID.
You can also display all messages stored across every flow and session by going to Settings > Messages.
-

Chat memory is retrieved from an external database or vector store using the Chat Memory component.
+Chat memory is stored to an external database or vector store using the Store Message component.
+The Chat Memories components provide access to their respective external databases as memory. This allows AIs to access external memory for persistence and context retention. For example, connect the Chat Memory component to an AstraDBChatMemory* component to store the message history in an external Astra DB database.
+This example stores and retrieves chat history from an AstraDBChatMemory component with Store Message and Chat Memory components.
+AstraCS:...)https://12adb-bc-5378c845f05a6-e0a12-bd889b4-us-east-2.apps.astra.datastax.com)Your completed flow should look like this:
+