minimaxir / simpleaichat

Python package for easily interfacing with chat apps, with robust features and minimal code complexity.
MIT License
3.43k stars 224 forks source link

Compressed session memory? #100

Closed ymyke closed 6 months ago

ymyke commented 6 months ago

As far as I understand simpleaichat just sends the earlier conversation along in order to support chat sessions. This approach will exceed the model's token limit quickly in cases, where the original context has already been substantial.

I don't think there is a way to have simpleaichat to compress the earlier conversation, I'll have to implement that outside of simpleaichat. Or did I miss something?

Is anybody aware of a great library that does that?

Thanks!

batmanscode commented 6 months ago

I've used LangChain to do this

https://python.langchain.com/docs/modules/memory/types/summary_buffer

ymyke commented 6 months ago

Thanks, @batmanscode!