liquid-loop 0.7.0__tar.gz → 0.7.1__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.
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/PKG-INFO +36 -7
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/README.md +35 -6
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/liquid_loop/__init__.py +2 -2
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/liquid_loop/workspace.py +12 -5
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/liquid_loop.egg-info/PKG-INFO +36 -7
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/pyproject.toml +1 -1
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/LICENSE +0 -0
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/liquid_loop/__main__.py +0 -0
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/liquid_loop/cli.py +0 -0
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/liquid_loop/cognitive_budget.py +0 -0
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/liquid_loop/entropy.py +0 -0
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/liquid_loop/mesh/__init__.py +0 -0
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/liquid_loop/mesh/v2.py +0 -0
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/liquid_loop/storage.py +0 -0
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/liquid_loop.egg-info/SOURCES.txt +0 -0
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/liquid_loop.egg-info/dependency_links.txt +0 -0
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/liquid_loop.egg-info/entry_points.txt +0 -0
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/liquid_loop.egg-info/requires.txt +0 -0
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/liquid_loop.egg-info/top_level.txt +0 -0
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/setup.cfg +0 -0
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/tests/test_consensus_expansion.py +0 -0
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/tests/test_entropy.py +0 -0
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/tests/test_nucleate_dual_track.py +0 -0
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/tests/test_peek_seal.py +0 -0
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/tests/test_seal_persistence.py +0 -0
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/tests/test_self_evolve.py +0 -0
- {liquid_loop-0.7.0 → liquid_loop-0.7.1}/tests/test_workspace.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: liquid-loop
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.1
|
|
4
4
|
Summary: Self-Organizing Cognitive Memory for AI Agents — Liquid Loop theory implementation
|
|
5
5
|
Author: fishbook0001
|
|
6
6
|
Maintainer: fishbook0001
|
|
@@ -72,7 +72,7 @@ Dynamic: license-file
|
|
|
72
72
|
| **Anchor** 锚点 | 晶种 | 认知关注点,有稳定性值 s ∈ [0,1] |
|
|
73
73
|
| **Evidence** 证据 | 附着粒子 | 锚点下的具体观察,权重指数衰减 w×0.95ᵗ |
|
|
74
74
|
| **Memory** 结晶 | 结晶体 | 2+ 条一致 Evidence 自动凝聚,有置信度 c |
|
|
75
|
-
| **Entropy** 熵值 | 流体无序度 | 八维加权(锚点漂移 / 冲突密度 / 碎片 / 活跃间隔 / 价值衰减 / 锚定强度 / CPE 三维) |
|
|
75
|
+
| **Entropy** 熵值 (LEI) | 流体无序度 | 八维加权(锚点漂移 / 冲突密度 / 碎片 / 活跃间隔 / 价值衰减 / 锚定强度 / CPE 三维) |
|
|
76
76
|
|
|
77
77
|
**状态判定:**
|
|
78
78
|
```
|
|
@@ -81,6 +81,12 @@ YELLOW (0.3 ≤ entropy < 0.6) — 需关注
|
|
|
81
81
|
RED (entropy ≥ 0.6) — 需清理
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
+
> **关于 "Entropy" 的语义澄清 — Liquid Entropy Index (LEI)**
|
|
85
|
+
>
|
|
86
|
+
> 本项目中的 `entropy` 是 **Liquid Entropy Index (LEI): a system-stability deviation metric, inspired by entropy but NOT equivalent to thermodynamic entropy.**
|
|
87
|
+
> 它不是物理熵 `S = -k Σ pᵢ log pᵢ`,而是对**系统状态偏离稳定流形程度**的综合度量——由八个可解释分量人工加权而成(锚点漂移 / 冲突密度 / 证据碎片 / 活跃间隔 / 价值衰减 / 锚定强度 + CPE 三维:回顾性衰退 / 策略漂移 / 泛化崩塌)。
|
|
88
|
+
> 代码层函数名保留 `calculate()`(历史连续性);文档 / 论文层一律以 **LEI** 指称,避免与热力学熵混淆。
|
|
89
|
+
|
|
84
90
|
---
|
|
85
91
|
|
|
86
92
|
## 快速开始
|
|
@@ -93,7 +99,7 @@ pip install liquid-loop
|
|
|
93
99
|
|
|
94
100
|
### 3 分钟上手
|
|
95
101
|
```python
|
|
96
|
-
from liquid_loop import WorkspaceState, load, save,
|
|
102
|
+
from liquid_loop import WorkspaceState, load, save, calculate
|
|
97
103
|
|
|
98
104
|
# 1. 创建/加载工作区
|
|
99
105
|
state = WorkspaceState() # 或 load(Path("."))
|
|
@@ -111,7 +117,7 @@ for m in state.memories:
|
|
|
111
117
|
print(f"结晶: {m.content[:50]}... (置信度={m.confidence:.2f})")
|
|
112
118
|
|
|
113
119
|
# 5. 监控认知健康
|
|
114
|
-
entropy =
|
|
120
|
+
entropy = calculate(state)
|
|
115
121
|
print(f"熵值: {entropy:.4f} → {'🟢GREEN' if entropy < 0.3 else '🟡YELLOW' if entropy < 0.6 else '🔴RED'}")
|
|
116
122
|
|
|
117
123
|
# 6. 持久化
|
|
@@ -167,6 +173,26 @@ print(health["CCI"], health["consensus_crystals"])
|
|
|
167
173
|
|
|
168
174
|
---
|
|
169
175
|
|
|
176
|
+
## 定位:Self-Regulating Persistent Memory Dynamics
|
|
177
|
+
|
|
178
|
+
液环的本质不是"AI 意识",而是一套 **agent 系统的自调节持久记忆动力学(Self-Regulating Persistent Memory Dynamics for Agent Systems)**。`AuditChain + LEI(Entropy) + Memory decay` 三者组合形成闭环,使记忆从"外部管理"转向"内部自组织":
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
Input Evidence
|
|
182
|
+
↓
|
|
183
|
+
Memory State ←──────────────┐
|
|
184
|
+
↓ │
|
|
185
|
+
LEI Evaluation (八维熵) │
|
|
186
|
+
↓ │
|
|
187
|
+
Decay / Reinforcement ────────┘
|
|
188
|
+
↓
|
|
189
|
+
AuditChain (SHA256 链式追溯)
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
这比单独的 memory store 更接近一个可被实验检验的**动态系统**:输入驱动状态、熵评估稳定性、衰减/强化回流状态、审计链保证来源可信。
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
170
196
|
## 架构对比
|
|
171
197
|
|
|
172
198
|
```
|
|
@@ -213,7 +239,7 @@ liquid-loop/
|
|
|
213
239
|
│ ├── __init__.py # 公共 API 导出
|
|
214
240
|
│ ├── workspace.py # 核心数据模型 + AuditChain + auto_classify + decay
|
|
215
241
|
│ ├── storage.py # JSON 持久化 + 审计链写入
|
|
216
|
-
│ ├── entropy.py #
|
|
242
|
+
│ ├── entropy.py # 八维熵值计算(含 CPE 三维)
|
|
217
243
|
│ ├── mesh/ # MESH v2 多智能体共识协议集成(validate_evidence / compute_cci / ...)
|
|
218
244
|
│ └── cli.py # Click CLI (11 命令)
|
|
219
245
|
├── examples/
|
|
@@ -240,12 +266,15 @@ pytest -v
|
|
|
240
266
|
|
|
241
267
|
## 路线图
|
|
242
268
|
|
|
243
|
-
- [ ] 语义一致性结晶(嵌入相似度替代精确匹配)
|
|
244
269
|
- [x] 多 Agent 液环耦合(`liquid_loop.mesh` v2 共识协议,2026-07-15 落地)
|
|
245
|
-
- [ ]
|
|
270
|
+
- [ ] **[v0.8] 反证轨(Evidence Graph)**:Evidence 分 support / contradiction,一致增稳、冲突降稳,驱动 memory stability score(不再"一致即真")
|
|
271
|
+
- [ ] **[v0.8] 显式时间动力学**:`M(t+1) = M(t) + reinforcement − decay − contradiction_penalty`,让记忆成为"过程"而非"对象"(真正的液态循环)
|
|
272
|
+
- [ ] **[v0.8] 三实验**:E2 错误记忆恢复(核心)→ E3 多 agent 冲突(mesh 价值)→ E1 长期漂移(压力测试)
|
|
246
273
|
- [ ] LoCoMo / LongMemEval 基准对比
|
|
247
274
|
- [ ] 边缘端部署优化(<50KB)
|
|
248
275
|
|
|
276
|
+
> 零向量是液环的硬约束:一致性判定永不引入 embedding / 相似度(这正是液环要替代的方案)。
|
|
277
|
+
|
|
249
278
|
---
|
|
250
279
|
|
|
251
280
|
## 许可证
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
| **Anchor** 锚点 | 晶种 | 认知关注点,有稳定性值 s ∈ [0,1] |
|
|
34
34
|
| **Evidence** 证据 | 附着粒子 | 锚点下的具体观察,权重指数衰减 w×0.95ᵗ |
|
|
35
35
|
| **Memory** 结晶 | 结晶体 | 2+ 条一致 Evidence 自动凝聚,有置信度 c |
|
|
36
|
-
| **Entropy** 熵值 | 流体无序度 | 八维加权(锚点漂移 / 冲突密度 / 碎片 / 活跃间隔 / 价值衰减 / 锚定强度 / CPE 三维) |
|
|
36
|
+
| **Entropy** 熵值 (LEI) | 流体无序度 | 八维加权(锚点漂移 / 冲突密度 / 碎片 / 活跃间隔 / 价值衰减 / 锚定强度 / CPE 三维) |
|
|
37
37
|
|
|
38
38
|
**状态判定:**
|
|
39
39
|
```
|
|
@@ -42,6 +42,12 @@ YELLOW (0.3 ≤ entropy < 0.6) — 需关注
|
|
|
42
42
|
RED (entropy ≥ 0.6) — 需清理
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
+
> **关于 "Entropy" 的语义澄清 — Liquid Entropy Index (LEI)**
|
|
46
|
+
>
|
|
47
|
+
> 本项目中的 `entropy` 是 **Liquid Entropy Index (LEI): a system-stability deviation metric, inspired by entropy but NOT equivalent to thermodynamic entropy.**
|
|
48
|
+
> 它不是物理熵 `S = -k Σ pᵢ log pᵢ`,而是对**系统状态偏离稳定流形程度**的综合度量——由八个可解释分量人工加权而成(锚点漂移 / 冲突密度 / 证据碎片 / 活跃间隔 / 价值衰减 / 锚定强度 + CPE 三维:回顾性衰退 / 策略漂移 / 泛化崩塌)。
|
|
49
|
+
> 代码层函数名保留 `calculate()`(历史连续性);文档 / 论文层一律以 **LEI** 指称,避免与热力学熵混淆。
|
|
50
|
+
|
|
45
51
|
---
|
|
46
52
|
|
|
47
53
|
## 快速开始
|
|
@@ -54,7 +60,7 @@ pip install liquid-loop
|
|
|
54
60
|
|
|
55
61
|
### 3 分钟上手
|
|
56
62
|
```python
|
|
57
|
-
from liquid_loop import WorkspaceState, load, save,
|
|
63
|
+
from liquid_loop import WorkspaceState, load, save, calculate
|
|
58
64
|
|
|
59
65
|
# 1. 创建/加载工作区
|
|
60
66
|
state = WorkspaceState() # 或 load(Path("."))
|
|
@@ -72,7 +78,7 @@ for m in state.memories:
|
|
|
72
78
|
print(f"结晶: {m.content[:50]}... (置信度={m.confidence:.2f})")
|
|
73
79
|
|
|
74
80
|
# 5. 监控认知健康
|
|
75
|
-
entropy =
|
|
81
|
+
entropy = calculate(state)
|
|
76
82
|
print(f"熵值: {entropy:.4f} → {'🟢GREEN' if entropy < 0.3 else '🟡YELLOW' if entropy < 0.6 else '🔴RED'}")
|
|
77
83
|
|
|
78
84
|
# 6. 持久化
|
|
@@ -128,6 +134,26 @@ print(health["CCI"], health["consensus_crystals"])
|
|
|
128
134
|
|
|
129
135
|
---
|
|
130
136
|
|
|
137
|
+
## 定位:Self-Regulating Persistent Memory Dynamics
|
|
138
|
+
|
|
139
|
+
液环的本质不是"AI 意识",而是一套 **agent 系统的自调节持久记忆动力学(Self-Regulating Persistent Memory Dynamics for Agent Systems)**。`AuditChain + LEI(Entropy) + Memory decay` 三者组合形成闭环,使记忆从"外部管理"转向"内部自组织":
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
Input Evidence
|
|
143
|
+
↓
|
|
144
|
+
Memory State ←──────────────┐
|
|
145
|
+
↓ │
|
|
146
|
+
LEI Evaluation (八维熵) │
|
|
147
|
+
↓ │
|
|
148
|
+
Decay / Reinforcement ────────┘
|
|
149
|
+
↓
|
|
150
|
+
AuditChain (SHA256 链式追溯)
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
这比单独的 memory store 更接近一个可被实验检验的**动态系统**:输入驱动状态、熵评估稳定性、衰减/强化回流状态、审计链保证来源可信。
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
131
157
|
## 架构对比
|
|
132
158
|
|
|
133
159
|
```
|
|
@@ -174,7 +200,7 @@ liquid-loop/
|
|
|
174
200
|
│ ├── __init__.py # 公共 API 导出
|
|
175
201
|
│ ├── workspace.py # 核心数据模型 + AuditChain + auto_classify + decay
|
|
176
202
|
│ ├── storage.py # JSON 持久化 + 审计链写入
|
|
177
|
-
│ ├── entropy.py #
|
|
203
|
+
│ ├── entropy.py # 八维熵值计算(含 CPE 三维)
|
|
178
204
|
│ ├── mesh/ # MESH v2 多智能体共识协议集成(validate_evidence / compute_cci / ...)
|
|
179
205
|
│ └── cli.py # Click CLI (11 命令)
|
|
180
206
|
├── examples/
|
|
@@ -201,12 +227,15 @@ pytest -v
|
|
|
201
227
|
|
|
202
228
|
## 路线图
|
|
203
229
|
|
|
204
|
-
- [ ] 语义一致性结晶(嵌入相似度替代精确匹配)
|
|
205
230
|
- [x] 多 Agent 液环耦合(`liquid_loop.mesh` v2 共识协议,2026-07-15 落地)
|
|
206
|
-
- [ ]
|
|
231
|
+
- [ ] **[v0.8] 反证轨(Evidence Graph)**:Evidence 分 support / contradiction,一致增稳、冲突降稳,驱动 memory stability score(不再"一致即真")
|
|
232
|
+
- [ ] **[v0.8] 显式时间动力学**:`M(t+1) = M(t) + reinforcement − decay − contradiction_penalty`,让记忆成为"过程"而非"对象"(真正的液态循环)
|
|
233
|
+
- [ ] **[v0.8] 三实验**:E2 错误记忆恢复(核心)→ E3 多 agent 冲突(mesh 价值)→ E1 长期漂移(压力测试)
|
|
207
234
|
- [ ] LoCoMo / LongMemEval 基准对比
|
|
208
235
|
- [ ] 边缘端部署优化(<50KB)
|
|
209
236
|
|
|
237
|
+
> 零向量是液环的硬约束:一致性判定永不引入 embedding / 相似度(这正是液环要替代的方案)。
|
|
238
|
+
|
|
210
239
|
---
|
|
211
240
|
|
|
212
241
|
## 许可证
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"""Liquid Loop — Workspace Cognitive Runtime v0.7.
|
|
2
|
-
__version__ = "0.7.
|
|
1
|
+
"""Liquid Loop — Workspace Cognitive Runtime v0.7.1 (CPE-fused, SEAL dual-opt, dual-track multi-agent, MESH v2 integration)"""
|
|
2
|
+
__version__ = "0.7.1"
|
|
3
3
|
|
|
4
4
|
from .workspace import (
|
|
5
5
|
WorkspaceState, Anchor, Evidence, Memory, Conflict,
|
|
@@ -248,11 +248,17 @@ class WorkspaceState:
|
|
|
248
248
|
self.updated_at = now()
|
|
249
249
|
return a
|
|
250
250
|
|
|
251
|
-
def add_evidence(self, anchor, content: str, quality: float = 1.0, agent_id: str = ""
|
|
251
|
+
def add_evidence(self, anchor, content: str, quality: float = 1.0, agent_id: str = "",
|
|
252
|
+
dedup: bool = False) -> Optional[Evidence]:
|
|
252
253
|
"""向指定锚点添加一条证据。
|
|
253
254
|
|
|
254
255
|
anchor 参数兼容:锚点名称(str) | 锚点ID(str) | Anchor对象
|
|
255
256
|
agent_id:多智能体共用写入者标识(缺省空=legacy/单实例)
|
|
257
|
+
dedup:幂等去重开关(默认 False)。
|
|
258
|
+
- False(默认,核心语义):同内容可重复写入——"≥2 条一致证据自动结晶"依赖此行为
|
|
259
|
+
(README quickstart / 双轨成核 / 理论定义)。
|
|
260
|
+
- True(mesh/API 层显式启用):同锚点+同内容+同 agent 已存在则复用,防网络重试/高频喂入膨胀。
|
|
261
|
+
幂等应由 mesh/API 层按需开启,核心模型默认不吞掉"重复观察"这一结晶信号。
|
|
256
262
|
"""
|
|
257
263
|
target = None
|
|
258
264
|
if isinstance(anchor, Anchor):
|
|
@@ -264,10 +270,11 @@ class WorkspaceState:
|
|
|
264
270
|
target = next((a for a in self.anchors if a.id == anchor), None)
|
|
265
271
|
if not target:
|
|
266
272
|
return None
|
|
267
|
-
#
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
273
|
+
# 幂等去重(仅当 dedup=True):同锚点+同内容+同 agent 已存在则复用
|
|
274
|
+
if dedup:
|
|
275
|
+
for ex in self.evidences:
|
|
276
|
+
if ex.anchor_id == target.id and ex.content == content and ex.agent_id == agent_id:
|
|
277
|
+
return ex
|
|
271
278
|
e = Evidence(
|
|
272
279
|
id=uid(), anchor_id=target.id, content=content,
|
|
273
280
|
quality=quality, timestamp=now(), agent_id=agent_id,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: liquid-loop
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.1
|
|
4
4
|
Summary: Self-Organizing Cognitive Memory for AI Agents — Liquid Loop theory implementation
|
|
5
5
|
Author: fishbook0001
|
|
6
6
|
Maintainer: fishbook0001
|
|
@@ -72,7 +72,7 @@ Dynamic: license-file
|
|
|
72
72
|
| **Anchor** 锚点 | 晶种 | 认知关注点,有稳定性值 s ∈ [0,1] |
|
|
73
73
|
| **Evidence** 证据 | 附着粒子 | 锚点下的具体观察,权重指数衰减 w×0.95ᵗ |
|
|
74
74
|
| **Memory** 结晶 | 结晶体 | 2+ 条一致 Evidence 自动凝聚,有置信度 c |
|
|
75
|
-
| **Entropy** 熵值 | 流体无序度 | 八维加权(锚点漂移 / 冲突密度 / 碎片 / 活跃间隔 / 价值衰减 / 锚定强度 / CPE 三维) |
|
|
75
|
+
| **Entropy** 熵值 (LEI) | 流体无序度 | 八维加权(锚点漂移 / 冲突密度 / 碎片 / 活跃间隔 / 价值衰减 / 锚定强度 / CPE 三维) |
|
|
76
76
|
|
|
77
77
|
**状态判定:**
|
|
78
78
|
```
|
|
@@ -81,6 +81,12 @@ YELLOW (0.3 ≤ entropy < 0.6) — 需关注
|
|
|
81
81
|
RED (entropy ≥ 0.6) — 需清理
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
+
> **关于 "Entropy" 的语义澄清 — Liquid Entropy Index (LEI)**
|
|
85
|
+
>
|
|
86
|
+
> 本项目中的 `entropy` 是 **Liquid Entropy Index (LEI): a system-stability deviation metric, inspired by entropy but NOT equivalent to thermodynamic entropy.**
|
|
87
|
+
> 它不是物理熵 `S = -k Σ pᵢ log pᵢ`,而是对**系统状态偏离稳定流形程度**的综合度量——由八个可解释分量人工加权而成(锚点漂移 / 冲突密度 / 证据碎片 / 活跃间隔 / 价值衰减 / 锚定强度 + CPE 三维:回顾性衰退 / 策略漂移 / 泛化崩塌)。
|
|
88
|
+
> 代码层函数名保留 `calculate()`(历史连续性);文档 / 论文层一律以 **LEI** 指称,避免与热力学熵混淆。
|
|
89
|
+
|
|
84
90
|
---
|
|
85
91
|
|
|
86
92
|
## 快速开始
|
|
@@ -93,7 +99,7 @@ pip install liquid-loop
|
|
|
93
99
|
|
|
94
100
|
### 3 分钟上手
|
|
95
101
|
```python
|
|
96
|
-
from liquid_loop import WorkspaceState, load, save,
|
|
102
|
+
from liquid_loop import WorkspaceState, load, save, calculate
|
|
97
103
|
|
|
98
104
|
# 1. 创建/加载工作区
|
|
99
105
|
state = WorkspaceState() # 或 load(Path("."))
|
|
@@ -111,7 +117,7 @@ for m in state.memories:
|
|
|
111
117
|
print(f"结晶: {m.content[:50]}... (置信度={m.confidence:.2f})")
|
|
112
118
|
|
|
113
119
|
# 5. 监控认知健康
|
|
114
|
-
entropy =
|
|
120
|
+
entropy = calculate(state)
|
|
115
121
|
print(f"熵值: {entropy:.4f} → {'🟢GREEN' if entropy < 0.3 else '🟡YELLOW' if entropy < 0.6 else '🔴RED'}")
|
|
116
122
|
|
|
117
123
|
# 6. 持久化
|
|
@@ -167,6 +173,26 @@ print(health["CCI"], health["consensus_crystals"])
|
|
|
167
173
|
|
|
168
174
|
---
|
|
169
175
|
|
|
176
|
+
## 定位:Self-Regulating Persistent Memory Dynamics
|
|
177
|
+
|
|
178
|
+
液环的本质不是"AI 意识",而是一套 **agent 系统的自调节持久记忆动力学(Self-Regulating Persistent Memory Dynamics for Agent Systems)**。`AuditChain + LEI(Entropy) + Memory decay` 三者组合形成闭环,使记忆从"外部管理"转向"内部自组织":
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
Input Evidence
|
|
182
|
+
↓
|
|
183
|
+
Memory State ←──────────────┐
|
|
184
|
+
↓ │
|
|
185
|
+
LEI Evaluation (八维熵) │
|
|
186
|
+
↓ │
|
|
187
|
+
Decay / Reinforcement ────────┘
|
|
188
|
+
↓
|
|
189
|
+
AuditChain (SHA256 链式追溯)
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
这比单独的 memory store 更接近一个可被实验检验的**动态系统**:输入驱动状态、熵评估稳定性、衰减/强化回流状态、审计链保证来源可信。
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
170
196
|
## 架构对比
|
|
171
197
|
|
|
172
198
|
```
|
|
@@ -213,7 +239,7 @@ liquid-loop/
|
|
|
213
239
|
│ ├── __init__.py # 公共 API 导出
|
|
214
240
|
│ ├── workspace.py # 核心数据模型 + AuditChain + auto_classify + decay
|
|
215
241
|
│ ├── storage.py # JSON 持久化 + 审计链写入
|
|
216
|
-
│ ├── entropy.py #
|
|
242
|
+
│ ├── entropy.py # 八维熵值计算(含 CPE 三维)
|
|
217
243
|
│ ├── mesh/ # MESH v2 多智能体共识协议集成(validate_evidence / compute_cci / ...)
|
|
218
244
|
│ └── cli.py # Click CLI (11 命令)
|
|
219
245
|
├── examples/
|
|
@@ -240,12 +266,15 @@ pytest -v
|
|
|
240
266
|
|
|
241
267
|
## 路线图
|
|
242
268
|
|
|
243
|
-
- [ ] 语义一致性结晶(嵌入相似度替代精确匹配)
|
|
244
269
|
- [x] 多 Agent 液环耦合(`liquid_loop.mesh` v2 共识协议,2026-07-15 落地)
|
|
245
|
-
- [ ]
|
|
270
|
+
- [ ] **[v0.8] 反证轨(Evidence Graph)**:Evidence 分 support / contradiction,一致增稳、冲突降稳,驱动 memory stability score(不再"一致即真")
|
|
271
|
+
- [ ] **[v0.8] 显式时间动力学**:`M(t+1) = M(t) + reinforcement − decay − contradiction_penalty`,让记忆成为"过程"而非"对象"(真正的液态循环)
|
|
272
|
+
- [ ] **[v0.8] 三实验**:E2 错误记忆恢复(核心)→ E3 多 agent 冲突(mesh 价值)→ E1 长期漂移(压力测试)
|
|
246
273
|
- [ ] LoCoMo / LongMemEval 基准对比
|
|
247
274
|
- [ ] 边缘端部署优化(<50KB)
|
|
248
275
|
|
|
276
|
+
> 零向量是液环的硬约束:一致性判定永不引入 embedding / 相似度(这正是液环要替代的方案)。
|
|
277
|
+
|
|
249
278
|
---
|
|
250
279
|
|
|
251
280
|
## 许可证
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "liquid-loop"
|
|
7
|
-
version = "0.7.
|
|
7
|
+
version = "0.7.1"
|
|
8
8
|
description = "Self-Organizing Cognitive Memory for AI Agents — Liquid Loop theory implementation"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = {text = "MIT"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|