Skip to main content

A library for managing LLM conversation history

Project description

MemexLLM

CI codecov PyPI version Python versions

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

Choose the installation option that best suits your needs:

Basic Installation

pip install memexllm

OpenAI Installation

pip install memexllm[openai]

Development Installation

pip install memexllm[dev]

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()

# 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.

Feature Roadmap

Here are the planned features and improvements for MemexLLM:

Short-term Goals

  • OpenAI integration
  • Memory storage backend
  • FIFO algorithm
  • Anthropic integration
  • LiteLLM integration
  • MongoDB storage backend support
  • SQLite storage backend support
  • Redis storage backend support
  • PostgreSQL storage backend support
  • Conversation summarization algorithm
  • Other algorithms
  • Export conversations to various formats (JSON, CSV, PDF)

Medium-term Goals

  • Advanced conversation analytics
  • Integration with popular LLM providers
  • Conversation branching and versioning

Long-term Goals

  • Distributed storage support
  • Multi-modal conversation support
  • Advanced privacy and security features
  • API Gateway integration
  • Enterprise-grade features

Contributing

We welcome contributions from the community! Here's how you can help:

Ways to Contribute

  1. Code Contributions

    • Fork the repository
    • Create a feature branch
    • Write clean, documented, and tested code
    • Submit a pull request
  2. Bug Reports

    • Use the GitHub issue tracker
    • Include detailed steps to reproduce
    • Provide system information and context
  3. Feature Requests

    • Open a GitHub issue with the "enhancement" label
    • Describe the feature and its use cases
    • Discuss with the community
  4. Documentation

    • Help improve documentation
    • Write tutorials and examples
    • Fix typos and clarify explanations

Development Setup

  1. Clone the repository:

    git clone https://github.com/eyenpi/memexllm.git
    cd memexllm
    
  2. Install development dependencies:

    pip install -e ".[dev]"
    
  3. Install pre-commit hooks:

    pip install pre-commit
    pre-commit install
    

Running Tests

pytest tests/

Code Style

  • We follow PEP 8 guidelines
  • Use Black for code formatting
  • Use isort for import sorting
  • Write meaningful commit messages

Review Process

  1. All code changes require tests
  2. CI must pass
  3. Code review by maintainers
  4. Documentation updates if needed

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

memexllm-0.0.3.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

memexllm-0.0.3-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file memexllm-0.0.3.tar.gz.

File metadata

  • Download URL: memexllm-0.0.3.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for memexllm-0.0.3.tar.gz
Algorithm Hash digest
SHA256 5913a4cc639d56248f97327d73af46f41de722cdd1781b571ffe44f09d69a32e
MD5 b55ce9477024a12ae53b8e950b549d5d
BLAKE2b-256 27ab8ef341c8085d8629ebb22b683feabbd2e921dddae1022e7f4c2d4460a047

See more details on using hashes here.

Provenance

The following attestation bundles were made for memexllm-0.0.3.tar.gz:

Publisher: publish.yml on eyenpi/MemexLLM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file memexllm-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: memexllm-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for memexllm-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 73970f2fb3fe5417e7a3a822c96568e7445a21115345cb09224352c9b5d0d137
MD5 377257653787c731e891157126244452
BLAKE2b-256 ad5c55d2147b4436f2769ad18ad8364299c258a85675dde07bd873ea9fc3fa13

See more details on using hashes here.

Provenance

The following attestation bundles were made for memexllm-0.0.3-py3-none-any.whl:

Publisher: publish.yml on eyenpi/MemexLLM

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page