PromtEngineer / localGPT

Chat with your documents on your local device using GPT models. No data leaves your device and 100% private.
Apache License 2.0
19.54k stars 2.19k forks source link

Chat history between program runs? #465

Open Vansick1 opened 10 months ago

Vansick1 commented 10 months ago

I'm noticing that chat history only persists during runtime - history is lost upon closing the program. Is there a way to implement persistent data storage for that?

PromtEngineer commented 9 months ago

This is something that could be added. Let me think about it on how to best do this.

Vansick1 commented 9 months ago

One thing I'm noticing is that the memory buffer eventually overflows and the program exits. I'm experimenting with saving the chat history to a text file and ingesting it after each display of the answer, but I don't know how to let the model gradually forget tokens to avoid the aforementioned buffer crash.

Vansick1 commented 9 months ago

Perhaps https://github.com/gmickel/memorybot could serve as a base? It's in Typescript, but I'm fairly certain that Langchain's Python version has the same functions.

konradzuse commented 8 months ago

It would be useful if the chat history could be passed in with the query. This way it would be possible to implement a stateless web api, and let the entire chat history be passed back and forth between client and server.