echomind-memory 1.1.5__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.
Files changed (49) hide show
  1. echomind_memory-1.1.5/LICENSE +21 -0
  2. echomind_memory-1.1.5/MANIFEST.in +9 -0
  3. echomind_memory-1.1.5/PKG-INFO +118 -0
  4. echomind_memory-1.1.5/README.md +89 -0
  5. echomind_memory-1.1.5/pyproject.toml +50 -0
  6. echomind_memory-1.1.5/requirements.txt +7 -0
  7. echomind_memory-1.1.5/setup.cfg +4 -0
  8. echomind_memory-1.1.5/src/echomind/__init__.py +34 -0
  9. echomind_memory-1.1.5/src/echomind/adapters/__init__.py +5 -0
  10. echomind_memory-1.1.5/src/echomind/adapters/hermes_provider.py +530 -0
  11. echomind_memory-1.1.5/src/echomind/adapters/http_api.py +323 -0
  12. echomind_memory-1.1.5/src/echomind/code_format/__init__.py +0 -0
  13. echomind_memory-1.1.5/src/echomind/code_format/cli.py +74 -0
  14. echomind_memory-1.1.5/src/echomind/code_format/memory.schema.json +33 -0
  15. echomind_memory-1.1.5/src/echomind/core/__init__.py +25 -0
  16. echomind_memory-1.1.5/src/echomind/core/_reflective_fallback.py +200 -0
  17. echomind_memory-1.1.5/src/echomind/core/_reflective_version.py +19 -0
  18. echomind_memory-1.1.5/src/echomind/core/agents/__init__.py +17 -0
  19. echomind_memory-1.1.5/src/echomind/core/agents/context_agent.py +25 -0
  20. echomind_memory-1.1.5/src/echomind/core/agents/experience_agent.py +76 -0
  21. echomind_memory-1.1.5/src/echomind/core/agents/knowledge_agent.py +100 -0
  22. echomind_memory-1.1.5/src/echomind/core/agents/research_agent.py +100 -0
  23. echomind_memory-1.1.5/src/echomind/core/agents/task_agent.py +63 -0
  24. echomind_memory-1.1.5/src/echomind/core/agents/user_agent.py +60 -0
  25. echomind_memory-1.1.5/src/echomind/core/config_manager.py +218 -0
  26. echomind_memory-1.1.5/src/echomind/core/learning/__init__.py +3 -0
  27. echomind_memory-1.1.5/src/echomind/core/learning/rl_weight_optimizer.py +170 -0
  28. echomind_memory-1.1.5/src/echomind/core/llm_client.py +210 -0
  29. echomind_memory-1.1.5/src/echomind/core/memory_agent.py +807 -0
  30. echomind_memory-1.1.5/src/echomind/core/models/__init__.py +13 -0
  31. echomind_memory-1.1.5/src/echomind/core/models/context.py +15 -0
  32. echomind_memory-1.1.5/src/echomind/core/models/experience.py +19 -0
  33. echomind_memory-1.1.5/src/echomind/core/models/knowledge.py +11 -0
  34. echomind_memory-1.1.5/src/echomind/core/models/reflection.py +45 -0
  35. echomind_memory-1.1.5/src/echomind/core/models/research.py +34 -0
  36. echomind_memory-1.1.5/src/echomind/core/models/task.py +20 -0
  37. echomind_memory-1.1.5/src/echomind/core/models/user.py +12 -0
  38. echomind_memory-1.1.5/src/echomind/core/reflective_agent.py +128 -0
  39. echomind_memory-1.1.5/src/echomind/core/storage/__init__.py +3 -0
  40. echomind_memory-1.1.5/src/echomind/core/storage/sqlite_store.py +648 -0
  41. echomind_memory-1.1.5/src/echomind/domain_keywords.yaml +159 -0
  42. echomind_memory-1.1.5/src/echomind/echomind_config.yaml +113 -0
  43. echomind_memory-1.1.5/src/echomind/main.py +200 -0
  44. echomind_memory-1.1.5/src/echomind_memory.egg-info/PKG-INFO +118 -0
  45. echomind_memory-1.1.5/src/echomind_memory.egg-info/SOURCES.txt +47 -0
  46. echomind_memory-1.1.5/src/echomind_memory.egg-info/dependency_links.txt +1 -0
  47. echomind_memory-1.1.5/src/echomind_memory.egg-info/entry_points.txt +2 -0
  48. echomind_memory-1.1.5/src/echomind_memory.egg-info/requires.txt +11 -0
  49. echomind_memory-1.1.5/src/echomind_memory.egg-info/top_level.txt +1 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 xiangjianhuan007
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,9 @@
1
+ # MANIFEST.in — Python package build manifest
2
+ prune src/echomind/**/__pycache__
3
+ prune .git
4
+ prune doc
5
+ prune test
6
+ prune build
7
+ prune dist
8
+ prune .claude
9
+ include requirements.txt
@@ -0,0 +1,118 @@
1
+ Metadata-Version: 2.4
2
+ Name: echomind-memory
3
+ Version: 1.1.5
4
+ Summary: 四层认知记忆系统 for AI agents — 世界事实 / 经历 / 观察 / 心智模型,LLM 反射引擎自动提炼
5
+ Author: xiangjianhuan007
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/xiangjianhuan007/echomind-memory-cn
8
+ Project-URL: Repository, https://github.com/xiangjianhuan007/echomind-memory-cn
9
+ Project-URL: Issues, https://github.com/xiangjianhuan007/echomind-memory-cn/issues
10
+ Keywords: ai,memory,llm,agent,rag,cognitive,hermes
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
15
+ Requires-Python: >=3.10
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: pydantic>=2.7
19
+ Requires-Dist: python-dotenv>=1.0
20
+ Requires-Dist: numpy>=1.26
21
+ Requires-Dist: PyYAML>=6.0
22
+ Requires-Dist: requests>=2.28
23
+ Requires-Dist: fastapi>=0.100
24
+ Requires-Dist: uvicorn>=0.20
25
+ Provides-Extra: dev
26
+ Requires-Dist: build; extra == "dev"
27
+ Requires-Dist: pytest; extra == "dev"
28
+ Dynamic: license-file
29
+
30
+ [![OpenClaw Compatible](https://img.shields.io/badge/OpenClaw-Compatible-brightgreen)](https://github.com/OpenClaw)
31
+ [![Hermes-Agent Ready](https://img.shields.io/badge/Hermes--Agent-Ready-blue)](https://github.com/Hermes-Agent)
32
+ [![Claude Code Supported](https://img.shields.io/badge/Claude%20Code-Supported-orange)](https://claude.ai/code)
33
+ [![OpenCode Compatible](https://img.shields.io/badge/OpenCode-Compatible-red)](https://github.com/open-code-ai)
34
+
35
+ # EchoMind v2.0 — Chinese Enhanced Edition
36
+
37
+ 🌐 **中文版:** [README.zh-CN.md](README.zh-CN.md)
38
+
39
+ > A cognitive architecture-level fork of [echomind_memory.skill](https://github.com/jasonatgit/echomind_memory.skill) (official v1.1.5).
40
+ > Borrowing Hindsight's "soul" and wrapping it in EchoMind's "shell." Your AI doesn't just "remember" anymore — it **thinks**.
41
+
42
+ ---
43
+
44
+ ## 🧠 Four-Layer Cognitive Architecture (Crushes Traditional Vector Search)
45
+
46
+ Most memory systems do only one thing: **store in, search out**. Like a goldfish — it knows you talked yesterday, but has no idea why, what conclusions were reached, or what to do next time.
47
+
48
+ **EchoMind v2.0 borrows Hindsight's cognitive science architecture, upgrading memory from a "hard drive" to a "brain":**
49
+
50
+ | Layer | Human Analogy | What It Does |
51
+ |:---|:---|:---|
52
+ | **🌍 World Facts** | "Fire is hot" | Categorize objective knowledge, trace sources |
53
+ | **📝 Experience** | "I touched that bright thing and got burned" | Full context + outcome for every interaction |
54
+ | **🔍 Observation** | "That bright thing is hot, might be fire" | **Auto-extract patterns from conversations** |
55
+ | **🧠 Mental Model** | "Don't touch bright things" | Confirmed observations → **auto-write to system preferences** |
56
+
57
+ This isn't fancy categorization. This is a fundamental leap from "storage" to "cognition."
58
+
59
+ ## ⚡ Three Core Upgrades
60
+
61
+ ### 1. Reflection Engine: From "Dead" to "Alive"
62
+
63
+ The original reflection engine never fired (the code literally said "don't reflect when LLM is available" — like buying a supercomputer and using it as a calculator).
64
+
65
+ **v2.0 fix**: Three-tier degradation strategy, LLM-driven semantic analysis, auto-triggers a brain review every 8 conversations.
66
+
67
+ ### 2. Observation Layer: From "Single Record" to "Pattern Discovery"
68
+
69
+ New `observation_memory` table, auto-deduplication, confidence accumulation:
70
+
71
+ ```
72
+ 1st occurrence → "User prefers concise replies" (conf=0.5, hit=1)
73
+ 2nd occurrence → "Same pattern again" (conf=0.65, hit=2)
74
+ 3rd occurrence → "Confirmed" (conf=0.75, hit=3) → **promoted to mental model**
75
+ ```
76
+
77
+ ### 3. Mental Model Auto-Sedimentation
78
+
79
+ When a pattern appears **3 times** with confidence **≥0.6**, auto-write to MEMORY.md/USER.md — permanently.
80
+
81
+ ## 🆚 Comparison
82
+
83
+ | Dimension | Original EchoMind | EchoMind v2.0 | Hindsight |
84
+ |:---|:---:|:---:|:---:|
85
+ | Storage | 9 flat tables | 11 tables + 4-layer | Cloud PostgreSQL |
86
+ | Reflection Engine | ❌ Never fires | ✅ LLM 3-tier | ✅ Built-in |
87
+ | Pattern Discovery | ❌ None | ✅ observation_memory | ✅ Automatic |
88
+ | Mental Models | ❌ None | ✅ Auto-write to files | ✅ Cloud storage |
89
+ | Offline | ✅ | ✅ | ❌ API-dependent |
90
+ | Deploy Cost | Zero | Zero | ~1GB Docker |
91
+
92
+ ## 📦 Usage
93
+
94
+ ```yaml
95
+ # config.yaml
96
+ memory:
97
+ provider: echomind
98
+ enabled: true
99
+ ```
100
+
101
+ No extra deployment, no Docker, no API key. Change one config line, restart, done.
102
+
103
+ ## 🔧 Files Modified (615 lines added)
104
+
105
+ | File | Change |
106
+ |:---|:---|
107
+ | `core/_reflective_fallback.py` | 200-line shell → 400-line complete reflection engine |
108
+ | `core/storage/sqlite_store.py` | New observation table + source_type migration |
109
+ | `adapters/hermes_provider.py` | Reflection loop + mental model auto-sedimentation |
110
+
111
+ ## 🔗 Links
112
+
113
+ - Official: https://github.com/jasonatgit/echomind_memory.skill
114
+ - Chinese Enhanced: https://github.com/xianjianhuang/echomind-memory-cn
115
+
116
+ ---
117
+
118
+ *This isn't a plugin. This is an AI Multi-Agent Memory Neural Network with self-reflective memory.*
@@ -0,0 +1,89 @@
1
+ [![OpenClaw Compatible](https://img.shields.io/badge/OpenClaw-Compatible-brightgreen)](https://github.com/OpenClaw)
2
+ [![Hermes-Agent Ready](https://img.shields.io/badge/Hermes--Agent-Ready-blue)](https://github.com/Hermes-Agent)
3
+ [![Claude Code Supported](https://img.shields.io/badge/Claude%20Code-Supported-orange)](https://claude.ai/code)
4
+ [![OpenCode Compatible](https://img.shields.io/badge/OpenCode-Compatible-red)](https://github.com/open-code-ai)
5
+
6
+ # EchoMind v2.0 — Chinese Enhanced Edition
7
+
8
+ 🌐 **中文版:** [README.zh-CN.md](README.zh-CN.md)
9
+
10
+ > A cognitive architecture-level fork of [echomind_memory.skill](https://github.com/jasonatgit/echomind_memory.skill) (official v1.1.5).
11
+ > Borrowing Hindsight's "soul" and wrapping it in EchoMind's "shell." Your AI doesn't just "remember" anymore — it **thinks**.
12
+
13
+ ---
14
+
15
+ ## 🧠 Four-Layer Cognitive Architecture (Crushes Traditional Vector Search)
16
+
17
+ Most memory systems do only one thing: **store in, search out**. Like a goldfish — it knows you talked yesterday, but has no idea why, what conclusions were reached, or what to do next time.
18
+
19
+ **EchoMind v2.0 borrows Hindsight's cognitive science architecture, upgrading memory from a "hard drive" to a "brain":**
20
+
21
+ | Layer | Human Analogy | What It Does |
22
+ |:---|:---|:---|
23
+ | **🌍 World Facts** | "Fire is hot" | Categorize objective knowledge, trace sources |
24
+ | **📝 Experience** | "I touched that bright thing and got burned" | Full context + outcome for every interaction |
25
+ | **🔍 Observation** | "That bright thing is hot, might be fire" | **Auto-extract patterns from conversations** |
26
+ | **🧠 Mental Model** | "Don't touch bright things" | Confirmed observations → **auto-write to system preferences** |
27
+
28
+ This isn't fancy categorization. This is a fundamental leap from "storage" to "cognition."
29
+
30
+ ## ⚡ Three Core Upgrades
31
+
32
+ ### 1. Reflection Engine: From "Dead" to "Alive"
33
+
34
+ The original reflection engine never fired (the code literally said "don't reflect when LLM is available" — like buying a supercomputer and using it as a calculator).
35
+
36
+ **v2.0 fix**: Three-tier degradation strategy, LLM-driven semantic analysis, auto-triggers a brain review every 8 conversations.
37
+
38
+ ### 2. Observation Layer: From "Single Record" to "Pattern Discovery"
39
+
40
+ New `observation_memory` table, auto-deduplication, confidence accumulation:
41
+
42
+ ```
43
+ 1st occurrence → "User prefers concise replies" (conf=0.5, hit=1)
44
+ 2nd occurrence → "Same pattern again" (conf=0.65, hit=2)
45
+ 3rd occurrence → "Confirmed" (conf=0.75, hit=3) → **promoted to mental model**
46
+ ```
47
+
48
+ ### 3. Mental Model Auto-Sedimentation
49
+
50
+ When a pattern appears **3 times** with confidence **≥0.6**, auto-write to MEMORY.md/USER.md — permanently.
51
+
52
+ ## 🆚 Comparison
53
+
54
+ | Dimension | Original EchoMind | EchoMind v2.0 | Hindsight |
55
+ |:---|:---:|:---:|:---:|
56
+ | Storage | 9 flat tables | 11 tables + 4-layer | Cloud PostgreSQL |
57
+ | Reflection Engine | ❌ Never fires | ✅ LLM 3-tier | ✅ Built-in |
58
+ | Pattern Discovery | ❌ None | ✅ observation_memory | ✅ Automatic |
59
+ | Mental Models | ❌ None | ✅ Auto-write to files | ✅ Cloud storage |
60
+ | Offline | ✅ | ✅ | ❌ API-dependent |
61
+ | Deploy Cost | Zero | Zero | ~1GB Docker |
62
+
63
+ ## 📦 Usage
64
+
65
+ ```yaml
66
+ # config.yaml
67
+ memory:
68
+ provider: echomind
69
+ enabled: true
70
+ ```
71
+
72
+ No extra deployment, no Docker, no API key. Change one config line, restart, done.
73
+
74
+ ## 🔧 Files Modified (615 lines added)
75
+
76
+ | File | Change |
77
+ |:---|:---|
78
+ | `core/_reflective_fallback.py` | 200-line shell → 400-line complete reflection engine |
79
+ | `core/storage/sqlite_store.py` | New observation table + source_type migration |
80
+ | `adapters/hermes_provider.py` | Reflection loop + mental model auto-sedimentation |
81
+
82
+ ## 🔗 Links
83
+
84
+ - Official: https://github.com/jasonatgit/echomind_memory.skill
85
+ - Chinese Enhanced: https://github.com/xianjianhuang/echomind-memory-cn
86
+
87
+ ---
88
+
89
+ *This isn't a plugin. This is an AI Multi-Agent Memory Neural Network with self-reflective memory.*
@@ -0,0 +1,50 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "echomind-memory"
7
+ # NOTE: keep in sync with src/echomind/core/_reflective_version.py :: ECHOMIND_VERSION
8
+ version = "1.1.5"
9
+ description = "四层认知记忆系统 for AI agents — 世界事实 / 经历 / 观察 / 心智模型,LLM 反射引擎自动提炼"
10
+ readme = "README.md"
11
+ requires-python = ">=3.10"
12
+ license = { text = "MIT" }
13
+ authors = [{ name = "xiangjianhuan007" }]
14
+ keywords = ["ai", "memory", "llm", "agent", "rag", "cognitive", "hermes"]
15
+ classifiers = [
16
+ "Programming Language :: Python :: 3",
17
+ "License :: OSI Approved :: MIT License",
18
+ "Operating System :: OS Independent",
19
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
20
+ ]
21
+ dependencies = [
22
+ "pydantic>=2.7",
23
+ "python-dotenv>=1.0",
24
+ "numpy>=1.26",
25
+ "PyYAML>=6.0",
26
+ "requests>=2.28",
27
+ "fastapi>=0.100",
28
+ "uvicorn>=0.20",
29
+ ]
30
+
31
+ [project.optional-dependencies]
32
+ dev = ["build", "pytest"]
33
+
34
+ [project.scripts]
35
+ echomind = "echomind.main:main"
36
+
37
+ [project.urls]
38
+ Homepage = "https://github.com/xiangjianhuan007/echomind-memory-cn"
39
+ Repository = "https://github.com/xiangjianhuan007/echomind-memory-cn"
40
+ Issues = "https://github.com/xiangjianhuan007/echomind-memory-cn/issues"
41
+
42
+ [tool.setuptools]
43
+ package-dir = { "" = "src" }
44
+
45
+ [tool.setuptools.packages.find]
46
+ where = ["src"]
47
+ include = ["echomind*"]
48
+
49
+ [tool.setuptools.package-data]
50
+ echomind = ["*.yaml", "code_format/*.json"]
@@ -0,0 +1,7 @@
1
+ pydantic>=2.7
2
+ python-dotenv>=1.0
3
+ numpy>=1.26
4
+ PyYAML>=6.0
5
+ requests>=2.28
6
+ fastapi>=0.100
7
+ uvicorn>=0.20
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,34 @@
1
+ """EchoMind Memory Skill — Hermes Plugin
2
+ AI Persistent memory system: 6 memory types + RL self-optimization + Self-Reflective Agent
3
+
4
+ as MemoryProvider: set memory.provider: echomind in config.yaml
5
+ as Plugin: run hermes plugins enable echomind
6
+ """
7
+ import os, sys
8
+ # Hermes plugin loader creates this module as _hermes_user_memory.echomind
9
+ # with spec_from_file_location — Python has no package context, so relative
10
+ # imports fail. Add plugin dir to sys.path so absolute imports work.
11
+ _plugin_dir = os.path.dirname(os.path.abspath(__file__))
12
+ _pkg_root = os.path.dirname(_plugin_dir) # 父目录:让 `import echomind` 可解析
13
+ for _p in (_pkg_root, _plugin_dir):
14
+ if _p not in sys.path:
15
+ sys.path.insert(0, _p)
16
+
17
+ from echomind.core._reflective_version import get_echomind_version
18
+
19
+ __version__ = get_echomind_version()
20
+
21
+ from echomind.adapters.hermes_provider import EchomindMemoryProvider
22
+
23
+ __all__ = ["EchomindMemoryProvider", "__version__"]
24
+
25
+ # ── Startup confirmation (user-visible, for Hermes plugin load) ──
26
+ try:
27
+ from echomind.core.storage.sqlite_store import SqliteStore
28
+ db = SqliteStore()
29
+ db.connect()
30
+ db.ensure_tables()
31
+ row_count = db._conn.execute("SELECT count(*) FROM user_memory").fetchone()[0]
32
+ print(f"🧠 EchoMind v{__version__} — 记忆存储正常 ({row_count} 条用户记忆)")
33
+ except Exception as e:
34
+ print(f"⚠️ EchoMind v{__version__} — 记忆存储异常: {e}")
@@ -0,0 +1,5 @@
1
+ # EchoMind platform adapters
2
+ from .hermes_provider import EchomindMemoryProvider
3
+ from .http_api import app
4
+
5
+ __all__ = ["EchomindMemoryProvider", "app"]