Home

Awesome

English | 中文 | 日本語

MemoryScope

<p align="center"> <img src="./docs/images/logo.png" alt="MemoryScopeLogo" width="75%"> </p> Equip your LLM chatbot with a powerful and flexible long term memory system.


📰 News


🌟 What is MemoryScope?

MemoryScope provides LLM chatbots with powerful and flexible long-term memory capabilities, offering a framework for building such abilities. It can be applied to scenarios like personal assistants and emotional companions, continuously learning through long-term memory to remember users' basic information as well as various habits and preferences. This allows users to gradually experience a sense of "understanding" when using the LLM.

Demo

<p align="center"> <img src="https://github.com/user-attachments/assets/1754c814-1342-4288-a8a3-74d0b40f59a6" alt="en_demo" width="75%"> </p>

Framework

<p align="center"> <img src="./docs/images/framework.png" alt="Framework" width="75%"> </p>

💾 Memory Database: MemoryScope is equipped with a vector database (default is ElasticSearch) to store all memory fragments recorded in the system.

🔧 Worker Library: MemoryScope atomizes the capabilities of long-term memory into individual workers, including over 20 workers for tasks such as query information filtering, observation extraction, and insight updating.

🛠️ Operation Library: Based on the worker pipeline, it constructs the operations for memory services, realizing key capabilities such as memory retrieval and memory consolidation.

⚙️ Best Practices:

Main Features

⚡ Low response-time (RT) for the user:

🌲 Hierarchical and coherent memory:

⏰ Time awareness:


💼 Supported Model API

BackendTaskSome Supported Models
openai_backendGenerationgpt-4o, gpt-4o-mini, gpt-4, gpt-3.5-turbo
Embeddingtext-embedding-ada-002, text-embedding-3-large, text-embedding-3-small
dashscope_backendGenerationqwen-max, qwen-plus, qwen-plus, qwen2-72b-instruct
Embeddingtext-embedding-v1, text-embedding-v2
Rerankergte-rerank

In the future, we will support more model interfaces and local deployment of LLM and embedding services.

🚀 Installation

For installation, please refer to Installation.md.

🍕 Quick Start

💡 Contribute

Contributions are always encouraged!

We highly recommend install pre-commit hooks in this repo before committing pull requests. These hooks are small house-keeping scripts executed every time you make a git commit, which will take care of the formatting and linting automatically.

pip install -e .
pre-commit install

Please refer to our Contribution Guide for more details.

📖 Citation

Reference to cite if you use MemoryScope in a paper:

@software{MemoryScope,
author = {Li Yu and 
          Tiancheng Qin and
          Qingxu Fu and
          Sen Huang and
          Xianzhe Xu and
          Zhaoyang Liu and
          Boyin Liu},
month = {09},
title = {{MemoryScope}},
url = {https://github.com/modelscope/MemoryScope},
year = {2024}
}