<div align="center">
<h1>Memor: A Python Library for Managing and Transferring Conversational Memory Across LLMs</h1>
<br/>
<a href="https://codecov.io/gh/openscilab/memor"><img src="https://codecov.io/gh/openscilab/memor/branch/dev/graph/badge.svg?token=TS5IAEXX7O"></a>
<a href="https://badge.fury.io/py/memor"><img src="https://badge.fury.io/py/memor.svg" alt="PyPI version"></a>
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/built%20with-Python3-green.svg" alt="built with Python3"></a>
<a href="https://github.com/openscilab/memor"><img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/openscilab/memor"></a>
<a href="https://discord.gg/cZxGwZ6utB"><img src="https://img.shields.io/discord/1064533716615049236.svg" alt="Discord Channel"></a>
</div>
----------
## Overview
<p align="justify">
Memor is a library designed to help users manage the memory of their interactions with Large Language Models (LLMs).
It enables users to seamlessly access and utilize the history of their conversations when prompting LLMs.
That would create a more personalized and context-aware experience.
Memor stands out by allowing users to transfer conversational history across different LLMs, eliminating cold starts where models don't have information about user and their preferences.
Users can select specific parts of past interactions with one LLM and share them with another.
By bridging the gap between isolated LLM instances, Memor revolutionizes the way users interact with AI by making transitions between models smoother.
</p>
<table>
<tr>
<td align="center">PyPI Counter</td>
<td align="center">
<a href="https://pepy.tech/projects/memor">
<img src="https://static.pepy.tech/badge/memor">
</a>
</td>
</tr>
<tr>
<td align="center">Github Stars</td>
<td align="center">
<a href="https://github.com/openscilab/memor">
<img src="https://img.shields.io/github/stars/openscilab/memor.svg?style=social&label=Stars">
</a>
</td>
</tr>
</table>
<table>
<tr>
<td align="center">Branch</td>
<td align="center">main</td>
<td align="center">dev</td>
</tr>
<tr>
<td align="center">CI</td>
<td align="center">
<img src="https://github.com/openscilab/memor/actions/workflows/test.yml/badge.svg?branch=main">
</td>
<td align="center">
<img src="https://github.com/openscilab/memor/actions/workflows/test.yml/badge.svg?branch=dev">
</td>
</tr>
</table>
<table>
<tr>
<td align="center">Code Quality</td>
<td align="center"><a href="https://www.codefactor.io/repository/github/openscilab/memor"><img src="https://www.codefactor.io/repository/github/openscilab/memor/badge" alt="CodeFactor"></a></td>
<td align="center"><a href="https://app.codacy.com/gh/openscilab/memor/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img src="https://app.codacy.com/project/badge/Grade/3758f5116c4347ce957997bb7f679cfa"/></a></td>
<td align="center"><a href="https://codebeat.co/projects/github-com-openscilab-memor-main"><img alt="codebeat badge" src="https://codebeat.co/badges/cd9a4239-280d-415d-95dd-faeea9270668"></a></td>
</tr>
</table>
## Installation
### PyPI
- Check [Python Packaging User Guide](https://packaging.python.org/installing/)
- Run `pip install memor==0.1`
### Source code
- Download [Version 0.1](https://github.com/openscilab/memor/archive/v0.1.zip) or [Latest Source](https://github.com/openscilab/memor/archive/dev.zip)
- Run `pip install .`
## Usage
Define your prompt and the response(s) to that; Memor will wrap it into a object with a templated representation.
```pycon
>>> from memor import Prompt, Response, Role
>>> from memor import PresetPromptTemplate, PromptRenderFormat
>>> response = Response(message="I am fine.", role=Role.ASSISTANT, temperature=0.9, score=0.9)
>>> prompt = Prompt(message="Hello, how are you?",
responses=[response],
role=Role.USER,
template=PresetPromptTemplate.INSTRUCTION1.PROMPT_RESPONSE_STANDARD)
>>> prompt.render(render_format=PromptRenderFormat.OPENAI)
[{'role': 'user', 'content': "I'm providing you with a history of a previous conversation. Please consider this context when responding to my new question.\nPrompt: Hello, how are you?\nResponse: I am fine."}]
```
## Issues & bug reports
Just fill an issue and describe it. We'll check it ASAP! or send an email to [memor@openscilab.com](mailto:memor@openscilab.com "memor@openscilab.com").
- Please complete the issue template
You can also join our discord server
<a href="https://discord.gg/cZxGwZ6utB">
<img src="https://img.shields.io/discord/1064533716615049236.svg?style=for-the-badge" alt="Discord Channel">
</a>
## References
## Show your support
### Star this repo
Give a ⭐️ if this project helped you!
### Donate to our project
If you do like our project and we hope that you do, can you please support us? Our project is not and is never going to be working for profit. We need the money just so we can continue doing what we do ;-) .
<a href="https://openscilab.com/#donation" target="_blank"><img src="https://github.com/openscilab/memor/raw/main/otherfiles/donation.png" height="90px" width="270px" alt="Memor Donation"></a>
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [0.1] - 2025-02-12
### Added
- `Prompt` class
- `Response` class
- `PromptTemplate` class
- `PresetPromptTemplate` class
[Unreleased]: https://github.com/openscilab/memor/compare/v0.1...dev
[0.1]: https://github.com/openscilab/memor/compare/6594313...v0.1
Raw data
{
"_id": null,
"home_page": "https://github.com/openscilab/memor",
"name": "memor",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "llm memory management conversational history ai agent",
"author": "Memor Development Team",
"author_email": "memor@openscilab.com",
"download_url": "https://files.pythonhosted.org/packages/d6/fa/a3f5d76da101c2da7e3b0d901ee6652ef00d4ff82e684b6c34229b8c05d2/memor-0.1.tar.gz",
"platform": null,
"description": "\n<div align=\"center\">\n <h1>Memor: A Python Library for Managing and Transferring Conversational Memory Across LLMs</h1>\n <br/>\n <a href=\"https://codecov.io/gh/openscilab/memor\"><img src=\"https://codecov.io/gh/openscilab/memor/branch/dev/graph/badge.svg?token=TS5IAEXX7O\"></a>\n <a href=\"https://badge.fury.io/py/memor\"><img src=\"https://badge.fury.io/py/memor.svg\" alt=\"PyPI version\"></a>\n <a href=\"https://www.python.org/\"><img src=\"https://img.shields.io/badge/built%20with-Python3-green.svg\" alt=\"built with Python3\"></a>\n <a href=\"https://github.com/openscilab/memor\"><img alt=\"GitHub repo size\" src=\"https://img.shields.io/github/repo-size/openscilab/memor\"></a>\n <a href=\"https://discord.gg/cZxGwZ6utB\"><img src=\"https://img.shields.io/discord/1064533716615049236.svg\" alt=\"Discord Channel\"></a>\n</div>\n\n----------\n\n\n## Overview\n<p align=\"justify\">\nMemor is a library designed to help users manage the memory of their interactions with Large Language Models (LLMs).\nIt enables users to seamlessly access and utilize the history of their conversations when prompting LLMs.\nThat would create a more personalized and context-aware experience.\nMemor stands out by allowing users to transfer conversational history across different LLMs, eliminating cold starts where models don't have information about user and their preferences.\nUsers can select specific parts of past interactions with one LLM and share them with another.\nBy bridging the gap between isolated LLM instances, Memor revolutionizes the way users interact with AI by making transitions between models smoother.\n\n</p>\n<table>\n <tr>\n <td align=\"center\">PyPI Counter</td>\n <td align=\"center\">\n <a href=\"https://pepy.tech/projects/memor\">\n <img src=\"https://static.pepy.tech/badge/memor\">\n </a>\n </td>\n </tr>\n <tr>\n <td align=\"center\">Github Stars</td>\n <td align=\"center\">\n <a href=\"https://github.com/openscilab/memor\">\n <img src=\"https://img.shields.io/github/stars/openscilab/memor.svg?style=social&label=Stars\">\n </a>\n </td>\n </tr>\n</table>\n<table>\n <tr> \n <td align=\"center\">Branch</td>\n <td align=\"center\">main</td>\n <td align=\"center\">dev</td>\n </tr>\n <tr>\n <td align=\"center\">CI</td>\n <td align=\"center\">\n <img src=\"https://github.com/openscilab/memor/actions/workflows/test.yml/badge.svg?branch=main\">\n </td>\n <td align=\"center\">\n <img src=\"https://github.com/openscilab/memor/actions/workflows/test.yml/badge.svg?branch=dev\">\n </td>\n </tr>\n</table>\n<table>\n <tr> \n <td align=\"center\">Code Quality</td>\n <td align=\"center\"><a href=\"https://www.codefactor.io/repository/github/openscilab/memor\"><img src=\"https://www.codefactor.io/repository/github/openscilab/memor/badge\" alt=\"CodeFactor\"></a></td>\n <td align=\"center\"><a href=\"https://app.codacy.com/gh/openscilab/memor/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade\"><img src=\"https://app.codacy.com/project/badge/Grade/3758f5116c4347ce957997bb7f679cfa\"/></a></td>\n <td align=\"center\"><a href=\"https://codebeat.co/projects/github-com-openscilab-memor-main\"><img alt=\"codebeat badge\" src=\"https://codebeat.co/badges/cd9a4239-280d-415d-95dd-faeea9270668\"></a></td>\n </tr>\n</table>\n\n\n## Installation\n\n### PyPI\n- Check [Python Packaging User Guide](https://packaging.python.org/installing/)\n- Run `pip install memor==0.1`\n### Source code\n- Download [Version 0.1](https://github.com/openscilab/memor/archive/v0.1.zip) or [Latest Source](https://github.com/openscilab/memor/archive/dev.zip)\n- Run `pip install .`\n\n## Usage\nDefine your prompt and the response(s) to that; Memor will wrap it into a object with a templated representation.\n\n```pycon\n>>> from memor import Prompt, Response, Role\n>>> from memor import PresetPromptTemplate, PromptRenderFormat\n>>> response = Response(message=\"I am fine.\", role=Role.ASSISTANT, temperature=0.9, score=0.9)\n>>> prompt = Prompt(message=\"Hello, how are you?\",\n responses=[response],\n role=Role.USER,\n template=PresetPromptTemplate.INSTRUCTION1.PROMPT_RESPONSE_STANDARD)\n>>> prompt.render(render_format=PromptRenderFormat.OPENAI)\n[{'role': 'user', 'content': \"I'm providing you with a history of a previous conversation. Please consider this context when responding to my new question.\\nPrompt: Hello, how are you?\\nResponse: I am fine.\"}]\n```\n\n## Issues & bug reports\n\nJust fill an issue and describe it. We'll check it ASAP! or send an email to [memor@openscilab.com](mailto:memor@openscilab.com \"memor@openscilab.com\"). \n\n- Please complete the issue template\n \nYou can also join our discord server\n\n<a href=\"https://discord.gg/cZxGwZ6utB\">\n <img src=\"https://img.shields.io/discord/1064533716615049236.svg?style=for-the-badge\" alt=\"Discord Channel\">\n</a>\n\n## References\n\n## Show your support\n\n\n### Star this repo\n\nGive a \u2b50\ufe0f if this project helped you!\n\n### Donate to our project\nIf you do like our project and we hope that you do, can you please support us? Our project is not and is never going to be working for profit. We need the money just so we can continue doing what we do ;-) .\t\t\t\n\n<a href=\"https://openscilab.com/#donation\" target=\"_blank\"><img src=\"https://github.com/openscilab/memor/raw/main/otherfiles/donation.png\" height=\"90px\" width=\"270px\" alt=\"Memor Donation\"></a>\n# Changelog\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)\nand this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).\n\n## [Unreleased]\n## [0.1] - 2025-02-12\n### Added\n- `Prompt` class\n- `Response` class\n- `PromptTemplate` class\n- `PresetPromptTemplate` class\n\n\n[Unreleased]: https://github.com/openscilab/memor/compare/v0.1...dev\n[0.1]: https://github.com/openscilab/memor/compare/6594313...v0.1\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Memor: A Python Library for Managing and Transferring Conversational Memory Across LLMs",
"version": "0.1",
"project_urls": {
"Download": "https://github.com/openscilab/memor/tarball/v0.1",
"Homepage": "https://github.com/openscilab/memor",
"Source": "https://github.com/openscilab/memor"
},
"split_keywords": [
"llm",
"memory",
"management",
"conversational",
"history",
"ai",
"agent"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "09bb628e477eed1afaa8fe978274cd018635c52528500458c702d448281bcb53",
"md5": "3c143d34408930d25b2fc45ae5b119c1",
"sha256": "3367358cbc4d648e9c168648708b0754c99fe33333fd6a43b9d321c64f629145"
},
"downloads": -1,
"filename": "memor-0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3c143d34408930d25b2fc45ae5b119c1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 15353,
"upload_time": "2025-02-12T10:51:25",
"upload_time_iso_8601": "2025-02-12T10:51:25.999082Z",
"url": "https://files.pythonhosted.org/packages/09/bb/628e477eed1afaa8fe978274cd018635c52528500458c702d448281bcb53/memor-0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "d6faa3f5d76da101c2da7e3b0d901ee6652ef00d4ff82e684b6c34229b8c05d2",
"md5": "2be044722be9d5a25634e4c7e4f7849b",
"sha256": "79126f05298c3c4781423114d86b59cb45d64449c45b06c543f5e8080a8477a8"
},
"downloads": -1,
"filename": "memor-0.1.tar.gz",
"has_sig": false,
"md5_digest": "2be044722be9d5a25634e4c7e4f7849b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 17389,
"upload_time": "2025-02-12T10:51:24",
"upload_time_iso_8601": "2025-02-12T10:51:24.075438Z",
"url": "https://files.pythonhosted.org/packages/d6/fa/a3f5d76da101c2da7e3b0d901ee6652ef00d4ff82e684b6c34229b8c05d2/memor-0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-12 10:51:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "openscilab",
"github_project": "memor",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [],
"lcname": "memor"
}