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

Uploaded Source

Built Distribution

threadmem-0.2.17-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: threadmem-0.2.17.tar.gz
  • Upload date:
  • Size: 14.1 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.17.tar.gz
Algorithm Hash digest
SHA256 69bb71ccad6cf5be397dde1c8f26b4188140a09ed32ea1c92e70660749ceb0b6
MD5 31eff1c1bdb47794ce4e255781057b8f
BLAKE2b-256 921b17765f532ad623d40535204498ce9b1905107b59853fb53004ac8faba942

See more details on using hashes here.

File details

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

File metadata

  • Download URL: threadmem-0.2.17-py3-none-any.whl
  • Upload date:
  • Size: 16.8 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.17-py3-none-any.whl
Algorithm Hash digest
SHA256 2dc7cdeee97b3d9ebcbfdb5ce9aad02fcdbd6718171355d6a0434bd6654b3520
MD5 65e10a3892b8fe290e97ea533f5019ad
BLAKE2b-256 42bd2aa95ca5158bc2a80261a6d8ce580d857b56a18282ccb00dd8c15e798134

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