moyu-memory 2.4.7__py3-none-any.whl
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.
- moyu_memory-2.4.7.dist-info/METADATA +345 -0
- moyu_memory-2.4.7.dist-info/RECORD +35 -0
- moyu_memory-2.4.7.dist-info/WHEEL +5 -0
- moyu_memory-2.4.7.dist-info/entry_points.txt +2 -0
- moyu_memory-2.4.7.dist-info/licenses/LICENSE +21 -0
- moyu_memory-2.4.7.dist-info/top_level.txt +1 -0
- moyu_toolkit/SKILL.md +393 -0
- moyu_toolkit/__init__.py +0 -0
- moyu_toolkit/_moyu_paths.py +55 -0
- moyu_toolkit/active_context.py +175 -0
- moyu_toolkit/agent_memory.py +1053 -0
- moyu_toolkit/agent_memory_sqlite.py +153 -0
- moyu_toolkit/config.yaml +61 -0
- moyu_toolkit/context_manager.py +1017 -0
- moyu_toolkit/defense_toolkit/encrypt.py +206 -0
- moyu_toolkit/defense_toolkit/forensic_patterns.json +1690 -0
- moyu_toolkit/defense_toolkit/forensic_patterns_base64.json +1690 -0
- moyu_toolkit/defense_toolkit/integrity_checker.py +558 -0
- moyu_toolkit/defense_toolkit/isolation.py +88 -0
- moyu_toolkit/defense_toolkit/pii_redactor.py +197 -0
- moyu_toolkit/forgetting_curve.py +644 -0
- moyu_toolkit/knowledge_base.py +393 -0
- moyu_toolkit/knowledge_graph.py +686 -0
- moyu_toolkit/learner.py +530 -0
- moyu_toolkit/memory_merge.py +267 -0
- moyu_toolkit/moyu.py +785 -0
- moyu_toolkit/moyu_demo.py +86 -0
- moyu_toolkit/moyu_wake.py +303 -0
- moyu_toolkit/requirements.txt +10 -0
- moyu_toolkit/security.py +506 -0
- moyu_toolkit/self_reflection.py +404 -0
- moyu_toolkit/session_bridge.py +410 -0
- moyu_toolkit/tests/test_all.py +440 -0
- moyu_toolkit/updater.py +345 -0
- moyu_toolkit//345/242/250/347/276/275/351/241/271/347/233/256.md +112 -0
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: moyu-memory
|
|
3
|
+
Version: 2.4.7
|
|
4
|
+
Summary: Zero-trust memory toolkit for AI Agents. Pure Python, zero infrastructure, self-defending.
|
|
5
|
+
Author: mianlou
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/awchzh/moyu-memory
|
|
8
|
+
Project-URL: Repository, https://github.com/awchzh/moyu-memory
|
|
9
|
+
Keywords: ai-agent,memory,toolkit,zero-trust,python,llm
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
20
|
+
Requires-Python: >=3.8
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: numpy>=1.24.0
|
|
24
|
+
Requires-Dist: requests>=2.31.0
|
|
25
|
+
Requires-Dist: pyyaml>=6.0
|
|
26
|
+
Provides-Extra: semantic
|
|
27
|
+
Requires-Dist: fastembed>=0.5.4; extra == "semantic"
|
|
28
|
+
Provides-Extra: encryption
|
|
29
|
+
Requires-Dist: cryptography>=44.0.1; extra == "encryption"
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
|
|
32
|
+
# MOYU โ Secure Memory Toolkit for AI Agents
|
|
33
|
+
|
|
34
|
+
**Your AI remembers every conversation, but is your memory safe? Will old memories bloat your context window?**
|
|
35
|
+
|
|
36
|
+
MOYU is a lightweight memory toolkit that gives your Agent a **secure, self-managing, cross-session persistent** memory system. Pure Python, zero infrastructure, plug-and-play with one folder. Works with Hermes, OpenClaw, LangChain, AutoGen, or any custom Python project.
|
|
37
|
+
|
|
38
|
+
**v2.4.3** โ Context warning: your agent tells you before it compresses. Auto-detect + configurable threshold + multi-platform paths. Diagnose any detection issue with one command.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## ๐ Quick Start
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pip install -r requirements.txt
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Copy the `moyu_toolkit/` folder into your project and run:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
cd moyu_toolkit
|
|
52
|
+
python3 moyu.py search "what did we talk about last time"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
> **Zero-config mode:** Works out of the box without an API key. Install FastEmbed to unlock semantic search (see `requirements.txt`).
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
python3 moyu.py help # List all commands
|
|
59
|
+
python3 moyu.py demo # Show capabilities
|
|
60
|
+
python3 moyu.py init # Initialize file integrity protection
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## ๐ก๏ธ Security Capability โ What MOYU Does and Doesn't Cover
|
|
66
|
+
|
|
67
|
+
MOYU's defense chain is a **layered deterrent**, not a silver bullet. Honest assessment by threat level:
|
|
68
|
+
|
|
69
|
+
| Level | Threat | Coverage | How |
|
|
70
|
+
|-------|--------|----------|-----|
|
|
71
|
+
| ๐ข | Accidental misuse (fat-finger, mis-script) | **~90%** | Password gate + burst guard + integrity check + daily backup |
|
|
72
|
+
| ๐ข | Script-kiddie injection (known patterns) | **~70%** | Content gate (422 patterns + regex combos) + loop detection |
|
|
73
|
+
| ๐ก | Simple prompt injection (standard variants) | **~60%** | Regex covers (forget\|ignore\|skip)ร(previous\|all\|your)ร(instructions\|rules) |
|
|
74
|
+
| ๐ | Professional adversarial injection (targeted bypass) | **~20%** | Keyword-based gates can't catch every novel variant |
|
|
75
|
+
| ๐ด | Semantic-level injection (metaphor, abstraction, no keywords) | **~0%** | Requires LLM-level semantic understanding โ not regex territory |
|
|
76
|
+
|
|
77
|
+
**Why we don't chase the top levels:** LLM-based content moderation on every write would destroy the zero-config experience. Semantic ambiguity means you either over-block (user frustration) or under-block (useless). No open-source tool in this space claims to block semantic injection.
|
|
78
|
+
|
|
79
|
+
**MOYU's strength is in the combination:** content gate + PII redaction + write burst guard + forensic analysis + password gate + integrity check + auto-restore + loop detection โ unique layers no other memory toolkit offers.
|
|
80
|
+
|
|
81
|
+
**Additional opt-in security** (config.yaml, disabled by default): user isolation (per-directory storage) & AES-256-GCM file encryption (requires `cryptography`, see `requirements.txt`).
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## ๐ Command Reference
|
|
86
|
+
|
|
87
|
+
All commands through a single entry point:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
python3 moyu.py <command> [arguments]
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### ๐ก๏ธ Defense & Security
|
|
94
|
+
|
|
95
|
+
| Command | Description |
|
|
96
|
+
|------|------|
|
|
97
|
+
| `moyu setup` | Set security password (required for dangerous operations) |
|
|
98
|
+
| `moyu verify <type> [desc]` | Verify dangerous operations (delete, modify config, etc.) |
|
|
99
|
+
| `moyu unlock` | Unlock security system (auto-locks for 30 min after 3 failed attempts) |
|
|
100
|
+
| `moyu check` | Check file integrity (SHA256 comparison + auto-recovery) |
|
|
101
|
+
| `moyu audit` | Full security audit โ all four defense layers |
|
|
102
|
+
| `moyu init` | Initialize integrity manifest |
|
|
103
|
+
|
|
104
|
+
Four-layer defense chain:
|
|
105
|
+
```
|
|
106
|
+
Layer 1 (pre-write): Content security gate + PII redaction โ injections & sensitive data blocked
|
|
107
|
+
Layer 2 (pre-op): Password verification โ dangerous operations blocked
|
|
108
|
+
Layer 3 (startup): Integrity check + forensic analysis โ tampering detected
|
|
109
|
+
Layer 4 (post-op): Auto-restore โ restore from daily backup
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Additional defenses:**
|
|
113
|
+
- **Write burst protection** โ >30 writes in 60s triggers fine-grained rollback + 5-minute lock + alert
|
|
114
|
+
- **Tool call loop detection** โ Intercepts infinite loops at agent layer, SHA256 fingerprint + cycle detection + hard abort
|
|
115
|
+
- **PII redaction** โ Chinese & international phone/ID/bank cards + email/SSN/credit cards/IPs/API keys, regex-based auto-replacement
|
|
116
|
+
|
|
117
|
+
### ๐ง Memory & Retrieval
|
|
118
|
+
|
|
119
|
+
| Command | Description |
|
|
120
|
+
|------|------|
|
|
121
|
+
| `moyu search <query>` | TEMPR multi-strategy search (semantic + BM25 keywords + time-weighted) |
|
|
122
|
+
| `moyu stats` | Show all statistics (memory count, embedding type, source distribution) |
|
|
123
|
+
| `moyu status` | System status + defense chain visualization |
|
|
124
|
+
| `moyu context` | Get behavioral rules (inject into system prompt) |
|
|
125
|
+
| `moyu signals` | View active trigger words (from learner module) |
|
|
126
|
+
|
|
127
|
+
Search quality: Local FastEmbed 512-dim semantic vectors, no crash on missing โ auto-degrades to n-gram + BM25. Backed by SQLite FTS5 full-text index.
|
|
128
|
+
|
|
129
|
+
### ๐ Knowledge Layer
|
|
130
|
+
|
|
131
|
+
| Command | Description |
|
|
132
|
+
|------|------|
|
|
133
|
+
| `moyu kg search <entity>` | Search entity relationships in knowledge graph |
|
|
134
|
+
| `moyu kg search <entity> --snapshot YYYY-MM-DD` | Time-travel query โ view graph state at a past point in time |
|
|
135
|
+
| `moyu kg search <entity> --snapshot all` | Include all historical relations (including expired) |
|
|
136
|
+
| `moyu kg history <entity>` | View entity's complete timeline (lifecycle of all relations) |
|
|
137
|
+
| `moyu kg invalidate --source X --target Y --relation Z` | Mark a relation as expired (preserved for backtracking) |
|
|
138
|
+
| `moyu kg invalidate --entity E` | Expire an entity and all its relations |
|
|
139
|
+
| `moyu kg stats` | Knowledge graph stats (active/expired/total) |
|
|
140
|
+
| `moyu kb list` | List all workflow knowledge files |
|
|
141
|
+
| `moyu kb search <keyword>` | Search knowledge files |
|
|
142
|
+
| `moyu kb index` | Rebuild keyword index |
|
|
143
|
+
| `moyu kb read <file>` | Read a knowledge file |
|
|
144
|
+
|
|
145
|
+
### โณ Lifecycle & Context Management
|
|
146
|
+
|
|
147
|
+
| Command | Description |
|
|
148
|
+
|------|------|
|
|
149
|
+
| `moyu compress` | View compression status |
|
|
150
|
+
| `moyu compress --now` | Force manual compression (password required) |
|
|
151
|
+
| `moyu compress config` | View compression parameters |
|
|
152
|
+
| `moyu compress set <key> <value>` | Adjust compression thresholds |
|
|
153
|
+
| `moyu compress diagnose` | Show detailed scan results for all supported agents |
|
|
154
|
+
| `moyu context` | One-line context usage percentage |
|
|
155
|
+
| `moyu context raw` | Get behavioral rules (inject into system prompt) |
|
|
156
|
+
| `moyu forget` | View forgetting curve status (3-gate + density analysis + distillation stats) |
|
|
157
|
+
| `moyu forget config` | View forgetting curve parameters |
|
|
158
|
+
| `moyu forget set <key> <value>` | Adjust forgetting parameters (demote_days, archive_days, etc.) |
|
|
159
|
+
| `moyu ref <name>` | Read original content of a compressed memory |
|
|
160
|
+
| `moyu ref list` | List all compressed memory references |
|
|
161
|
+
|
|
162
|
+
Forgetting curve + knowledge distillation:
|
|
163
|
+
- **Three gates** (OR logic): Safety window (14 days) โ Access density analysis โ Scene association protection
|
|
164
|
+
- **Distillation**: Entity relations auto-extracted to knowledge graph before demotion โ structural knowledge survives when raw memory is cleared
|
|
165
|
+
- **Task map**: Auto-generated Mermaid task graph on wake โ agent sees the big picture at a glance
|
|
166
|
+
|
|
167
|
+
> **๐ง Context warning (v2.4.3):** Your agent compresses silently โ now it tells you first. MOYU auto-detects your running agent (Hermes, Claude Code, OpenClaw, Cursor, or Continue), reads its real-time context usage, and injects a warning into the agent's behavior rules before compression kicks in.
|
|
168
|
+
>
|
|
169
|
+
> ```bash
|
|
170
|
+
> # Quick check โ how full is your context window?
|
|
171
|
+
> python3 moyu.py context
|
|
172
|
+
> # โ Hermes็ชๅฃ: 85% (็ดฏ่ฎก120,456/128,000, 45ๆฌก่ฐ็จ) โ ๏ธ ๅทฒๆทฑๅบฆๅ็ผฉ
|
|
173
|
+
> # โ ้ข่ญฆ็บฟ: 70%
|
|
174
|
+
>
|
|
175
|
+
> # Set your preferred warning threshold and language
|
|
176
|
+
> moyu compress set warn_threshold 0.6 # warn at 60% (default: 0.7)
|
|
177
|
+
> moyu compress set warn_language zh # Chinese warning (default: en)
|
|
178
|
+
> moyu compress config # view all parameters
|
|
179
|
+
> ```
|
|
180
|
+
>
|
|
181
|
+
> When the threshold is crossed, the warning auto-appends to your agent's behavioral rules:
|
|
182
|
+
> - *"Hermes context at 85%, conversation deeply compressed โ /new recommended"*
|
|
183
|
+
> - *"Hermes context at 72%, approaching 70% warning โ set MOYU warn below it"*
|
|
184
|
+
>
|
|
185
|
+
> **Supported agents:** Hermes โ
(macOS, verified), Claude Code, OpenClaw, Cursor, Continue โ all with cross-platform paths (macOS / Windows / Linux). Works out of the box for default installations.
|
|
186
|
+
>
|
|
187
|
+
> **Custom paths?** Bypass auto-detection with environment variables:
|
|
188
|
+
> ```bash
|
|
189
|
+
> export MOYU_FORCE_PROVIDER=Hermes
|
|
190
|
+
> export MOYU_PROVIDER_PATH="/custom/path/to/state.db"
|
|
191
|
+
> ```
|
|
192
|
+
>
|
|
193
|
+
> **Can't detect your agent?** Run the diagnostic command โ it shows exactly where each agent's data is (or isn't):
|
|
194
|
+
> ```bash
|
|
195
|
+
> moyu compress diagnose
|
|
196
|
+
> # โ [Hermes] โ
/Users/you/.hermes/state.db
|
|
197
|
+
> # โ [Claude] โ ~/.claude/projects (not found)
|
|
198
|
+
> # โ [OpenClaw] โ
~/.openclaw/agents
|
|
199
|
+
> ```
|
|
200
|
+
|
|
201
|
+
### ๐ Learning & Self-Reflection
|
|
202
|
+
|
|
203
|
+
| Command | Description |
|
|
204
|
+
|------|------|
|
|
205
|
+
| `moyu learn <text>` | Learn from user corrections (3 identical corrections โ permanent rule) |
|
|
206
|
+
| `moyu detect <text>` | Detect correction signals in text |
|
|
207
|
+
| `moyu reflect` | Self-reflect (cross-time association analysis, contradiction detection) |
|
|
208
|
+
|
|
209
|
+
### ๐ Session & Maintenance
|
|
210
|
+
|
|
211
|
+
| Command | Description |
|
|
212
|
+
|------|------|
|
|
213
|
+
| `moyu bridge` | View cross-session bridge status (prefill + current_context dual sync) |
|
|
214
|
+
| `moyu update` | Check GitHub for updates (TOFU checksum verification) |
|
|
215
|
+
| `moyu update now` | Download and apply latest update (password required) |
|
|
216
|
+
| `moyu demo` | Interactive capability showcase |
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## ๐ฌ 25 Capabilities Detailed
|
|
221
|
+
|
|
222
|
+
### ๐ก๏ธ Defense Layer (8)
|
|
223
|
+
|
|
224
|
+
| # | Capability | Description |
|
|
225
|
+
|---|-----------|------|
|
|
226
|
+
| 1 | **Content Security Gate** | Blocks injection attacks before writing (422 patterns + regex combos, 8 categories) |
|
|
227
|
+
| 2 | **Forensic Analysis** | Detects injection patterns, JSON corruption, file tampering |
|
|
228
|
+
| 3 | **Write Burst Protection** | >30 writes/60s triggers fine-grained rollback + 5-min lock |
|
|
229
|
+
| 4 | **Tool Call Loop Detection** | Runtime-level infinite loop interception, SHA256 fingerprint + exhaustive cycle scan + hard abort |
|
|
230
|
+
| 5 | **PII Redaction** | Bilingual: Chinese & international phones, ID cards, bank cards, emails, SSNs, IPs, API keys โ regex-based, no deps |
|
|
231
|
+
| 6 | **Password Verification** | Pre-op confirmation + auto-lock after 3 failures (30 min) |
|
|
232
|
+
| 7 | **Integrity Check & Recovery** | SHA256 manifest + daily backups (3-day retention) |
|
|
233
|
+
| 8 | **User Isolation & Encryption** (opt-in) | Per-user storage directories + AES-256-GCM file encryption (requires `cryptography`, see `requirements.txt`) |
|
|
234
|
+
|
|
235
|
+
### ๐ง Memory Layer (4)
|
|
236
|
+
|
|
237
|
+
| # | Capability | Description |
|
|
238
|
+
|---|-----------|------|
|
|
239
|
+
| 9 | **TEMPR Multi-Strategy Retrieval** | Semantic embedding + BM25 keywords + time-weighted hybrid ranking |
|
|
240
|
+
| 10 | **FastEmbed Local Embedding** | Local ONNX vectorization, no API dependency, auto-degrade to n-gram |
|
|
241
|
+
| 11 | **SQLite FTS5** | Full-text index for accelerated keyword search |
|
|
242
|
+
| 12 | **MD5 Dedup** | In-library + batch double dedup |
|
|
243
|
+
|
|
244
|
+
### ๐ Knowledge Layer (3)
|
|
245
|
+
|
|
246
|
+
| # | Capability | Description |
|
|
247
|
+
|---|-----------|------|
|
|
248
|
+
| 13 | **Knowledge Graph** | Entity-relation extraction + time-travel snapshots + relation invalidation + full timeline + knowledge distillation |
|
|
249
|
+
| 14 | **Workflow Knowledge Base** | Markdown knowledge file indexing + keyword search |
|
|
250
|
+
| 15 | **User Profile** | Auto-extract preferences, habits, facts from conversation |
|
|
251
|
+
|
|
252
|
+
### โณ Lifecycle Layer (4)
|
|
253
|
+
|
|
254
|
+
| # | Capability | Description |
|
|
255
|
+
|---|-----------|------|
|
|
256
|
+
| 16 | **Context-Aware Compression + Warning** | Two-tier (70% mild / 85% aggressive), originals preserved in refs/. Auto-detects agent context usage and warns before compression (configurable threshold, bilingual) |
|
|
257
|
+
| 17 | **Task Map** | Auto-generated Mermaid task graph on wake โ see full progress at a glance |
|
|
258
|
+
| 18 | **Forgetting Curve** | Three gates (safety window / access density / scene protection) + knowledge distillation |
|
|
259
|
+
| 19 | **Memory Merge** | Detect keyword-overlapping related memories and merge, originals preserved |
|
|
260
|
+
|
|
261
|
+
### ๐ Learning & Reflection (2)
|
|
262
|
+
|
|
263
|
+
| # | Capability | Description |
|
|
264
|
+
|---|-----------|------|
|
|
265
|
+
| 20 | **Learn from Corrections** | Auto-detect correction signals, 3 identical corrections โ permanent behavioral rule |
|
|
266
|
+
| 21 | **Self-Reflection** | Analyze memory base on startup, discover cross-time associations, contradictions, topic shifts |
|
|
267
|
+
|
|
268
|
+
### ๐ Integration Layer (4)
|
|
269
|
+
|
|
270
|
+
| # | Capability | Description |
|
|
271
|
+
|---|-----------|------|
|
|
272
|
+
| 22 | **Working Memory** | Independent file, survives context compression |
|
|
273
|
+
| 23 | **Cross-Session Bridge** | Conversation summaries auto-synced to prefill + current_context, continuity across sessions |
|
|
274
|
+
| 24 | **Auto-Update** | Check GitHub for new versions, in-place update (TOFU checksum), preserves user data and config |
|
|
275
|
+
| 25 | **Wake Orchestration** | `moyu_wake`: full module pipeline โ checkโbackupโforgetโmergeโreflectโcontextโbridge |
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## ๐ File Structure
|
|
280
|
+
|
|
281
|
+
```
|
|
282
|
+
moyu_toolkit/
|
|
283
|
+
โโโ agent_memory.py # Vector memory engine + TEMPR retrieval
|
|
284
|
+
โโโ agent_memory_sqlite.py # SQLite FTS5 search index
|
|
285
|
+
โโโ active_context.py # Working memory (compression-surviving)
|
|
286
|
+
โโโ context_manager.py # Context-aware compression + warning + task map
|
|
287
|
+
โโโ forgetting_curve.py # Memory lifecycle โ three gates + knowledge distillation
|
|
288
|
+
โโโ memory_merge.py # Topic-aware memory merging
|
|
289
|
+
โโโ knowledge_graph.py # Entity-relation knowledge graph (with time-travel)
|
|
290
|
+
โโโ knowledge_base.py # Workflow knowledge base
|
|
291
|
+
โโโ learner.py # Learn from corrections + user profile
|
|
292
|
+
โโโ security.py # Memory self-protection โ password + lockout
|
|
293
|
+
โโโ session_bridge.py # Cross-session continuity
|
|
294
|
+
โโโ moyu.py # Unified CLI entry point
|
|
295
|
+
โโโ moyu_wake.py # Startup integration pipeline
|
|
296
|
+
โโโ moyu_demo.py # Interactive demo
|
|
297
|
+
โโโ updater.py # Auto-update (TOFU checksum verification)
|
|
298
|
+
โโโ self_reflection.py # Self-reflection
|
|
299
|
+
โโโ defense_toolkit/
|
|
300
|
+
โ โโโ integrity_checker.py # File integrity + auto-recovery + forensic analysis + alerts
|
|
301
|
+
โ โโโ forensic_patterns.json # Injection detection rule base (422 patterns + regex)
|
|
302
|
+
โ โโโ pii_redactor.py # PII redaction (bilingual, API key support)
|
|
303
|
+
โ โโโ isolation.py # User isolation (opt-in)
|
|
304
|
+
โ โโโ encrypt.py # AES-256-GCM file encryption (opt-in, requires cryptography)
|
|
305
|
+
โโโ tests/
|
|
306
|
+
โ โโโ test_all.py # Automated tests (26 items)
|
|
307
|
+
โโโ config.yaml # API keys & settings
|
|
308
|
+
โโโ requirements.txt
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## ๐ Comparison
|
|
314
|
+
|
|
315
|
+
| Dimension | Built-in (Hermes/OpenClaw) | Mem0 | **MOYU** |
|
|
316
|
+
|------|------------------------|------|----------|
|
|
317
|
+
| Storage | Plain text files | Vector DB | **JSON + SQLite FTS5** |
|
|
318
|
+
| Search | Full dump | Semantic (API/LLM) | **TEMPR triple strategy** |
|
|
319
|
+
| Security | โ None | โ None | **โ
4-layer defense chain** |
|
|
320
|
+
| PII Redaction | โ None | โ None | **โ
Bilingual (regex, zero deps)** |
|
|
321
|
+
| Tool Call Protection | โ None | โ None | **โ
Loop detection + hard abort** |
|
|
322
|
+
| Lifecycle | โ None | โ None | **โ
Forgetting curve + compression + task map** |
|
|
323
|
+
| Knowledge Graph | โ None | โ None | **โ
Time-travel + snapshots + distillation** |
|
|
324
|
+
| Working Memory | โ None | โ None | **โ
Independent file, compression-surviving** |
|
|
325
|
+
| Cross-Session | Manual | โ None | **โ
Auto-sync prefill + current_context** |
|
|
326
|
+
| Platform Lock-in | Locked | SDK locked | **โ
Zero lock-in** |
|
|
327
|
+
| API Lock-in | Fixed | OpenAI | **โ
Hot-swappable** |
|
|
328
|
+
| Deployment | Out of box | 5 min + API Key | **pip install, 30 sec** |
|
|
329
|
+
| Offline | Partial | Requires API Key | **โ
Full local degradation** |
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
## ๐ฎ Use Cases
|
|
334
|
+
|
|
335
|
+
- Want your AI Agent to **remember cross-session conversations** with real security
|
|
336
|
+
- Frequently hit **context limits**, need auto-compression without losing important memories
|
|
337
|
+
- Concerned about **PII leaks** โ don't want phone numbers, IDs, API keys lingering in memory files
|
|
338
|
+
- Switching between **Hermes, OpenClaw, LangChain, or custom projects**, need a unified memory solution
|
|
339
|
+
- Want **zero infrastructure** โ no Docker, no databases, no signups
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
## ๐ License
|
|
344
|
+
|
|
345
|
+
MIT
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
moyu_memory-2.4.7.dist-info/licenses/LICENSE,sha256=OOCLQz6NxJ_A2E2TPmgl-TX35RDW9FFbG0Uv-q1x5jE,1063
|
|
2
|
+
moyu_toolkit/SKILL.md,sha256=EJbm71xIHa1BBmEIUFomksR9eid2FqKhLzxImV57480,20671
|
|
3
|
+
moyu_toolkit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
moyu_toolkit/_moyu_paths.py,sha256=cjeIFKL-f3XziUeRCR37p4jJjmNIdywOLA1uLpotezg,1503
|
|
5
|
+
moyu_toolkit/active_context.py,sha256=KkYnlNpAIq0vXrLuKW19kFquWve8EWjQHiVFp5oNVUo,5384
|
|
6
|
+
moyu_toolkit/agent_memory.py,sha256=b2-ffeFjm2XbR0a13kkqvZi1OtYV7Z1W7nu1eswTdSs,38790
|
|
7
|
+
moyu_toolkit/agent_memory_sqlite.py,sha256=ilxg3bRxBESrmugmLzjY0_zblavbnlnc5R8vkZYxwR0,5219
|
|
8
|
+
moyu_toolkit/config.yaml,sha256=gaqHOES_MLFSaHLpa_3Q1DSHummJmV2ioRgAkptqIv8,992
|
|
9
|
+
moyu_toolkit/context_manager.py,sha256=OWlyZ908KHR6xyL3IvidDwGQEPRTuMpfAnuyzq4uThU,37878
|
|
10
|
+
moyu_toolkit/forgetting_curve.py,sha256=c-FEN4oMYZUX_ssTvv1EAtcGg9_bhRMIH3AI_oXJ1uE,24124
|
|
11
|
+
moyu_toolkit/knowledge_base.py,sha256=VywWoKyIhEFkBkvb2jhQdyGwfwVPHFvX60cI1JBYUWc,12522
|
|
12
|
+
moyu_toolkit/knowledge_graph.py,sha256=60yl2hprtPsxfMTkdHld98CLBUXPcVfR_NEfP8cKf2E,29237
|
|
13
|
+
moyu_toolkit/learner.py,sha256=eyRupplDfDZoeGuu52aRgjvpquLqOYjqbkpx6OJf96s,19631
|
|
14
|
+
moyu_toolkit/memory_merge.py,sha256=ZAcf0fAHa0eH128hi0YtCBsuxuqROmF363tGIxSqzeY,9084
|
|
15
|
+
moyu_toolkit/moyu.py,sha256=rAeWmQ8W0ov9u40_jp1oSH5m_30bMOBTIKRcm9NHZhs,30212
|
|
16
|
+
moyu_toolkit/moyu_demo.py,sha256=3BnyxPt_VVUDGqUpQXJ_fwlsZdCZ6hG83CmwXoKB_jo,2524
|
|
17
|
+
moyu_toolkit/moyu_wake.py,sha256=_NIzrflwaUZv_LhVN1Je1bM8UkpKUJxrLmv25UHWKWM,10575
|
|
18
|
+
moyu_toolkit/requirements.txt,sha256=IJbQcCygnGLdzPl2DLcknpjm7BD99HMMDw3OftH_6JE,491
|
|
19
|
+
moyu_toolkit/security.py,sha256=A4hrK5yP_tqgMH0LqSVeADRCY211R-Rxl9_ZWwM4R_Q,16660
|
|
20
|
+
moyu_toolkit/self_reflection.py,sha256=c17tuI9wpBVxitTjZVO7cqMocoQIyZTIRYYlMtSiBR0,16552
|
|
21
|
+
moyu_toolkit/session_bridge.py,sha256=D441456jPMpqe4Z2sePyNCUmbrfol9Ldy1vgysNTkC0,13633
|
|
22
|
+
moyu_toolkit/updater.py,sha256=lovABRQtekePgS0w1SEhVZzsB17Xvi2y_DS67TmqZVY,12368
|
|
23
|
+
moyu_toolkit/ๅขจ็พฝ้กน็ฎ.md,sha256=x8Ay4migTuZ4-0CpwryqcTm80WOqhemgv8rEca3iXD8,5244
|
|
24
|
+
moyu_toolkit/defense_toolkit/encrypt.py,sha256=ucrydRWL--4vGI4nLQT_LmYHYRpVG1REOtD0PG3sLK4,6087
|
|
25
|
+
moyu_toolkit/defense_toolkit/forensic_patterns.json,sha256=8K-j1x92v53I-JQh5WyZPv60AhuJlyKdR0N8aTsyliI,30534
|
|
26
|
+
moyu_toolkit/defense_toolkit/forensic_patterns_base64.json,sha256=Kb7LxwqfTkfBC5wYvPxPxl9h_dqF-3Fj54O9PSFr-i4,34922
|
|
27
|
+
moyu_toolkit/defense_toolkit/integrity_checker.py,sha256=jSF4BbbLNxrBHb2Fc9hjZuV-H_loqKT4eZ7YMTeMrhA,19340
|
|
28
|
+
moyu_toolkit/defense_toolkit/isolation.py,sha256=rMG4NUhv6s8YOxSwjcMi-J3mZoj2v5saaEcmGk-jBcU,2492
|
|
29
|
+
moyu_toolkit/defense_toolkit/pii_redactor.py,sha256=nIRPwAr63u3-h3EOhqLoOFKJLfHO4bwMrj0yMNjasNo,7376
|
|
30
|
+
moyu_toolkit/tests/test_all.py,sha256=p102vPCOTzLetk6bTLLWhME02MpEzgnINDDP04sA9Uk,16754
|
|
31
|
+
moyu_memory-2.4.7.dist-info/METADATA,sha256=blAX7bHsnGBuYxyHK9QA8SAkmcMUIoVoHRVjA2Wfv8w,17658
|
|
32
|
+
moyu_memory-2.4.7.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
33
|
+
moyu_memory-2.4.7.dist-info/entry_points.txt,sha256=SqE7IoyDrflWHrrxiASqiGEZ-ss1vcjeRhLXA7McahU,52
|
|
34
|
+
moyu_memory-2.4.7.dist-info/top_level.txt,sha256=CcLiFpfCHmSIjaC0RYl8DDY7bRYffiVhfycYneTT_t0,13
|
|
35
|
+
moyu_memory-2.4.7.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 awchzh
|
|
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 @@
|
|
|
1
|
+
moyu_toolkit
|