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.18.tar.gz
(14.5 kB
view details)
Built Distribution
File details
Details for the file threadmem-0.2.18.tar.gz
.
File metadata
- Download URL: threadmem-0.2.18.tar.gz
- Upload date:
- Size: 14.5 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 | 1e8b9b37f3734d5cc4e03943f27a149f8ec09e7fe03af8d2ac1ac828e50817a3 |
|
MD5 | 827f0a2caabb057e6d3d0564275cc9cc |
|
BLAKE2b-256 | 4b26af64c769cc2155849769983f67805a8ace9e5d6a0d90839b1cd395be6cbe |
File details
Details for the file threadmem-0.2.18-py3-none-any.whl
.
File metadata
- Download URL: threadmem-0.2.18-py3-none-any.whl
- Upload date:
- Size: 17.2 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 | d6c8d6de9a28ba36f91419ed4b3d576914811c86c85235d08ad889ad9f053663 |
|
MD5 | cbbcfb6c2787ec3eefee3929a942160e |
|
BLAKE2b-256 | c48ea4c4766f6b7f1e0415a1af0f8bc39b4f82cfd1fc71a61f761f8867f2e011 |