mneno 0.3.0a1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. mneno-0.3.0a1/.github/ISSUE_TEMPLATE/bug_report.yml +41 -0
  2. mneno-0.3.0a1/.github/ISSUE_TEMPLATE/feature_request.yml +28 -0
  3. mneno-0.3.0a1/.github/PULL_REQUEST_TEMPLATE.md +14 -0
  4. mneno-0.3.0a1/.github/workflows/ci.yml +78 -0
  5. mneno-0.3.0a1/.github/workflows/release.yml +109 -0
  6. mneno-0.3.0a1/.gitignore +175 -0
  7. mneno-0.3.0a1/.pre-commit-config.yaml +13 -0
  8. mneno-0.3.0a1/.superset/config.json +4 -0
  9. mneno-0.3.0a1/AGENTS.md +342 -0
  10. mneno-0.3.0a1/CODE_OF_CONDUCT.md +25 -0
  11. mneno-0.3.0a1/CONTRIBUTING.md +28 -0
  12. mneno-0.3.0a1/LICENSE +170 -0
  13. mneno-0.3.0a1/PKG-INFO +554 -0
  14. mneno-0.3.0a1/README.md +522 -0
  15. mneno-0.3.0a1/SECURITY.md +19 -0
  16. mneno-0.3.0a1/docs/.mintignore +7 -0
  17. mneno-0.3.0a1/docs/AGENTS.md +33 -0
  18. mneno-0.3.0a1/docs/CONTRIBUTING.md +34 -0
  19. mneno-0.3.0a1/docs/LICENSE +21 -0
  20. mneno-0.3.0a1/docs/README.md +55 -0
  21. mneno-0.3.0a1/docs/advanced/import-export.mdx +68 -0
  22. mneno-0.3.0a1/docs/advanced/providers.mdx +88 -0
  23. mneno-0.3.0a1/docs/changelog/overview.mdx +33 -0
  24. mneno-0.3.0a1/docs/concepts/compaction.mdx +69 -0
  25. mneno-0.3.0a1/docs/concepts/context-building.mdx +80 -0
  26. mneno-0.3.0a1/docs/concepts/scoring.mdx +66 -0
  27. mneno-0.3.0a1/docs/concepts/storage.mdx +84 -0
  28. mneno-0.3.0a1/docs/docs.json +63 -0
  29. mneno-0.3.0a1/docs/favicon.svg +5 -0
  30. mneno-0.3.0a1/docs/images/checks-passed.png +0 -0
  31. mneno-0.3.0a1/docs/images/hero-dark.png +0 -0
  32. mneno-0.3.0a1/docs/images/hero-light.png +0 -0
  33. mneno-0.3.0a1/docs/index.mdx +34 -0
  34. mneno-0.3.0a1/docs/logo/dark.svg +17 -0
  35. mneno-0.3.0a1/docs/logo/light.svg +17 -0
  36. mneno-0.3.0a1/docs/quickstart.mdx +77 -0
  37. mneno-0.3.0a1/docs/snippets/snippet-intro.mdx +4 -0
  38. mneno-0.3.0a1/examples/basic_usage.py +35 -0
  39. mneno-0.3.0a1/mneno/__init__.py +151 -0
  40. mneno-0.3.0a1/mneno/client.py +1412 -0
  41. mneno-0.3.0a1/mneno/compaction/__init__.py +8 -0
  42. mneno-0.3.0a1/mneno/compaction/base.py +15 -0
  43. mneno-0.3.0a1/mneno/compaction/diff.py +48 -0
  44. mneno-0.3.0a1/mneno/compaction/engine.py +372 -0
  45. mneno-0.3.0a1/mneno/compaction/policies.py +30 -0
  46. mneno-0.3.0a1/mneno/conflicts/__init__.py +24 -0
  47. mneno-0.3.0a1/mneno/conflicts/detector.py +281 -0
  48. mneno-0.3.0a1/mneno/conflicts/policies.py +19 -0
  49. mneno-0.3.0a1/mneno/conflicts/reports.py +67 -0
  50. mneno-0.3.0a1/mneno/conflicts/resolver.py +203 -0
  51. mneno-0.3.0a1/mneno/context/__init__.py +21 -0
  52. mneno-0.3.0a1/mneno/context/budget.py +36 -0
  53. mneno-0.3.0a1/mneno/context/builder.py +268 -0
  54. mneno-0.3.0a1/mneno/context/package.py +69 -0
  55. mneno-0.3.0a1/mneno/context/policies.py +49 -0
  56. mneno-0.3.0a1/mneno/context/presets.py +63 -0
  57. mneno-0.3.0a1/mneno/evaluation/__init__.py +59 -0
  58. mneno-0.3.0a1/mneno/evaluation/adapters.py +23 -0
  59. mneno-0.3.0a1/mneno/evaluation/benchmark.py +17 -0
  60. mneno-0.3.0a1/mneno/evaluation/export.py +110 -0
  61. mneno-0.3.0a1/mneno/evaluation/metrics.py +102 -0
  62. mneno-0.3.0a1/mneno/evaluation/reports.py +121 -0
  63. mneno-0.3.0a1/mneno/extraction/__init__.py +24 -0
  64. mneno-0.3.0a1/mneno/extraction/base.py +52 -0
  65. mneno-0.3.0a1/mneno/extraction/deterministic.py +83 -0
  66. mneno-0.3.0a1/mneno/extraction/llm.py +60 -0
  67. mneno-0.3.0a1/mneno/extraction/prompts.py +45 -0
  68. mneno-0.3.0a1/mneno/hierarchy/__init__.py +25 -0
  69. mneno-0.3.0a1/mneno/hierarchy/layers.py +54 -0
  70. mneno-0.3.0a1/mneno/hierarchy/manager.py +242 -0
  71. mneno-0.3.0a1/mneno/hierarchy/policies.py +22 -0
  72. mneno-0.3.0a1/mneno/hierarchy/transitions.py +39 -0
  73. mneno-0.3.0a1/mneno/io/__init__.py +30 -0
  74. mneno-0.3.0a1/mneno/io/backup.py +36 -0
  75. mneno-0.3.0a1/mneno/io/export.py +45 -0
  76. mneno-0.3.0a1/mneno/io/importers.py +146 -0
  77. mneno-0.3.0a1/mneno/io/validation.py +39 -0
  78. mneno-0.3.0a1/mneno/models.py +243 -0
  79. mneno-0.3.0a1/mneno/observability/__init__.py +23 -0
  80. mneno-0.3.0a1/mneno/observability/events.py +27 -0
  81. mneno-0.3.0a1/mneno/observability/inspector.py +46 -0
  82. mneno-0.3.0a1/mneno/observability/recorder.py +152 -0
  83. mneno-0.3.0a1/mneno/observability/trace.py +31 -0
  84. mneno-0.3.0a1/mneno/policies/__init__.py +6 -0
  85. mneno-0.3.0a1/mneno/policies/config.py +5 -0
  86. mneno-0.3.0a1/mneno/providers/__init__.py +27 -0
  87. mneno-0.3.0a1/mneno/providers/base.py +7 -0
  88. mneno-0.3.0a1/mneno/providers/embedding.py +63 -0
  89. mneno-0.3.0a1/mneno/providers/exceptions.py +17 -0
  90. mneno-0.3.0a1/mneno/providers/llm.py +98 -0
  91. mneno-0.3.0a1/mneno/providers/registry.py +79 -0
  92. mneno-0.3.0a1/mneno/providers/reranker.py +44 -0
  93. mneno-0.3.0a1/mneno/py.typed +1 -0
  94. mneno-0.3.0a1/mneno/retrieval/__init__.py +16 -0
  95. mneno-0.3.0a1/mneno/retrieval/base.py +14 -0
  96. mneno-0.3.0a1/mneno/retrieval/rerank.py +65 -0
  97. mneno-0.3.0a1/mneno/retrieval/semantic.py +75 -0
  98. mneno-0.3.0a1/mneno/retrieval/similarity.py +37 -0
  99. mneno-0.3.0a1/mneno/scoring/__init__.py +6 -0
  100. mneno-0.3.0a1/mneno/scoring/base.py +14 -0
  101. mneno-0.3.0a1/mneno/scoring/temporal.py +206 -0
  102. mneno-0.3.0a1/mneno/sessions/__init__.py +17 -0
  103. mneno-0.3.0a1/mneno/sessions/continuity.py +104 -0
  104. mneno-0.3.0a1/mneno/sessions/manager.py +72 -0
  105. mneno-0.3.0a1/mneno/sessions/models.py +35 -0
  106. mneno-0.3.0a1/mneno/sessions/timeline.py +94 -0
  107. mneno-0.3.0a1/mneno/storage/__init__.py +8 -0
  108. mneno-0.3.0a1/mneno/storage/base.py +46 -0
  109. mneno-0.3.0a1/mneno/storage/json_file.py +122 -0
  110. mneno-0.3.0a1/mneno/storage/memory.py +81 -0
  111. mneno-0.3.0a1/mneno/storage/sqlite.py +186 -0
  112. mneno-0.3.0a1/pyproject.toml +67 -0
  113. mneno-0.3.0a1/scripts/check.sh +23 -0
  114. mneno-0.3.0a1/scripts/format.sh +21 -0
  115. mneno-0.3.0a1/scripts/setup_dev.sh +14 -0
  116. mneno-0.3.0a1/scripts/teardown.sh +13 -0
  117. mneno-0.3.0a1/scripts/test.sh +13 -0
  118. mneno-0.3.0a1/tests/test_compaction.py +184 -0
  119. mneno-0.3.0a1/tests/test_conflicts.py +263 -0
  120. mneno-0.3.0a1/tests/test_context.py +374 -0
  121. mneno-0.3.0a1/tests/test_evaluation.py +259 -0
  122. mneno-0.3.0a1/tests/test_extraction.py +202 -0
  123. mneno-0.3.0a1/tests/test_hierarchy.py +214 -0
  124. mneno-0.3.0a1/tests/test_import.py +10 -0
  125. mneno-0.3.0a1/tests/test_io.py +366 -0
  126. mneno-0.3.0a1/tests/test_models.py +183 -0
  127. mneno-0.3.0a1/tests/test_observability.py +261 -0
  128. mneno-0.3.0a1/tests/test_providers.py +135 -0
  129. mneno-0.3.0a1/tests/test_reranking.py +255 -0
  130. mneno-0.3.0a1/tests/test_scoring.py +86 -0
  131. mneno-0.3.0a1/tests/test_semantic_retrieval.py +205 -0
  132. mneno-0.3.0a1/tests/test_sessions.py +264 -0
  133. mneno-0.3.0a1/tests/test_storage.py +235 -0
