Thread memory for AI agents
Project description
threadmem
Chat thread memory for AI agents
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Threadmem is a simple tool that helps manage chat conversations with language models.
Backend
Installation
pip install threadmem
Usage
Role Threads
Role based threads are useful for managing openai-style chat schemas.
from threadmem import RoleThread
# Create a thread storing it in a local sqlite db
thread = RoleThread(owner_id="dolores@agentsea.ai")
# Post messages
thread.post("user", "Hello, Thread!")
thread.post("assistant", "How can I help?")
thread.post("user", "Whats this image?", images=["data:image/jpeg;base64,..."])
# Output in openai chat schema format
print(thread.to_oai())
# Find a thread
threads = RoleThread.find(owner_id="dolores@agentsea.ai")
# Delete a thread
threads[0].delete()
Supported Backends
- Sqlite
- Postgresql
Develop
To test
make test
To publish
make publish
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
threadmem-0.2.12.tar.gz
(14.4 kB
view details)
Built Distribution
File details
Details for the file threadmem-0.2.12.tar.gz
.
File metadata
- Download URL: threadmem-0.2.12.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.1 Darwin/22.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cdeedd462221a5825a64ae3f9c6de5ffff1ad4e1ff777c71a20b7e7513b2ca8 |
|
MD5 | 31ecacc372442924a56234e4e0f414fc |
|
BLAKE2b-256 | e34cabf04af264c7d6e5d85ddc31d9580aac599445c54409549d0927e7ab3b64 |
File details
Details for the file threadmem-0.2.12-py3-none-any.whl
.
File metadata
- Download URL: threadmem-0.2.12-py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.10.1 Darwin/22.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88c9116bd921ed94464c11f56a73f74ead5a537f9f7a02b8a42ce0deea05432b |
|
MD5 | e51b9f1f5619f6b00a015457c8673b61 |
|
BLAKE2b-256 | c9294b8e2db7f715163490f27d1f7168f9e336d8b2fbabe759f8c7e951c6eb8c |