mnemo-mcp-agent 0.3.2__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.
- mnemo_mcp_agent-0.3.2/.github/workflows/ci.yml +49 -0
- mnemo_mcp_agent-0.3.2/.github/workflows/publish.yml +31 -0
- mnemo_mcp_agent-0.3.2/.gitignore +55 -0
- mnemo_mcp_agent-0.3.2/LICENSE +21 -0
- mnemo_mcp_agent-0.3.2/PKG-INFO +111 -0
- mnemo_mcp_agent-0.3.2/README.md +78 -0
- mnemo_mcp_agent-0.3.2/mnemo_architecture.html +376 -0
- mnemo_mcp_agent-0.3.2/mnemo_graph.html +376 -0
- mnemo_mcp_agent-0.3.2/mnemo_project_graph.html +376 -0
- mnemo_mcp_agent-0.3.2/pyproject.toml +116 -0
- mnemo_mcp_agent-0.3.2/run_mcp.py +12 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/__init__.py +3 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/cli/__init__.py +1 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/cli/main.py +512 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/cli/visualize.py +640 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/core/__init__.py +1 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/core/decay.py +96 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/core/models.py +270 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/core/rrf.py +78 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/engine/__init__.py +1 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/engine/audn.py +185 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/engine/retriever.py +139 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/engine/scanner.py +484 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/engine/tier_manager.py +190 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/mcp/__init__.py +1 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/mcp/prompts.py +40 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/mcp/resources.py +91 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/mcp/server.py +141 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/mcp/tools.py +259 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/serialization/__init__.py +1 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/serialization/toon.py +422 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/storage/__init__.py +1 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/storage/connection.py +193 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/storage/fts_store.py +100 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/storage/graph_store.py +178 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/storage/migrations.py +221 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/storage/schema.sql +141 -0
- mnemo_mcp_agent-0.3.2/src/mnemo/storage/vector_store.py +232 -0
- mnemo_mcp_agent-0.3.2/tests/conftest.py +170 -0
- mnemo_mcp_agent-0.3.2/tests/test_audn.py +96 -0
- mnemo_mcp_agent-0.3.2/tests/test_cli.py +208 -0
- mnemo_mcp_agent-0.3.2/tests/test_decay.py +99 -0
- mnemo_mcp_agent-0.3.2/tests/test_mcp_tools.py +116 -0
- mnemo_mcp_agent-0.3.2/tests/test_migrations.py +72 -0
- mnemo_mcp_agent-0.3.2/tests/test_models.py +90 -0
- mnemo_mcp_agent-0.3.2/tests/test_retriever.py +80 -0
- mnemo_mcp_agent-0.3.2/tests/test_rrf.py +83 -0
- mnemo_mcp_agent-0.3.2/tests/test_scanner.py +178 -0
- mnemo_mcp_agent-0.3.2/tests/test_storage.py +275 -0
- mnemo_mcp_agent-0.3.2/tests/test_tier_manager.py +104 -0
- mnemo_mcp_agent-0.3.2/tests/test_toon.py +195 -0
- mnemo_mcp_agent-0.3.2/tests/test_visualize.py +81 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, master ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main, master ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ${{ matrix.os }}
|
|
12
|
+
strategy:
|
|
13
|
+
fail-fast: false
|
|
14
|
+
matrix:
|
|
15
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
16
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
22
|
+
uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: ${{ matrix.python-version }}
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: |
|
|
28
|
+
python -m pip install --upgrade pip
|
|
29
|
+
python -m pip install .[dev]
|
|
30
|
+
|
|
31
|
+
- name: Lint with ruff
|
|
32
|
+
run: |
|
|
33
|
+
ruff check .
|
|
34
|
+
ruff format --check .
|
|
35
|
+
|
|
36
|
+
- name: Type check with mypy
|
|
37
|
+
run: |
|
|
38
|
+
mypy src/
|
|
39
|
+
|
|
40
|
+
- name: Run tests with pytest
|
|
41
|
+
run: |
|
|
42
|
+
pytest --cov=src/mnemo --cov-report=xml --cov-report=term-missing
|
|
43
|
+
|
|
44
|
+
- name: Upload coverage reports to Codecov
|
|
45
|
+
uses: codecov/codecov-action@v4
|
|
46
|
+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
|
|
47
|
+
with:
|
|
48
|
+
token: ${{ secrets.CODECOV_TOKEN }}
|
|
49
|
+
slug: mnemo/mnemo
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
pypi-publish:
|
|
9
|
+
name: Build and publish to PyPI
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- name: Checkout source code
|
|
13
|
+
uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- name: Set up Python
|
|
16
|
+
uses: actions/setup-python@v5
|
|
17
|
+
with:
|
|
18
|
+
python-version: "3.11"
|
|
19
|
+
|
|
20
|
+
- name: Install build tool
|
|
21
|
+
run: |
|
|
22
|
+
python -m pip install --upgrade pip
|
|
23
|
+
pip install build
|
|
24
|
+
|
|
25
|
+
- name: Build wheel and sdist packages
|
|
26
|
+
run: python -m build
|
|
27
|
+
|
|
28
|
+
- name: Publish to PyPI
|
|
29
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
30
|
+
with:
|
|
31
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# Distribution / packaging
|
|
7
|
+
.Python
|
|
8
|
+
build/
|
|
9
|
+
develop-eggs/
|
|
10
|
+
dist/
|
|
11
|
+
downloads/
|
|
12
|
+
eggs/
|
|
13
|
+
.eggs/
|
|
14
|
+
lib/
|
|
15
|
+
lib64/
|
|
16
|
+
parts/
|
|
17
|
+
sdist/
|
|
18
|
+
var/
|
|
19
|
+
wheels/
|
|
20
|
+
share/python-wheels/
|
|
21
|
+
*.egg-info/
|
|
22
|
+
.installed.cfg
|
|
23
|
+
*.egg
|
|
24
|
+
MANIFEST
|
|
25
|
+
|
|
26
|
+
# Virtual environments
|
|
27
|
+
.env
|
|
28
|
+
.venv
|
|
29
|
+
env/
|
|
30
|
+
venv/
|
|
31
|
+
ENV/
|
|
32
|
+
env.bak/
|
|
33
|
+
venv.bak/
|
|
34
|
+
|
|
35
|
+
# SQLite databases
|
|
36
|
+
*.sqlite
|
|
37
|
+
*.sqlite3
|
|
38
|
+
*.db
|
|
39
|
+
*.db-wal
|
|
40
|
+
*.db-shm
|
|
41
|
+
|
|
42
|
+
# Testing & Linting
|
|
43
|
+
.pytest_cache/
|
|
44
|
+
.coverage
|
|
45
|
+
htmlcov/
|
|
46
|
+
.mypy_cache/
|
|
47
|
+
.ruff_cache/
|
|
48
|
+
|
|
49
|
+
# IDE & OS files
|
|
50
|
+
.vscode/
|
|
51
|
+
.idea/
|
|
52
|
+
*.swp
|
|
53
|
+
*.swo
|
|
54
|
+
.DS_Store
|
|
55
|
+
Thumbs.db
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mnemo Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: mnemo-mcp-agent
|
|
3
|
+
Version: 0.3.2
|
|
4
|
+
Summary: Cross-platform local MCP server and CLI for bitemporal long-term memory for AI agents
|
|
5
|
+
Author: Mnemo Contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Keywords: ai-agents,bitemporal,fts5,knowledge-graph,llm,mcp,memory,model-context-protocol,sqlite,vector-search
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
18
|
+
Requires-Python: >=3.11
|
|
19
|
+
Requires-Dist: mcp>=1.0.0
|
|
20
|
+
Requires-Dist: numpy>=1.24.0
|
|
21
|
+
Requires-Dist: pydantic>=2.0.0
|
|
22
|
+
Requires-Dist: rich>=13.0.0
|
|
23
|
+
Requires-Dist: typer>=0.12.0
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: mypy>=1.10.0; extra == 'dev'
|
|
26
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
|
|
27
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: pytest>=7.4.0; extra == 'dev'
|
|
29
|
+
Requires-Dist: ruff>=0.4.0; extra == 'dev'
|
|
30
|
+
Provides-Extra: embeddings
|
|
31
|
+
Requires-Dist: fastembed>=0.2.0; extra == 'embeddings'
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# Mnemo
|
|
35
|
+
|
|
36
|
+
Autonomous bitemporal memory engine for AI coding agents.
|
|
37
|
+
|
|
38
|
+
Mnemo provides persistent, cross-session architectural memory. It automatically maps repository structure, tracks context across edits, and exposes structured retrieval via Model Context Protocol (FastMCP) and clean CLI tools.
|
|
39
|
+
|
|
40
|
+
## Key Features
|
|
41
|
+
|
|
42
|
+
* **Autonomous AST Mapping:** Automatically parses modules, classes, and dependencies with incremental SHA-256 diff caching.
|
|
43
|
+
* **Bitemporal Knowledge Engine:** Tracks both event time and assertion time using SQLite with WAL mode and full-text search (FTS5).
|
|
44
|
+
* **Self-Healing Storage:** Dynamic schema migrations and automatic FTS index repair.
|
|
45
|
+
* **Dark Minimal Visualizer:** Interactive 3-column Sankey graph mapping categories, memory tiers, and architecture flows.
|
|
46
|
+
|
|
47
|
+
## Installation
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
pip install mnemo
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Quick Start
|
|
54
|
+
|
|
55
|
+
### 1. Initialize Memory Store
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
mnemo init
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 2. Autonomous Repository Scan
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
mnemo scan .
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 3. Interactive Knowledge Visualization
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
mnemo visualize
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 4. Health Diagnostics
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
mnemo doctor
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Model Context Protocol (FastMCP)
|
|
80
|
+
|
|
81
|
+
Mnemo integrates natively with Claude Desktop, Cursor, Antigravity, and any MCP client over stdio:
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"mcpServers": {
|
|
86
|
+
"mnemo": {
|
|
87
|
+
"command": "mnemo",
|
|
88
|
+
"args": ["serve"]
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Available MCP Tools
|
|
95
|
+
|
|
96
|
+
* `mnemo_remember`: Stores or updates facts through the AUDN classifier and auto-links mentioned code entities.
|
|
97
|
+
* `mnemo_search`: Hybrid 3-channel retrieval (Vector + FTS5 + Recursive CTE Graph) fused via Reciprocal Rank Fusion (RRF).
|
|
98
|
+
* `mnemo_scan_project`: Triggers an on-demand incremental AST scan of the repository.
|
|
99
|
+
* `mnemo_invalidate`: Soft-deletes records with bitemporal invalidation timestamps.
|
|
100
|
+
* `mnemo_tier_decay`: Recalculates Ebbinghaus salience decay and tier promotions/demotions.
|
|
101
|
+
* `mnemo_get_debt_ledger`: Detects decaying working-tier facts, stale core assumptions, and architectural debt.
|
|
102
|
+
|
|
103
|
+
## Architecture
|
|
104
|
+
|
|
105
|
+
* **Storage:** Local SQLite in WAL mode with FTS5 BM25, vector embeddings, and recursive CTE graph traversal.
|
|
106
|
+
* **Serialization:** Token-Optimized Object Notation (TOON) providing up to 56% token savings over standard JSON.
|
|
107
|
+
* **CLI:** Borderless Matrix interface powered by Typer and Rich.
|
|
108
|
+
|
|
109
|
+
## License
|
|
110
|
+
|
|
111
|
+
MIT License. Copyright (c) 2026 Mnemo Contributors.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Mnemo
|
|
2
|
+
|
|
3
|
+
Autonomous bitemporal memory engine for AI coding agents.
|
|
4
|
+
|
|
5
|
+
Mnemo provides persistent, cross-session architectural memory. It automatically maps repository structure, tracks context across edits, and exposes structured retrieval via Model Context Protocol (FastMCP) and clean CLI tools.
|
|
6
|
+
|
|
7
|
+
## Key Features
|
|
8
|
+
|
|
9
|
+
* **Autonomous AST Mapping:** Automatically parses modules, classes, and dependencies with incremental SHA-256 diff caching.
|
|
10
|
+
* **Bitemporal Knowledge Engine:** Tracks both event time and assertion time using SQLite with WAL mode and full-text search (FTS5).
|
|
11
|
+
* **Self-Healing Storage:** Dynamic schema migrations and automatic FTS index repair.
|
|
12
|
+
* **Dark Minimal Visualizer:** Interactive 3-column Sankey graph mapping categories, memory tiers, and architecture flows.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install mnemo
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
### 1. Initialize Memory Store
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
mnemo init
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### 2. Autonomous Repository Scan
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
mnemo scan .
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 3. Interactive Knowledge Visualization
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
mnemo visualize
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 4. Health Diagnostics
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
mnemo doctor
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Model Context Protocol (FastMCP)
|
|
47
|
+
|
|
48
|
+
Mnemo integrates natively with Claude Desktop, Cursor, Antigravity, and any MCP client over stdio:
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"mcpServers": {
|
|
53
|
+
"mnemo": {
|
|
54
|
+
"command": "mnemo",
|
|
55
|
+
"args": ["serve"]
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Available MCP Tools
|
|
62
|
+
|
|
63
|
+
* `mnemo_remember`: Stores or updates facts through the AUDN classifier and auto-links mentioned code entities.
|
|
64
|
+
* `mnemo_search`: Hybrid 3-channel retrieval (Vector + FTS5 + Recursive CTE Graph) fused via Reciprocal Rank Fusion (RRF).
|
|
65
|
+
* `mnemo_scan_project`: Triggers an on-demand incremental AST scan of the repository.
|
|
66
|
+
* `mnemo_invalidate`: Soft-deletes records with bitemporal invalidation timestamps.
|
|
67
|
+
* `mnemo_tier_decay`: Recalculates Ebbinghaus salience decay and tier promotions/demotions.
|
|
68
|
+
* `mnemo_get_debt_ledger`: Detects decaying working-tier facts, stale core assumptions, and architectural debt.
|
|
69
|
+
|
|
70
|
+
## Architecture
|
|
71
|
+
|
|
72
|
+
* **Storage:** Local SQLite in WAL mode with FTS5 BM25, vector embeddings, and recursive CTE graph traversal.
|
|
73
|
+
* **Serialization:** Token-Optimized Object Notation (TOON) providing up to 56% token savings over standard JSON.
|
|
74
|
+
* **CLI:** Borderless Matrix interface powered by Typer and Rich.
|
|
75
|
+
|
|
76
|
+
## License
|
|
77
|
+
|
|
78
|
+
MIT License. Copyright (c) 2026 Mnemo Contributors.
|