Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5390e2d
build: optimize dependencies management
Ki-Seki Jul 17, 2025
39e59d1
Merge branch 'dev' into feat/dependency-resolve
Ki-Seki Jul 17, 2025
3b851eb
build: drop deprecated sections
Ki-Seki Jul 17, 2025
6922d6b
fix: correct typo and commands
Ki-Seki Jul 17, 2025
24ebea6
refactor: optimize pyproject.toml
Ki-Seki Jul 17, 2025
c8a6d62
ci: add Python release testing workflow
Ki-Seki Jul 17, 2025
bf0c064
build: optimize version constraints and optional groups
Ki-Seki Jul 17, 2025
997b405
fix: update patch paths for SentenceChunker and QdrantClient in tests
Ki-Seki Jul 17, 2025
9ee7c52
ci: enhance dependency and building test
Ki-Seki Jul 17, 2025
5338d93
docs: update installation instructions
Ki-Seki Jul 17, 2025
2389aeb
fix: move ruff dependency to test group
Ki-Seki Jul 17, 2025
06065a9
fix: specify encoding
Ki-Seki Jul 17, 2025
0f8fa3a
fix: refine wheel and sdist installation steps for OS-specific handling
Ki-Seki Jul 17, 2025
76b56e5
fix: update Windows installation commands to use PowerShell syntax
Ki-Seki Jul 17, 2025
4b0ea81
chore: add comments for clarity in Python tests workflow
Ki-Seki Jul 17, 2025
cac1931
fix: report slowest tests
Ki-Seki Jul 17, 2025
0b1bcd1
Merge branch 'dev' into feat/dependency-resolve
Ki-Seki Jul 18, 2025
3804a36
ci: support macos-13 as much as possible
Ki-Seki Jul 18, 2025
fd77d0f
fix: macos-13 testing
Ki-Seki Jul 18, 2025
a7d034d
chore: add comments
Ki-Seki Jul 18, 2025
bd729ae
chore: update comments in pyproject.toml
Ki-Seki Jul 18, 2025
b5da6ea
docs: support all platforms
Ki-Seki Jul 18, 2025
1bc6277
fix: poetry update
Ki-Seki Jul 18, 2025
91c7695
fix: move scikit-learn and qdrant-client
Ki-Seki Jul 18, 2025
b8c4a76
docs: clarify optional dependencies
Ki-Seki Jul 18, 2025
ffdb0f5
Merge branch 'dev' into feat/dependency-resolve
CaralHsi Jul 19, 2025
54d5e4a
Merge branch 'dev' into feat/dependency-resolve
CaralHsi Jul 19, 2025
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
52 changes: 47 additions & 5 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
os:
- "ubuntu-latest"
- "windows-latest"
- "macos-13"
- "macos-14"
- "macos-15"
# Ref: https://docs.github.com/en/actions/how-tos/writing-workflows/choosing-where-your-workflow-runs/choosing-the-runner-for-a-job
Expand All @@ -46,13 +47,54 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install dependencies

