Skip to main content

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


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.21.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

threadmem-0.2.21-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file threadmem-0.2.21.tar.gz.

File metadata

  • Download URL: threadmem-0.2.21.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

Hashes for threadmem-0.2.21.tar.gz
Algorithm Hash digest
SHA256 758b9347f4003ebd8f2fb84a2d4a75b3ca0ad38c4cdf8d4c4e6e4a25cdd2e1d5
MD5 882ddf1f4441667083ee0a265378b1b5
BLAKE2b-256 bf29af24b5765da8e73ef69fe95f1eaca03d91db879d06f7b6e75baaf763786b

See more details on using hashes here.

File details

Details for the file threadmem-0.2.21-py3-none-any.whl.

File metadata

  • Download URL: threadmem-0.2.21-py3-none-any.whl
  • Upload date:
  • Size: 17.0 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

Hashes for threadmem-0.2.21-py3-none-any.whl
Algorithm Hash digest
SHA256 a74243341de10244618af2bd1dfc18fb24b1d8dddbb34e958764945929a30b76
MD5 296057c39135de36afdaa3c9e9e9d291
BLAKE2b-256 cd757b8c6d062e16c5047cdabccf4cb6ae7e24757bd92daf8ea49ecd953f68b2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page