langchain/docs/snippets/modules
Shantanu Nair 53f3793504
Fast load conversationsummarymemory from existing summary (#7533)
- Description: Adds an optional buffer arg to the memory's
from_messages() method. If provided the existing memory will be loaded
instead of regenerating a summary from the loaded messages.
 
Why? If we have past messages to load from, it is likely we also have an
existing summary. This is particularly helpful in cases where the chat
is ephemeral and/or is backed by serverless where the chat history is
not stored but where the updated chat history is passed back and forth
between a backend/frontend.

Eg: Take a stateless qa backend implementation that loads messages on
every request and generates a response — without this addition, each
time the messages are loaded via from_messages, the summaries are
recomputed even though they may have just been computed during the
previous response. With this, the previously computed summary can be
passed in and avoid:
  1) spending extra $$$ on tokens, and 
2) increased response time by avoiding regenerating previously generated
summary.

Tag maintainer: @hwchase17
Twitter handle: https://twitter.com/ShantanuNair

---------

Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
2023-07-31 18:14:11 -07:00
..
agents Wfh/ref links (#8454) 2023-07-29 08:44:32 -07:00
callbacks Adds OpenAI functions powered document metadata tagger (#7521) 2023-07-13 01:12:41 -04:00
chains cr 2023-07-27 22:00:52 -07:00
data_connection Update Integrations links (#8206) 2023-07-24 21:20:32 -07:00
memory Fast load conversationsummarymemory from existing summary (#7533) 2023-07-31 18:14:11 -07:00
model_io updates some spelling mistakes (#8537) 2023-07-31 17:15:29 -07:00