diff --git a/docker/.env.example b/docker/.env.example index 85d9080a5..ca3abde94 100644 --- a/docker/.env.example +++ b/docker/.env.example @@ -20,7 +20,7 @@ MOS_TOP_K=50 ## Chat LLM (main dialogue) MOS_CHAT_MODEL=gpt-4o-mini MOS_CHAT_TEMPERATURE=0.8 -MOS_MAX_TOKENS=8000 +MOS_MAX_TOKENS=2048 MOS_TOP_P=0.9 MOS_CHAT_MODEL_PROVIDER=openai # openai | huggingface | vllm MOS_MODEL_SCHEMA=memos.configs.llm.VLLMLLMConfig # vllm only: config class path; keep default unless you extend it @@ -51,9 +51,18 @@ MOS_RERANKER_HEADERS_EXTRA= # extra headers, JSON string, e.g. {"A MOS_RERANKER_STRATEGY=single_turn MOS_RERANK_SOURCE= # optional rerank scope, e.g., history/stream/custom + +# External Services (for evaluation scripts) +ZEP_API_KEY=your_zep_api_key_here +MEM0_API_KEY=your_mem0_api_key_here +MODEL=gpt-4o-mini +EMBEDDING_MODEL=nomic-embed-text:latest + ## Internet search & preference memory ENABLE_INTERNET=false BOCHA_API_KEY= # required if ENABLE_INTERNET=true +XINYU_API_KEY= +XINYU_SEARCH_ENGINE_ID= SEARCH_MODE=fast # fast | fine | mixture FAST_GRAPH=false BM25_CALL=false @@ -121,6 +130,7 @@ POLAR_DB_USER=root POLAR_DB_PASSWORD=123456 POLAR_DB_DB_NAME=shared_memos_db POLAR_DB_USE_MULTI_DB=false +POLARDB_POOL_MAX_CONN=100 ## Redis (scheduler queue) — fill only if you want scheduler queues in Redis; otherwise in-memory queue is used REDIS_HOST=localhost # global Redis endpoint (preferred over MEMSCHEDULER_*) @@ -170,3 +180,11 @@ OSS_PUBLIC_BASE_URL= ## SDK / external client MEMOS_API_KEY= MEMOS_BASE_URL=https://memos.memtensor.cn/api/openmem/v1 + +CHAT_MODEL_LIST='[{ + "backend": "deepseek", + "api_base": "http://localhost:1234", + "api_key": "your-api-key", + "model_name_or_path": "deepseek-r1", + "support_models": ["deepseek-r1"] +}]' diff --git a/docker/Dockerfile b/docker/Dockerfile index 29636881c..13fb477d9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -32,4 +32,4 @@ ENV PYTHONPATH=/app/src EXPOSE 8000 # Start the docker -CMD ["uvicorn", "memos.api.product_api:app", "--host", "0.0.0.0", "--port", "8000", "--reload"] +CMD ["uvicorn", "memos.api.server_api:app", "--host", "0.0.0.0", "--port", "8000", "--reload"] \ No newline at end of file diff --git a/docker/requirements-full.txt b/docker/requirements-full.txt new file mode 100644 index 000000000..538f5e578 --- /dev/null +++ b/docker/requirements-full.txt @@ -0,0 +1,186 @@ +# Generated from poetry.lock - Main dependencies +# This file contains all transitive dependencies for the production build. + +annotated-types==0.7.0 +anyio==4.9.0 +async-timeout==5.0.1 +attrs==25.3.0 +authlib==1.6.0 +beautifulsoup4==4.13.4 +cachetools==6.2.1 +certifi==2025.7.14 +cffi==1.17.1 +charset-normalizer==3.4.2 +chonkie==1.1.1 +click==8.2.1 +cobble==0.1.4 +colorama==0.4.6 +coloredlogs==15.0.1 +concurrent-log-handler==0.9.28 +cryptography==45.0.5 +cyclopts==3.22.2 +datasketch==1.6.5 +defusedxml==0.7.1 +distro==1.9.0 +dnspython==2.7.0 +docstring-parser==0.16 +docutils==0.21.2 +email-validator==2.2.0 +et-xmlfile==2.0.0 +exceptiongroup==1.3.0 +fastapi==0.115.14 +fastapi-cli==0.0.8 +fastapi-cloud-cli==0.1.4 +fastmcp==2.10.5 +filelock==3.18.0 +flatbuffers==25.2.10 +fsspec==2025.7.0 +greenlet==3.2.3 +grpcio==1.73.1 +h11==0.16.0 +h2==4.2.0 +hf-xet==1.1.5 +hpack==4.1.0 +httpcore==1.0.9 +httptools==0.6.4 +httpx==0.28.1 +httpx-sse==0.4.1 +huggingface-hub==0.33.4 +humanfriendly==10.0 +hyperframe==6.1.0 +idna==3.10 +itsdangerous==2.2.0 +jieba==0.42 +jinja2==3.1.6 +jiter==0.10.0 +joblib==1.5.1 +jsonpatch==1.33 +jsonpointer==3.0.0 +jsonschema==4.24.1 +jsonschema-specifications==2025.4.1 +langchain-core==1.1.0 +langchain-text-splitters==1.0.0 +langsmith==0.4.7 +lxml==6.0.0 +magika==0.6.2 +mammoth==1.9.1 +markdown-it-py==3.0.0 +markdownify==1.1.0 +markitdown==0.1.2 +markupsafe==3.0.2 +mcp==1.12.0 +mdurl==0.1.2 +mpmath==1.3.0 +neo4j==5.28.1 +networkx==3.5 +nltk==3.9.1 +numpy==2.3.1 +nvidia-cublas-cu12==12.6.4.1 +nvidia-cuda-cupti-cu12==12.6.80 +nvidia-cuda-nvrtc-cu12==12.6.77 +nvidia-cuda-runtime-cu12==12.6.77 +nvidia-cudnn-cu12==9.5.1.17 +nvidia-cufft-cu12==11.3.0.4 +nvidia-cufile-cu12==1.11.1.6 +nvidia-curand-cu12==10.3.7.77 +nvidia-cusolver-cu12==11.7.1.2 +nvidia-cusparse-cu12==12.5.4.2 +nvidia-cusparselt-cu12==0.6.3 +nvidia-nccl-cu12==2.26.2 +nvidia-nvjitlink-cu12==12.6.85 +nvidia-nvtx-cu12==12.6.77 +ollama==0.4.9 +onnxruntime==1.22.1 +openai==1.97.0 +openapi-pydantic==0.5.1 +openpyxl==3.1.5 +orjson==3.11.0 +packaging==25.0 +pandas==2.3.1 +pdfminer-six==20250506 +pika==1.3.2 +pillow==11.3.0 +portalocker==2.10.1 +prometheus-client==0.23.1 +protobuf==6.31.1 +pycparser==2.22 +pydantic==2.11.7 +pydantic-core==2.33.2 +pydantic-extra-types==2.10.5 +pydantic-settings==2.10.1 +pygments==2.19.2 +pymilvus==2.6.2 +pymysql==1.1.2 +python-dateutil==2.9.0.post0 +python-dotenv==1.1.1 +python-multipart==0.0.20 +python-pptx==1.0.2 +pytz==2025.2 +pyyaml==6.0.2 +qdrant-client==1.14.3 +rake-nltk==1.0.6 +rank-bm25==0.2.2 +redis==6.2.0 +referencing==0.36.2 +regex==2024.11.6 +requests==2.32.4 +requests-toolbelt==1.0.0 +rich==14.0.0 +rich-rst==1.3.1 +rich-toolkit==0.14.8 +rignore==0.6.2 +rpds-py==0.26.0 +safetensors==0.5.3 +schedule==1.2.2 +scikit-learn==1.7.0 +scipy==1.16.0 +sentence-transformers==4.1.0 +sentry-sdk==2.33.0 +setuptools==80.9.0 +shellingham==1.5.4 +six==1.17.0 +sniffio==1.3.1 +soupsieve==2.7 +sqlalchemy==2.0.41 +sse-starlette==2.4.1 +starlette==0.46.2 +sympy==1.14.0 +tenacity==9.1.2 +threadpoolctl==3.6.0 +tokenizers==0.21.2 +torch +tqdm==4.67.1 +transformers==4.53.2 +triton==3.5.0 +typer==0.16.0 +typing-extensions +typing-inspection==0.4.1 +tzdata==2025.2 +ujson==5.10.0 +urllib3==2.5.0 +uvicorn==0.35.0 +uvloop==0.21.0 +volcengine-python-sdk==4.0.6 +watchfiles==1.1.0 +websockets==15.0.1 +xlrd==2.0.2 +xlsxwriter==3.2.5 +zstandard==0.23.0 +prometheus_client==0.23.1 +beartype==0.22.5 +diskcache==5.6.3 +iniconfig==2.3.0 +jaraco.classes==3.4.0 +jaraco.context==6.0.1 +jaraco.functools==4.3.0 +keyring==25.6.0 +more-itertools==10.8.0 +pathable==0.4.4 +pathvalidate==3.3.1 +platformdirs==4.5.0 +pluggy==1.6.0 +psycopg2-binary==2.9.9 +py-key-value-aio==0.2.8 +py-key-value-shared==0.2.8 +PyJWT==2.10.1 +pytest==9.0.2 \ No newline at end of file diff --git a/docker/requirements.txt b/docker/requirements.txt index 8890ce679..738a53920 100644 --- a/docker/requirements.txt +++ b/docker/requirements.txt @@ -1,6 +1,3 @@ -# Docker optimized requirements - Core dependencies only -# Excludes Windows-specific and heavy GPU packages for faster builds - annotated-types==0.7.0 anyio==4.9.0 async-timeout==5.0.1 @@ -20,146 +17,112 @@ cryptography==45.0.5 cyclopts==3.22.2 defusedxml==0.7.1 distro==1.9.0 -dnspython==2.7.0 -docstring-parser==0.16 -docutils==0.21.2 -email-validator==2.2.0 -et-xmlfile==2.0.0 +dnspython==2.8.0 +docstring_parser==0.17.0 +docutils==0.22.3 +email-validator==2.3.0 exceptiongroup==1.3.0 -fastapi-cli==0.0.8 -fastapi-cloud-cli==0.1.4 fastapi==0.115.14 -fastmcp==2.10.5 -filelock==3.18.0 -flatbuffers==25.2.10 -fsspec==2025.7.0 -greenlet==3.2.3 -grpcio==1.73.1 +fastapi-cli==0.0.16 +fastapi-cloud-cli==0.3.1 +fastmcp==2.13.0.2 +filelock==3.20.0 +fsspec==2025.10.0 +grpcio==1.76.0 +neo4j==5.28.1 h11==0.16.0 -h2==4.2.0 -hf-xet==1.1.5 -hpack==4.1.0 +hf-xet==1.2.0 httpcore==1.0.9 -httptools==0.6.4 -httpx-sse==0.4.1 +httptools==0.7.1 httpx==0.28.1 -huggingface-hub==0.33.4 -humanfriendly==10.0 -hyperframe==6.1.0 -idna==3.10 +httpx-sse==0.4.3 +huggingface-hub==0.36.0 +idna==3.11 +iniconfig==2.3.0 itsdangerous==2.2.0 -jinja2==3.1.6 -jiter==0.10.0 -joblib==1.5.1 -jsonschema-specifications==2025.4.1 -jsonschema==4.24.1 -lxml==6.0.0 -magika==0.6.2 -mammoth==1.9.1 -markdown-it-py==3.0.0 -markdownify==1.1.0 -markitdown==0.1.2 -markupsafe==3.0.2 -mcp==1.12.0 +jaraco.classes==3.4.0 +jaraco.context==6.0.1 +jaraco.functools==4.3.0 +jieba==0.42 +Jinja2==3.1.6 +jiter==0.12.0 +joblib==1.5.2 +jsonschema==4.25.1 +jsonschema-path==0.3.4 +jsonschema-specifications==2025.9.1 +keyring==25.6.0 +markdown-it-py==4.0.0 +MarkupSafe==3.0.3 +mcp==1.21.1 mdurl==0.1.2 -mpmath==1.3.0 -neo4j==5.28.1 -networkx==3.5 -numpy==2.3.1 -# NVIDIA CUDA packages excluded for lighter Docker images -# If GPU support is needed, uncomment relevant packages below: -# nvidia-cublas-cu12==12.6.4.1 -# nvidia-cuda-cupti-cu12==12.6.80 -# nvidia-cuda-nvrtc-cu12==12.6.77 -# nvidia-cuda-runtime-cu12==12.6.77 -# nvidia-cudnn-cu12==9.5.1.17 -# nvidia-cufft-cu12==11.3.0.4 -# nvidia-cufile-cu12==1.11.1.6 -# nvidia-curand-cu12==10.3.7.77 -# nvidia-cusolver-cu12==11.7.1.2 -# nvidia-cusparse-cu12==12.5.4.2 -# nvidia-cusparselt-cu12==0.6.3 -# nvidia-nccl-cu12==2.26.2 -# nvidia-nvjitlink-cu12==12.6.85 -# nvidia-nvtx-cu12==12.6.77 +more-itertools==10.8.0 +numpy==2.3.4 ollama==0.4.9 -onnxruntime==1.22.1 -openai==1.97.0 +openai==1.109.1 openapi-pydantic==0.5.1 -openpyxl==3.1.5 -orjson==3.11.0 +orjson==3.11.4 packaging==25.0 -pandas==2.3.1 -pdfminer-six==20250506 +pandas==2.3.3 +pathable==0.4.4 +pathvalidate==3.3.1 pika==1.3.2 -pillow==11.3.0 -portalocker==2.10.1 -protobuf==6.31.1 -pycparser==2.22 -pydantic-core==2.33.2 -pydantic-extra-types==2.10.5 -pydantic-settings==2.10.1 -pydantic==2.11.7 -pygments==2.19.2 -pymysql==1.1.1 -pyperclip==1.9.0 -# Windows-specific packages excluded: -# pyreadline3==3.5.4 # Windows only -# pywin32==311 # Windows only +platformdirs==4.5.0 +pluggy==1.6.0 +portalocker==3.2.0 +prometheus_client==0.23.1 +protobuf==6.33.1 +psycopg2-binary==2.9.9 +py-key-value-aio==0.2.8 +py-key-value-shared==0.2.8 +pycparser==2.23 +pydantic==2.12.4 +pydantic-extra-types==2.10.6 +pydantic-settings==2.12.0 +pydantic_core==2.41.5 +Pygments==2.19.2 +PyJWT==2.10.1 +pymilvus==2.6.5 +PyMySQL==1.1.2 +pyperclip==1.11.0 +pytest==9.0.2 python-dateutil==2.9.0.post0 -python-dotenv==1.1.1 +python-dotenv==1.2.1 python-multipart==0.0.20 -python-pptx==1.0.2 pytz==2025.2 -pyyaml==6.0.2 -qdrant-client==1.14.3 -redis==6.2.0 +PyYAML==6.0.3 +qdrant-client +redis==6.4.0 referencing==0.36.2 -regex==2024.11.6 -requests==2.32.4 -rich-rst==1.3.1 -rich-toolkit==0.14.8 -rich==14.0.0 -rignore==0.6.2 -rpds-py==0.26.0 -safetensors==0.5.3 -schedule==1.2.2 -scikit-learn==1.7.0 -scipy==1.16.0 -sentence-transformers==4.1.0 -sentry-sdk==2.33.0 +regex==2025.11.3 +requests==2.32.5 +rich==14.2.0 +rich-rst==1.3.2 +rich-toolkit==0.15.1 +rignore==0.7.6 +rpds-py==0.28.0 +safetensors==0.6.2 +scikit-learn==1.7.2 +scipy==1.16.3 +sentry-sdk==2.44.0 setuptools==80.9.0 shellingham==1.5.4 six==1.17.0 sniffio==1.3.1 -soupsieve==2.7 -sqlalchemy==2.0.41 -sse-starlette==2.4.1 +SQLAlchemy==2.0.44 +sse-starlette==3.0.3 starlette==0.46.2 -sympy==1.14.0 tenacity==9.1.2 threadpoolctl==3.6.0 -tokenizers==0.21.2 -# Torch excluded for lighter Docker images (very large package ~2GB) -# If needed for ML/AI features, uncomment: -# torch==2.7.1 -# triton==3.3.1 +tokenizers==0.22.1 tqdm==4.67.1 -transformers==4.53.2 -typer==0.16.0 -typing-extensions==4.14.1 -typing-inspection==0.4.1 +transformers==4.57.1 +typer==0.20.0 +typing-inspection==0.4.2 +typing_extensions==4.15.0 tzdata==2025.2 -ujson==5.10.0 +ujson==5.11.0 urllib3==2.5.0 -uvicorn==0.35.0 -uvloop==0.21.0 -volcengine-python-sdk==4.0.6 -watchfiles==1.1.0 -websockets==15.0.1 -xlrd==2.0.2 -xlsxwriter==3.2.5 -prometheus-client==0.23.1 -pymilvus==2.5.12 -nltk==3.9.1 -rake-nltk==1.0.6 +uvicorn==0.38.0 +uvloop==0.22.1 +watchfiles==1.1.1 +websockets==15.0.1 \ No newline at end of file