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.4.tar.gz (15.2 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.4-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: memexllm-0.0.4.tar.gz
  • Upload date:
  • Size: 15.2 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.4.tar.gz
Algorithm Hash digest
SHA256 e03a46a42e638fb94e794022ffcd6d91d725b314bc9c33234f50bbd24cf9cfc5
MD5 cf888425b54af04452e88963c0f15088
BLAKE2b-256 887667c4bf93b30c7efb28238914a4a37057df2f3e031d04ff968945f38c61df

See more details on using hashes here.

Provenance

The following attestation bundles were made for memexllm-0.0.4.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.4-py3-none-any.whl.

File metadata

  • Download URL: memexllm-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 19.1 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c8b41a01a723364a108591f7bba717dd7449e3b877b2b8896f403088b6a388db
MD5 5f07aa8dc942e4ba463f14e416389161
BLAKE2b-256 d44dbc49ab1e4360cf7039f227d247a2ba8a91c7282071e46cd7578fdbc0aeb8

See more details on using hashes here.

Provenance

The following attestation bundles were made for memexllm-0.0.4-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