diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..7774bbe8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# sudo docker build --network=host -t memoryscope . +# sudo docker run -it --net=host memoryscope +FROM python:3.11 + +# 非必要步骤,更换pip源 (以下三行,可以删除) +RUN echo '[global]' > /etc/pip.conf && \ + echo 'index-url = https://mirrors.aliyun.com/pypi/simple/' >> /etc/pip.conf && \ + echo 'trusted-host = mirrors.aliyun.com' >> /etc/pip.conf + +# 安装大部分依赖,利用Docker缓存加速以后的构建 (以下两行,可以删除) +COPY requirements.txt ./ +RUN pip3 install -r requirements.txt + +# 进入工作路径(必要) +WORKDIR /memory_scope_project +COPY . . +RUN pip install -r requirements.txt + +# 启动(必要) +CMD ["python3", "memory_scope/cli.py", "config/docker_config.yaml"] diff --git a/config/docker_config.yaml b/config/docker_config.yaml new file mode 100644 index 00000000..2668a5e7 --- /dev/null +++ b/config/docker_config.yaml @@ -0,0 +1,83 @@ +global_config: + language: cn + max_workers: 5 + dash_scope_apikey: + open_ai_apikey: + +memory_chat: + cli_memory_chat: + class: chat.cli_memory_chat # select class + memory_service: memory_chat_service + generation_model: dashscope_generation + human_name: human + assistant_name: assistant + +memory_service: + memory_chat_service: + class: memory.service.chat_memory_service # select class + history_msg_count: 32 + contextual_msg_count: 6 + read_memory_key: read_memory + memory_operations: + read_message: # define operation + class: memory.operation.read_memory + workflow: dummy_workflow # select workflow + description: "read session messages of the user" + read_memory: + class: memory.operation.read_memory + workflow: dummy_workflow + description: "read related memories of the user" + list_memory: + class: memory.operation.read_memory + workflow: dummy_workflow + description: "read all memories of the user" + write_memory: + class: memory.operation.write_memory + workflow: dummy_workflow + description: "write observation memories of the user" + interval_time: 60 + summary_memory: + class: memory.operation.summary_memory + workflow: dummy_workflow + description: "summary observation memories of the user" + interval_time: 300 + +models: + dashscope_generation: + class: models.llama_index_generation_model # select class + module_name: dashscope_generation + model_name: qwen-max + dashscope_embedding: + class: models.llama_index_embedding_model # select class + module_name: dashscope_embedding + model_name: text-embedding-v2 + dashscope_rank: + class: models.llama_index_rank_model # select class + module_name: dashscope_rank + model_name: gte-rerank + +vector_store: + class: storage.dummy_vector_store # select class + embedding_model: dashscope_embedding + +monitor: + class: storage.dummy_monitor # select class + +worker: + dummy_workflow: + class: memory.worker.dummy_worker + generation_model: dashscope_generation + embedding_model: dashscope_embedding + rank_model: dashscope_rank + retrieve_store_worker: + class: memory.worker.read.retrieve_store_worker + retrieve_obs_top_k: 100 + retrieve_ins_pf_top_k: 100 + fuse_rerank_worker: + class: memory.worker.read.fuse_rerank_worker + fuse_score_threshold: 0.1 + fuse_ratio_dict: + observation: 1 + fuse_time_ratio: 2.0 + fuse_rerank_top_k: 10 +