-
Clone the repository and edit settings
# clone project git clone https://github.com/modelscope/memoryscope cd memoryscope # edit configuration, e.g. add api keys vim memoryscope/core/config/demo_config.yaml
-
Build Docker image
sudo docker build --network=host -t memoryscope . -
Launch Docker container (ARM architecture not yet supported)
sudo docker run -it --rm --net=host memoryscope
Important
To inspect memory shift during the conversation, modify command in step 3 to sudo docker run -it --name=memoryscope_container --rm --net=host memoryscope;
Then start a new terminal window and execute sudo docker exec -it memoryscope_container python quick-start-demo.py --config_path=memoryscope/core/config/demo_config_zh.yaml;
In the second window, input /list_memory refresh_time=5 to inspect memory
-
Clone the repository and edit settings
# clone project git clone https://github.com/modelscope/memoryscope cd memoryscope # edit configuration, e.g. add api keys vim memoryscope/core/config/demo_config.yaml
-
Edit
docker-compose.ymlto change environment variable.OPENAI_API_KEY: "sk-0000000000" -
Run
docker-compose run memory_scope_mainto build and launch the memory-scope cli interface. (ARM architecture not yet supported)
-
Install from PyPI
pip install memoryscope
-
Run Elasticsearch service, refer to elasticsearch documents. The docker method is recommended:
sudo docker run -p 9200:9200 \ -e "discovery.type=single-node" \ -e "xpack.security.enabled=false" \ -e "xpack.license.self_generated.type=trial" \ docker.elastic.co/elasticsearch/elasticsearch:8.13.2 -
Test Chinese / Dashscope Configuration
export DASHSCOPE_API_KEY="sk-0000000000" memoryscope --language="cn" \ --memory_chat_class="cli_memory_chat" \ --human_name="用户" \ --assistant_name="AI" \ --generation_backend="dashscope_generation" \ --generation_model="qwen-max" \ --embedding_backend="dashscope_embedding" \ --embedding_model="text-embedding-v2" \ --enable_ranker=True \ --rank_backend="dashscope_rank" \ --rank_model="gte-rerank"
-
Test English / OpenAI Configuration
export OPENAI_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" memoryscope --language="en" \ --memory_chat_class="cli_memory_chat" \ --human_name="User" \ --assistant_name="AI" \ --generation_backend="openai_generation" \ --generation_model="gpt-4o" \ --embedding_backend="openai_embedding" \ --embedding_model="text-embedding-3-small" \ --enable_ranker=False
-
Clone the repository and edit settings
# clone project git clone https://github.com/modelscope/memoryscope cd memoryscope # edit configuration, e.g. add api keys vim memoryscope/core/config/demo_config.yaml
-
Install
pip install -e . -
Run Elasticsearch service, refer to elasticsearch documents. The docker method is recommended:
sudo docker run -p 9200:9200 \ -e "discovery.type=single-node" \ -e "xpack.security.enabled=false" \ -e "xpack.license.self_generated.type=trial" \ docker.elastic.co/elasticsearch/elasticsearch:8.13.2 -
Launch memoryscope, also refer to cli documents
export OPENAI_API_KEY="sk-0000000000" python quick-start-demo.py --config_path=memoryscope/core/config/demo_config_zh.yaml