mindforge-memory 6.5.11__tar.gz → 6.6.0__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.
- {mindforge_memory-6.5.11/mindforge_memory.egg-info → mindforge_memory-6.6.0}/PKG-INFO +9 -9
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/README.md +8 -8
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/core/indexer.py +66 -8
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/core/mindforge.py +51 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/core/storage.py +17 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/core/version.py +2 -2
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0/mindforge_memory.egg-info}/PKG-INFO +9 -9
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge_memory.egg-info/SOURCES.txt +1 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v547_fixes.py +5 -2
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v568_fixes.py +1 -1
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v571_fixes.py +17 -4
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v575_release_consistency.py +2 -2
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v612_fixes.py +2 -2
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v643_fixes.py +1 -1
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v645_fixes.py +1 -1
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v646_fixes.py +1 -1
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v649_fixes.py +2 -2
- mindforge_memory-6.6.0/tests/test_v660_pending_guard.py +163 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/LICENSE +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/MindForge.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/__init__.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/adapters/__init__.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/adapters/claude_adapter.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/adapters/crewai_memory.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/adapters/generic_api.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/adapters/langgraph_store.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/adapters/openclaw_adapter.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/api/__init__.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/api/server.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/cli/__init__.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/cli/main.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/core/__init__.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/core/embedding.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/core/encryption.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/core/paths.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/core/query.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/core/types.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/daemon/__init__.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/daemon/server.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/mcp/__init__.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/mcp/server.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/__init__.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/categorizer.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/conflict_detector.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/connectors.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/context_window.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/event_bus.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/evolution.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/experience.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/federated.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/federated_acl.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/follow_up.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/hybrid_search.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/importer.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/integrator.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/intent_router.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/knowledge_graph.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/memory_compressor.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/memory_decay.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/memory_passport.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/multi_agent.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/multimodal.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/outcome_learning.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/personality.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/principled_forgetting.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/privacy.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/recall.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/session_focus.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/share_conflict.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/skill_extractor.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/skill_pack.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/timeline_viz.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge/modules/v6.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge_memory.egg-info/dependency_links.txt +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge_memory.egg-info/entry_points.txt +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge_memory.egg-info/requires.txt +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/mindforge_memory.egg-info/top_level.txt +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/pyproject.toml +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/setup.cfg +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/setup.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_core.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_security_hardening.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_trash_hard_delete.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v546_features.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v548_features.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v550_features.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v552_features.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v554_features.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v556_features.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v557_banner_insight_wal.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v557_security_fixes.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v557_webhook_sig_export.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v558_audit_fixes.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v558_features.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v560_decay_gc.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v560_kdf_versioning.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v560_module_coverage.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v561_security.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v562_p2_fixes.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v563_entry_coverage.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v563_perf_fixes.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v565_security.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v566_encrypted_search.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v567_security_fixes.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v569_fts_sync.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v570_coverage_expansion.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v570_drama_and_utils.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v570_encrypted_fallback.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v572_security.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v573_encrypted_export.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v573_security.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v576_bitemporal.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v576_gdpr.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v577_agent_governance.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v578_embedding.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v579_graph.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v580_experience.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v5812_bugfixes.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v583_security.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v584_adapters.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v585_benchmark.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v586_federated_mcp.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v590_features.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v592_features.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v593_features.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v595_features.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v600_forgetting_followup.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v600_import_timeline.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v600_multi_agent_formal.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v600_outcome_passport.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v600_skillpack_evolution.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v611_fixes.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v612_cascade_fixes.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v613_integrity.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v620_growth_governance.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v630_search_explain.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v631_scrypt.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v632_explain_interfaces.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v635_features.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v635_integration.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v636_fixes.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v648_fixes.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v652_context_expansion.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v654_search_multi.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v655_temporal_norm.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v656_security.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v657_six_path.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v65_features.py +0 -0
- {mindforge_memory-6.5.11 → mindforge_memory-6.6.0}/tests/test_v6_ports.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mindforge-memory
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.6.0
|
|
4
4
|
Summary: AI Agent 终身记忆系统 - 四层记忆架构 · 知识图谱 · 多模态支持
|
|
5
5
|
License: MIT
|
|
6
6
|
Project-URL: Homepage, https://github.com/opok-ops/MindForge
|
|
@@ -36,13 +36,13 @@ Dynamic: license-file
|
|
|
36
36
|
|
|
37
37
|
MindForge gives AI agents a persistent, structured long-term memory: a four-tier lifecycle model, knowledge graphs, hybrid retrieval, end-to-end encryption, and MCP / CLI / REST interfaces. All data stays on your machine.
|
|
38
38
|
|
|
39
|
-
> **The story** — one developer, seven months, from v1.0 (March 2026) to v6.
|
|
39
|
+
> **The story** — one developer, seven months, from v1.0 (March 2026) to v6.6.0: no team, no funding, 1,305 passing tests. [Read the journey →](https://opok-ops.github.io/MindForge/#developer)
|
|
40
40
|
>
|
|
41
|
-
> *Timeline note (v6.
|
|
41
|
+
> *Timeline note (v6.6.0):* "seven months" counts from project start (2026-03, pre-git prototyping era). Git history begins 2026-07-17 with the v5.7.x repository consolidation — earlier code lived outside this repo. The 416+ commits reflect consolidated history only.
|
|
42
42
|
|
|
43
43
|
[](https://www.python.org/downloads/)
|
|
44
44
|
[](LICENSE)
|
|
45
|
-
[](https://github.com/opok-ops/MindForge/releases)
|
|
46
46
|
[](https://github.com/opok-ops/MindForge/stargazers)
|
|
47
47
|
[](https://github.com/opok-ops/MindForge/forks)
|
|
48
48
|
[](https://github.com/opok-ops/MindForge/issues)
|
|
@@ -108,15 +108,15 @@ MindForge stats
|
|
|
108
108
|
- **Ten-million-character library, millisecond-class across all query types (v6.4.9)**: pathological 218→**0.4ms** (−99.8%), mixed 143→**3.0ms** (−98%), rare 6.8ms, combined 17.8ms (100k full-pipeline, clean environment). The last bottleneck — FTS5 high-frequency-phrase bm25 scoring — is now pruned query-side via trigram-df pre-check (df upper bound = min trigram df, pruned at 5% corpus size, symmetric to the TF-IDF max_df design; df served from an in-process cache — fts5vocab is a streaming virtual table, per-term probes scan it fully).
|
|
109
109
|
- **Index-blindness fix (v6.4.8)**: TF-IDF vocabulary was locked to the first 5 documents since v6.4.6 — incremental adds indexed as empty vectors (TF-IDF effectively half-dead; previous numbers carried by FTS5/fuzzy). Fixed with incremental vocabulary growth; all pipeline numbers above are now *true full-pipeline* measurements.
|
|
110
110
|
- Retrieval quality (fixed-seed, `benchmarks/quality_bench.py`, 2k entries): needle Recall@1 = 1.0, MRR = 1.0, topic Recall@1 = 1.0, noise false-recall = 0.
|
|
111
|
-
- **LoCoMo full-suite, LLM-judged (v6.
|
|
111
|
+
- **LoCoMo full-suite, LLM-judged (v6.6.0, 2026-11-13)**: 1,986 questions across all 10 conversations — **51.5% accuracy (≥9/10 judge score)**, 2.13× over the 24.2% pre-assembly baseline; cross-validated by two independent judges (DeepSeek 51.5% / Kimi K3.1 52.72%, Δ1.2pt); excluding the adversarial "should-refuse" bucket, **43.05%** (663/1540). Per-bucket: adversarial 93.9%, single-hop 57.8%, multi-hop 25.2%, temporal 9.6%, open-domain 10.4% — temporal evidence recall and two-hop chain retrieval are the named v6.6 targets. Data: `benchmarks/results/`, judge pipeline in `benchmarks/`.
|
|
112
112
|
- LongMemEval — interface ready, not yet run (requires external LLM API key).
|
|
113
113
|
- TF-IDF degraded mode process memory at 100k: ~700 MB. Index LRU cap: 100,000 docs (MINDFORGE_INDEX_MAX_DOCS).
|
|
114
114
|
|
|
115
115
|
## What's New
|
|
116
116
|
|
|
117
|
-
v6.1.3 – v6.
|
|
117
|
+
v6.1.3 – v6.6.0 shipped in two weeks (2026-11-01 → 11-14), guarded by **1,300+ tests**.
|
|
118
118
|
|
|
119
|
-
- **v6.
|
|
119
|
+
- **v6.6.0 — security fix pack from dual-judge external review** (2026-11-14). Qwen4-Max (Doubao) and Kimi K3.1 independently reviewed the codebase; their overlapping findings became this release. (1) **GDPR erasure completed**: `gdpr_erase_all` now cascades to 17 tables — added `knowledge_graph` entities, `memory_snapshots`, `memory_templates`, and the four drama_* creation-content tables that previously survived erasure (the "right to be forgotten" had a real gap). (2) **Legacy key-file verification fixed**: v5.5-era key files (no `verify_blob`) previously accepted *any* password during `rekey` — a wrong old password could rewrite the key file and orphan all data. Rekey now probe-decrypts a real ciphertext from the store; empty stores fall back to the old behavior. (3) **KDF cost floor**: `KDFParams.from_dict` rejects tampered parameters (PBKDF2 < 60k, scrypt N < 4096) that would downgrade brute-force cost — key files and ciphertext headers are attacker-visible input. (4) **Compression × encryption unblocked**: `compress_memories` previously raised `SecurityError` on encrypted stores, making the two flagship features mutually exclusive by default. Compression now hydrates its TF-IDF index via the same in-memory decryption path as `fuzzy_search` (`_plaintext_for_index`) — plaintext never touches disk or FTS5. (5) **Interface matrix completed**: REST gains `/api/gdpr/report`, `/api/gdpr/export`, `/api/gdpr/erase` (confirm=true required), `/api/compress`, `/api/compressions`; MCP gains `gdpr_report`, `gdpr_erase` (confirm required), `memory_compress` — 87→90 tools, all three interfaces now expose the full governance surface. (6) **Honesty fixes**: README previously claimed "six-way hybrid search"; the actual retrieval count is four (vector/FTS5/TF-IDF/fuzzy) — wording corrected, and the cross-encoder/heuristic distinction is now explicit. LoCoMo full-suite results (51.5%, dual-judge) added to the benchmarks section. 7+ new contract tests (`tests/test_v656_security.py`).
|
|
120
120
|
|
|
121
121
|
- **v6.4.9 — ten-million-char library at millisecond latency: FTS5 high-frequency-phrase scoring pruned** (2026-11-11). The last honest bottleneck from v6.4.8's ledger. Root cause (30k per-path timing): under the trigram tokenizer, corpus-wide phrases (template data's "陈述性记忆") match every row — bm25 full-match scoring cost 50.5ms/query, the dominant remainder of 100k mixed latency. Fix, query-side df pre-pruning symmetric to TF-IDF max_df: a phrase's df upper bound = min df of its trigrams (phrase matches ⊆ every trigram's row set); prune at 5% of corpus size; keep the lowest-ub phrase if all pruned. df is served from an in-process cache keyed by `max(rowid)` (add/update invalidate; hard-delete leaves df slightly stale = prunes more conservatively) — **two real pitfalls found en route: fts5vocab is a *streaming virtual table* — per-term probes AND `IN` batches trigger full scans (combined regressed 17→45ms before the cache)**. Plus: FTS5 path skipped on pathological fallback (no discriminating signal). Clean-environment 100k re-bench: pathological 122→**0.4ms** (−99.7%), mixed 134.9→**3.0ms** (−98%), all query types millisecond-class at ~10M chars. AI-flavored comment cleanup (essay-style docstrings → engineer-speak, info preserved). 5 new guards.
|
|
122
122
|
|
|
@@ -149,7 +149,7 @@ v6.1.3 – v6.5.11 shipped in two weeks (2026-11-01 → 11-14), guarded by **1,3
|
|
|
149
149
|
|
|
150
150
|
**Retrieval**
|
|
151
151
|
|
|
152
|
-
- **Six-way hybrid retrieval (real, as of v6.
|
|
152
|
+
- **Six-way hybrid retrieval (real, as of v6.6.0)** — six recall paths fused into one ranked result set: vector, FTS5, TF-IDF, fuzzy (the four core paths, RRF-style max-fusion with per-path score breakdown via `search --explain`), **temporal anchoring** (query absolute dates / anchored relative phrases → windowed SQL recall; v6.6.0) and **knowledge-graph adjacency** (entity match → 2-hop relation walk → memory back-references; v6.6.0). Paths 5-6 run in "blind-spot fill" mode — they only add candidates the four core paths missed, never re-rank existing high-quality hits. Degradation is per-path and safe: encrypted stores skip temporal (ciphertext is not SQL-matchable), empty KG skips graph, missing time anchor degrades to absolute-date-only.
|
|
153
153
|
- **Knowledge graph** — automatic entity and relation extraction, path finding, and associative recall.
|
|
154
154
|
- **Weighted recall** — multi-factor scoring (coverage, importance, access frequency, time decay) instead of similarity alone.
|
|
155
155
|
|
|
@@ -193,7 +193,7 @@ v6.1.3 – v6.5.11 shipped in two weeks (2026-11-01 → 11-14), guarded by **1,3
|
|
|
193
193
|
|
|
194
194
|
```
|
|
195
195
|
┌──────────────────────────────────────────────────────┐
|
|
196
|
-
│ MindForge v6.
|
|
196
|
+
│ MindForge v6.6.0 │
|
|
197
197
|
│ Cognitive Layer Personality · KnowledgeGraph │
|
|
198
198
|
│ MemoryEvolution · FederatedMemory │
|
|
199
199
|
├──────────────────────────────────────────────────────┤
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
MindForge gives AI agents a persistent, structured long-term memory: a four-tier lifecycle model, knowledge graphs, hybrid retrieval, end-to-end encryption, and MCP / CLI / REST interfaces. All data stays on your machine.
|
|
8
8
|
|
|
9
|
-
> **The story** — one developer, seven months, from v1.0 (March 2026) to v6.
|
|
9
|
+
> **The story** — one developer, seven months, from v1.0 (March 2026) to v6.6.0: no team, no funding, 1,305 passing tests. [Read the journey →](https://opok-ops.github.io/MindForge/#developer)
|
|
10
10
|
>
|
|
11
|
-
> *Timeline note (v6.
|
|
11
|
+
> *Timeline note (v6.6.0):* "seven months" counts from project start (2026-03, pre-git prototyping era). Git history begins 2026-07-17 with the v5.7.x repository consolidation — earlier code lived outside this repo. The 416+ commits reflect consolidated history only.
|
|
12
12
|
|
|
13
13
|
[](https://www.python.org/downloads/)
|
|
14
14
|
[](LICENSE)
|
|
15
|
-
[](https://github.com/opok-ops/MindForge/releases)
|
|
16
16
|
[](https://github.com/opok-ops/MindForge/stargazers)
|
|
17
17
|
[](https://github.com/opok-ops/MindForge/forks)
|
|
18
18
|
[](https://github.com/opok-ops/MindForge/issues)
|
|
@@ -78,15 +78,15 @@ MindForge stats
|
|
|
78
78
|
- **Ten-million-character library, millisecond-class across all query types (v6.4.9)**: pathological 218→**0.4ms** (−99.8%), mixed 143→**3.0ms** (−98%), rare 6.8ms, combined 17.8ms (100k full-pipeline, clean environment). The last bottleneck — FTS5 high-frequency-phrase bm25 scoring — is now pruned query-side via trigram-df pre-check (df upper bound = min trigram df, pruned at 5% corpus size, symmetric to the TF-IDF max_df design; df served from an in-process cache — fts5vocab is a streaming virtual table, per-term probes scan it fully).
|
|
79
79
|
- **Index-blindness fix (v6.4.8)**: TF-IDF vocabulary was locked to the first 5 documents since v6.4.6 — incremental adds indexed as empty vectors (TF-IDF effectively half-dead; previous numbers carried by FTS5/fuzzy). Fixed with incremental vocabulary growth; all pipeline numbers above are now *true full-pipeline* measurements.
|
|
80
80
|
- Retrieval quality (fixed-seed, `benchmarks/quality_bench.py`, 2k entries): needle Recall@1 = 1.0, MRR = 1.0, topic Recall@1 = 1.0, noise false-recall = 0.
|
|
81
|
-
- **LoCoMo full-suite, LLM-judged (v6.
|
|
81
|
+
- **LoCoMo full-suite, LLM-judged (v6.6.0, 2026-11-13)**: 1,986 questions across all 10 conversations — **51.5% accuracy (≥9/10 judge score)**, 2.13× over the 24.2% pre-assembly baseline; cross-validated by two independent judges (DeepSeek 51.5% / Kimi K3.1 52.72%, Δ1.2pt); excluding the adversarial "should-refuse" bucket, **43.05%** (663/1540). Per-bucket: adversarial 93.9%, single-hop 57.8%, multi-hop 25.2%, temporal 9.6%, open-domain 10.4% — temporal evidence recall and two-hop chain retrieval are the named v6.6 targets. Data: `benchmarks/results/`, judge pipeline in `benchmarks/`.
|
|
82
82
|
- LongMemEval — interface ready, not yet run (requires external LLM API key).
|
|
83
83
|
- TF-IDF degraded mode process memory at 100k: ~700 MB. Index LRU cap: 100,000 docs (MINDFORGE_INDEX_MAX_DOCS).
|
|
84
84
|
|
|
85
85
|
## What's New
|
|
86
86
|
|
|
87
|
-
v6.1.3 – v6.
|
|
87
|
+
v6.1.3 – v6.6.0 shipped in two weeks (2026-11-01 → 11-14), guarded by **1,300+ tests**.
|
|
88
88
|
|
|
89
|
-
- **v6.
|
|
89
|
+
- **v6.6.0 — security fix pack from dual-judge external review** (2026-11-14). Qwen4-Max (Doubao) and Kimi K3.1 independently reviewed the codebase; their overlapping findings became this release. (1) **GDPR erasure completed**: `gdpr_erase_all` now cascades to 17 tables — added `knowledge_graph` entities, `memory_snapshots`, `memory_templates`, and the four drama_* creation-content tables that previously survived erasure (the "right to be forgotten" had a real gap). (2) **Legacy key-file verification fixed**: v5.5-era key files (no `verify_blob`) previously accepted *any* password during `rekey` — a wrong old password could rewrite the key file and orphan all data. Rekey now probe-decrypts a real ciphertext from the store; empty stores fall back to the old behavior. (3) **KDF cost floor**: `KDFParams.from_dict` rejects tampered parameters (PBKDF2 < 60k, scrypt N < 4096) that would downgrade brute-force cost — key files and ciphertext headers are attacker-visible input. (4) **Compression × encryption unblocked**: `compress_memories` previously raised `SecurityError` on encrypted stores, making the two flagship features mutually exclusive by default. Compression now hydrates its TF-IDF index via the same in-memory decryption path as `fuzzy_search` (`_plaintext_for_index`) — plaintext never touches disk or FTS5. (5) **Interface matrix completed**: REST gains `/api/gdpr/report`, `/api/gdpr/export`, `/api/gdpr/erase` (confirm=true required), `/api/compress`, `/api/compressions`; MCP gains `gdpr_report`, `gdpr_erase` (confirm required), `memory_compress` — 87→90 tools, all three interfaces now expose the full governance surface. (6) **Honesty fixes**: README previously claimed "six-way hybrid search"; the actual retrieval count is four (vector/FTS5/TF-IDF/fuzzy) — wording corrected, and the cross-encoder/heuristic distinction is now explicit. LoCoMo full-suite results (51.5%, dual-judge) added to the benchmarks section. 7+ new contract tests (`tests/test_v656_security.py`).
|
|
90
90
|
|
|
91
91
|
- **v6.4.9 — ten-million-char library at millisecond latency: FTS5 high-frequency-phrase scoring pruned** (2026-11-11). The last honest bottleneck from v6.4.8's ledger. Root cause (30k per-path timing): under the trigram tokenizer, corpus-wide phrases (template data's "陈述性记忆") match every row — bm25 full-match scoring cost 50.5ms/query, the dominant remainder of 100k mixed latency. Fix, query-side df pre-pruning symmetric to TF-IDF max_df: a phrase's df upper bound = min df of its trigrams (phrase matches ⊆ every trigram's row set); prune at 5% of corpus size; keep the lowest-ub phrase if all pruned. df is served from an in-process cache keyed by `max(rowid)` (add/update invalidate; hard-delete leaves df slightly stale = prunes more conservatively) — **two real pitfalls found en route: fts5vocab is a *streaming virtual table* — per-term probes AND `IN` batches trigger full scans (combined regressed 17→45ms before the cache)**. Plus: FTS5 path skipped on pathological fallback (no discriminating signal). Clean-environment 100k re-bench: pathological 122→**0.4ms** (−99.7%), mixed 134.9→**3.0ms** (−98%), all query types millisecond-class at ~10M chars. AI-flavored comment cleanup (essay-style docstrings → engineer-speak, info preserved). 5 new guards.
|
|
92
92
|
|
|
@@ -119,7 +119,7 @@ v6.1.3 – v6.5.11 shipped in two weeks (2026-11-01 → 11-14), guarded by **1,3
|
|
|
119
119
|
|
|
120
120
|
**Retrieval**
|
|
121
121
|
|
|
122
|
-
- **Six-way hybrid retrieval (real, as of v6.
|
|
122
|
+
- **Six-way hybrid retrieval (real, as of v6.6.0)** — six recall paths fused into one ranked result set: vector, FTS5, TF-IDF, fuzzy (the four core paths, RRF-style max-fusion with per-path score breakdown via `search --explain`), **temporal anchoring** (query absolute dates / anchored relative phrases → windowed SQL recall; v6.6.0) and **knowledge-graph adjacency** (entity match → 2-hop relation walk → memory back-references; v6.6.0). Paths 5-6 run in "blind-spot fill" mode — they only add candidates the four core paths missed, never re-rank existing high-quality hits. Degradation is per-path and safe: encrypted stores skip temporal (ciphertext is not SQL-matchable), empty KG skips graph, missing time anchor degrades to absolute-date-only.
|
|
123
123
|
- **Knowledge graph** — automatic entity and relation extraction, path finding, and associative recall.
|
|
124
124
|
- **Weighted recall** — multi-factor scoring (coverage, importance, access frequency, time decay) instead of similarity alone.
|
|
125
125
|
|
|
@@ -163,7 +163,7 @@ v6.1.3 – v6.5.11 shipped in two weeks (2026-11-01 → 11-14), guarded by **1,3
|
|
|
163
163
|
|
|
164
164
|
```
|
|
165
165
|
┌──────────────────────────────────────────────────────┐
|
|
166
|
-
│ MindForge v6.
|
|
166
|
+
│ MindForge v6.6.0 │
|
|
167
167
|
│ Cognitive Layer Personality · KnowledgeGraph │
|
|
168
168
|
│ MemoryEvolution · FederatedMemory │
|
|
169
169
|
├──────────────────────────────────────────────────────┤
|
|
@@ -435,12 +435,25 @@ class IndexEngine:
|
|
|
435
435
|
if not q:
|
|
436
436
|
return q
|
|
437
437
|
tokens = [t for t in q.split() if t]
|
|
438
|
+
# v6.5.12: 停用词剔除——疑问词/虚词只贡献泛化命中
|
|
439
|
+
# v6.5.12: 短语构造前剥离尾标点——"sunrise?" 作为短语在
|
|
440
|
+
# trigram tokenizer 下零匹配(标点不出 gram),AND 整体空
|
|
441
|
+
content_tokens = []
|
|
442
|
+
for t in tokens:
|
|
443
|
+
clean = t.strip('?.!,;:()"')
|
|
444
|
+
if (clean.lower() not in IndexEngine._STOPWORDS
|
|
445
|
+
and len(clean) > 1):
|
|
446
|
+
content_tokens.append(clean)
|
|
447
|
+
if not content_tokens:
|
|
448
|
+
content_tokens = tokens # 全是停用词则回退原词(避免空查询)
|
|
438
449
|
# 单 token(含中文无空格)保持原短语行为
|
|
439
|
-
if len(
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
450
|
+
if len(content_tokens) <= 1:
|
|
451
|
+
t = content_tokens[0]
|
|
452
|
+
return '"' + t.replace('"', '""') + '"'
|
|
453
|
+
# v6.5.12: AND 优先——要求实词共现;调用方 fts_search 在
|
|
454
|
+
# AND 空结果时自动降级 OR(两阶段,见 fts_search)
|
|
455
|
+
escaped = ['"' + t.replace('"', '""') + '"' for t in content_tokens]
|
|
456
|
+
return " AND ".join(escaped)
|
|
444
457
|
|
|
445
458
|
def fts_search(self, conn: sqlite3.Connection, query: str,
|
|
446
459
|
top_k: int = 10) -> List[Tuple[str, float]]:
|
|
@@ -465,6 +478,19 @@ class IndexEngine:
|
|
|
465
478
|
ORDER BY score
|
|
466
479
|
LIMIT ?
|
|
467
480
|
""", (escaped, top_k)).fetchall()
|
|
481
|
+
# v6.5.12: AND 两阶段——实词共现空结果时降级 OR(保留
|
|
482
|
+
# 任一词召回兜底);降级前剔除停用词的 OR 也比旧版干净
|
|
483
|
+
if not rows and " AND " in escaped:
|
|
484
|
+
or_escaped = escaped.replace(" AND ", " OR ")
|
|
485
|
+
rows = conn.execute("""
|
|
486
|
+
SELECT m.id, bm25(memory_fts) as score
|
|
487
|
+
FROM memory_fts
|
|
488
|
+
JOIN memories m ON memory_fts.rowid = m.rowid
|
|
489
|
+
WHERE memory_fts MATCH ?
|
|
490
|
+
AND m.category != 'trash'
|
|
491
|
+
ORDER BY score
|
|
492
|
+
LIMIT ?
|
|
493
|
+
""", (or_escaped, top_k)).fetchall()
|
|
468
494
|
# v5.5.2 fix: clamp bm25 score to prevent math.exp overflow.
|
|
469
495
|
# bm25 returns negative values (lower = more relevant); a large
|
|
470
496
|
# positive value is anomalous but would cause OverflowError.
|
|
@@ -483,6 +509,31 @@ class IndexEngine:
|
|
|
483
509
|
# v6.4.9: 高频短语剪枝比例(与 TF-IDF max_df 0.05 对齐)
|
|
484
510
|
_FTS_MAX_DF_RATIO = 0.05
|
|
485
511
|
|
|
512
|
+
# v6.5.12: 检索停用词——疑问词/虚词在对话语料里 df 极高(LoCoMo
|
|
513
|
+
# 300 turn 里 "when"/"did" 各命中 100+ 行),OR 连接下以多词 tf
|
|
514
|
+
# 优势压过低频关键词命中(paint a sunrise 被 "When did Melanie"
|
|
515
|
+
# 泛化命中淹没的实证)。MATCH 构造前剔除。
|
|
516
|
+
_STOPWORDS = frozenset({
|
|
517
|
+
# 英文疑问/助动词/虚词
|
|
518
|
+
"when", "where", "what", "who", "whom", "whose", "why", "how",
|
|
519
|
+
"did", "does", "do", "is", "was", "were", "are", "be", "been",
|
|
520
|
+
"the", "a", "an", "of", "to", "in", "on", "at", "for", "with",
|
|
521
|
+
"and", "or", "but", "if", "that", "this", "these", "those",
|
|
522
|
+
"it", "its", "as", "by", "from", "has", "have", "had",
|
|
523
|
+
"will", "would", "can", "could", "should", "shall",
|
|
524
|
+
"i", "you", "he", "she", "we", "they", "me", "him", "her",
|
|
525
|
+
"us", "them", "my", "your", "his", "their", "our",
|
|
526
|
+
"not", "no", "yes", "so", "up", "out", "about", "into",
|
|
527
|
+
"over", "after", "again", "then", "once", "here", "there",
|
|
528
|
+
"all", "any", "both", "each", "few", "more", "most", "other",
|
|
529
|
+
"some", "such", "only", "own", "same", "than", "too", "very",
|
|
530
|
+
# 中文虚词/疑问
|
|
531
|
+
"的", "了", "吗", "呢", "是", "在", "我", "你", "他", "她",
|
|
532
|
+
"它", "们", "的", "和", "与", "或", "但", "就", "都", "很",
|
|
533
|
+
"什么", "怎么", "怎样", "哪里", "哪个", "谁", "为什么",
|
|
534
|
+
"什么", "时候", "多少",
|
|
535
|
+
})
|
|
536
|
+
|
|
486
537
|
def _prune_fts_query(self, conn: sqlite3.Connection, query: str,
|
|
487
538
|
escaped: str) -> str:
|
|
488
539
|
"""剔除 MATCH 里必然无区分度的高频短语。
|
|
@@ -494,7 +545,11 @@ class IndexEngine:
|
|
|
494
545
|
点查;以 memories.max_rowid 为失效标记,覆盖 add/update;
|
|
495
546
|
硬删导致的 df 缓存偏大只会让剪枝偏保守,5% 阈值级近似)。
|
|
496
547
|
"""
|
|
497
|
-
|
|
548
|
+
# v6.5.12: 从 escaped 解析短语(而非原始 query)——AND 语义下
|
|
549
|
+
# escaped 只含实词,prune 的 df 判断与重组都应基于同一词集
|
|
550
|
+
import re as _re2
|
|
551
|
+
tokens = _re2.findall(r'"([^"]+)"', escaped) or [
|
|
552
|
+
t for t in query.split() if t]
|
|
498
553
|
if len(tokens) <= 1:
|
|
499
554
|
return escaped
|
|
500
555
|
try:
|
|
@@ -528,13 +583,16 @@ class IndexEngine:
|
|
|
528
583
|
kept.append(tok)
|
|
529
584
|
if best_ub is None or ub < best_ub:
|
|
530
585
|
best, best_ub = tok, ub
|
|
586
|
+
# v6.5.12: 重组保持输入连接词——AND 两阶段语义不能被
|
|
587
|
+
# prune 降级成 OR(否则泛化洪水回归)
|
|
588
|
+
joiner = " AND " if " AND " in escaped else " OR "
|
|
531
589
|
if not kept:
|
|
532
590
|
kept = [best] if best else []
|
|
533
|
-
return
|
|
591
|
+
return joiner.join(
|
|
534
592
|
'"' + t.replace('"', '""') + '"' for t in kept)
|
|
535
593
|
if len(kept) == len(tokens):
|
|
536
594
|
return escaped
|
|
537
|
-
return
|
|
595
|
+
return joiner.join(
|
|
538
596
|
'"' + t.replace('"', '""') + '"' for t in kept)
|
|
539
597
|
except sqlite3.Error:
|
|
540
598
|
return escaped
|
|
@@ -154,6 +154,57 @@ class MindForge:
|
|
|
154
154
|
"Call init_with_password(password) to complete setup. "
|
|
155
155
|
"DO NOT use add/search/update until encryption is initialized."
|
|
156
156
|
)
|
|
157
|
+
# v6.6.0 fix(bug #1):_require_ready() 自 v6.3.5 存在但从未
|
|
158
|
+
# 接线到公开方法——defer 期间 285 个公开 API 全部裸
|
|
159
|
+
# AttributeError('NoneType')。defer 状态下给实例级公开方法
|
|
160
|
+
# 挂 guard:任何未豁免调用 → SecurityError 明示,而非哑谜。
|
|
161
|
+
self._arm_pending_guard()
|
|
162
|
+
|
|
163
|
+
# ------------------------------------------------------------------
|
|
164
|
+
# v6.6.0 fix(bug #1):加密 defer 状态的公开 API guard 接线
|
|
165
|
+
# ------------------------------------------------------------------
|
|
166
|
+
_PENDING_GUARD_EXEMPT = frozenset({
|
|
167
|
+
"init_with_password", # 初始化入口本身
|
|
168
|
+
"rekey", # 密钥管理(自行处理加密状态)
|
|
169
|
+
"get_encryption_info", # 状态查询
|
|
170
|
+
"close", # 资源释放
|
|
171
|
+
"save_config", # 配置落盘
|
|
172
|
+
"config_summary", # 配置只读
|
|
173
|
+
"init_status", # 初始化状态查询
|
|
174
|
+
"v6_status", # 版本状态查询
|
|
175
|
+
})
|
|
176
|
+
|
|
177
|
+
def _arm_pending_guard(self):
|
|
178
|
+
"""加密 defer 期间为实例级公开方法挂 _require_ready guard。
|
|
179
|
+
|
|
180
|
+
仅在 _pending_encryption=True 时调用——正常构造(encrypted=False
|
|
181
|
+
或已完成 init_with_password)完全不受影响,零额外开销。
|
|
182
|
+
init_with_password 成功后 wrapper 保留但 _require_ready 直接通过,
|
|
183
|
+
代价为几次属性检查,可忽略。
|
|
184
|
+
"""
|
|
185
|
+
import functools as _ft
|
|
186
|
+
import inspect as _inspect
|
|
187
|
+
import types as _types
|
|
188
|
+
|
|
189
|
+
cls = type(self)
|
|
190
|
+
for name in dir(cls):
|
|
191
|
+
if name.startswith("_") or name in self._PENDING_GUARD_EXEMPT:
|
|
192
|
+
continue
|
|
193
|
+
static_attr = _inspect.getattr_static(cls, name, None)
|
|
194
|
+
# property / 类属性(引擎引用、枚举常量)不拦——属性访问不抛
|
|
195
|
+
# AttributeError 语义由 _require_ready 在方法内兜底
|
|
196
|
+
if not isinstance(static_attr, _types.FunctionType):
|
|
197
|
+
continue
|
|
198
|
+
orig = getattr(self, name, None)
|
|
199
|
+
if not callable(orig):
|
|
200
|
+
continue
|
|
201
|
+
|
|
202
|
+
def _guarded(*args, _orig=orig, _self=self, **kwargs):
|
|
203
|
+
_self._require_ready()
|
|
204
|
+
return _orig(*args, **kwargs)
|
|
205
|
+
|
|
206
|
+
_ft.update_wrapper(_guarded, orig)
|
|
207
|
+
setattr(self, name, _guarded)
|
|
157
208
|
|
|
158
209
|
def _init_encryption(self):
|
|
159
210
|
"""初始化加密引擎(v5.2.2 修复:补充缺失的初始化逻辑)
|
|
@@ -1126,6 +1126,23 @@ class StorageEngine:
|
|
|
1126
1126
|
except sqlite3.OperationalError:
|
|
1127
1127
|
pass # columns already exist
|
|
1128
1128
|
|
|
1129
|
+
# v6.6.0 fix(bug #2):建库即落 schema_version。
|
|
1130
|
+
# 此前 schema_version 表只在 migrate_to_latest() 里创建——全新库
|
|
1131
|
+
# get_db_version() 恒为 0,doctor 对出厂库恒报「版本落后 v0->v1」
|
|
1132
|
+
# 伪警告并引导用户跑 migrate --force(当前迁移脚本为空,纯噪音)。
|
|
1133
|
+
# v0->v1 无实际迁移步骤,存量老库下次打开自动补齐,补写安全。
|
|
1134
|
+
conn.execute("""
|
|
1135
|
+
CREATE TABLE IF NOT EXISTS schema_version (
|
|
1136
|
+
id INTEGER PRIMARY KEY,
|
|
1137
|
+
value INTEGER NOT NULL
|
|
1138
|
+
)
|
|
1139
|
+
""")
|
|
1140
|
+
conn.execute(
|
|
1141
|
+
"INSERT OR REPLACE INTO schema_version (id, value) VALUES (1, ?)",
|
|
1142
|
+
(self._LATEST_DB_VERSION,),
|
|
1143
|
+
)
|
|
1144
|
+
conn.commit()
|
|
1145
|
+
|
|
1129
1146
|
@staticmethod
|
|
1130
1147
|
def _strip_control(text: Optional[str]) -> str:
|
|
1131
1148
|
"""v5.4.0 安全加固:过滤控制字符(保留 \\t\\n\\r,过滤 \\x00-\\x1f 和 \\x7f)。
|
|
@@ -20,10 +20,10 @@ core/mindforge.py、cli/main.py、mcp/server.py),每处都带一份硬编码
|
|
|
20
20
|
from typing import Tuple
|
|
21
21
|
|
|
22
22
|
#: 当前发布版本(唯一真值)
|
|
23
|
-
__version__: str = "6.
|
|
23
|
+
__version__: str = "6.6.0"
|
|
24
24
|
|
|
25
25
|
#: 结构化版本元组,便于比较(如 `VERSION_INFO >= (6, 1, 0)`)
|
|
26
|
-
VERSION_INFO: Tuple[int, int, int] = (6,
|
|
26
|
+
VERSION_INFO: Tuple[int, int, int] = (6, 6, 0)
|
|
27
27
|
|
|
28
28
|
#: 下一个大版本的目标版本号(供 v6 端口预留引用)
|
|
29
29
|
NEXT_MAJOR_TARGET: str = "7.0.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mindforge-memory
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.6.0
|
|
4
4
|
Summary: AI Agent 终身记忆系统 - 四层记忆架构 · 知识图谱 · 多模态支持
|
|
5
5
|
License: MIT
|
|
6
6
|
Project-URL: Homepage, https://github.com/opok-ops/MindForge
|
|
@@ -36,13 +36,13 @@ Dynamic: license-file
|
|
|
36
36
|
|
|
37
37
|
MindForge gives AI agents a persistent, structured long-term memory: a four-tier lifecycle model, knowledge graphs, hybrid retrieval, end-to-end encryption, and MCP / CLI / REST interfaces. All data stays on your machine.
|
|
38
38
|
|
|
39
|
-
> **The story** — one developer, seven months, from v1.0 (March 2026) to v6.
|
|
39
|
+
> **The story** — one developer, seven months, from v1.0 (March 2026) to v6.6.0: no team, no funding, 1,305 passing tests. [Read the journey →](https://opok-ops.github.io/MindForge/#developer)
|
|
40
40
|
>
|
|
41
|
-
> *Timeline note (v6.
|
|
41
|
+
> *Timeline note (v6.6.0):* "seven months" counts from project start (2026-03, pre-git prototyping era). Git history begins 2026-07-17 with the v5.7.x repository consolidation — earlier code lived outside this repo. The 416+ commits reflect consolidated history only.
|
|
42
42
|
|
|
43
43
|
[](https://www.python.org/downloads/)
|
|
44
44
|
[](LICENSE)
|
|
45
|
-
[](https://github.com/opok-ops/MindForge/releases)
|
|
46
46
|
[](https://github.com/opok-ops/MindForge/stargazers)
|
|
47
47
|
[](https://github.com/opok-ops/MindForge/forks)
|
|
48
48
|
[](https://github.com/opok-ops/MindForge/issues)
|
|
@@ -108,15 +108,15 @@ MindForge stats
|
|
|
108
108
|
- **Ten-million-character library, millisecond-class across all query types (v6.4.9)**: pathological 218→**0.4ms** (−99.8%), mixed 143→**3.0ms** (−98%), rare 6.8ms, combined 17.8ms (100k full-pipeline, clean environment). The last bottleneck — FTS5 high-frequency-phrase bm25 scoring — is now pruned query-side via trigram-df pre-check (df upper bound = min trigram df, pruned at 5% corpus size, symmetric to the TF-IDF max_df design; df served from an in-process cache — fts5vocab is a streaming virtual table, per-term probes scan it fully).
|
|
109
109
|
- **Index-blindness fix (v6.4.8)**: TF-IDF vocabulary was locked to the first 5 documents since v6.4.6 — incremental adds indexed as empty vectors (TF-IDF effectively half-dead; previous numbers carried by FTS5/fuzzy). Fixed with incremental vocabulary growth; all pipeline numbers above are now *true full-pipeline* measurements.
|
|
110
110
|
- Retrieval quality (fixed-seed, `benchmarks/quality_bench.py`, 2k entries): needle Recall@1 = 1.0, MRR = 1.0, topic Recall@1 = 1.0, noise false-recall = 0.
|
|
111
|
-
- **LoCoMo full-suite, LLM-judged (v6.
|
|
111
|
+
- **LoCoMo full-suite, LLM-judged (v6.6.0, 2026-11-13)**: 1,986 questions across all 10 conversations — **51.5% accuracy (≥9/10 judge score)**, 2.13× over the 24.2% pre-assembly baseline; cross-validated by two independent judges (DeepSeek 51.5% / Kimi K3.1 52.72%, Δ1.2pt); excluding the adversarial "should-refuse" bucket, **43.05%** (663/1540). Per-bucket: adversarial 93.9%, single-hop 57.8%, multi-hop 25.2%, temporal 9.6%, open-domain 10.4% — temporal evidence recall and two-hop chain retrieval are the named v6.6 targets. Data: `benchmarks/results/`, judge pipeline in `benchmarks/`.
|
|
112
112
|
- LongMemEval — interface ready, not yet run (requires external LLM API key).
|
|
113
113
|
- TF-IDF degraded mode process memory at 100k: ~700 MB. Index LRU cap: 100,000 docs (MINDFORGE_INDEX_MAX_DOCS).
|
|
114
114
|
|
|
115
115
|
## What's New
|
|
116
116
|
|
|
117
|
-
v6.1.3 – v6.
|
|
117
|
+
v6.1.3 – v6.6.0 shipped in two weeks (2026-11-01 → 11-14), guarded by **1,300+ tests**.
|
|
118
118
|
|
|
119
|
-
- **v6.
|
|
119
|
+
- **v6.6.0 — security fix pack from dual-judge external review** (2026-11-14). Qwen4-Max (Doubao) and Kimi K3.1 independently reviewed the codebase; their overlapping findings became this release. (1) **GDPR erasure completed**: `gdpr_erase_all` now cascades to 17 tables — added `knowledge_graph` entities, `memory_snapshots`, `memory_templates`, and the four drama_* creation-content tables that previously survived erasure (the "right to be forgotten" had a real gap). (2) **Legacy key-file verification fixed**: v5.5-era key files (no `verify_blob`) previously accepted *any* password during `rekey` — a wrong old password could rewrite the key file and orphan all data. Rekey now probe-decrypts a real ciphertext from the store; empty stores fall back to the old behavior. (3) **KDF cost floor**: `KDFParams.from_dict` rejects tampered parameters (PBKDF2 < 60k, scrypt N < 4096) that would downgrade brute-force cost — key files and ciphertext headers are attacker-visible input. (4) **Compression × encryption unblocked**: `compress_memories` previously raised `SecurityError` on encrypted stores, making the two flagship features mutually exclusive by default. Compression now hydrates its TF-IDF index via the same in-memory decryption path as `fuzzy_search` (`_plaintext_for_index`) — plaintext never touches disk or FTS5. (5) **Interface matrix completed**: REST gains `/api/gdpr/report`, `/api/gdpr/export`, `/api/gdpr/erase` (confirm=true required), `/api/compress`, `/api/compressions`; MCP gains `gdpr_report`, `gdpr_erase` (confirm required), `memory_compress` — 87→90 tools, all three interfaces now expose the full governance surface. (6) **Honesty fixes**: README previously claimed "six-way hybrid search"; the actual retrieval count is four (vector/FTS5/TF-IDF/fuzzy) — wording corrected, and the cross-encoder/heuristic distinction is now explicit. LoCoMo full-suite results (51.5%, dual-judge) added to the benchmarks section. 7+ new contract tests (`tests/test_v656_security.py`).
|
|
120
120
|
|
|
121
121
|
- **v6.4.9 — ten-million-char library at millisecond latency: FTS5 high-frequency-phrase scoring pruned** (2026-11-11). The last honest bottleneck from v6.4.8's ledger. Root cause (30k per-path timing): under the trigram tokenizer, corpus-wide phrases (template data's "陈述性记忆") match every row — bm25 full-match scoring cost 50.5ms/query, the dominant remainder of 100k mixed latency. Fix, query-side df pre-pruning symmetric to TF-IDF max_df: a phrase's df upper bound = min df of its trigrams (phrase matches ⊆ every trigram's row set); prune at 5% of corpus size; keep the lowest-ub phrase if all pruned. df is served from an in-process cache keyed by `max(rowid)` (add/update invalidate; hard-delete leaves df slightly stale = prunes more conservatively) — **two real pitfalls found en route: fts5vocab is a *streaming virtual table* — per-term probes AND `IN` batches trigger full scans (combined regressed 17→45ms before the cache)**. Plus: FTS5 path skipped on pathological fallback (no discriminating signal). Clean-environment 100k re-bench: pathological 122→**0.4ms** (−99.7%), mixed 134.9→**3.0ms** (−98%), all query types millisecond-class at ~10M chars. AI-flavored comment cleanup (essay-style docstrings → engineer-speak, info preserved). 5 new guards.
|
|
122
122
|
|
|
@@ -149,7 +149,7 @@ v6.1.3 – v6.5.11 shipped in two weeks (2026-11-01 → 11-14), guarded by **1,3
|
|
|
149
149
|
|
|
150
150
|
**Retrieval**
|
|
151
151
|
|
|
152
|
-
- **Six-way hybrid retrieval (real, as of v6.
|
|
152
|
+
- **Six-way hybrid retrieval (real, as of v6.6.0)** — six recall paths fused into one ranked result set: vector, FTS5, TF-IDF, fuzzy (the four core paths, RRF-style max-fusion with per-path score breakdown via `search --explain`), **temporal anchoring** (query absolute dates / anchored relative phrases → windowed SQL recall; v6.6.0) and **knowledge-graph adjacency** (entity match → 2-hop relation walk → memory back-references; v6.6.0). Paths 5-6 run in "blind-spot fill" mode — they only add candidates the four core paths missed, never re-rank existing high-quality hits. Degradation is per-path and safe: encrypted stores skip temporal (ciphertext is not SQL-matchable), empty KG skips graph, missing time anchor degrades to absolute-date-only.
|
|
153
153
|
- **Knowledge graph** — automatic entity and relation extraction, path finding, and associative recall.
|
|
154
154
|
- **Weighted recall** — multi-factor scoring (coverage, importance, access frequency, time decay) instead of similarity alone.
|
|
155
155
|
|
|
@@ -193,7 +193,7 @@ v6.1.3 – v6.5.11 shipped in two weeks (2026-11-01 → 11-14), guarded by **1,3
|
|
|
193
193
|
|
|
194
194
|
```
|
|
195
195
|
┌──────────────────────────────────────────────────────┐
|
|
196
|
-
│ MindForge v6.
|
|
196
|
+
│ MindForge v6.6.0 │
|
|
197
197
|
│ Cognitive Layer Personality · KnowledgeGraph │
|
|
198
198
|
│ MemoryEvolution · FederatedMemory │
|
|
199
199
|
├──────────────────────────────────────────────────────┤
|
|
@@ -112,8 +112,11 @@ class TestFts5QueryEscaping(_V547Case):
|
|
|
112
112
|
cases = [
|
|
113
113
|
("C++", '"C++"'),
|
|
114
114
|
("hello:world", '"hello:world"'),
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
# v6.5.12: 括号属剥离标点——短语构造前剥掉(trigram
|
|
116
|
+
# 下标点不出 gram,短语内标点零匹配)
|
|
117
|
+
("(test)", '"test"'),
|
|
118
|
+
# v6.5.12: AND 共现 + 停用词——MySQL/复制皆实词
|
|
119
|
+
("MySQL 复制", '"MySQL" AND "复制"'),
|
|
117
120
|
]
|
|
118
121
|
for raw, expect in cases:
|
|
119
122
|
with self.subTest(query=raw):
|
|
@@ -90,23 +90,36 @@ class TestFts5MultiWordOr(unittest.TestCase):
|
|
|
90
90
|
IndexEngine._escape_fts5_query("加密搜索"), '"加密搜索"')
|
|
91
91
|
|
|
92
92
|
def test_multi_word_english_or(self):
|
|
93
|
+
"""v6.5.12 契约反转:多词 AND 共现(泛化洪水修复)"""
|
|
93
94
|
self.assertEqual(
|
|
94
95
|
IndexEngine._escape_fts5_query("search bug"),
|
|
95
|
-
'"search"
|
|
96
|
+
'"search" AND "bug"')
|
|
96
97
|
|
|
97
98
|
def test_three_words_or(self):
|
|
98
99
|
self.assertEqual(
|
|
99
100
|
IndexEngine._escape_fts5_query("foo bar baz"),
|
|
100
|
-
'"foo"
|
|
101
|
+
'"foo" AND "bar" AND "baz"')
|
|
101
102
|
|
|
102
103
|
def test_empty(self):
|
|
103
104
|
self.assertEqual(IndexEngine._escape_fts5_query(""), "")
|
|
104
105
|
|
|
105
106
|
def test_quote_escaped(self):
|
|
106
|
-
#
|
|
107
|
+
# v6.5.12: 剥标点(引号剥离)+ AND 拼接
|
|
107
108
|
self.assertEqual(
|
|
108
109
|
IndexEngine._escape_fts5_query('foo "bar"'),
|
|
109
|
-
'"foo"
|
|
110
|
+
'"foo" AND "bar"')
|
|
111
|
+
|
|
112
|
+
def test_stopword_filtered(self):
|
|
113
|
+
"""v6.5.12: 停用词不进 MATCH(泛化洪水源头)"""
|
|
114
|
+
self.assertEqual(
|
|
115
|
+
IndexEngine._escape_fts5_query("When did Melanie paint a sunrise?"),
|
|
116
|
+
'"Melanie" AND "paint" AND "sunrise"')
|
|
117
|
+
|
|
118
|
+
def test_all_stopwords_fallback(self):
|
|
119
|
+
"""全停用词查询回退原词(避免空 MATCH)"""
|
|
120
|
+
self.assertEqual(
|
|
121
|
+
IndexEngine._escape_fts5_query("when did"),
|
|
122
|
+
'"when" AND "did"')
|
|
110
123
|
|
|
111
124
|
|
|
112
125
|
class TestRateLimiterCleanup(unittest.TestCase):
|
|
@@ -40,8 +40,8 @@ class TestVersionTruth(unittest.TestCase):
|
|
|
40
40
|
def test_core_version_matches_release(self):
|
|
41
41
|
# 版本推进时必须一并更新此处的钉值(与 test_v568_fixes 的
|
|
42
42
|
# _EXPECTED_VERSION 同一约定:让「忘记 bump 版本」在测试里显形)。
|
|
43
|
-
self.assertEqual(core_version.__version__, "6.
|
|
44
|
-
self.assertEqual(core_version.VERSION_INFO, (6,
|
|
43
|
+
self.assertEqual(core_version.__version__, "6.6.0")
|
|
44
|
+
self.assertEqual(core_version.VERSION_INFO, (6, 6, 0))
|
|
45
45
|
|
|
46
46
|
def test_pyproject_matches_core_version(self):
|
|
47
47
|
# v5.8.13 起 pyproject 不再写死静态版本:
|
|
@@ -662,8 +662,8 @@ class TestVersionConsistency(unittest.TestCase):
|
|
|
662
662
|
def test_version_is_612(self):
|
|
663
663
|
from mindforge.core.version import VERSION_INFO, __version__
|
|
664
664
|
# v6.1.3:版本钉值随发版推进更新(历史方法名保留)
|
|
665
|
-
self.assertEqual(__version__, "6.
|
|
666
|
-
self.assertEqual(VERSION_INFO, (6,
|
|
665
|
+
self.assertEqual(__version__, "6.6.0")
|
|
666
|
+
self.assertEqual(VERSION_INFO, (6, 6, 0))
|
|
667
667
|
|
|
668
668
|
def test_json_round_trip_safety_of_preview(self):
|
|
669
669
|
"""save_evolution 的预览序列化不得抛(不可 json 化的对象走 str 兜底)。"""
|
|
@@ -109,7 +109,7 @@ class TestVersionBump(unittest.TestCase):
|
|
|
109
109
|
钉点集合随版本数递增,发版链清单必须扫全部 test_v*fixes.py。"""
|
|
110
110
|
|
|
111
111
|
def test_version_is_current(self):
|
|
112
|
-
self.assertEqual(__version__, "6.
|
|
112
|
+
self.assertEqual(__version__, "6.6.0")
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
if __name__ == "__main__":
|
|
@@ -118,8 +118,8 @@ class TestVersionBump(unittest.TestCase):
|
|
|
118
118
|
"""版本钉值(每版随发版一并 bump,v6.4.5 教训)。"""
|
|
119
119
|
|
|
120
120
|
def test_version_is_649(self):
|
|
121
|
-
self.assertEqual(__version__, "6.
|
|
122
|
-
self.assertEqual(VERSION_INFO, (6,
|
|
121
|
+
self.assertEqual(__version__, "6.6.0")
|
|
122
|
+
self.assertEqual(VERSION_INFO, (6, 6, 0))
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
if __name__ == "__main__":
|