ThreadMem
is a library for building and manipulating persistent chat threads. It makes it easier to communicate with LLMs, but it’s not limited to that alone.
For example, you can create a Thread in the code and add messages to it (like, a message from “system”, a message from “user”, a message from “assistant”, from “user” again, etc). The threads get written to a DB (SQLite/Postgres), so you can return to the chat at any time and pick up where you left off.
./data/threads.db
.
to_oai
method for exporting the thread to OpenAI format.
ThreadMem
. To do that, you pass the remote server URL to the thread constructor: