Skip to content

Commit 2e6f6e8

Browse files
MemTensorKi-SekiCaralHsifridayLJ1awei-Yang
committed
MemOS initial commit by MemTensor
Co-authored-by: Shichao Song <60967965+Ki-Seki@users.noreply.github.com> Co-authored-by: CaralHsi <caralhsi@gmail.com> Co-authored-by: chunyu li <78344051+fridayL@users.noreply.github.com> Co-authored-by: jiawei yang <103758578+J1awei-Yang@users.noreply.github.com> Co-authored-by: Wang Hanyu <128483880+MarrytheToilet@users.noreply.github.com> Co-authored-by: Jiahao Huo <2151773@tongji.edu.cn> Co-authored-by: Hao <42795704+Nyakult@users.noreply.github.com> Co-authored-by: Travis Tang <travistang@foxmail.com> Co-authored-by: Jihao Zhao <119649807+Robot2050@users.noreply.github.com> Co-authored-by: spitzblattr <36479200+spitzblattr@users.noreply.github.com> Co-authored-by: siminniu <146621079+siminniu@users.noreply.github.com> Co-authored-by: hush <61102027+hush-cd@users.noreply.github.com> Co-authored-by: Qingchen Yu <92162236+Duguce@users.noreply.github.com> Co-authored-by: Kyrie Chen <kyriiiechen@gmail.com> Co-authored-by: lijicode <34564964+lijicode@users.noreply.github.com> Co-authored-by: 王鹏远(Pengyuan Wang) <18237423458@163.com> Co-authored-by: Zhiyu Li <zhiyulee@ruc.edu.cn> Co-authored-by: Yezhaohui Wang <yezhaohuiwang@gmail.com>
0 parents  commit 2e6f6e8

File tree

298 files changed

+149376
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

298 files changed

+149376
-0
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## Description
2+
3+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
4+
5+
Fixes # (issue)
6+
7+
## Type of change
8+
9+
Please delete options that are not relevant.
10+
11+
- [ ] Bug fix (non-breaking change which fixes an issue)
12+
- [ ] New feature (non-breaking change which adds functionality)
13+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
14+
- [ ] Refactor (does not change functionality, e.g. code style improvements, linting)
15+
- [ ] Documentation update
16+
17+
## How Has This Been Tested?
18+
19+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
20+
21+
Please delete options that are not relevant.
22+
23+
- [ ] Unit Test
24+
- [ ] Test Script (please provide)
25+
26+
## Checklist:
27+
28+
- [ ] My code follows the style guidelines of this project
29+
- [ ] I have performed a self-review of my own code
30+
- [ ] I have commented my code, particularly in hard-to-understand areas
31+
- [ ] My changes generate no new warnings
32+
- [ ] I have added tests that prove my fix is effective or that my feature works
33+
- [ ] New and existing unit tests pass locally with my changes
34+
- [ ] I have checked my code and corrected any misspellings
35+
36+
## Maintainer Checklist
37+
38+
- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
39+
- [ ] Made sure Checks passed

.github/workflows/python-release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Upload Python Package to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
deploy:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Install poetry
18+
run: pipx install poetry
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.10'
23+
- name: Install dependencies
24+
run: |
25+
poetry install --no-interaction
26+
- name: Build package
27+
run: poetry build
28+
- name: Publish package
29+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
30+
with:
31+
user: __token__
32+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/python-tests.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Python tests
5+
6+
on:
7+
push:
8+
branches:
9+
- "main"
10+
- "dev"
11+
- "feat/*"
12+
pull_request:
13+
branches:
14+
- "main"
15+
- "dev"
16+
- "feat/*"
17+
18+
jobs:
19+
build:
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
os:
24+
- "ubuntu-latest"
25+
python-version:
26+
- "3.10"
27+
- "3.11"
28+
- "3.12"
29+
- "3.13"
30+
runs-on: ${{ matrix.os }}
31+
timeout-minutes: 30
32+
33+
steps:
34+
- uses: actions/checkout@v4
35+
- name: Install poetry
36+
run: pipx install poetry
37+
- name: Set up Python ${{ matrix.python-version }}
38+
uses: actions/setup-python@v5
39+
with:
40+
python-version: ${{ matrix.python-version }}
41+
cache: 'poetry'
42+
- name: Install dependencies
43+
run: |
44+
poetry install --no-interaction --with dev --with test
45+
- name: Test with ruff
46+
run: |
47+
poetry run ruff check
48+
poetry run ruff format --check
49+
- name: Test with pytest
50+
run: |
51+
PYTHONPATH=src poetry run pytest tests -vv

.gitignore

