langchainjs icon indicating copy to clipboard operation
langchainjs copied to clipboard

Preserving chain state between requests

Open msikora78 opened this issue 1 year ago • 0 comments

I have looked over the documentation and various examples and it is not clear to me how to preserve the state of an LLM chain between sessions. Let's say I have an agent with one custom tool (vector db retrieval), how can I serialize the current state of this agent so I can store this in an external persistence store and then resurrect the session when the same user asks another question in the same chat thread (similar functionality to the ChatGPT UI)? It feels like I'm missing something fundamental as this is a really basic use case. Would anyone be able to point me in the right direction or an example where this is done? Thanks!

msikora78 avatar Apr 10 '23 22:04 msikora78