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

Uploaded Source

Built Distribution

threadmem-0.2.9-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: threadmem-0.2.9.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.9.tar.gz
Algorithm Hash digest
SHA256 1c60d8ad83103891a7b03bde552c5ef8d00b4df64fb578567328d5918cc89d85
MD5 657e77240288b2ebea5ee1d07e1e6c32
BLAKE2b-256 872585a9dacfcff4df9fa520c1badc3111f837a0e83a4abc57ead714a4c4b42b

See more details on using hashes here.

File details

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

File metadata

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

Hashes for threadmem-0.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 c43b5e1ebd870bf0d9c3537a163733c4c0e9fd1ce0dae46b15d42eb4e3299e6b
MD5 2491892248a1082528a83df3765d16c1
BLAKE2b-256 2c2566c5f1049bda69ac29b356a0ec57aef1f1bf6ae657a41065021166483ff5

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