-
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 .
If you are using arm-based computers, modify command above into:
sudo docker build -f DockerfileArm --network=host -t memoryscope .
-
Launch Docker container
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.yml
to change environment variable.OPENAI_API_KEY: "sk-0000000000"
-
Run
docker-compose run memory_scope_main
to build and launch the memory-scope cli interface. (For ARM architecture, you should editdocker-compose.yml
, changingimage: ghcr.io/modelscope/memoryscope:main
toimage: ghcr.io/modelscope/memoryscope_arm:main
)
-
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