为 OpenClaw 打造的长期记忆操作系统,实现跨 Session 记忆持久化、智能检索和用户偏好学习。
bash
# 自动安装 (推荐)
python3 install_hongnao.py
# 或手动安装
pip3 install -r requirements.txt
python
from memory_api import HongNaoMemorySystem, MemorySystemConfig
# 初始化
config = MemorySystemConfig()
memory_system = HongNaoMemorySystem(config)
# 添加记忆
memory_system.add_memories_from_text("用户喜欢简洁的沟通风格", source="chat")
# 检索记忆
result = memory_system.retrieve_memories("用户偏好")
print(result['context'])
指标目标实测添加延迟<10ms0.03ms ✅检索延迟<100ms0.27ms ✅召回率>90%100.0% ✅Token 节省>40%~45% ✅
编辑 hongnao_memory_config.ini:
ini
[memory]
db_path = ~/.openclaw/workspace/hongnao_memory/hongnao.db
vector_store_path = ~/.openclaw/workspace/hongnao_memory/chroma_db
[preference_learning]
enable_preference_learning = true
confidence_threshold = 0.6
快速入门.md集成指南.mdRELEASE_NOTES.mdbash
# 核心模块测试
python3 test_core_modules.py
# 性能基准测试
python3 quick_benchmark.py
MIT License