Lines changed: 202 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
1+
# MemOS home
2+
.memos/
3+
4+
# Temporary files
5+
tmp/
6+
**/tmp_data/
7+
8+
# evaluation data
9+
evaluation/data/langmemeval
10+
evaluation/*tmp/
11+
evaluation/results
12+
evaluation/.env
13+
evaluation/scripts/*.sh
14+
evaluation/configs/*
15+
.env
16+
17+
# Byte-compiled / optimized / DLL files
18+
__pycache__/
19+
*.py[cod]
20+
*$py.class
21+
22+
# C extensions
23+
*.so
24+
25+
# Distribution / packaging
26+
.Python
27+
build/
28+
develop-eggs/
29+
dist/
30+
downloads/
31+
eggs/
32+
.eggs/
33+
lib/
34+
lib64/
35+
parts/
36+
sdist/
37+
var/
38+
wheels/
39+
share/python-wheels/
40+
*.egg-info/
41+
.installed.cfg
42+
*.egg
43+
MANIFEST
44+
45+
# PyInstaller
46+
# Usually these files are written by a python script from a template
47+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
48+
*.manifest
49+
*.spec
50+
51+
# Installer logs
52+
pip-log.txt
53+
pip-delete-this-directory.txt
54+
55+
# Unit test / coverage reports
56+
htmlcov/
57+
.tox/
58+
.nox/
59+
.coverage
60+
.coverage.*
61+
.cache
62+
nosetests.xml
63+
coverage.xml
64+
*.cover
65+
*.py,cover
66+
.hypothesis/
67+
.pytest_cache/
68+
cover/
69+
70+
# Translations
71+
*.mo
72+
*.pot
73+
74+
# Django stuff:
75+
*.log
76+
local_settings.py
77+
db.sqlite3
78+
db.sqlite3-journal
79+
80+
# Flask stuff:
81+
instance/
82+
.webassets-cache
83+
84+
# Scrapy stuff:
85+
.scrapy
86+
87+
# Sphinx documentation
88+
docs/_build/
89+
90+
# PyBuilder
91+
.pybuilder/
92+
target/
93+
94+
# Jupyter Notebook
95+
.ipynb_checkpoints
96+
97+
# IPython
98+
profile_default/
99+
ipython_config.py
100+
101+
# pyenv
102+
# For a library or package, you might want to ignore these files since the code is
103+
# intended to run in multiple environments; otherwise, check them in:
104+
# .python-version
105+
106+
# pipenv
107+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
108+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
109+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
110+
# install all needed dependencies.
111+
#Pipfile.lock
112+
113+
# poetry
114+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
115+
# This is especially recommended for binary packages to ensure reproducibility, and is more
116+
# commonly ignored for libraries.
117+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
118+
#poetry.lock
119+
120+
# pdm
121+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
122+
#pdm.lock
123+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
124+
# in version control.
125+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
126+
.pdm.toml
127+
.pdm-python
128+
.pdm-build/
129+
130+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
131+
__pypackages__/
132+
133+
# Celery stuff
134+
celerybeat-schedule
135+
celerybeat.pid
136+
137+
# SageMath parsed files
138+
*.sage.py
139+
140+
# Environments
141+
.env
142+
.venv
143+
env/
144+
venv/
145+
ENV/
146+
env.bak/
147+
venv.bak/
148+
149+
# Spyder project settings
150+
.spyderproject
151+
.spyproject
152+
153+
# Rope project settings
154+
.ropeproject
155+
156+
# mkdocs documentation
157+
/site
158+
159+
# ignore all office files
160+
*.pdf
161+
*.txt
162+
*.docx
163+
*.doc
164+
*.pptx
165+
*.xls
166+
*.xlsx
167+
*.json
168+
*.pkl
169+
170+
# but do not ignore docs/openapi.json
171+
!docs/openapi.json
172+
173+
174+
# mypy
175+
.mypy_cache/
176+
.dmypy.json
177+
dmypy.json
178+
179+
# Pyre type checker
180+
.pyre/
181+
182+
# pytype static type analyzer
183+
.pytype/
184+
185+
# Cython debug symbols
186+
cython_debug/
187+
188+
# PyCharm
189+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
190+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
191+
# and can be added to the global gitignore or merged into this file. For a more nuclear
192+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
193+
.idea/
194+
195+
# VSCode
196+
.vscode*
197+
198+
# DS_Store
199+
.DS_Store
200+
201+
# Outputs and Evaluation Results
202+
outputs

.pre-commit-config.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: trailing-whitespace
6+
exclude: tests/repositories/fixtures/pypi.org/metadata/.*\.metadata
7+
- id: end-of-file-fixer
8+
exclude: ^.*\.egg-info/|tests/repositories/fixtures/pypi.org/metadata/.*\.metadata
9+
- id: check-merge-conflict
10+
- id: check-case-conflict
11+
- id: check-json
12+
- id: check-toml
13+
exclude: tests/fixtures/invalid_lock/poetry\.lock
14+
- id: check-yaml
15+
- id: pretty-format-json
16+
args: [--autofix, --no-ensure-ascii, --no-sort-keys]
17+
- id: check-ast
18+
- id: debug-statements
19+
- id: check-docstring-first
20+
21+
- repo: https://github.com/pre-commit/pre-commit
22+
rev: v4.2.0
23+
hooks:
24+
- id: validate_manifest
25+
26+
- repo: https://github.com/astral-sh/ruff-pre-commit
27+
rev: v0.11.8
28+
hooks:
29+
- id: ruff
30+
args: [ --fix, --config=./pyproject.toml ]
31+
- id: ruff-format
32+
args: [ --config=./pyproject.toml ]
33+
34+
- repo: https://github.com/python-poetry/poetry
35+
rev: '2.1.3'
36+
hooks:
37+
- id: poetry-check
38+
- id: poetry-lock
39+
- id: poetry-install
40+
41+
- repo: https://github.com/hauntsaninja/no_implicit_optional
42+
rev: '1.4'
43+
hooks:
44+
- id: no_implicit_optional
45+
name: no_implicit_optional
46+
description: "A codemod to make your implicit optional type hints PEP 484 compliant"
47+
entry: no_implicit_optional
48+
language: python
49+
minimum_pre_commit_version: 2.9.2
50+
require_serial: true
51+
types_or: [python, pyi]

.vscode/settings.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"python.testing.pytestArgs": [
3+
"tests",
4+
"-vv"
5+
],
6+
"python.testing.unittestEnabled": false,
7+
"python.testing.pytestEnabled": true,
8+
"python.analysis.typeCheckingMode": "off"
9+
}

0 commit comments

Comments
 (0)