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

Uploaded Source

Built Distribution

threadmem-0.2.19-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: threadmem-0.2.19.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.19.tar.gz
Algorithm Hash digest
SHA256 1b58444382ac770c9813812f3f38f205bd40ee64e9f8c3ec76d9e9655453dd6c
MD5 dca0b9cccb6bbeea671ed9443601ba63
BLAKE2b-256 f3709e274c2739d6478aea64900c5c8a84556bf5d16d81e1bd2de54bb1c2bdf1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: threadmem-0.2.19-py3-none-any.whl
  • Upload date:
  • Size: 17.1 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.19-py3-none-any.whl
Algorithm Hash digest
SHA256 d1657a1d089391aaad88650af7ec9635e375136920bc50baaa411d30460bb912
MD5 a7d28d9e054e886359bd1d041d467682
BLAKE2b-256 420bd2062c257721fea40356259afdaf63eaa22ba73f8ad17306b110888a07a5

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