A simple Python library for managing chat message history in langchain
Project description
Memory Bank
Memory Bank is a simple Python library for managing chat message history in memory. It provides an easy way to create, store, and retrieve chat messages for different sessions.
Installation
Straightforward installation with pipenv in case you want to try out the test cases. Be sure to install dependencies in development mode as well.
Features
- Create unique memory sessions
- Store and retrieve chat messages
- Asynchronous support
- Clear message history
- Session-based memory management
API Reference
MemoryBank
- create_memory(): Creates a new Memory instance with a unique session ID.
- get_memory(session_id): Retrieves a Memory instance by session ID.
Memory
- add_message(message): Adds a message to the memory.
- add_messages(messages): Adds multiple messages to the memory.
- clear(): Clears all messages from the memory.
- get_messages(): Returns all messages in the memory.
- get_session_id(): Returns the session ID of the memory.
- activate_memory(): Returns a dictionary with the session ID.
- Async versions of these methods are also available with the prefix a (e.g., aadd_messages, aclear, aget_messages).
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
memory_bank-0.1.2.tar.gz
(3.4 kB
view details)
Built Distribution
File details
Details for the file memory_bank-0.1.2.tar.gz
.
File metadata
- Download URL: memory_bank-0.1.2.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4488693d395ea6d2f0591162eaece80df0a9f0d18a137bfd6f48ff7aec14e2ef |
|
MD5 | 1b31c115ee93fa21eac8162dcfaf742a |
|
BLAKE2b-256 | 07377bb4c794c612a55ed96b9516e1b175776af1365427611b5f43be3857e236 |
File details
Details for the file memory_bank-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: memory_bank-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d33eae53c14467fe4e76d347999c7f5aae6ef2c0b938be8730c361b1909fded |
|
MD5 | 97678edaef1426e8cf7da0231c833af1 |
|
BLAKE2b-256 | 66a6de087db8ece59756d298d11b900e73ace7349a820588693731a682c54cca |