From the course: Oracle Cloud Infrastructure Generative AI Professional Cert Prep

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Extending a chatbot by adding memory

Extending a chatbot by adding memory

(logo chiming) - [Hemant] So what is memory in the context of Chatbot and LangChain? Ability to store information is memory. We'll use memory to store past interactions. For example, we'll store a list of prior questions asked and their responses in the memory. This is called Azure Chat History. Chains that support memory interacts with memory twice. When we ask a question, and before chain sends it to the LLM, chain retrieves the conversation, that is a series of chat messages from a memory using a key, and passes it to the LLM along with the question. This provides additional context to the LLM. And once chain receives a new answer to the latest query, chain writes back the query and answer to the memory. This way, the memory is kept up to date. LangChain offers a variety of memory types. It all depends on what is returned from the memory. For example, we may use a chain that returns a summary of the contents of the memory instead of actual contents of the memory. When multiple…

Contents