🧠 Ichiro-Mind
"The mind of Ichiro — Unifying all memory layers into one intelligent system."
Ichiro-Mind is the ultimate unified memory system for AI agents, combining the best of 5 proven memory approaches into one cohesive architecture. Named after its creator's vision for persistent, intelligent memory.
🏗️ Architecture Overview
CODEBLOCK0
✨ Core Features
1. Intelligent Memory Routing
Automatically selects the best retrieval method based on query type:
| Query Type | Method | Speed |
|---|
| Recent context | HOT (SESSION-STATE) | <10ms |
| Facts & preferences |
COLD (Vector search) | ~50ms |
| Causal relationships | WARM (Neural graph) | ~100ms |
| Long-term decisions | ARCHIVE (Git-Notes) | ~200ms |
2. Automatic Memory Lifecycle
CODEBLOCK1
3. Neural Graph with Spreading Activation
- - Not keyword search — Finds conceptually related memories through graph traversal
- 20 synapse types — Temporal, causal, semantic, emotional connections
- Hebbian learning — Memories strengthen with use
- Contradiction detection — Auto-detects conflicting information
4. Experience Learning
Decision → Action → Outcome → Lesson
│ │ │ │
Store Track Record Learn
- - Tracks decisions and their outcomes
- Learns from errors
- Suggests based on past patterns
5. Smart Hygiene
- - Auto-cleans junk memories
- Deduplicates similar entries
- Optimizes token usage
- Monthly maintenance mode
🚀 Quick Start
Installation
CODEBLOCK3
Setup
CODEBLOCK4
Basic Usage
CODEBLOCK5
📝 Memory Layers in Detail
HOT Layer — SESSION-STATE.md
Real-time working memory using Write-Ahead Log protocol.
CODEBLOCK6
WAL Protocol: Write BEFORE responding, not after.
WARM Layer — Neural Graph
Associative memory with spreading activation.
CODEBLOCK7
COLD Layer — Vector Store
Semantic search with LanceDB.
CODEBLOCK8
ARCHIVE Layer — Persistent Storage
Human-readable long-term memory.
CODEBLOCK9
🛠️ Advanced Features
Memory Hygiene
CODEBLOCK10
Experience Replay
CODEBLOCK11
Entity Tracking
CODEBLOCK12
🔌 MCP Integration
Add to ~/.openclaw/mcp.json:
CODEBLOCK13
📊 Performance
| Operation | Latency | Throughput |
|---|
| HOT recall | <10ms | 10K ops/s |
| WARM recall |
~100ms | 1K ops/s |
| COLD search | ~50ms | 500 ops/s |
| ARCHIVE read | ~200ms | 100 ops/s |
| Store memory | ~20ms | 5K ops/s |
🎯 Use Cases
- 1. Long-running projects — Never lose context across sessions
- Complex decisions — Track decision trees and outcomes
- User relationships — Remember preferences, history, quirks
- Error prevention — Learn from mistakes, suggest alternatives
- Knowledge accumulation — Build up domain expertise over time
🧠 Philosophy
"Memory is not storage — it's intelligence."
Ichiro-Mind treats memory as a first-class citizen:
- - Memories have relationships
- Memories evolve over time
- Memories compete for attention
- Memories decay when unused
- Contradictions are resolved
📚 Related Skills
- - elite-longterm-memory — Foundation layer architecture
- neural-memory — Associative graph engine
- memory-hygiene — Cleanup and optimization
- memory-setup — Configuration and structure
🙏 Credits
Built by 兵步一郎 (Ichiro) with love for persistent, intelligent AI memory.
Inspired by the best memory systems in the OpenClaw ecosystem.
License
MIT
🧠 一郎心智
一郎的心智——将所有记忆层统一为一个智能系统。
一郎心智 是面向AI代理的终极统一记忆系统,将5种经过验证的记忆方法融合为一个连贯的架构。以其创造者对持久、智能记忆的愿景命名。
🏗️ 架构概览
┌─────────────────────────────────────────────────────────────────┐
│ 🧠 一郎心智 │
│ 永不遗忘的心智 │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ⚡ 热层(工作内存) 🔥 温层(神经网络) │
│ ┌─────────────────────┐ ┌─────────────────────┐ │
│ │ SESSION-STATE.md │◄────────►│ 联想记忆 │ │
│ │ • 实时状态 │ 同步 │ • 扩散召回 │ │
│ │ • WAL协议 │ │ • 因果链 │ │
│ │ • 压缩后存活 │ │ • 矛盾检测 │ │
│ └─────────────────────┘ └─────────────────────┘ │
│ │ │ │
│ ▼ ▼ │
│ 💾 冷层(向量) 📚 归档层(长期) │
│ ┌─────────────────────┐ ┌─────────────────────┐ │
│ │ LanceDB存储 │ │ MEMORY.md + 每日日志 │ │
│ │ • 语义搜索 │ │ • Git-Notes图谱 │ │
│ │ • 自动提取 │ │ • 云备份 │ │
│ │ • 重要性评分 │ │ • 人类可读 │ │
│ └─────────────────────┘ └─────────────────────┘ │
│ │
│ 🧹 卫生引擎 🎓 学习引擎 │
│ • 自动清理 • 决策追踪 │
│ • 去重 • 错误学习 │
│ • Token优化 • 实体演化 │
└─────────────────────────────────────────────────────────────────┘
✨ 核心功能
1. 智能记忆路由
根据查询类型自动选择最佳检索方法:
| 查询类型 | 方法 | 速度 |
|---|
| 近期上下文 | 热层(SESSION-STATE) | <10ms |
| 事实与偏好 |
冷层(向量搜索) | ~50ms |
| 因果关系 | 温层(神经图谱) | ~100ms |
| 长期决策 | 归档层(Git-Notes) | ~200ms |
2. 自动记忆生命周期
捕获 → 提取 → 处理 → 存储 → 召回 → 清理
│ │ │ │ │ │
输入 Mem0/自动 重要性 4层 智能 定期
捕获 提取 评分 存储 路由 卫生
3. 带扩散激活的神经图谱
- - 非关键词搜索 — 通过图谱遍历找到概念相关的记忆
- 20种突触类型 — 时间、因果、语义、情感连接
- 赫布学习 — 记忆随使用而强化
- 矛盾检测 — 自动检测冲突信息
4. 经验学习
决策 → 行动 → 结果 → 教训
│ │ │ │
存储 追踪 记录 学习
- - 追踪决策及其结果
- 从错误中学习
- 基于过往模式提出建议
5. 智能卫生
- - 自动清理垃圾记忆
- 去重相似条目
- 优化Token使用
- 月度维护模式
🚀 快速开始
安装
bash
clawhub install ichiro-mind
设置
bash
初始化一郎心智
ichiro-mind init
配置MCP
ichiro-mind setup-mcp
基本用法
python
from ichiro_mind import IchiroMind
初始化
mind = IchiroMind()
存储记忆(自动路由到相应层)
mind.remember(
content=用户偏好深色模式,
category=偏好,
importance=0.9
)
通过智能路由召回
result = mind.recall(用户偏好什么模式?)
从经验中学习
mind.learn(
decision=开发时使用SQLite,
outcome=大数据时变慢,
lesson=数据集>1GB时使用PostgreSQL
)
📝 记忆层详解
热层 — SESSION-STATE.md
使用预写日志协议的实时工作内存。
markdown
SESSION-STATE.md — 一郎心智热层
当前任务
构建统一记忆系统
活跃上下文
- - 用户:兵步一郎
- 项目:一郎心智
- 技术栈:Python + LanceDB + 神经图谱
关键决策
待办事项
- - [ ] 编写SKILL.md
- [ ] 创建Python核心
WAL协议:在响应之前写入,而非之后。
温层 — 神经图谱
带扩散激活的联想记忆。
python
带关系存储
mind.remember(
content=生产环境使用PostgreSQL,
type=决策,
tags=[数据库, 基础设施],
relations=[
{type: 由...引起, target: 性能问题},
{type: 导致, target: 更好的可扩展性}
]
)
深度召回
memories = mind.recall_deep(
query=数据库决策,
depth=2 # 跟随因果链
)
冷层 — 向量存储
使用LanceDB进行语义搜索。
python
从对话中自动捕获
mind.auto_capture(text=用户喜欢极简UI)
语义搜索
results = mind.search(用户界面偏好)
归档层 — 持久存储
人类可读的长期记忆。
workspace/
├── MEMORY.md # 精选长期记忆
└── memory/
├── 2026-03-07.md # 每日日志
├── decisions/ # 结构化决策
├── entities/ # 人物、项目、概念
└── lessons/ # 学到的经验
🛠️ 高级功能
记忆卫生
bash
审计记忆
ichiro-mind audit
清理垃圾
ichiro-mind cleanup --dry-run
ichiro-mind cleanup --confirm
优化Token
ichiro-mind optimize
经验回放
python
在做出类似决策前
similar = mind.get_lessons(context=数据库选择)
返回过往决策和结果
实体追踪
python
追踪演化的实体
mind.track_entity(
name=兵步一郎,
type=人物,
attributes={
角色: 创造者,
兴趣: [AI, 自动化],
偏好: {UI: 极简, 文档: 双语}
}
)
更新实体
mind.update_entity(兵步一郎, {最后联系: 2026-03-07})
🔌 MCP集成
添加到 ~/.openclaw/mcp.json:
json
{
mcpServers: {
ichiro-mind: {
command: python3,
args: [-m, ichiro_mind.mcp],
env: {
ICHIROMINDBRAIN: default
}
}
}
}
📊 性能
| 操作 | 延迟 | 吞吐量 |
|---|
| 热层召回 | <10ms | 10K ops/s |
| 温层召回 |
~100ms | 1K ops/s |
| 冷层搜索 | ~50ms | 500 ops/s |
| 归档层读取 | ~200ms | 100 ops/s |
| 存储记忆 | ~20ms | 5K ops/s |
🎯 使用场景
- 1. 长期运行项目 — 跨会话永不丢失上下文
- 复杂决策 — 追踪决策树和结果
- 用户关系 — 记住偏好、历史、怪癖
- 错误预防 — 从错误中学习,建议替代方案
- 知识积累 — 随时间构建领域专长
🧠 理念
记忆不是存储——它是智能。
一郎心智将记忆视为一等公民:
- - 记忆之间有关系
- 记忆随时间演化
- 记忆争夺注意力
- 记忆不使用时衰退