mindcore-memory 0.1.2__tar.gz → 0.1.4__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.
- mindcore_memory-0.1.4/.gitignore +144 -0
- mindcore_memory-0.1.4/.pypirc +8 -0
- {mindcore_memory-0.1.2 → mindcore_memory-0.1.4}/LICENSE +21 -21
- mindcore_memory-0.1.4/PKG-INFO +210 -0
- mindcore_memory-0.1.4/README.md +182 -0
- {mindcore_memory-0.1.2 → mindcore_memory-0.1.4}/mindcore_memory/__init__.py +13 -13
- {mindcore_memory-0.1.2 → mindcore_memory-0.1.4}/mindcore_memory/eval_framework.py +325 -325
- {mindcore_memory-0.1.2 → mindcore_memory-0.1.4}/mindcore_memory/http_app.py +114 -114
- {mindcore_memory-0.1.2 → mindcore_memory-0.1.4}/mindcore_memory/memory_engine.py +367 -367
- {mindcore_memory-0.1.2 → mindcore_memory-0.1.4}/mindcore_memory/server.py +333 -333
- {mindcore_memory-0.1.2 → mindcore_memory-0.1.4}/pyproject.toml +69 -69
- {mindcore_memory-0.1.2 → mindcore_memory-0.1.4}/tests/test_memory.py +124 -124
- mindcore_memory-0.1.2/.github/workflows/ci.yml +0 -92
- mindcore_memory-0.1.2/.gitignore +0 -50
- mindcore_memory-0.1.2/CONTRIBUTING.md +0 -44
- mindcore_memory-0.1.2/PKG-INFO +0 -233
- mindcore_memory-0.1.2/README.md +0 -205
- mindcore_memory-0.1.2/examples/basic_usage.py +0 -72
- mindcore_memory-0.1.2/server.json +0 -17
- mindcore_memory-0.1.2/smithery.yaml +0 -9
- mindcore_memory-0.1.2/sponsor_qrcode.jpg +0 -0
- mindcore_memory-0.1.2/src/__init__.py +0 -13
- mindcore_memory-0.1.2/src/eval_framework.py +0 -324
- mindcore_memory-0.1.2/src/http_app.py +0 -118
- mindcore_memory-0.1.2/src/memory_engine.py +0 -369
- mindcore_memory-0.1.2/src/server.py +0 -334
|
@@ -0,0 +1,144 @@
|
|
|
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
|
+
*.manifest
|
|
31
|
+
*.spec
|
|
32
|
+
|
|
33
|
+
# Installer logs
|
|
34
|
+
pip-log.txt
|
|
35
|
+
pip-delete-this-directory.txt
|
|
36
|
+
|
|
37
|
+
# Unit test / coverage reports
|
|
38
|
+
htmlcov/
|
|
39
|
+
.tox/
|
|
40
|
+
.nox/
|
|
41
|
+
.coverage
|
|
42
|
+
.coverage.*
|
|
43
|
+
.cache
|
|
44
|
+
nosetests.xml
|
|
45
|
+
coverage.xml
|
|
46
|
+
*.cover
|
|
47
|
+
*.py,cover
|
|
48
|
+
.hypothesis/
|
|
49
|
+
.pytest_cache/
|
|
50
|
+
cover/
|
|
51
|
+
|
|
52
|
+
# Translations
|
|
53
|
+
*.mo
|
|
54
|
+
*.pot
|
|
55
|
+
|
|
56
|
+
# Django stuff:
|
|
57
|
+
*.log
|
|
58
|
+
local_settings.py
|
|
59
|
+
db.sqlite3
|
|
60
|
+
db.sqlite3-journal
|
|
61
|
+
|
|
62
|
+
# Flask stuff:
|
|
63
|
+
instance/
|
|
64
|
+
.webassets-cache
|
|
65
|
+
|
|
66
|
+
# Scrapy stuff:
|
|
67
|
+
.scrapy
|
|
68
|
+
|
|
69
|
+
# Sphinx documentation
|
|
70
|
+
docs/_build/
|
|
71
|
+
|
|
72
|
+
# PyBuilder
|
|
73
|
+
target/
|
|
74
|
+
|
|
75
|
+
# Jupyter Notebook
|
|
76
|
+
.ipynb_checkpoints
|
|
77
|
+
|
|
78
|
+
# IPython
|
|
79
|
+
profile_default/
|
|
80
|
+
ipython_config.py
|
|
81
|
+
|
|
82
|
+
# pyenv
|
|
83
|
+
.python-version
|
|
84
|
+
|
|
85
|
+
# pipenv
|
|
86
|
+
Pipfile.lock
|
|
87
|
+
|
|
88
|
+
# PEP 582
|
|
89
|
+
__pypackages__/
|
|
90
|
+
|
|
91
|
+
# Celery beat schedule file
|
|
92
|
+
celerybeat-schedule
|
|
93
|
+
|
|
94
|
+
# SageMath parsed files
|
|
95
|
+
*.sage.py
|
|
96
|
+
|
|
97
|
+
# Environments
|
|
98
|
+
.env
|
|
99
|
+
.venv
|
|
100
|
+
env/
|
|
101
|
+
venv/
|
|
102
|
+
ENV/
|
|
103
|
+
env.bak/venv.bak/
|
|
104
|
+
|
|
105
|
+
# Spyder project settings
|
|
106
|
+
.spyderproject
|
|
107
|
+
.spyproject
|
|
108
|
+
|
|
109
|
+
# Rope project settings
|
|
110
|
+
.ropeproject
|
|
111
|
+
|
|
112
|
+
# mkdocs documentation
|
|
113
|
+
/site
|
|
114
|
+
|
|
115
|
+
# mypy
|
|
116
|
+
.mypy_cache/
|
|
117
|
+
.dmypy.json
|
|
118
|
+
dmypy.json
|
|
119
|
+
|
|
120
|
+
# Pyre type checker
|
|
121
|
+
.pyre/
|
|
122
|
+
|
|
123
|
+
# pytype static type analyzer
|
|
124
|
+
.pytype/
|
|
125
|
+
|
|
126
|
+
# Operating System Files
|
|
127
|
+
.DS_Store
|
|
128
|
+
Thumbs.db
|
|
129
|
+
|
|
130
|
+
# IDE
|
|
131
|
+
.idea/
|
|
132
|
+
.vscode/
|
|
133
|
+
*.swp
|
|
134
|
+
*.swo
|
|
135
|
+
*~
|
|
136
|
+
|
|
137
|
+
# Project specific
|
|
138
|
+
storage/
|
|
139
|
+
*.db
|
|
140
|
+
*.db-shm
|
|
141
|
+
*.db-wal
|
|
142
|
+
models/
|
|
143
|
+
logs/
|
|
144
|
+
backups/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
[distutils]
|
|
2
|
+
index-servers =
|
|
3
|
+
pypi
|
|
4
|
+
|
|
5
|
+
[pypi]
|
|
6
|
+
repository = https://upload.pypi.org/legacy/
|
|
7
|
+
username = __token__
|
|
8
|
+
password = pypi-AgEIcHlwaS5vcmcCJGJlZTNjMDBiLTc5MjctNGI4ZS04NTEyLWI5NTJiMzdmZmU2MQACKlszLCI3ZjBlYzA1MC1iNTk5LTQxNGQtYjY0NS04MzZkZTJlY2NhYTQiXQAABiAGDa-9DUpieFzHiMvnbqlzpU-cI3ZbfsSd-hkpX-D4Fw==
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026
|
|
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
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lao Hei
|
|
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 limitation the rights to use,
|
|
8
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
9
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
10
|
+
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,210 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mindcore-memory
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Summary: MCP Server for AI long-term memory and context management
|
|
5
|
+
Author-email: Lao Hei <1410770089@qq.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Keywords: agent,ai,context,llm,mcp,memory
|
|
9
|
+
Classifier: Development Status :: 3 - Alpha
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Requires-Python: >=3.10
|
|
16
|
+
Requires-Dist: json-rpc>=1.5.0
|
|
17
|
+
Requires-Dist: mcp[cli]>=1.0.0
|
|
18
|
+
Requires-Dist: pydantic>=2.0.0
|
|
19
|
+
Requires-Dist: structlog>=24.0.0
|
|
20
|
+
Requires-Dist: tinydb>=4.8.0
|
|
21
|
+
Provides-Extra: dev
|
|
22
|
+
Requires-Dist: mypy>=1.9.0; extra == 'dev'
|
|
23
|
+
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
|
|
24
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
|
|
25
|
+
Requires-Dist: pytest>=8.0.0; extra == 'dev'
|
|
26
|
+
Requires-Dist: ruff>=0.3.0; extra == 'dev'
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
# MindCore Memory MCP
|
|
30
|
+
|
|
31
|
+
**AI Long-Term Memory Server — Production-grade persistent memory for AI agents.**
|
|
32
|
+
|
|
33
|
+
> "The best AI agent isn't the smartest — it's the one that remembers."
|
|
34
|
+
|
|
35
|
+
[](https://github.com/woshilaohei/mindcore-memory-mcp/stargazers)
|
|
36
|
+
[](https://opensource.org/licenses/MIT)
|
|
37
|
+
[](https://python.org)
|
|
38
|
+
[](https://glama.ai/mcp/servers/woshilaohei/mindcore-memory-mcp)
|
|
39
|
+
|
|
40
|
+
## Value Proposition
|
|
41
|
+
|
|
42
|
+
**MindCore Memory** solves AI Agent's biggest pain point: limited context windows, lost information in long conversations, and broken cross-session memory continuity.
|
|
43
|
+
|
|
44
|
+
## What Problem It Solves
|
|
45
|
+
|
|
46
|
+
| Pain Point | Status Quo | MindCore Memory |
|
|
47
|
+
|------------|-----------|-----------------|
|
|
48
|
+
| AI forgets everything | Conversation ends, all lost | Persistent long-term memory |
|
|
49
|
+
| No cross-session recall | Re-teach every session | Cross-session knowledge reuse |
|
|
50
|
+
| Memory chaos, no priority | All memories weighted equally | Importance grading + confidence |
|
|
51
|
+
| RAG brute-force injection | Context overload, quality drops | Precise context window |
|
|
52
|
+
|
|
53
|
+
## Quick Start (3 lines)
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# 1. Install
|
|
57
|
+
pip install mindcore-memory
|
|
58
|
+
|
|
59
|
+
# 2. Launch MCP Server
|
|
60
|
+
mindcore-memory
|
|
61
|
+
|
|
62
|
+
# 3. Call from your AI Agent
|
|
63
|
+
memory_id = memory_store("User says his name is Zhang San, free on Wednesday")
|
|
64
|
+
context = memory_recall("User's schedule")
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Eval Framework Results
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
Storage Integrity: 100% (data persistence correct)
|
|
71
|
+
Recall Relevance: 100% (relevant memories recalled first)
|
|
72
|
+
Confidence Calibration: 100% (confidence correctly calibrated)
|
|
73
|
+
Importance Weighting: 100% (high-priority memories ranked higher)
|
|
74
|
+
Context Efficiency: 100% (context window not overloaded)
|
|
75
|
+
|
|
76
|
+
Overall Score: 100%
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Core Tools
|
|
80
|
+
|
|
81
|
+
### `memory_store` - Store memory
|
|
82
|
+
```python
|
|
83
|
+
memory_store(
|
|
84
|
+
content="Python was created by Guido van Rossum from Netherlands",
|
|
85
|
+
importance=3, # 1-4 importance level
|
|
86
|
+
tags=["python", "history"],
|
|
87
|
+
confidence=0.95, # confidence score
|
|
88
|
+
source="agent" # agent/user/tool
|
|
89
|
+
)
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### `memory_recall` - Recall memory
|
|
93
|
+
```python
|
|
94
|
+
memory_recall(
|
|
95
|
+
query="Who created Python",
|
|
96
|
+
tags=["python"], # optional tag filter
|
|
97
|
+
limit=10 # return count
|
|
98
|
+
)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### `memory_context` - Build context window
|
|
102
|
+
```python
|
|
103
|
+
# Build optimal context for current task (auto-dedup + priority sort)
|
|
104
|
+
context = memory_context(
|
|
105
|
+
query="Current project status",
|
|
106
|
+
max_tokens=2000 # auto-truncate
|
|
107
|
+
)
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### `memory_stats` - System status
|
|
111
|
+
```python
|
|
112
|
+
# View memory statistics: total/distribution/confidence
|
|
113
|
+
stats = memory_stats()
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Project Structure
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
mindcore-memory-mcp/
|
|
120
|
+
├── mindcore_memory/ # Python package (pip install entry)
|
|
121
|
+
│ ├── __init__.py
|
|
122
|
+
│ ├── memory_engine.py # Core memory engine
|
|
123
|
+
│ ├── server.py # MCP Server (stdio + HTTP dual transport)
|
|
124
|
+
│ ├── http_app.py # HTTP endpoint (production deploy)
|
|
125
|
+
│ └── eval_framework.py # Evaluation framework
|
|
126
|
+
├── tests/
|
|
127
|
+
│ └── test_memory.py # Unit tests
|
|
128
|
+
├── examples/
|
|
129
|
+
│ └── basic_usage.py # Usage examples
|
|
130
|
+
├── pyproject.toml
|
|
131
|
+
├── README.md
|
|
132
|
+
└── LICENSE
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Integration
|
|
136
|
+
|
|
137
|
+
### Claude Desktop
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"mcpServers": {
|
|
141
|
+
"mindcore-memory": {
|
|
142
|
+
"command": "pip",
|
|
143
|
+
"args": ["install", "mindcore-memory"]
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### VS Code AI
|
|
150
|
+
Search `MindCore Memory` in the extension marketplace.
|
|
151
|
+
|
|
152
|
+
### HTTP API (Production)
|
|
153
|
+
```bash
|
|
154
|
+
curl -X POST http://localhost:8080/mcp \
|
|
155
|
+
-H "Content-Type: application/json" \
|
|
156
|
+
-H "Authorization: Bearer YOUR_TOKEN" \
|
|
157
|
+
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"memory_store","arguments":{"content":"test"}},"id":1}'
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Production Standards
|
|
161
|
+
|
|
162
|
+
| Standard | Implementation |
|
|
163
|
+
|----------|---------------|
|
|
164
|
+
| **JSON-RPC 2.0** | stdio + HTTP dual transport |
|
|
165
|
+
| **Bearer Token Auth** | Optional auth for HTTP endpoints |
|
|
166
|
+
| **Input Validation** | Pydantic schemas |
|
|
167
|
+
| **CI/CD** | GitHub Actions |
|
|
168
|
+
| **Unit Tests** | pytest + coverage |
|
|
169
|
+
| **Eval Framework** | 5 core metrics |
|
|
170
|
+
| **Observability** | structlog complete logging |
|
|
171
|
+
| **Data Sovereignty** | JSONL local files, no vendor lock-in |
|
|
172
|
+
|
|
173
|
+
## Open Source
|
|
174
|
+
|
|
175
|
+
This project is open source (MIT License). The code is completely free. Storage uses local JSON files with no cloud service dependency and no data collection.
|
|
176
|
+
|
|
177
|
+
## License
|
|
178
|
+
|
|
179
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Star History
|
|
184
|
+
|
|
185
|
+
[](https://star-history.com/#woshilaohei/mindcore-memory-mcp&Timeline)
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
<p align="center">
|
|
190
|
+
<strong>Give AI memory. Make humans trust AI more.</strong>
|
|
191
|
+
</p>
|
|
192
|
+
|
|
193
|
+
---
|
|
194
|
+
|
|
195
|
+
## Collaborate With Me
|
|
196
|
+
|
|
197
|
+
I'm actively developing AI safety architecture projects including:
|
|
198
|
+
|
|
199
|
+
1. **Cerebellum Evolution Engine** - AI safety & evolution framework
|
|
200
|
+
2. **MindCore** - Cognitive memory architecture for AI systems
|
|
201
|
+
3. **Border Guard** - Self-evolving security operating system
|
|
202
|
+
4. **Ternary Balance Boundary Algorithm** - Novel equilibrium theory with 3 papers
|
|
203
|
+
5. **MindCore Memory MCP** - This project: production-grade long-term memory server
|
|
204
|
+
|
|
205
|
+
**Interested in collaborating?** Reach out:
|
|
206
|
+
|
|
207
|
+
- Email: [1410770089@qq.com](mailto:1410770089@qq.com)
|
|
208
|
+
- GitHub: [@woshilaohei](https://github.com/woshilaohei)
|
|
209
|
+
|
|
210
|
+
**Author:** Lao Hei
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# MindCore Memory MCP
|
|
2
|
+
|
|
3
|
+
**AI Long-Term Memory Server — Production-grade persistent memory for AI agents.**
|
|
4
|
+
|
|
5
|
+
> "The best AI agent isn't the smartest — it's the one that remembers."
|
|
6
|
+
|
|
7
|
+
[](https://github.com/woshilaohei/mindcore-memory-mcp/stargazers)
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
9
|
+
[](https://python.org)
|
|
10
|
+
[](https://glama.ai/mcp/servers/woshilaohei/mindcore-memory-mcp)
|
|
11
|
+
|
|
12
|
+
## Value Proposition
|
|
13
|
+
|
|
14
|
+
**MindCore Memory** solves AI Agent's biggest pain point: limited context windows, lost information in long conversations, and broken cross-session memory continuity.
|
|
15
|
+
|
|
16
|
+
## What Problem It Solves
|
|
17
|
+
|
|
18
|
+
| Pain Point | Status Quo | MindCore Memory |
|
|
19
|
+
|------------|-----------|-----------------|
|
|
20
|
+
| AI forgets everything | Conversation ends, all lost | Persistent long-term memory |
|
|
21
|
+
| No cross-session recall | Re-teach every session | Cross-session knowledge reuse |
|
|
22
|
+
| Memory chaos, no priority | All memories weighted equally | Importance grading + confidence |
|
|
23
|
+
| RAG brute-force injection | Context overload, quality drops | Precise context window |
|
|
24
|
+
|
|
25
|
+
## Quick Start (3 lines)
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# 1. Install
|
|
29
|
+
pip install mindcore-memory
|
|
30
|
+
|
|
31
|
+
# 2. Launch MCP Server
|
|
32
|
+
mindcore-memory
|
|
33
|
+
|
|
34
|
+
# 3. Call from your AI Agent
|
|
35
|
+
memory_id = memory_store("User says his name is Zhang San, free on Wednesday")
|
|
36
|
+
context = memory_recall("User's schedule")
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Eval Framework Results
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
Storage Integrity: 100% (data persistence correct)
|
|
43
|
+
Recall Relevance: 100% (relevant memories recalled first)
|
|
44
|
+
Confidence Calibration: 100% (confidence correctly calibrated)
|
|
45
|
+
Importance Weighting: 100% (high-priority memories ranked higher)
|
|
46
|
+
Context Efficiency: 100% (context window not overloaded)
|
|
47
|
+
|
|
48
|
+
Overall Score: 100%
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Core Tools
|
|
52
|
+
|
|
53
|
+
### `memory_store` - Store memory
|
|
54
|
+
```python
|
|
55
|
+
memory_store(
|
|
56
|
+
content="Python was created by Guido van Rossum from Netherlands",
|
|
57
|
+
importance=3, # 1-4 importance level
|
|
58
|
+
tags=["python", "history"],
|
|
59
|
+
confidence=0.95, # confidence score
|
|
60
|
+
source="agent" # agent/user/tool
|
|
61
|
+
)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### `memory_recall` - Recall memory
|
|
65
|
+
```python
|
|
66
|
+
memory_recall(
|
|
67
|
+
query="Who created Python",
|
|
68
|
+
tags=["python"], # optional tag filter
|
|
69
|
+
limit=10 # return count
|
|
70
|
+
)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### `memory_context` - Build context window
|
|
74
|
+
```python
|
|
75
|
+
# Build optimal context for current task (auto-dedup + priority sort)
|
|
76
|
+
context = memory_context(
|
|
77
|
+
query="Current project status",
|
|
78
|
+
max_tokens=2000 # auto-truncate
|
|
79
|
+
)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### `memory_stats` - System status
|
|
83
|
+
```python
|
|
84
|
+
# View memory statistics: total/distribution/confidence
|
|
85
|
+
stats = memory_stats()
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Project Structure
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
mindcore-memory-mcp/
|
|
92
|
+
├── mindcore_memory/ # Python package (pip install entry)
|
|
93
|
+
│ ├── __init__.py
|
|
94
|
+
│ ├── memory_engine.py # Core memory engine
|
|
95
|
+
│ ├── server.py # MCP Server (stdio + HTTP dual transport)
|
|
96
|
+
│ ├── http_app.py # HTTP endpoint (production deploy)
|
|
97
|
+
│ └── eval_framework.py # Evaluation framework
|
|
98
|
+
├── tests/
|
|
99
|
+
│ └── test_memory.py # Unit tests
|
|
100
|
+
├── examples/
|
|
101
|
+
│ └── basic_usage.py # Usage examples
|
|
102
|
+
├── pyproject.toml
|
|
103
|
+
├── README.md
|
|
104
|
+
└── LICENSE
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Integration
|
|
108
|
+
|
|
109
|
+
### Claude Desktop
|
|
110
|
+
```json
|
|
111
|
+
{
|
|
112
|
+
"mcpServers": {
|
|
113
|
+
"mindcore-memory": {
|
|
114
|
+
"command": "pip",
|
|
115
|
+
"args": ["install", "mindcore-memory"]
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### VS Code AI
|
|
122
|
+
Search `MindCore Memory` in the extension marketplace.
|
|
123
|
+
|
|
124
|
+
### HTTP API (Production)
|
|
125
|
+
```bash
|
|
126
|
+
curl -X POST http://localhost:8080/mcp \
|
|
127
|
+
-H "Content-Type: application/json" \
|
|
128
|
+
-H "Authorization: Bearer YOUR_TOKEN" \
|
|
129
|
+
-d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"memory_store","arguments":{"content":"test"}},"id":1}'
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Production Standards
|
|
133
|
+
|
|
134
|
+
| Standard | Implementation |
|
|
135
|
+
|----------|---------------|
|
|
136
|
+
| **JSON-RPC 2.0** | stdio + HTTP dual transport |
|
|
137
|
+
| **Bearer Token Auth** | Optional auth for HTTP endpoints |
|
|
138
|
+
| **Input Validation** | Pydantic schemas |
|
|
139
|
+
| **CI/CD** | GitHub Actions |
|
|
140
|
+
| **Unit Tests** | pytest + coverage |
|
|
141
|
+
| **Eval Framework** | 5 core metrics |
|
|
142
|
+
| **Observability** | structlog complete logging |
|
|
143
|
+
| **Data Sovereignty** | JSONL local files, no vendor lock-in |
|
|
144
|
+
|
|
145
|
+
## Open Source
|
|
146
|
+
|
|
147
|
+
This project is open source (MIT License). The code is completely free. Storage uses local JSON files with no cloud service dependency and no data collection.
|
|
148
|
+
|
|
149
|
+
## License
|
|
150
|
+
|
|
151
|
+
MIT License - see [LICENSE](LICENSE) file for details.
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Star History
|
|
156
|
+
|
|
157
|
+
[](https://star-history.com/#woshilaohei/mindcore-memory-mcp&Timeline)
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
<p align="center">
|
|
162
|
+
<strong>Give AI memory. Make humans trust AI more.</strong>
|
|
163
|
+
</p>
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Collaborate With Me
|
|
168
|
+
|
|
169
|
+
I'm actively developing AI safety architecture projects including:
|
|
170
|
+
|
|
171
|
+
1. **Cerebellum Evolution Engine** - AI safety & evolution framework
|
|
172
|
+
2. **MindCore** - Cognitive memory architecture for AI systems
|
|
173
|
+
3. **Border Guard** - Self-evolving security operating system
|
|
174
|
+
4. **Ternary Balance Boundary Algorithm** - Novel equilibrium theory with 3 papers
|
|
175
|
+
5. **MindCore Memory MCP** - This project: production-grade long-term memory server
|
|
176
|
+
|
|
177
|
+
**Interested in collaborating?** Reach out:
|
|
178
|
+
|
|
179
|
+
- Email: [1410770089@qq.com](mailto:1410770089@qq.com)
|
|
180
|
+
- GitHub: [@woshilaohei](https://github.com/woshilaohei)
|
|
181
|
+
|
|
182
|
+
**Author:** Lao Hei
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"""
|
|
2
|
-
MindCore Memory MCP
|
|
3
|
-
"""
|
|
4
|
-
|
|
5
|
-
from .memory_engine import MemoryEngine, MemoryEntry, RetrievalResult, MemoryImportance
|
|
6
|
-
from . import server
|
|
7
|
-
|
|
8
|
-
__all__ = [
|
|
9
|
-
"MemoryEngine",
|
|
10
|
-
"MemoryEntry",
|
|
11
|
-
"RetrievalResult",
|
|
12
|
-
"MemoryImportance",
|
|
13
|
-
]
|
|
1
|
+
"""
|
|
2
|
+
MindCore Memory MCP
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from .memory_engine import MemoryEngine, MemoryEntry, RetrievalResult, MemoryImportance
|
|
6
|
+
from . import server
|
|
7
|
+
|
|
8
|
+
__all__ = [
|
|
9
|
+
"MemoryEngine",
|
|
10
|
+
"MemoryEntry",
|
|
11
|
+
"RetrievalResult",
|
|
12
|
+
"MemoryImportance",
|
|
13
|
+
]
|