langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Keeping chat session ids with chatbot agents

Open assafelovic opened this issue 2 years ago • 3 comments

First off kudos for this remarkable library!

I'm experimenting with chatbot agents, but missing how can I save a specific conversation sessions and context per user. The issue is that if I deploy this and serve to multiple users, the context gets confused. Any suggestions?

assafelovic avatar Feb 17 '23 12:02 assafelovic

@assafelovic - did you find any workaround for this ?

ashavish avatar Mar 15 '23 10:03 ashavish

I guess you would need a memory class which stores the chat memory in a database of some sort with a session id and retrieve it from there when a request arrives related to that chat session. As far as I see, this PR was trying to achieve something similar with the DynamoDB as database backend.

I was actually thinking to implement something like this for Redis as database backend, but I will ask @hwchase17 first, as we might want to do that a bit more generalized (like not calling it "serverless", as the backend isn't always serverless).

zoltan-fedor avatar Mar 21 '23 20:03 zoltan-fedor

Here is an initial implementation for this: https://github.com/hwchase17/langchain/pull/1058#issuecomment-1478775638

zoltan-fedor avatar Mar 22 '23 01:03 zoltan-fedor

This has been added recently in v0.0.126, see https://github.com/hwchase17/langchain/pull/2122

zoltan-fedor avatar Mar 31 '23 20:03 zoltan-fedor

Hi, @assafelovic! I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.

From what I understand, the issue you raised was about saving conversation sessions and context per user in a chatbot agent. There were some suggestions made by other users, such as using a memory class to store chat memory in a database with a session ID, and a PR that attempted to achieve something similar using DynamoDB as the database backend.

However, I wanted to inform you that this feature has been resolved in version 0.0.126 of the repository. The LangChain team has added the capability to save conversation sessions and context per user.

If you believe that this issue is still relevant to the latest version of the LangChain repository, please let us know by commenting on this issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.

Thank you for your contribution to the LangChain project!

dosubot[bot] avatar Sep 19 '23 16:09 dosubot[bot]