superlocalmemory 2.8.2 → 2.8.5
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.
- package/ATTRIBUTION.md +1 -1
- package/CHANGELOG.md +17 -0
- package/README.md +7 -5
- package/api_server.py +5 -0
- package/bin/slm +35 -0
- package/bin/slm.bat +3 -3
- package/docs/SECURITY-QUICK-REFERENCE.md +214 -0
- package/install.ps1 +11 -11
- package/mcp_server.py +78 -10
- package/package.json +2 -2
- package/requirements-core.txt +16 -18
- package/requirements-learning.txt +8 -8
- package/requirements.txt +9 -7
- package/scripts/prepack.js +33 -0
- package/scripts/verify-v27.ps1 +301 -0
- package/src/agent_registry.py +32 -28
- package/src/auto_backup.py +12 -6
- package/src/cache_manager.py +2 -2
- package/src/compression/__init__.py +25 -0
- package/src/compression/cli.py +150 -0
- package/src/compression/cold_storage.py +217 -0
- package/src/compression/config.py +72 -0
- package/src/compression/orchestrator.py +133 -0
- package/src/compression/tier2_compressor.py +228 -0
- package/src/compression/tier3_compressor.py +153 -0
- package/src/compression/tier_classifier.py +148 -0
- package/src/db_connection_manager.py +5 -5
- package/src/event_bus.py +24 -22
- package/src/hnsw_index.py +3 -3
- package/src/learning/__init__.py +5 -4
- package/src/learning/adaptive_ranker.py +14 -265
- package/src/learning/bootstrap/__init__.py +69 -0
- package/src/learning/bootstrap/constants.py +93 -0
- package/src/learning/bootstrap/db_queries.py +316 -0
- package/src/learning/bootstrap/sampling.py +82 -0
- package/src/learning/bootstrap/text_utils.py +71 -0
- package/src/learning/cross_project_aggregator.py +58 -57
- package/src/learning/db/__init__.py +40 -0
- package/src/learning/db/constants.py +44 -0
- package/src/learning/db/schema.py +279 -0
- package/src/learning/learning_db.py +15 -234
- package/src/learning/ranking/__init__.py +33 -0
- package/src/learning/ranking/constants.py +84 -0
- package/src/learning/ranking/helpers.py +278 -0
- package/src/learning/source_quality_scorer.py +66 -65
- package/src/learning/synthetic_bootstrap.py +28 -310
- package/src/memory/__init__.py +36 -0
- package/src/memory/cli.py +205 -0
- package/src/memory/constants.py +39 -0
- package/src/memory/helpers.py +28 -0
- package/src/memory/schema.py +166 -0
- package/src/memory-profiles.py +94 -86
- package/src/memory-reset.py +187 -185
- package/src/memory_compression.py +2 -2
- package/src/memory_store_v2.py +44 -354
- package/src/migrate_v1_to_v2.py +11 -10
- package/src/patterns/analyzers.py +104 -100
- package/src/patterns/learner.py +17 -13
- package/src/patterns/scoring.py +25 -21
- package/src/patterns/store.py +40 -38
- package/src/patterns/terminology.py +53 -51
- package/src/provenance_tracker.py +2 -2
- package/src/qualixar_attribution.py +1 -1
- package/src/search/engine.py +16 -14
- package/src/search/index_loader.py +13 -11
- package/src/setup_validator.py +160 -158
- package/src/subscription_manager.py +20 -18
- package/src/tree/builder.py +66 -64
- package/src/tree/nodes.py +103 -97
- package/src/tree/queries.py +142 -137
- package/src/tree/schema.py +46 -42
- package/src/webhook_dispatcher.py +3 -3
- package/ui_server.py +7 -4
package/ATTRIBUTION.md
CHANGED
|
@@ -38,7 +38,7 @@ is_valid = QualixarSigner.verify(signed_output)
|
|
|
38
38
|
|
|
39
39
|
### Research Initiative
|
|
40
40
|
|
|
41
|
-
Qualixar is a research
|
|
41
|
+
Qualixar is a research initiative for AI agent development tools by Varun Pratap Bhardwaj. SuperLocalMemory is one of several research initiatives under the Qualixar umbrella.
|
|
42
42
|
|
|
43
43
|
### Third-Party Acknowledgments
|
|
44
44
|
|
package/CHANGELOG.md
CHANGED
|
@@ -16,6 +16,23 @@ SuperLocalMemory V2 - Intelligent local memory system for AI coding assistants.
|
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
19
|
+
## [2.8.3] - 2026-03-05
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
- Windows installation and cross-platform compatibility
|
|
23
|
+
- Database stability under concurrent usage
|
|
24
|
+
- Forward compatibility with latest Python versions
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
- Full Windows support with PowerShell scripts for all operations
|
|
28
|
+
- `slm attribution` command for license and creator information
|
|
29
|
+
|
|
30
|
+
### Improved
|
|
31
|
+
- Overall reliability and code quality
|
|
32
|
+
- Dependency management for reproducible installs
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
19
36
|
## [2.8.2] - 2026-03-04
|
|
20
37
|
|
|
21
38
|
### Fixed
|
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
16
|
<p align="center">
|
|
17
|
+
<a href="https://arxiv.org/abs/2603.02240"><img src="https://img.shields.io/badge/arXiv-2603.02240-b31b1b?style=for-the-badge&logo=arxiv&logoColor=white" alt="arXiv"/></a>
|
|
17
18
|
<a href="https://zenodo.org/records/18709670"><img src="https://img.shields.io/badge/DOI-10.5281%2Fzenodo.18709670-blue?style=for-the-badge&logo=doi&logoColor=white" alt="DOI"/></a>
|
|
18
19
|
<a href="https://zenodo.org/records/18709670"><img src="https://img.shields.io/badge/Zenodo-Research_Paper-1682D4?style=for-the-badge&logo=zenodo&logoColor=white" alt="Zenodo"/></a>
|
|
19
20
|
<a href="https://www.researchgate.net/publication/400976053"><img src="https://img.shields.io/badge/ResearchGate-Paper-00CCBB?style=for-the-badge&logo=researchgate&logoColor=white" alt="ResearchGate"/></a>
|
|
@@ -55,21 +56,22 @@ The paper presents SuperLocalMemory's architecture for defending against OWASP A
|
|
|
55
56
|
|
|
56
57
|
| Platform | Link |
|
|
57
58
|
|----------|------|
|
|
59
|
+
| **arXiv** | [arXiv:2603.02240](https://arxiv.org/abs/2603.02240) |
|
|
58
60
|
| **Zenodo** (CERN) | [DOI: 10.5281/zenodo.18709670](https://zenodo.org/records/18709670) |
|
|
59
61
|
| **ResearchGate** | [Publication Page](https://www.researchgate.net/publication/400976053) |
|
|
60
|
-
| **arXiv** | Submission under review |
|
|
61
62
|
| **Research Portfolio** | [superlocalmemory.com/research](https://superlocalmemory.com/research) |
|
|
62
63
|
|
|
63
64
|
If you use SuperLocalMemory in your research, please cite:
|
|
64
65
|
|
|
65
66
|
```bibtex
|
|
66
|
-
@
|
|
67
|
+
@article{bhardwaj2026superlocalmemory,
|
|
67
68
|
title={SuperLocalMemory: Privacy-Preserving Multi-Agent Memory with Bayesian Trust Defense Against Memory Poisoning},
|
|
68
69
|
author={Bhardwaj, Varun Pratap},
|
|
69
70
|
year={2026},
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
eprint={2603.02240},
|
|
72
|
+
archivePrefix={arXiv},
|
|
73
|
+
primaryClass={cs.AI},
|
|
74
|
+
url={https://arxiv.org/abs/2603.02240}
|
|
73
75
|
}
|
|
74
76
|
```
|
|
75
77
|
|
package/api_server.py
CHANGED
|
@@ -18,6 +18,8 @@ from fastapi.responses import HTMLResponse, JSONResponse
|
|
|
18
18
|
from pydantic import BaseModel
|
|
19
19
|
import uvicorn
|
|
20
20
|
|
|
21
|
+
from security_middleware import SecurityHeadersMiddleware
|
|
22
|
+
|
|
21
23
|
# Import local modules
|
|
22
24
|
import sys
|
|
23
25
|
sys.path.insert(0, str(Path(__file__).parent / "src"))
|
|
@@ -37,6 +39,9 @@ app = FastAPI(
|
|
|
37
39
|
version="2.0.0"
|
|
38
40
|
)
|
|
39
41
|
|
|
42
|
+
# Security middleware (add first for proper header application)
|
|
43
|
+
app.add_middleware(SecurityHeadersMiddleware)
|
|
44
|
+
|
|
40
45
|
# Mount static files
|
|
41
46
|
UI_DIR.mkdir(exist_ok=True)
|
|
42
47
|
app.mount("/static", StaticFiles(directory=str(UI_DIR)), name="static")
|
package/bin/slm
CHANGED
|
@@ -310,6 +310,38 @@ except Exception as e:
|
|
|
310
310
|
"
|
|
311
311
|
;;
|
|
312
312
|
|
|
313
|
+
attribution)
|
|
314
|
+
python3 -c "
|
|
315
|
+
import sys
|
|
316
|
+
sys.path.insert(0, '${SLM_DIR}')
|
|
317
|
+
try:
|
|
318
|
+
from memory_store_v2 import MemoryStoreV2
|
|
319
|
+
store = MemoryStoreV2()
|
|
320
|
+
attr = store.get_attribution()
|
|
321
|
+
print('SuperLocalMemory — Attribution')
|
|
322
|
+
print('=' * 45)
|
|
323
|
+
print(f\"Creator: {attr.get('creator_name', 'Varun Pratap Bhardwaj')}\")
|
|
324
|
+
print(f\"Role: {attr.get('creator_role', 'Solution Architect')}\")
|
|
325
|
+
print(f\"Platform: {attr.get('platform', 'Qualixar')}\")
|
|
326
|
+
print(f\"License: {attr.get('license', 'MIT')}\")
|
|
327
|
+
print(f\"Website: {attr.get('website', 'https://superlocalmemory.com')}\")
|
|
328
|
+
print(f\"Author: {attr.get('author_website', 'https://varunpratap.com')}\")
|
|
329
|
+
print('=' * 45)
|
|
330
|
+
try:
|
|
331
|
+
from qualixar_attribution import QualixarSigner
|
|
332
|
+
from qualixar_watermark import encode_watermark
|
|
333
|
+
print('Layer 1 (Visible): Active')
|
|
334
|
+
print('Layer 2 (Cryptographic): Active')
|
|
335
|
+
print('Layer 3 (Steganographic): Active')
|
|
336
|
+
except ImportError:
|
|
337
|
+
print('Layer 1 (Visible): Active')
|
|
338
|
+
print('Layer 2 (Cryptographic): Not available')
|
|
339
|
+
print('Layer 3 (Steganographic): Not available')
|
|
340
|
+
except Exception as e:
|
|
341
|
+
print(f'Error: {e}')
|
|
342
|
+
"
|
|
343
|
+
;;
|
|
344
|
+
|
|
313
345
|
help|--help|-h)
|
|
314
346
|
cat <<EOF
|
|
315
347
|
SuperLocalMemory V2 - Universal CLI
|
|
@@ -356,6 +388,9 @@ HTTP SERVER (MCP):
|
|
|
356
388
|
slm serve [PORT] Start MCP HTTP server (default port 8417)
|
|
357
389
|
For ChatGPT/remote: ngrok http PORT
|
|
358
390
|
|
|
391
|
+
ATTRIBUTION:
|
|
392
|
+
slm attribution Show creator attribution and provenance status
|
|
393
|
+
|
|
359
394
|
ADVANCED:
|
|
360
395
|
slm reset soft Soft reset (clear memories)
|
|
361
396
|
slm reset hard --confirm Hard reset (nuclear option)
|
package/bin/slm.bat
CHANGED
|
@@ -49,7 +49,7 @@ exit /b 1
|
|
|
49
49
|
|
|
50
50
|
REM Parse command
|
|
51
51
|
if "%1"=="" (
|
|
52
|
-
echo SuperLocalMemory
|
|
52
|
+
echo SuperLocalMemory - Universal AI Memory System
|
|
53
53
|
echo.
|
|
54
54
|
echo Usage: slm [command] [options]
|
|
55
55
|
echo.
|
|
@@ -145,7 +145,7 @@ if exist "%INSTALL_DIR%\memory-profiles.py" (
|
|
|
145
145
|
exit /b %ERRORLEVEL%
|
|
146
146
|
|
|
147
147
|
:show_help
|
|
148
|
-
echo SuperLocalMemory
|
|
148
|
+
echo SuperLocalMemory - Universal AI Memory System
|
|
149
149
|
echo.
|
|
150
150
|
echo Usage: slm [command] [options]
|
|
151
151
|
echo.
|
|
@@ -188,7 +188,7 @@ echo Report issues: https://github.com/varun369/SuperLocalMemoryV2/issues
|
|
|
188
188
|
exit /b 0
|
|
189
189
|
|
|
190
190
|
:show_version
|
|
191
|
-
echo SuperLocalMemory V2.
|
|
191
|
+
echo SuperLocalMemory V2.8.3
|
|
192
192
|
echo Copyright (c) 2026 Varun Pratap Bhardwaj
|
|
193
193
|
echo Licensed under MIT License
|
|
194
194
|
echo Repository: https://github.com/varun369/SuperLocalMemoryV2
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
# Security Quick Reference — For Developers
|
|
2
|
+
|
|
3
|
+
**Last Updated:** March 4, 2026
|
|
4
|
+
|
|
5
|
+
## TL;DR — Safe Coding Patterns
|
|
6
|
+
|
|
7
|
+
### ✅ DO THIS (Safe)
|
|
8
|
+
|
|
9
|
+
```javascript
|
|
10
|
+
// Safe: Use textContent for plain text
|
|
11
|
+
element.textContent = userContent;
|
|
12
|
+
|
|
13
|
+
// Safe: Use escapeHtml() before DOM insertion
|
|
14
|
+
element.innerHTML = escapeHtml(userContent);
|
|
15
|
+
|
|
16
|
+
// Safe: Create elements programmatically
|
|
17
|
+
const div = document.createElement('div');
|
|
18
|
+
div.textContent = userContent;
|
|
19
|
+
parent.appendChild(div);
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### ❌ DON'T DO THIS (Dangerous)
|
|
23
|
+
|
|
24
|
+
```javascript
|
|
25
|
+
// DANGEROUS: Direct assignment with user content
|
|
26
|
+
element.innerHTML = userContent; // XSS VULNERABLE
|
|
27
|
+
|
|
28
|
+
// DANGEROUS: Using code evaluation with user input
|
|
29
|
+
// Never use eval, Function constructor, or similar
|
|
30
|
+
|
|
31
|
+
// DANGEROUS: Inline event handlers with user content
|
|
32
|
+
element.setAttribute('onclick', userCode); // XSS VULNERABLE
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Security Checklist — Before Committing
|
|
36
|
+
|
|
37
|
+
- [ ] No direct innerHTML assignments without escapeHtml()
|
|
38
|
+
- [ ] All user content either uses textContent or is escaped
|
|
39
|
+
- [ ] No code evaluation with user input
|
|
40
|
+
- [ ] No inline event handlers with dynamic content
|
|
41
|
+
- [ ] All API endpoints return explicit Content-Type
|
|
42
|
+
- [ ] SQL queries use parameterized statements (never string concatenation)
|
|
43
|
+
- [ ] No secrets in code or config files
|
|
44
|
+
- [ ] Run security tests: pytest tests/test_security_headers.py -v
|
|
45
|
+
|
|
46
|
+
## Common Patterns
|
|
47
|
+
|
|
48
|
+
### Rendering User-Generated Content
|
|
49
|
+
|
|
50
|
+
**Pattern 1: Plain Text Only**
|
|
51
|
+
```javascript
|
|
52
|
+
const contentDiv = document.getElementById('memory-content');
|
|
53
|
+
contentDiv.textContent = memory.content; // Automatically safe
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Pattern 2: Mixed Content (HTML Structure + User Text)**
|
|
57
|
+
```javascript
|
|
58
|
+
const html = `
|
|
59
|
+
<div class="memory-card">
|
|
60
|
+
<h3>${escapeHtml(memory.title)}</h3>
|
|
61
|
+
<p>${escapeHtml(memory.content)}</p>
|
|
62
|
+
<span class="badge">${escapeHtml(memory.category)}</span>
|
|
63
|
+
</div>
|
|
64
|
+
`;
|
|
65
|
+
container.innerHTML = html;
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Pattern 3: Building DOM Programmatically (Most Secure)**
|
|
69
|
+
```javascript
|
|
70
|
+
const card = document.createElement('div');
|
|
71
|
+
card.className = 'memory-card';
|
|
72
|
+
|
|
73
|
+
const title = document.createElement('h3');
|
|
74
|
+
title.textContent = memory.title;
|
|
75
|
+
|
|
76
|
+
const content = document.createElement('p');
|
|
77
|
+
content.textContent = memory.content;
|
|
78
|
+
|
|
79
|
+
card.appendChild(title);
|
|
80
|
+
card.appendChild(content);
|
|
81
|
+
container.appendChild(card);
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### FastAPI Routes
|
|
85
|
+
|
|
86
|
+
**Safe Pattern:**
|
|
87
|
+
```python
|
|
88
|
+
@router.get("/api/memories")
|
|
89
|
+
async def get_memories():
|
|
90
|
+
# FastAPI automatically sets Content-Type: application/json
|
|
91
|
+
return {
|
|
92
|
+
"memories": memories, # User content here is safe in JSON
|
|
93
|
+
"total": len(memories)
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**SQL Queries:**
|
|
98
|
+
```python
|
|
99
|
+
# SAFE: Parameterized query
|
|
100
|
+
cursor.execute("SELECT * FROM memories WHERE id = ?", (memory_id,))
|
|
101
|
+
|
|
102
|
+
# DANGEROUS: String concatenation (SQL injection)
|
|
103
|
+
# Never use f-strings or concatenation for SQL queries
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Testing XSS Protection
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
# Test that XSS payloads are handled safely
|
|
110
|
+
def test_xss_payload():
|
|
111
|
+
payload = "<script>alert('xss')</script>"
|
|
112
|
+
|
|
113
|
+
# This should be safe when:
|
|
114
|
+
# 1. Returned as JSON with Content-Type: application/json
|
|
115
|
+
# 2. Rendered with escapeHtml() on client
|
|
116
|
+
# 3. Protected by CSP headers
|
|
117
|
+
|
|
118
|
+
response = client.get(f"/api/memory?content={payload}")
|
|
119
|
+
assert response.headers["Content-Type"] == "application/json"
|
|
120
|
+
assert response.headers["X-Content-Type-Options"] == "nosniff"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Security Headers Reference
|
|
124
|
+
|
|
125
|
+
All responses include these headers automatically via SecurityHeadersMiddleware:
|
|
126
|
+
|
|
127
|
+
- X-Content-Type-Options: nosniff
|
|
128
|
+
- X-Frame-Options: DENY
|
|
129
|
+
- X-XSS-Protection: 1; mode=block
|
|
130
|
+
- Content-Security-Policy: (comprehensive policy)
|
|
131
|
+
- Referrer-Policy: strict-origin-when-cross-origin
|
|
132
|
+
- Cache-Control: no-store (API endpoints only)
|
|
133
|
+
|
|
134
|
+
**Don't override these headers** unless you have a specific security reason and understand the implications.
|
|
135
|
+
|
|
136
|
+
## CORS Configuration
|
|
137
|
+
|
|
138
|
+
Current allowed origins:
|
|
139
|
+
- http://localhost:8765
|
|
140
|
+
- http://127.0.0.1:8765
|
|
141
|
+
- http://localhost:8417
|
|
142
|
+
- http://127.0.0.1:8417
|
|
143
|
+
|
|
144
|
+
**To add a new origin:**
|
|
145
|
+
1. Add to the allow_origins list in ui_server.py
|
|
146
|
+
2. Document why it's needed
|
|
147
|
+
3. Never use wildcard * in production
|
|
148
|
+
|
|
149
|
+
## When to Update Security
|
|
150
|
+
|
|
151
|
+
### Add New Route
|
|
152
|
+
- [ ] Verify return type has explicit Content-Type
|
|
153
|
+
- [ ] Test with XSS payloads
|
|
154
|
+
- [ ] Add test case to test_security_headers.py
|
|
155
|
+
|
|
156
|
+
### Add New JavaScript
|
|
157
|
+
- [ ] Use textContent for plain text
|
|
158
|
+
- [ ] Use escapeHtml() for mixed content
|
|
159
|
+
- [ ] Test rendering with XSS payloads
|
|
160
|
+
|
|
161
|
+
### Modify Security Headers
|
|
162
|
+
- [ ] Document reason in commit message
|
|
163
|
+
- [ ] Update SECURITY.md
|
|
164
|
+
- [ ] Run full security test suite
|
|
165
|
+
- [ ] Consider security implications
|
|
166
|
+
|
|
167
|
+
## Resources
|
|
168
|
+
|
|
169
|
+
- **Full Security Policy:** See SECURITY.md
|
|
170
|
+
- **Security Enhancement Details:** .backup/security-enhancement-2026-03-04.md
|
|
171
|
+
- **Security Tests:** tests/test_security_headers.py
|
|
172
|
+
- **Middleware Source:** security_middleware.py
|
|
173
|
+
- **Client-Side Escaping:** ui/app.js (escapeHtml function)
|
|
174
|
+
|
|
175
|
+
## Quick Test Commands
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# Run security tests only
|
|
179
|
+
pytest tests/test_security_headers.py -v
|
|
180
|
+
|
|
181
|
+
# Run all tests
|
|
182
|
+
pytest tests/ -x -q
|
|
183
|
+
|
|
184
|
+
# Manual verification (browser)
|
|
185
|
+
python3 ui_server.py
|
|
186
|
+
# Open http://localhost:8765
|
|
187
|
+
# DevTools → Network → Check response headers
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Red Flags — Stop and Review
|
|
191
|
+
|
|
192
|
+
If you see any of these patterns, STOP and review:
|
|
193
|
+
|
|
194
|
+
- innerHTML with user content (without escaping)
|
|
195
|
+
- Code evaluation functions anywhere
|
|
196
|
+
- String concatenation in SQL queries
|
|
197
|
+
- CORS with wildcard *
|
|
198
|
+
- User input in event handler attributes
|
|
199
|
+
- Disabling CSP or security headers
|
|
200
|
+
- Secrets or API keys in code
|
|
201
|
+
|
|
202
|
+
## When in Doubt
|
|
203
|
+
|
|
204
|
+
**Ask these questions:**
|
|
205
|
+
1. Could a user inject a script tag here?
|
|
206
|
+
2. Is this content escaped before rendering?
|
|
207
|
+
3. Does this SQL query use parameters?
|
|
208
|
+
4. Could this header configuration weaken security?
|
|
209
|
+
|
|
210
|
+
**If unsure:** Use the safest pattern (textContent or programmatic DOM creation).
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
**Remember:** Defense in depth. We have multiple layers (headers, CSP, escaping). Use all of them.
|
package/install.ps1
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
# ============================================================================
|
|
2
|
-
# SuperLocalMemory V2.
|
|
2
|
+
# SuperLocalMemory V2.8.3 - Windows Installation Script (PowerShell)
|
|
3
3
|
# Copyright (c) 2026 Varun Pratap Bhardwaj
|
|
4
4
|
# Licensed under MIT License
|
|
5
5
|
# Repository: https://github.com/varun369/SuperLocalMemoryV2
|
|
6
6
|
# ============================================================================
|
|
7
7
|
|
|
8
|
+
# IMPORTANT: param() must be the FIRST executable statement in PowerShell
|
|
9
|
+
param(
|
|
10
|
+
[switch]$NonInteractive,
|
|
11
|
+
[switch]$Auto,
|
|
12
|
+
[switch]$Yes,
|
|
13
|
+
[switch]$y
|
|
14
|
+
)
|
|
15
|
+
|
|
8
16
|
$ErrorActionPreference = "Stop"
|
|
9
17
|
|
|
10
18
|
$INSTALL_DIR = Join-Path $env:USERPROFILE ".claude-memory"
|
|
@@ -16,14 +24,6 @@ if (-not [Environment]::UserInteractive) {
|
|
|
16
24
|
$NON_INTERACTIVE = $true
|
|
17
25
|
}
|
|
18
26
|
|
|
19
|
-
# Parse command line arguments
|
|
20
|
-
param(
|
|
21
|
-
[switch]$NonInteractive,
|
|
22
|
-
[switch]$Auto,
|
|
23
|
-
[switch]$Yes,
|
|
24
|
-
[switch]$y
|
|
25
|
-
)
|
|
26
|
-
|
|
27
27
|
if ($NonInteractive -or $Auto -or $Yes -or $y) {
|
|
28
28
|
$NON_INTERACTIVE = $true
|
|
29
29
|
}
|
|
@@ -31,7 +31,7 @@ if ($NonInteractive -or $Auto -or $Yes -or $y) {
|
|
|
31
31
|
# Print banner
|
|
32
32
|
Write-Host ""
|
|
33
33
|
Write-Host "=================================================================="
|
|
34
|
-
Write-Host " SuperLocalMemory V2.
|
|
34
|
+
Write-Host " SuperLocalMemory V2.8.3 - Windows Installation "
|
|
35
35
|
Write-Host " by Varun Pratap Bhardwaj "
|
|
36
36
|
Write-Host " https://github.com/varun369/SuperLocalMemoryV2 "
|
|
37
37
|
Write-Host "=================================================================="
|
|
@@ -552,7 +552,7 @@ Write-Host "=================================================================="
|
|
|
552
552
|
Write-Host " Optional Features Available "
|
|
553
553
|
Write-Host "=================================================================="
|
|
554
554
|
Write-Host ""
|
|
555
|
-
Write-Host "SuperLocalMemory
|
|
555
|
+
Write-Host "SuperLocalMemory includes optional features:"
|
|
556
556
|
Write-Host ""
|
|
557
557
|
Write-Host " 1) Advanced Search (~1.5GB, 5-10 min)"
|
|
558
558
|
Write-Host " - Semantic search with sentence transformers"
|
package/mcp_server.py
CHANGED
|
@@ -61,6 +61,26 @@ try:
|
|
|
61
61
|
except ImportError:
|
|
62
62
|
TRUST_AVAILABLE = False
|
|
63
63
|
|
|
64
|
+
# Qualixar Attribution (v2.8.3 — 3-layer provenance)
|
|
65
|
+
try:
|
|
66
|
+
from qualixar_attribution import QualixarSigner
|
|
67
|
+
from qualixar_watermark import encode_watermark
|
|
68
|
+
_signer = QualixarSigner("superlocalmemory", "2.8.3")
|
|
69
|
+
ATTRIBUTION_AVAILABLE = True
|
|
70
|
+
except ImportError:
|
|
71
|
+
_signer = None
|
|
72
|
+
ATTRIBUTION_AVAILABLE = False
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def _sign_response(response: dict) -> dict:
|
|
76
|
+
"""Apply Layer 2 cryptographic signing to MCP tool responses."""
|
|
77
|
+
if _signer and isinstance(response, dict):
|
|
78
|
+
try:
|
|
79
|
+
return _signer.sign(response)
|
|
80
|
+
except Exception:
|
|
81
|
+
pass
|
|
82
|
+
return response
|
|
83
|
+
|
|
64
84
|
# Learning System (v2.7+)
|
|
65
85
|
try:
|
|
66
86
|
sys.path.insert(0, str(Path(__file__).parent / "src"))
|
|
@@ -203,7 +223,7 @@ _agent_registry = None
|
|
|
203
223
|
_provenance_tracker = None
|
|
204
224
|
|
|
205
225
|
|
|
206
|
-
def get_agent_registry():
|
|
226
|
+
def get_agent_registry() -> Optional[Any]:
|
|
207
227
|
"""Get shared AgentRegistry singleton (v2.5+). Returns None if unavailable."""
|
|
208
228
|
global _agent_registry
|
|
209
229
|
if not PROVENANCE_AVAILABLE:
|
|
@@ -213,7 +233,7 @@ def get_agent_registry():
|
|
|
213
233
|
return _agent_registry
|
|
214
234
|
|
|
215
235
|
|
|
216
|
-
def get_provenance_tracker():
|
|
236
|
+
def get_provenance_tracker() -> Optional[Any]:
|
|
217
237
|
"""Get shared ProvenanceTracker singleton (v2.5+). Returns None if unavailable."""
|
|
218
238
|
global _provenance_tracker
|
|
219
239
|
if not PROVENANCE_AVAILABLE:
|
|
@@ -226,7 +246,7 @@ def get_provenance_tracker():
|
|
|
226
246
|
_trust_scorer = None
|
|
227
247
|
|
|
228
248
|
|
|
229
|
-
def get_trust_scorer():
|
|
249
|
+
def get_trust_scorer() -> Optional[Any]:
|
|
230
250
|
"""Get shared TrustScorer singleton (v2.6+). Returns None if unavailable."""
|
|
231
251
|
global _trust_scorer
|
|
232
252
|
if not TRUST_AVAILABLE:
|
|
@@ -676,12 +696,12 @@ async def remember(
|
|
|
676
696
|
# Format response
|
|
677
697
|
preview = content[:100] + "..." if len(content) > 100 else content
|
|
678
698
|
|
|
679
|
-
return {
|
|
699
|
+
return _sign_response({
|
|
680
700
|
"success": True,
|
|
681
701
|
"memory_id": memory_id,
|
|
682
702
|
"message": f"Memory saved with ID {memory_id}",
|
|
683
703
|
"content_preview": preview
|
|
684
|
-
}
|
|
704
|
+
})
|
|
685
705
|
|
|
686
706
|
except Exception as e:
|
|
687
707
|
return {
|
|
@@ -805,13 +825,13 @@ async def recall(
|
|
|
805
825
|
if r.get('score', 0) >= min_score
|
|
806
826
|
]
|
|
807
827
|
|
|
808
|
-
return {
|
|
828
|
+
return _sign_response({
|
|
809
829
|
"success": True,
|
|
810
830
|
"query": query,
|
|
811
831
|
"results": filtered_results,
|
|
812
832
|
"count": len(filtered_results),
|
|
813
833
|
"total_searched": len(results)
|
|
814
|
-
}
|
|
834
|
+
})
|
|
815
835
|
|
|
816
836
|
except Exception as e:
|
|
817
837
|
return {
|
|
@@ -888,10 +908,10 @@ async def get_status() -> dict:
|
|
|
888
908
|
# Call existing get_stats method
|
|
889
909
|
stats = store.get_stats()
|
|
890
910
|
|
|
891
|
-
return {
|
|
911
|
+
return _sign_response({
|
|
892
912
|
"success": True,
|
|
893
913
|
**stats
|
|
894
|
-
}
|
|
914
|
+
})
|
|
895
915
|
|
|
896
916
|
except Exception as e:
|
|
897
917
|
return {
|
|
@@ -1637,6 +1657,54 @@ async def project_context_prompt(project_name: str) -> str:
|
|
|
1637
1657
|
# SERVER STARTUP
|
|
1638
1658
|
# ============================================================================
|
|
1639
1659
|
|
|
1660
|
+
@mcp.tool(annotations=ToolAnnotations(
|
|
1661
|
+
readOnlyHint=True,
|
|
1662
|
+
destructiveHint=False,
|
|
1663
|
+
openWorldHint=False,
|
|
1664
|
+
))
|
|
1665
|
+
async def get_attribution() -> dict:
|
|
1666
|
+
"""
|
|
1667
|
+
Get creator attribution and provenance verification for SuperLocalMemory.
|
|
1668
|
+
|
|
1669
|
+
Returns creator information, license details, and verification status
|
|
1670
|
+
for the 3-layer Qualixar attribution system.
|
|
1671
|
+
|
|
1672
|
+
Returns:
|
|
1673
|
+
{
|
|
1674
|
+
"creator": str,
|
|
1675
|
+
"license": str,
|
|
1676
|
+
"platform": str,
|
|
1677
|
+
"layers": {
|
|
1678
|
+
"visible": bool,
|
|
1679
|
+
"cryptographic": bool,
|
|
1680
|
+
"steganographic": bool
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
"""
|
|
1684
|
+
try:
|
|
1685
|
+
store = get_store()
|
|
1686
|
+
attribution = store.get_attribution()
|
|
1687
|
+
|
|
1688
|
+
return _sign_response({
|
|
1689
|
+
"success": True,
|
|
1690
|
+
**attribution,
|
|
1691
|
+
"website": "https://superlocalmemory.com",
|
|
1692
|
+
"author_website": "https://varunpratap.com",
|
|
1693
|
+
"attribution_layers": {
|
|
1694
|
+
"layer1_visible": True,
|
|
1695
|
+
"layer2_cryptographic": ATTRIBUTION_AVAILABLE,
|
|
1696
|
+
"layer3_steganographic": ATTRIBUTION_AVAILABLE,
|
|
1697
|
+
},
|
|
1698
|
+
})
|
|
1699
|
+
|
|
1700
|
+
except Exception as e:
|
|
1701
|
+
return {
|
|
1702
|
+
"success": False,
|
|
1703
|
+
"error": _sanitize_error(e),
|
|
1704
|
+
"message": "Failed to get attribution"
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
|
|
1640
1708
|
if __name__ == "__main__":
|
|
1641
1709
|
import argparse
|
|
1642
1710
|
|
|
@@ -1662,7 +1730,7 @@ if __name__ == "__main__":
|
|
|
1662
1730
|
# Print startup message to stderr (stdout is used for MCP protocol)
|
|
1663
1731
|
print("=" * 60, file=sys.stderr)
|
|
1664
1732
|
print("SuperLocalMemory V2 - MCP Server", file=sys.stderr)
|
|
1665
|
-
print("Version: 2.
|
|
1733
|
+
print("Version: 2.8.3", file=sys.stderr)
|
|
1666
1734
|
print("=" * 60, file=sys.stderr)
|
|
1667
1735
|
print("Created by: Varun Pratap Bhardwaj (Solution Architect)", file=sys.stderr)
|
|
1668
1736
|
print("Repository: https://github.com/varun369/SuperLocalMemoryV2", file=sys.stderr)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "superlocalmemory",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.5",
|
|
4
4
|
"description": "Your AI Finally Remembers You - Local-first intelligent memory system for AI assistants. Works with Claude, Cursor, Windsurf, VS Code/Copilot, Codex, and 17+ AI tools. 100% local, zero cloud dependencies.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-memory",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"superlocalmemory": "./bin/slm-npm"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
|
-
"prepack": "
|
|
49
|
+
"prepack": "node scripts/prepack.js",
|
|
50
50
|
"postinstall": "node scripts/postinstall.js",
|
|
51
51
|
"preuninstall": "node scripts/preuninstall.js",
|
|
52
52
|
"test": "echo \"Run: npm install -g . && slm status\" && exit 0"
|
package/requirements-core.txt
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
|
-
# SuperLocalMemory
|
|
1
|
+
# SuperLocalMemory - Core Feature Dependencies
|
|
2
2
|
# ============================================================================
|
|
3
|
-
#
|
|
4
|
-
#
|
|
3
|
+
# Required for knowledge graph and web dashboard.
|
|
4
|
+
# Core memory operations work without these (stdlib only).
|
|
5
5
|
#
|
|
6
|
-
# Download size: ~50MB
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
# Install with: pip3 install -r requirements-core.txt
|
|
6
|
+
# Download size: ~50MB | Install time: 1-2 minutes
|
|
7
|
+
# Install: pip3 install -r requirements-core.txt
|
|
10
8
|
# ============================================================================
|
|
11
9
|
|
|
12
|
-
# Knowledge Graph
|
|
13
|
-
python-igraph>=0.10.0
|
|
14
|
-
leidenalg>=0.9.0
|
|
15
|
-
scikit-learn>=1.3.0
|
|
10
|
+
# Knowledge Graph
|
|
11
|
+
python-igraph>=0.10.0,<2.0.0
|
|
12
|
+
leidenalg>=0.9.0,<1.0.0
|
|
13
|
+
scikit-learn>=1.3.0,<2.0.0
|
|
16
14
|
|
|
17
|
-
# Web Dashboard
|
|
18
|
-
fastapi>=0.109.0
|
|
19
|
-
uvicorn[standard]>=0.27.0
|
|
20
|
-
python-multipart>=0.0.6
|
|
15
|
+
# Web Dashboard
|
|
16
|
+
fastapi>=0.109.0,<1.0.0
|
|
17
|
+
uvicorn[standard]>=0.27.0,<1.0.0
|
|
18
|
+
python-multipart>=0.0.6,<1.0.0
|
|
21
19
|
|
|
22
|
-
# Performance
|
|
23
|
-
orjson>=3.9.0
|
|
24
|
-
diskcache>=5.6.0
|
|
20
|
+
# Performance
|
|
21
|
+
orjson>=3.9.0,<4.0.0
|
|
22
|
+
diskcache>=5.6.0,<6.0.0
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# SuperLocalMemory
|
|
1
|
+
# SuperLocalMemory - Learning Dependencies
|
|
2
2
|
# ============================================================================
|
|
3
|
-
# Optional but recommended. Enables intelligent pattern learning
|
|
4
|
-
# personalized recall ranking.
|
|
5
|
-
#
|
|
6
|
-
# If installation fails, core features work normally (v2.6 behavior).
|
|
7
|
-
# To install: pip3 install -r requirements-learning.txt
|
|
3
|
+
# Optional but recommended. Enables intelligent pattern learning
|
|
4
|
+
# and personalized recall ranking.
|
|
8
5
|
#
|
|
6
|
+
# If installation fails, core features work normally.
|
|
7
|
+
# Install: pip3 install -r requirements-learning.txt
|
|
9
8
|
# Download size: ~30MB
|
|
10
9
|
# ============================================================================
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
|
|
11
|
+
lightgbm>=4.0.0,<5.0.0
|
|
12
|
+
scipy>=1.9.0,<2.0.0
|