@@ -0,0 +1,41 @@
1
+ name: Bug report
2
+ description: Report a reproducible problem in Mneno.
3
+ title: "[Bug]: "
4
+ labels: ["bug"]
5
+ body:
6
+ - type: textarea
7
+ id: summary
8
+ attributes:
9
+ label: Summary
10
+ description: What happened?
11
+ validations:
12
+ required: true
13
+ - type: textarea
14
+ id: reproduction
15
+ attributes:
16
+ label: Reproduction
17
+ description: Provide the smallest code sample or steps that reproduce the issue.
18
+ validations:
19
+ required: true
20
+ - type: textarea
21
+ id: expected
22
+ attributes:
23
+ label: Expected behavior
24
+ validations:
25
+ required: true
26
+ - type: input
27
+ id: python
28
+ attributes:
29
+ label: Python version
30
+ placeholder: "3.11.x"
31
+ validations:
32
+ required: true
33
+ - type: input
34
+ id: mneno
35
+ attributes:
36
+ label: Mneno version
37
+ placeholder: "0.2.0"
38
+ - type: textarea
39
+ id: context
40
+ attributes:
41
+ label: Additional context
@@ -0,0 +1,28 @@
1
+ name: Feature request
2
+ description: Suggest a focused improvement for Mneno.
3
+ title: "[Feature]: "
4
+ labels: ["enhancement"]
5
+ body:
6
+ - type: textarea
7
+ id: problem
8
+ attributes:
9
+ label: Problem
10
+ description: What problem should this feature solve?
11
+ validations:
12
+ required: true
13
+ - type: textarea
14
+ id: proposal
15
+ attributes:
16
+ label: Proposal
17
+ description: Describe the API or behavior you want.
18
+ validations:
19
+ required: true
20
+ - type: textarea
21
+ id: explainability
22
+ attributes:
23
+ label: Explainability impact
24
+ description: How should users inspect or verify this behavior?
25
+ - type: textarea
26
+ id: alternatives
27
+ attributes:
28
+ label: Alternatives considered
@@ -0,0 +1,14 @@
1
+ ## Summary
2
+
3
+ Describe the change and why it is needed.
4
+
5
+ ## Testing
6
+
7
+ - [ ] `scripts/check.sh`
8
+
9
+ ## Checklist
10
+
11
+ - [ ] Public APIs are documented and tested.
12
+ - [ ] Core dependencies remain lightweight.
13
+ - [ ] Compaction or memory behavior remains explainable.
14
+ - [ ] No LLM, embedding, vector DB, or graph DB provider was added to core dependencies.
@@ -0,0 +1,78 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: ["main"]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ lint-test:
13
+ name: Python ${{ matrix.python-version }}
14
+ runs-on: ubuntu-latest
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ python-version: ["3.11", "3.12", "3.13"]
19
+
20
+ steps:
21
+ - name: Check out repository
22
+ uses: actions/checkout@v6
23
+
24
+ - name: Set up Python
25
+ uses: actions/setup-python@v6
26
+ with:
27
+ python-version: ${{ matrix.python-version }}
28
+ cache: "pip"
29
+
30
+ - name: Install package
31
+ run: |
32
+ python -m pip install --upgrade pip
33
+ python -m pip install -e ".[dev]"
34
+
35
+ - name: Ruff check
36
+ run: ruff check .
37
+
38
+ - name: Ruff format check
39
+ run: ruff format --check .
40
+
41
+ - name: Mypy
42
+ run: mypy
43
+
44
+ - name: Pytest
45
+ run: pytest
46
+
47
+ build:
48
+ name: Build universal wheel
49
+ runs-on: ubuntu-latest
50
+ needs: lint-test
51
+
52
+ steps:
53
+ - name: Check out repository
54
+ uses: actions/checkout@v6
55
+
56
+ - name: Set up Python
57
+ uses: actions/setup-python@v6
58
+ with:
59
+ python-version: "3.11"
60
+ cache: "pip"
61
+
62
+ - name: Install build tools
63
+ run: |
64
+ python -m pip install --upgrade pip
65
+ python -m pip install build twine
66
+
67
+ - name: Build wheel
68
+ run: python -m build --wheel
69
+
70
+ - name: Check wheel
71
+ run: python -m twine check dist/*-py3-none-any.whl
72
+
73
+ - name: Upload wheel artifact
74
+ uses: actions/upload-artifact@v7
75
+ with:
76
+ name: mneno-py3-none-any-wheel
77
+ path: dist/*-py3-none-any.whl
78
+ if-no-files-found: error
@@ -0,0 +1,109 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*"
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ test:
14
+ name: Test before release
15
+ runs-on: ubuntu-latest
16
+
17
+ steps:
18
+ - name: Check out repository
19
+ uses: actions/checkout@v6
20
+
21
+ - name: Set up Python
22
+ uses: actions/setup-python@v6
23
+ with:
24
+ python-version: "3.11"
25
+ cache: "pip"
26
+
27
+ - name: Install package
28
+ run: |
29
+ python -m pip install --upgrade pip
30
+ python -m pip install -e ".[dev]"
31
+
32
+ - name: Run checks
33
+ run: |
34
+ ruff check .
35
+ ruff format --check .
36
+ mypy
37
+ pytest
38
+
39
+ build:
40
+ name: Build release distributions
41
+ runs-on: ubuntu-latest
42
+ needs: test
43
+
44
+ steps:
45
+ - name: Check out repository
46
+ uses: actions/checkout@v6
47
+
48
+ - name: Set up Python
49
+ uses: actions/setup-python@v6
50
+ with:
51
+ python-version: "3.11"
52
+ cache: "pip"
53
+
54
+ - name: Install build tools
55
+ run: |
56
+ python -m pip install --upgrade pip
57
+ python -m pip install build twine
58
+
59
+ - name: Validate tag matches package version
60
+ if: startsWith(github.ref, 'refs/tags/v')
61
+ env:
62
+ RELEASE_TAG: ${{ github.ref_name }}
63
+ run: |
64
+ python - <<'PY'
65
+ import os
66
+ import tomllib
67
+ from pathlib import Path
68
+
69
+ package_version = tomllib.loads(Path("pyproject.toml").read_text())["project"]["version"]
70
+ tag_version = os.environ["RELEASE_TAG"].removeprefix("v")
71
+ if tag_version != package_version:
72
+ raise SystemExit(
73
+ f"Release tag {tag_version!r} does not match package version {package_version!r}"
74
+ )
75
+ PY
76
+
77
+ - name: Build distributions
78
+ run: python -m build
79
+
80
+ - name: Check distributions
81
+ run: python -m twine check --strict dist/*
82
+
83
+ - name: Upload distribution artifact
84
+ uses: actions/upload-artifact@v7
85
+ with:
86
+ name: mneno-release-distributions
87
+ path: dist/*
88
+ if-no-files-found: error
89
+
90
+ publish-pypi:
91
+ name: Publish to PyPI
92
+ runs-on: ubuntu-latest
93
+ needs: build
94
+ if: startsWith(github.ref, 'refs/tags/v')
95
+ environment:
96
+ name: pypi
97
+ url: https://pypi.org/project/mneno/
98
+ permissions:
99
+ id-token: write
100
+
101
+ steps:
102
+ - name: Download distribution artifact
103
+ uses: actions/download-artifact@v8
104
+ with:
105
+ name: mneno-release-distributions
106
+ path: dist
107
+
108
+ - name: Publish package
109
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,175 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ /lib/
18
+ /lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+ .ruff_cache/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended not to include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .env.*
125
+ !.env.example
126
+ .venv
127
+ env/
128
+ venv/
129
+ ENV/
130
+ env.bak/
131
+ venv.bak/
132
+ pyenv/
133
+
134
+ # Spyder project settings
135
+ .spyderproject
136
+ .spyproject
137
+
138
+ # Rope project settings
139
+ .ropeproject
140
+
141
+ # mkdocs documentation
142
+ /site
143
+
144
+ # mypy
145
+ .mypy_cache/
146
+ .dmypy.json
147
+ dmypy.json
148
+
149
+ # Pyre type checker
150
+ .pyre/
151
+
152
+ # pytype static type analyzer
153
+ .pytype/
154
+
155
+ # Cython debug symbols
156
+ cython_debug/
157
+
158
+ # PyCharm
159
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
160
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
161
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
162
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
163
+ #.idea/
164
+
165
+ .ideas.md
166
+ .todos.md
167
+
168
+ .vscode
169
+ .idea/
170
+
171
+ .DS_Store
172
+ Thumbs.db
173
+
174
+ .ipynb_checkpoints/
175
+ *.db
@@ -0,0 +1,13 @@
1
+ repos:
2
+ - repo: local
3
+ hooks:
4
+ - id: format
5
+ name: format
6
+ entry: scripts/format.sh
7
+ language: system
8
+ pass_filenames: false
9
+ - id: check
10
+ name: check
11
+ entry: scripts/check.sh
12
+ language: system
13
+ pass_filenames: false
@@ -0,0 +1,4 @@
1
+ {
2
+ "setup": ["scripts/setup_dev.sh"],
3
+ "teardown": ["scripts/teardown.sh"]
4
+ }