# Dependency and building tests
- name: Install main dependencies
run: |
poetry install --no-root --no-interaction
- name: Check no top-level optional dependencies
run: |
poetry run python scripts/check_dependencies.py
- name: Build sdist and wheel
run: poetry build
- name: Test wheel installation on Windows
if: startsWith(matrix.os, 'windows')
run: |
Get-ChildItem dist/*.whl | ForEach-Object { pip install $_.FullName }
pip uninstall -y memoryos
- name: Test wheel installation on Linux / Mac
if: ${{ !startsWith(matrix.os, 'windows') }}
run: |
pip install dist/*.whl
pip uninstall -y memoryos
- name: Test sdist installation on Windows
if: startsWith(matrix.os, 'windows')
run: |
poetry install --no-interaction --with dev --with test
- name: Test with ruff
Get-ChildItem dist/*.tar.gz | ForEach-Object { pip install $_.FullName }
pip uninstall -y memoryos
- name: Test sdist installation on Linux / Mac
if: ${{ !startsWith(matrix.os, 'windows') }}
run: |
pip install dist/*.tar.gz
pip uninstall -y memoryos

# Ruff checks
- name: Install test group dependencies
run: |
poetry install --no-interaction --with test
- name: Ruff checks
run: |
poetry run ruff check
poetry run ruff format --check
- name: Test with pytest

# PyTest checks
- name: Install all extra dependencies
# macos-13 doesn't support torch==2.7.1
# So, pytest won't work
if: ${{ !startsWith(matrix.os, 'macos-13') }}
run: |
poetry install --no-interaction --extras all
- name: PyTest unit tests
if: ${{ !startsWith(matrix.os, 'macos-13') }}
run: |
poetry run pytest tests -vv
poetry run pytest tests -vv --durations=10
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.PHONY: test

install:
poetry install --with dev --with test
poetry install --extras all --with dev --with test
poetry run pre-commit install --install-hooks

clean:
Expand Down
2 changes: 1 addition & 1 deletion evaluation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This repository provides tools and scripts for evaluating the LoCoMo dataset usi

2. Install the required dependencies:
```bash
poetry install --with eval
poetry install --extras all --with eval
```

## Configuration
Expand Down
2,294 changes: 1,306 additions & 988 deletions poetry.lock

Large diffs are not rendered by default.

185 changes: 135 additions & 50 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,48 +1,143 @@
# Poetry related
[project]
##############################################################################
# Here define the project metadata and dependencies for the MemoryOS package.
##############################################################################

[tool.poetry]
name = "MemoryOS"
version = "0.2.0"
description = "Intelligence Begins with Memory"
license = "Apache-2.0"
authors = ["MemTensor <lizy@memtensor.cn>"]
license = {text = "Apache-2.0"}
readme = "README.md"
requires-python = ">=3.10,<3.14"
authors = [
{name = "MemTensor", email = "MemTensor@memtensor.cn"}
]
keywords = [
"memory",
"llm",
"language model",
"memoryOS",
"agent",
"kv cache",
"lora",
]
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Natural Language :: Chinese (Simplified)",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"openai (>=1.77.0,<2.0.0)",
"ollama (>=0.4.8,<0.5.0)",
"transformers (>=4.51.3,<5.0.0)",
"tenacity (>=9.1.2,<10.0.0)", # Error handling and retrying library
"fastapi[all] (>=0.115.12,<0.116.0)", # Web framework for building APIs
"sqlalchemy (>=2.0.41,<3.0.0)", # SQL toolkit
]

[project.urls]
homepage = "https://memos.openmem.net/"
repository = "https://github.com/MemTensor/MemOS"
keywords = ["memory", "llm", "language model", "memoryOS", "agent"]
packages = [{include = "memos", from = "src"}]
download = "https://pypi.org/project/MemoryOS/#files"
changelog = "https://github.com/MemTensor/MemOS/releases"
releasenotes = "https://github.com/MemTensor/MemOS/releases"
documentation = "https://memos-docs.openmem.net/home/overview/"
issues = "https://github.com/MemTensor/MemOS/issues"

[project.scripts]
memos = "memos.cli:main"

[project.optional-dependencies]
# These are optional dependencies for various features of MemoryOS.
# Developers install: `poetry install --extras <feature>`. e.g., `poetry install --extras general-mem`
# Users install: `pip install MemoryOS[<feature>]`. e.g., `pip install MemoryOS[general-mem]`

# TreeTextualMemory
tree-mem = [
"neo4j (>=5.28.1,<6.0.0)", # Graph database
"schedule (>=1.2.2,<2.0.0)", # Task scheduling
"scikit-learn (>=1.7.0,<2.0.0)", # Machine learning
]

# MemScheduler
mem-scheduler = [
"redis (>=6.2.0,<7.0.0)", # Key-value store
"pika (>=1.3.2,<2.0.0)", # RabbitMQ client
]

# MemReader
mem-reader = [
"chonkie (>=1.0.7,<2.0.0)", # Sentence chunking library
"markitdown[docx,pdf,pptx,xls,xlsx] (>=0.1.1,<0.2.0)", # Markdown parser for various file formats
]

# All optional dependencies
# Allow users to install with `pip install MemoryOS[all]`
all = [
# Exist in the above optional groups
"qdrant-client (>=1.14.2,<2.0.0)",
"neo4j (>=5.28.1,<6.0.0)",
"schedule (>=1.2.2,<2.0.0)",
"scikit-learn (>=1.7.0,<2.0.0)",
"redis (>=6.2.0,<7.0.0)",
"pika (>=1.3.2,<2.0.0)",

# NOT exist in the above optional groups
# Because they are either huge-size dependencies or infrequently used dependencies.
# We kindof don't want users to install them.
"torch (>=2.7.1,<3.0.0)",
"markitdown[docx,pdf,pptx,xls,xlsx] (>=0.1.1,<0.2.0)",
"chonkie (>=1.0.7,<2.0.0)",
"sentence-transformers (>=4.1.0,<5.0.0)",
"volcengine-python-sdk (>=4.0.4,<5.0.0)"
]


[build-system]
##############################################################################
# Python package build system requirements.
##############################################################################

requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.dependencies]
python = "^3.10"
openai = "^1.77.0"
ollama = "^0.4.8"
qdrant-client = "^1.14.2"
transformers = "^4.51.3"
markitdown = {extras = ["docx", "pdf", "pptx", "xls", "xlsx"], version = "^0.1.1"}
chonkie = "^1.0.7"
tenacity = "^9.1.2"
neo4j = "^5.28.1"
accelerate = "^1.7.0"
fastapi = {extras = ["all"], version = "^0.115.12"}
sentence-transformers = "^4.1.0"
sqlalchemy = "^2.0.41"
redis = "^6.2.0"
pika = "^1.3.2"
schedule = "^1.2.2"
volcengine-python-sdk = "^4.0.4"

[tool.poetry]
##############################################################################
# Here mainly define dependencies for development, testing, and evaluation.
# These dependencies will NOT be included in the MemoryOS package itself.
# They will be installed when you run `poetry install --with dev,test,eval`.
#
# More about version specifiers (e.g. "^0.1.0" or ">=0.1.0,<0.2.0"):
# https://python-poetry.org/docs/dependency-specification#caret-requirements
##############################################################################

packages = [{include = "memos", from = "src"}]
requires-poetry = ">=2.0"

[tool.poetry.group.dev]
optional = false
optional = true

[tool.poetry.group.dev.dependencies]
pre-commit = "^4.2.0"
ruff = "^0.11.8"


[tool.poetry.group.test]
optional = false
optional = true

[tool.poetry.group.test.dependencies]
pytest = "^8.3.5"
pytest-asyncio = "^0.23.5"
ruff = "^0.11.8"

[tool.poetry.group.eval]
optional = true
Expand All @@ -59,41 +154,33 @@ python-dotenv = "^1.1.1"
langgraph = "^0.5.1"
langmem = "^0.0.27"

[tool.poetry.scripts]
memos = "memos.cli:main"

[[tool.poetry.source]]
name = "mirrors"
url = "https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/"
priority = "supplemental"


# Building related

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"


# Testing related

[tool.pytest.ini_options]
##############################################################################
# PyTest settings for running tests/
##############################################################################

asyncio_mode = "auto"
pythonpath = "src"
filterwarnings = [
"ignore::DeprecationWarning:qdrant_client.*",
]


# Linting related

[tool.ruff]
##############################################################################
# Ruff is a fast Python linter and formatter.
##############################################################################

fix = true
line-length = 100
target-version = "py310"

[tool.ruff.lint]
extend-select = [
lint.extend-select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"ERA", # flake8-eradicate/eradicate
Expand All @@ -103,15 +190,13 @@ extend-select = [
"PGH", # pygrep
"RUF", # ruff checks
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"TC", # flake8-type-checking
"TID", # flake8-tidy-imports
"UP", # pyupgrade
]
ignore = [
lint.ignore = [
"RUF001", # ambiguous-unicode-character-string
"PGH003", # blanket-type-ignore
]

[tool.ruff.lint.isort]
lines-between-types = 1
lines-after-imports = 2
lint.isort.lines-between-types = 1
lint.isort.lines-after-imports = 2
Loading