🐟 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.
Features
- Drop-in Integrations: Add conversation management to your LLM applications with zero code changes using our provider integrations
- Flexible Storage: Choose from memory, SQLite, or bring your own storage backend
- Conversation Management: Organize, retrieve, and manipulate conversation threads with ease
- Memory Management Algorithms: Control conversation context with built-in algorithms (FIFO, summarization, etc.)
- Provider Agnostic: Works with OpenAI, Anthropic, and other LLM providers
- Extensible Architecture: Build custom storage backends and memory management algorithms
Quick Start
Installation
pip install memexllm # Basic installation
pip install memexllm[openai] # With OpenAI support
Basic 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()
# Add messages
history_manager.add_message(
thread_id=thread.id,
content="Hello, how can I help you today?",
role="assistant"
)
Zero-Code-Change Integration
Add conversation management to your OpenAI application with no code changes:
from openai import OpenAI
from memexllm.integrations.openai import with_history
from memexllm.storage import MemoryStorage
from memexllm.algorithms import FIFOAlgorithm
# Initialize your OpenAI client as usual
client = OpenAI(api_key="your-api-key")
# Add conversation memory with history management
storage = MemoryStorage()
algorithm = FIFOAlgorithm(max_messages=100)
history_manager = HistoryManager(storage=storage, algorithm=algorithm)
client = with_history(history_manager=history_manager)(client)
# Use the client as you normally would - conversations are now managed automatically
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello, who are you?"}]
)
Documentation
For detailed documentation, including:
- Complete API reference
- Advanced usage examples
- Available storage backends
- Contributing guidelines
- Feature roadmap
Visit our documentation at: https://eyenpi.github.io/MemexLLM/
Contributing
We welcome contributions! Please see our Contributing Guide for details on how to get started.
License
This project is licensed under the MIT License.
Release files for memexllm 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| memexllm-0.1.0.tar.gz | 20.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| memexllm-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 45.6 kB
Release files / memexllm-0.1.0.tar.gz
| Download URL | memexllm-0.1.0.tar.gz |
|---|---|
| Size | 20.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7d67c85273af4c4a99f999ca846e35d3d235a10bc5d6e047b44def80121a7099
|
|
BLAKE2b-256 checksum How to use checksums |
0cedf2cb492ea9d9842811339f5b6c32f5fbb3938329938357b5449a3d397444
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 8, 2025.
Transparency logRelease files / memexllm-0.1.0-py3-none-any.whl
| Download URL | memexllm-0.1.0-py3-none-any.whl |
|---|---|
| Size | 25.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eb46fe0af279d86fd33cdc6af95017dfcc3c6ff01abda62fa76e3b1c4e7aff8a
|
|
BLAKE2b-256 checksum How to use checksums |
ea07b7c0d8eedaa47646ab8a10854dcf4edd66d790baef3cc75eb0403f10e46c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 8, 2025.
Transparency log