Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ services:
environment:
- PYTHONPATH=/app/src
- HF_ENDPOINT=https://hf-mirror.com
- QDRANT_HOST=qdrant-docker
- QDRANT_PORT=6333
- NEO4J_URI=bolt://neo4j-docker:7687
volumes:
- ../src:/app/src
- .:/app/docker
Expand All @@ -29,7 +32,7 @@ services:
- "7474:7474" # HTTP
- "7687:7687" # Bolt
healthcheck:
test: wget http://localhost:7687 || exit 1
test: wget http://localhost:7474 || exit 1
interval: 1s
timeout: 10s
retries: 20
Expand All @@ -44,7 +47,7 @@ services:
- memos_network

qdrant:
image: qdrant/qdrant:v1.15.0
image: qdrant/qdrant:v1.15.3
container_name: qdrant-docker
ports:
- "6333:6333" # REST API
Expand Down
297 changes: 160 additions & 137 deletions docker/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,137 +1,160 @@
annotated-types==0.7.0 ; python_version >= "3.10" and python_version < "4.0"
anyio==4.9.0 ; python_version >= "3.10" and python_version < "4.0"
attrs==25.3.0 ; python_version >= "3.10" and python_version < "4.0"
authlib==1.6.0 ; python_version >= "3.10" and python_version < "4.0"
beautifulsoup4==4.13.4 ; python_version >= "3.10" and python_version < "4.0"
certifi==2025.7.14 ; python_version >= "3.10" and python_version < "4.0"
cffi==1.17.1 ; python_version >= "3.10" and python_version < "4.0" and platform_python_implementation != "PyPy"
cfgv==3.4.0 ; python_version >= "3.10" and python_version < "4.0"
charset-normalizer==3.4.2 ; python_version >= "3.10" and python_version < "4.0"
chonkie==1.1.1 ; python_version >= "3.10" and python_version < "4.0"
click==8.2.1 ; python_version >= "3.10" and python_version < "4.0"
cobble==0.1.4 ; python_version >= "3.10" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.10" and python_version < "4.0" and (platform_system == "Windows" or sys_platform == "win32")
coloredlogs==15.0.1 ; python_version >= "3.10" and python_version < "4.0"
cryptography==45.0.5 ; python_version >= "3.10" and python_version < "4.0"
cyclopts==3.22.2 ; python_version >= "3.10" and python_version < "4.0"
defusedxml==0.7.1 ; python_version >= "3.10" and python_version < "4.0"
distlib==0.4.0 ; python_version >= "3.10" and python_version < "4.0"
distro==1.9.0 ; python_version >= "3.10" and python_version < "4.0"
dnspython==2.7.0 ; python_version >= "3.10" and python_version < "4.0"
docstring-parser==0.16 ; python_version >= "3.10" and python_version < "4.0"
docutils==0.21.2 ; python_version >= "3.10" and python_version < "4.0"
email-validator==2.2.0 ; python_version >= "3.10" and python_version < "4.0"
et-xmlfile==2.0.0 ; python_version >= "3.10" and python_version < "4.0"
exceptiongroup==1.3.0 ; python_version >= "3.10" and python_version < "4.0"
fastapi-cli==0.0.8 ; python_version >= "3.10" and python_version < "4.0"
fastapi-cloud-cli==0.1.4 ; python_version >= "3.10" and python_version < "4.0"
fastapi==0.115.14 ; python_version >= "3.10" and python_version < "4.0"
fastmcp==2.10.5 ; python_version >= "3.10" and python_version < "4.0"
filelock==3.18.0 ; python_version >= "3.10" and python_version < "4.0"
flatbuffers==25.2.10 ; python_version >= "3.10" and python_version < "4.0"
fsspec==2025.7.0 ; python_version >= "3.10" and python_version < "4.0"
greenlet==3.2.3 ; python_version >= "3.10" and python_version < "3.14" and (platform_machine == "aarch64" or platform_machine == "ppc64le" or platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "AMD64" or platform_machine == "win32" or platform_machine == "WIN32")
h11==0.16.0 ; python_version >= "3.10" and python_version < "4.0"
hf-xet==1.1.5 ; python_version >= "3.10" and python_version < "4.0" and (platform_machine == "x86_64" or platform_machine == "amd64" or platform_machine == "arm64" or platform_machine == "aarch64")
httpcore==1.0.9 ; python_version >= "3.10" and python_version < "4.0"
httptools==0.6.4 ; python_version >= "3.10" and python_version < "4.0"
httpx-sse==0.4.1 ; python_version >= "3.10" and python_version < "4.0"
httpx==0.28.1 ; python_version >= "3.10" and python_version < "4.0"
huggingface-hub==0.33.4 ; python_version >= "3.10" and python_version < "4.0"
humanfriendly==10.0 ; python_version >= "3.10" and python_version < "4.0"
identify==2.6.12 ; python_version >= "3.10" and python_version < "4.0"
idna==3.10 ; python_version >= "3.10" and python_version < "4.0"
iniconfig==2.1.0 ; python_version >= "3.10" and python_version < "4.0"
itsdangerous==2.2.0 ; python_version >= "3.10" and python_version < "4.0"
jinja2==3.1.6 ; python_version >= "3.10" and python_version < "4.0"
jiter==0.10.0 ; python_version >= "3.10" and python_version < "4.0"
joblib==1.5.1 ; python_version >= "3.10" and python_version < "4.0"
jsonschema-specifications==2025.4.1 ; python_version >= "3.10" and python_version < "4.0"
jsonschema==4.24.1 ; python_version >= "3.10" and python_version < "4.0"
lxml==6.0.0 ; python_version >= "3.10" and python_version < "4.0"
magika==0.6.2 ; python_version >= "3.10" and python_version < "4.0"
mammoth==1.9.1 ; python_version >= "3.10" and python_version < "4.0"
markdown-it-py==3.0.0 ; python_version >= "3.10" and python_version < "4.0"
markdownify==1.1.0 ; python_version >= "3.10" and python_version < "4.0"
markitdown==0.1.2 ; python_version >= "3.10" and python_version < "4.0"
markupsafe==3.0.2 ; python_version >= "3.10" and python_version < "4.0"
mcp==1.12.0 ; python_version >= "3.10" and python_version < "4.0"
mdurl==0.1.2 ; python_version >= "3.10" and python_version < "4.0"
mpmath==1.3.0 ; python_version >= "3.10" and python_version < "4.0"
neo4j==5.28.1 ; python_version >= "3.10" and python_version < "4.0"
nodeenv==1.9.1 ; python_version >= "3.10" and python_version < "4.0"
numpy==2.2.6 ; python_version == "3.10"
numpy==2.3.1 ; python_version >= "3.11" and python_version < "4.0"
ollama==0.4.9 ; python_version >= "3.10" and python_version < "4.0"
onnxruntime==1.22.1 ; python_version >= "3.10" and python_version < "4.0"
openai==1.97.0 ; python_version >= "3.10" and python_version < "4.0"
openapi-pydantic==0.5.1 ; python_version >= "3.10" and python_version < "4.0"
openpyxl==3.1.5 ; python_version >= "3.10" and python_version < "4.0"
orjson==3.11.0 ; python_version >= "3.10" and python_version < "4.0"
packaging==25.0 ; python_version >= "3.10" and python_version < "4.0"
pandas==2.3.1 ; python_version >= "3.10" and python_version < "4.0"
pdfminer-six==20250506 ; python_version >= "3.10" and python_version < "4.0"
pillow==11.3.0 ; python_version >= "3.10" and python_version < "4.0"
platformdirs==4.3.8 ; python_version >= "3.10" and python_version < "4.0"
pluggy==1.6.0 ; python_version >= "3.10" and python_version < "4.0"
pre-commit==4.2.0 ; python_version >= "3.10" and python_version < "4.0"
protobuf==6.31.1 ; python_version >= "3.10" and python_version < "4.0"
pycparser==2.22 ; python_version >= "3.10" and python_version < "4.0" and platform_python_implementation != "PyPy"
pydantic-core==2.33.2 ; python_version >= "3.10" and python_version < "4.0"
pydantic-extra-types==2.10.5 ; python_version >= "3.10" and python_version < "4.0"
pydantic-settings==2.10.1 ; python_version >= "3.10" and python_version < "4.0"
pydantic==2.11.7 ; python_version >= "3.10" and python_version < "4.0"
pygments==2.19.2 ; python_version >= "3.10" and python_version < "4.0"
pyperclip==1.9.0 ; python_version >= "3.10" and python_version < "4.0"
pyreadline3==3.5.4 ; python_version >= "3.10" and python_version < "4.0" and sys_platform == "win32"
pytest-asyncio==0.23.8 ; python_version >= "3.10" and python_version < "4.0"
pytest==8.4.1 ; python_version >= "3.10" and python_version < "4.0"
python-dateutil==2.9.0.post0 ; python_version >= "3.10" and python_version < "4.0"
python-dotenv==1.1.1 ; python_version >= "3.10" and python_version < "4.0"
python-multipart==0.0.20 ; python_version >= "3.10" and python_version < "4.0"
python-pptx==1.0.2 ; python_version >= "3.10" and python_version < "4.0"
pytz==2025.2 ; python_version >= "3.10" and python_version < "4.0"
pywin32==311 ; python_version >= "3.10" and python_version < "4.0" and (platform_system == "Windows" or sys_platform == "win32")
pyyaml==6.0.2 ; python_version >= "3.10" and python_version < "4.0"
referencing==0.36.2 ; python_version >= "3.10" and python_version < "4.0"
regex==2024.11.6 ; python_version >= "3.10" and python_version < "4.0"
requests==2.32.4 ; python_version >= "3.10" and python_version < "4.0"
rich-rst==1.3.1 ; python_version >= "3.10" and python_version < "4.0"
rich-toolkit==0.14.8 ; python_version >= "3.10" and python_version < "4.0"
rich==14.0.0 ; python_version >= "3.10" and python_version < "4.0"
rignore==0.6.2 ; python_version >= "3.10" and python_version < "4.0"
rpds-py==0.26.0 ; python_version >= "3.10" and python_version < "4.0"
ruff==0.11.13 ; python_version >= "3.10" and python_version < "4.0"
safetensors==0.5.3 ; python_version >= "3.10" and python_version < "4.0"
schedule==1.2.2 ; python_version >= "3.10" and python_version < "4.0"
scikit-learn==1.7.0 ; python_version >= "3.10" and python_version < "4.0"
scipy==1.15.3 ; python_version == "3.10"
scipy==1.16.0 ; python_version >= "3.11" and python_version < "4.0"
sentry-sdk==2.33.0 ; python_version >= "3.10" and python_version < "4.0"
shellingham==1.5.4 ; python_version >= "3.10" and python_version < "4.0"
six==1.17.0 ; python_version >= "3.10" and python_version < "4.0"
sniffio==1.3.1 ; python_version >= "3.10" and python_version < "4.0"
soupsieve==2.7 ; python_version >= "3.10" and python_version < "4.0"
sqlalchemy==2.0.41 ; python_version >= "3.10" and python_version < "4.0"
sse-starlette==2.4.1 ; python_version >= "3.10" and python_version < "4.0"
starlette==0.46.2 ; python_version >= "3.10" and python_version < "4.0"
sympy==1.14.0 ; python_version >= "3.10" and python_version < "4.0"
tenacity==9.1.2 ; python_version >= "3.10" and python_version < "4.0"
threadpoolctl==3.6.0 ; python_version >= "3.10" and python_version < "4.0"
tokenizers==0.21.2 ; python_version >= "3.10" and python_version < "4.0"
tomli==2.2.1 ; python_version == "3.10"
tqdm==4.67.1 ; python_version >= "3.10" and python_version < "4.0"
transformers==4.53.2 ; python_version >= "3.10" and python_version < "4.0"
typer==0.16.0 ; python_version >= "3.10" and python_version < "4.0"
typing-extensions==4.14.1 ; python_version >= "3.10" and python_version < "4.0"
typing-inspection==0.4.1 ; python_version >= "3.10" and python_version < "4.0"
tzdata==2025.2 ; python_version >= "3.10" and python_version < "4.0"
ujson==5.10.0 ; python_version >= "3.10" and python_version < "4.0"
urllib3==2.5.0 ; python_version >= "3.10" and python_version < "4.0"
uvicorn==0.35.0 ; python_version >= "3.10" and python_version < "4.0"
uvloop==0.21.0 ; python_version >= "3.10" and python_version < "4.0" and platform_python_implementation != "PyPy" and sys_platform != "win32" and sys_platform != "cygwin"
virtualenv==20.31.2 ; python_version >= "3.10" and python_version < "4.0"
watchfiles==1.1.0 ; python_version >= "3.10" and python_version < "4.0"
websockets==15.0.1 ; python_version >= "3.10" and python_version < "4.0"
xlrd==2.0.2 ; python_version >= "3.10" and python_version < "4.0"
xlsxwriter==3.2.5 ; python_version >= "3.10" and python_version < "4.0"
# 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
attrs==25.3.0
authlib==1.6.0
beautifulsoup4==4.13.4
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
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
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
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-sse==0.4.1
httpx==0.28.1
huggingface-hub==0.33.4
humanfriendly==10.0
hyperframe==6.1.0
idna==3.10
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
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
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
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
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
redis==6.2.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
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 excluded for lighter Docker images (very large package ~2GB)
# If needed for ML/AI features, uncomment:
# torch==2.7.1
# triton==3.3.1
tqdm==4.67.1
transformers==4.53.2
typer==0.16.0
typing-extensions==4.14.1
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
12 changes: 6 additions & 6 deletions src/memos/api/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,22 +186,22 @@ def get_neo4j_community_config(user_id: str | None = None) -> dict[str, Any]:
return {
"uri": os.getenv("NEO4J_URI", "bolt://localhost:7687"),
"user": os.getenv("NEO4J_USER", "neo4j"),
"db_name": os.getenv("NEO4J_DB_NAME", "shared-tree-textual-memory"),
"db_name": os.getenv("NEO4J_DB_NAME", "neo4j"),
"password": os.getenv("NEO4J_PASSWORD", "12345678"),
"user_name": f"memos{user_id.replace('-', '')}",
"auto_create": True,
"auto_create": False,
"use_multi_db": False,
"embedding_dimension": int(os.getenv("EMBEDDING_DIMENSION", 3072)),
"embedding_dimension": int(os.getenv("EMBEDDING_DIMENSION", 1024)),
"vec_config": {
# Pass nested config to initialize external vector DB
# If you use qdrant, please use Server instead of local mode.
"backend": "qdrant",
"config": {
"collection_name": "neo4j_vec_db",
"vector_dimension": int(os.getenv("EMBEDDING_DIMENSION", 3072)),
"vector_dimension": int(os.getenv("EMBEDDING_DIMENSION", 1024)),
"distance_metric": "cosine",
"host": "localhost",
"port": 6333,
"host": os.getenv("QDRANT_HOST", "localhost"),
"port": int(os.getenv("QDRANT_PORT", "6333")),
},
},
}
Expand Down
10 changes: 10 additions & 0 deletions src/memos/api/start_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,3 +421,13 @@ async def global_exception_handler(request: Request, exc: Exception):
status_code=500,
content={"code": 500, "message": str(exc), "data": None},
)


if __name__ == "__main__":
import argparse

parser = argparse.ArgumentParser()
parser.add_argument("--port", type=int, default=8000, help="Port to run the server on")
parser.add_argument("--host", type=str, default="0.0.0.0", help="Host to run the server on")
parser.add_argument("--reload", action="store_true", help="Enable auto-reload for development")
args = parser.parse_args()
3 changes: 2 additions & 1 deletion src/memos/memories/activation/kv.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import os
import pickle

from datetime import datetime
from importlib.metadata import version
from packaging.version import Version

from packaging.version import Version
from transformers import DynamicCache

from memos.configs.memory import KVCacheMemoryConfig
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json
import re

from datetime import datetime

from dateutil import parser
Expand All @@ -14,6 +15,7 @@
MEMORY_RELATION_RESOLVER_PROMPT,
)


logger = get_logger(__name__)


Expand Down
Loading