A library for managing LLM conversation history
Project description
MemexLLM
Overview
MemexLLM is a Python library for managing and storing LLM conversations. It provides a flexible and extensible framework for history management, storage, and retrieval of conversations.
Installation
pip install memexllm
Quick Usage
from memexllm.storage import MemoryStorage
from memexllm.algorithms import FIFOAlgorithm
from memexllm.core import HistoryManager
# Initialize components
storage = MemoryStorage()
algorithm = FIFOAlgorithm(max_messages=100)
history_manager = HistoryManager(storage=storage, algorithm=algorithm)
# Create a conversation thread
thread = history_manager.create_thread(metadata={"user": "alice"})
# Add messages
history_manager.add_message(
thread_id=thread.id,
content="Hello, how can I help you today?",
role="assistant"
)
# Retrieve conversation
thread = history_manager.get_thread(thread.id)
for msg in thread.messages:
print(f"{msg.role}: {msg.content}")
For more examples, check out the examples directory.
Development
Setup
- Install pre-commit hooks:
pip install pre-commit pre-commit install
This will automatically format your code with black and isort before each commit.
Running Tests
pytest tests/
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file memexllm-0.0.2.tar.gz.
File metadata
- Download URL: memexllm-0.0.2.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6bb0c62528aed75cd44cc6a8c2297d3b38b167bd963631a05eca7ce0f5b9836
|
|
| MD5 |
41c346607011f4eaa42a7d4c63bf13d3
|
|
| BLAKE2b-256 |
e3461fff2b9c0a1e55cb5e8b024d9d077760645d0d001a3072a4a7d54af250e0
|
Provenance
The following attestation bundles were made for memexllm-0.0.2.tar.gz:
Publisher:
publish.yml on eyenpi/MemexLLM
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
memexllm-0.0.2.tar.gz -
Subject digest:
f6bb0c62528aed75cd44cc6a8c2297d3b38b167bd963631a05eca7ce0f5b9836 - Sigstore transparency entry: 173484496
- Sigstore integration time:
-
Permalink:
eyenpi/MemexLLM@ceeef8d5425af62301643eb3847f50b0dfa48348 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/eyenpi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ceeef8d5425af62301643eb3847f50b0dfa48348 -
Trigger Event:
release
-
Statement type:
File details
Details for the file memexllm-0.0.2-py3-none-any.whl.
File metadata
- Download URL: memexllm-0.0.2-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3801b6c16adcc92bde331d317982092d1749cb8900ee76d1c500dd486a852b09
|
|
| MD5 |
093ddd79c217817ded4bdec4fdbb66da
|
|
| BLAKE2b-256 |
fc0330c27e2afb66b1ad0fe8aea766b94ba246ced35277c6dfbbee88ee96f553
|
Provenance
The following attestation bundles were made for memexllm-0.0.2-py3-none-any.whl:
Publisher:
publish.yml on eyenpi/MemexLLM
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
memexllm-0.0.2-py3-none-any.whl -
Subject digest:
3801b6c16adcc92bde331d317982092d1749cb8900ee76d1c500dd486a852b09 - Sigstore transparency entry: 173484498
- Sigstore integration time:
-
Permalink:
eyenpi/MemexLLM@ceeef8d5425af62301643eb3847f50b0dfa48348 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/eyenpi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ceeef8d5425af62301643eb3847f50b0dfa48348 -
Trigger Event:
release
-
Statement type: